From 6a1238889ae0b3830157c5baa07cf79bac7d0e31 Mon Sep 17 00:00:00 2001 From: dpetker Date: Fri, 30 Jan 2015 12:52:04 -0500 Subject: [PATCH 001/190] Create README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9dd9a4b --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# armsglobe +A more generic version of https://github.com/dataarts/armsglobe for visualizing source/destination data. + +This fork attempts to make the globe data-agnostic so that users can simply provide source/destination data and have it graphed. If timestamp information is provided, this globe can act as a semi-real-time visualization. From c9af88f131aaca9f801a6ef04a5f31d855cc7aff Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 30 Jan 2015 13:02:00 -0500 Subject: [PATCH 002/190] Initial commit of Node gear to allow basic development usage. --- .gitignore | 4 +++- app.js | 27 +++++++++++++++++++++++++++ package.json | 17 +++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 app.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore index ccf0cd5..be5c778 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ app.yaml client hostery-files -.hostery-config \ No newline at end of file +.hostery-config + +node_modules/ diff --git a/app.js b/app.js new file mode 100644 index 0000000..836a122 --- /dev/null +++ b/app.js @@ -0,0 +1,27 @@ +/* +Index.js - Entry point to serve up the Data Globe +*/ + +var express = require( 'express' ); +var serveStatic = require( 'serve-static' ); + +var app = express(); + +// For CORS +app.use( function( req, res, next ) { + res.header( "Access-Control-Allow-Origin", "*" ); + res.header( "Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept" ); + res.header( "Access-Control-Allow-Methods", "GET" ); + + if( req.method == 'OPTIONS' ) { + res.json( [] ); + } else { + next(); + } +}); + +app.use( serveStatic( __dirname, { 'index': ['index.html', 'index.htm' ] } ) ); + +app.listen( 8080 ); + +console.log( 'Listening on port 8080...' ); diff --git a/package.json b/package.json new file mode 100644 index 0000000..30eeb87 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "dataglobe", + "version": "0.0.0", + "description": "A more generic version of https://github.com/dataarts/armsglobe for visualizing source/destination data, served up via Node.", + "main": "app.js", + "repository": { + "type": "git", + "url": "https://github.com/dpetker/dataglobe.git" + }, + "author": "dpetker", + "private": true, + "homepage": "https://github.com/dpetker/dataglobe.git", + "dependencies": { + "express": "^4.11.1", + "serve-static": "^1.8.1" + } +} From 2ef84cb0f17cb514581e013680691390c28de40d Mon Sep 17 00:00:00 2001 From: dpetker Date: Fri, 30 Jan 2015 13:41:09 -0500 Subject: [PATCH 003/190] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9dd9a4b..043f834 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# armsglobe +# Data Globe A more generic version of https://github.com/dataarts/armsglobe for visualizing source/destination data. This fork attempts to make the globe data-agnostic so that users can simply provide source/destination data and have it graphed. If timestamp information is provided, this globe can act as a semi-real-time visualization. From 77a6415c3b2306362b3b031f181646ff812b346e Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Sat, 31 Jan 2015 10:35:52 -0500 Subject: [PATCH 004/190] Cleaned up titles/headers. --- index.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index e944ac8..d2069d9 100755 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - Interactive Globe: Small Arms Imports & Exports + Interactive Globe: Source/Destination Data Visualization @@ -11,7 +11,7 @@
-

Loading Small Arms and Ammunition Trade Data from 1992 to 2010. Please wait...

+

Loading Data. Please wait...

@@ -37,8 +37,8 @@

Loading Small Arms and Ammunition Trade Data from 1992 to 2010. Please wait. - - + + @@ -140,11 +140,11 @@

Loading Small Arms and Ammunition Trade Data from 1992 to 2010. Please wait. -
-

Small Arms and Ammunition — Imports & Exports -
An interactive visualization of government-authorized small arms and ammunition transfers from 1992 to 2010.
+
+

Data Visualization Globe +
An interactive visualization of source/destination data over time.

-
+

From 9bf051a40151ff51ef9b11de42022706086635cb Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Sat, 31 Jan 2015 10:50:59 -0500 Subject: [PATCH 005/190] Cleaned up more of index page --- index.html | 181 ++++++++++++++++++++++++----------------------------- 1 file changed, 83 insertions(+), 98 deletions(-) diff --git a/index.html b/index.html index d2069d9..b06134a 100755 --- a/index.html +++ b/index.html @@ -5,7 +5,6 @@ - @@ -29,6 +28,89 @@

Loading Data. Please wait...

+ +
+

Data Visualization Globe +
An interactive visualization of source/destination data over time.
+

+
+ +
+ + + + +
+
+
+
+
+
+
RELATIVE PERCENT CHANGE
+
EXPORTS
+
IMPORTS

+
+
+
+
    +
  • 1992
  • +
  • 93
  • +
  • 94
  • +
  • 95
  • +
  • 96
  • +
  • 97
  • +
  • 98
  • +
  • 99
  • +
  • 2000
  • +
  • 01
  • +
  • 02
  • +
  • 03
  • +
  • 04
  • +
  • 05
  • +
  • 06
  • +
  • 07
  • +
  • 08
  • +
  • 09
  • +
  • 2010
  • +
    +
+
+
+
+
+
Military
+
Civilian
+
Ammo

+
+
+
+
+
+
Imports

+
+
+
+
+
+
Exports

+
+
+
+
+
+
+
Information about the data
+
+ This data visualization was produced by Google as part of the Google Ideas INFO (Illicit Networks, Forces in Opposition) Summit with support from the Igarape Institute and data provided by the Peace Research Institute Oslo (PRIO) small arms database. The visualization includes >1 million individual import and export data points from annual custom reports and maps the transfer of small arms, light weapons and ammunition across 250 nation states and territories around the world between 1992 and 2010. +
+ +
+
+
+ @@ -125,102 +207,5 @@

Loading Data. Please wait...

- - - - - -
-

Data Visualization Globe -
An interactive visualization of source/destination data over time.
-

-
- -
- - - - -
-
-
-
-
-
-
RELATIVE PERCENT CHANGE
-
EXPORTS
-
IMPORTS

-
-
-
-
    -
  • 1992
  • -
  • 93
  • -
  • 94
  • -
  • 95
  • -
  • 96
  • -
  • 97
  • -
  • 98
  • -
  • 99
  • -
  • 2000
  • -
  • 01
  • -
  • 02
  • -
  • 03
  • -
  • 04
  • -
  • 05
  • -
  • 06
  • -
  • 07
  • -
  • 08
  • -
  • 09
  • -
  • 2010
  • -
    -
-
-
-
-
-
Military
-
Civilian
-
Ammo

-
-
-
-
-
-
Imports

-
-
-
-
-
-
Exports

-
-
-
- -
-
-
-
Information about the data
-
- This data visualization was produced by Google as part of the Google Ideas INFO (Illicit Networks, Forces in Opposition) Summit with support from the Igarape Institute and data provided by the Peace Research Institute Oslo (PRIO) small arms database. The visualization includes >1 million individual import and export data points from annual custom reports and maps the transfer of small arms, light weapons and ammunition across 250 nation states and territories around the world between 1992 and 2010. -
- -
-
- From 5c60ed594cf32b7044ba3b73ff6728c96f8db369 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Sat, 31 Jan 2015 11:02:46 -0500 Subject: [PATCH 006/190] Removing markers for the time being. --- index.html | 3 +- js/visualize.js | 132 ++++++++++++++++++++++++------------------------ 2 files changed, 69 insertions(+), 66 deletions(-) diff --git a/index.html b/index.html index b06134a..e9656ca 100755 --- a/index.html +++ b/index.html @@ -134,7 +134,8 @@

Data Visualization Globe - + + diff --git a/js/visualize.js b/js/visualize.js index 787da2a..94cf722 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -1,12 +1,12 @@ -function buildDataVizGeometries( linearData ){ +function buildDataVizGeometries( linearData ){ var loadLayer = document.getElementById('loading'); for( var i in linearData ){ - var yearBin = linearData[i].data; + var yearBin = linearData[i].data; var year = linearData[i].t; - selectableYears.push(year); + selectableYears.push(year); var count = 0; console.log('Building data for ...' + year); @@ -17,14 +17,14 @@ function buildDataVizGeometries( linearData ){ var importerName = set.i.toUpperCase(); exporter = countryData[exporterName]; - importer = countryData[importerName]; - + importer = countryData[importerName]; + // we couldn't find the country, it wasn't in our list... if( exporter === undefined || importer === undefined ) - continue; + continue; // visualize this event - set.lineGeometry = makeConnectionLineGeometry( exporter, importer, set.v, set.wc ); + set.lineGeometry = makeConnectionLineGeometry( exporter, importer, set.v, set.wc ); // if( s % 1000 == 0 ) // console.log( 'calculating ' + s + ' of ' + yearBin.length + ' in year ' + year); @@ -36,9 +36,9 @@ function buildDataVizGeometries( linearData ){ // how to make this work? // loadLayer.innerHTML = 'loading data for ' + year + '...'; // console.log(loadLayer.innerHTML); - } + } - loadLayer.style.display = 'none'; + loadLayer.style.display = 'none'; } function getVisualizedMesh( linearData, year, countries, exportCategories, importCategories ){ @@ -54,13 +54,13 @@ function getVisualizedMesh( linearData, year, countries, exportCategories, impor var affectedCountries = []; - var bin = linearData[indexFromYear].data; + var bin = linearData[indexFromYear].data; var linesGeo = new THREE.Geometry(); var lineColors = []; var particlesGeo = new THREE.Geometry(); - var particleColors = []; + var particleColors = []; // var careAboutExports = ( action === 'exports' ); // var careAboutImports = ( action === 'imports' ); @@ -80,8 +80,8 @@ function getVisualizedMesh( linearData, year, countries, exportCategories, impor var useImporter = relevantImport; var categoryName = reverseWeaponLookup[set.wc]; - var relevantExportCategory = relevantExport && $.inArray(categoryName,exportCategories) >= 0; - var relevantImportCategory = relevantImport && $.inArray(categoryName,importCategories) >= 0; + var relevantExportCategory = relevantExport && $.inArray(categoryName,exportCategories) >= 0; + var relevantImportCategory = relevantImport && $.inArray(categoryName,importCategories) >= 0; if( (useImporter || useExporter) && (relevantExportCategory || relevantImportCategory) ){ // we may not have line geometry... (?) @@ -99,7 +99,7 @@ function getVisualizedMesh( linearData, year, countries, exportCategories, impor var lastColor; // grab the colors from the vertices for( s in set.lineGeometry.vertices ){ - var v = set.lineGeometry.vertices[s]; + var v = set.lineGeometry.vertices[s]; lineColors.push(lineColor); lastColor = lineColor; } @@ -107,11 +107,11 @@ function getVisualizedMesh( linearData, year, countries, exportCategories, impor // merge it all together THREE.GeometryUtils.merge( linesGeo, set.lineGeometry ); - var particleColor = lastColor.clone(); + var particleColor = lastColor.clone(); var points = set.lineGeometry.vertices; var particleCount = Math.floor(set.v / 8000 / set.lineGeometry.vertices.length) + 1; particleCount = constrain(particleCount,1,100); - var particleSize = set.lineGeometry.size; + var particleSize = set.lineGeometry.size; for( var s=0; s 1){ particle.lerpN = 0; @@ -258,29 +258,29 @@ function getVisualizedMesh( linearData, year, countries, exportCategories, impor var currentPoint = path[particle.moveIndex]; var nextPoint = path[particle.nextIndex]; - + particle.copy( currentPoint ); - particle.lerpSelf( nextPoint, particle.lerpN ); + particle.lerpSelf( nextPoint, particle.lerpN ); } this.geometry.verticesNeedUpdate = true; - }; + }; // return this info as part of the mesh package, we'll use this in selectvisualization splineOutline.affectedCountries = affectedCountries; - return splineOutline; + return splineOutline; } function selectVisualization( linearData, year, countries, exportCategories, importCategories ){ // we're only doing one country for now so... var cName = countries[0].toUpperCase(); - + $("#hudButtons .countryTextInput").val(cName); previouslySelectedCountry = selectedCountry; selectedCountry = countryData[countries[0].toUpperCase()]; - + selectedCountry.summary = { imported: { mil: 0, @@ -308,10 +308,11 @@ function selectVisualization( linearData, year, countries, exportCategories, imp country.mapColor = 0; } + /* Removing markers for now until I decide how to use them */ // clear markers - for( var i in selectableCountries ){ - removeMarkerFromCountry( selectableCountries[i] ); - } + // for( var i in selectableCountries ){ + // removeMarkerFromCountry( selectableCountries[i] ); + // } // clear children while( visualizationMesh.children.length > 0 ){ @@ -321,24 +322,25 @@ function selectVisualization( linearData, year, countries, exportCategories, imp // build the mesh console.time('getVisualizedMesh'); - var mesh = getVisualizedMesh( timeBins, year, countries, exportCategories, importCategories ); + var mesh = getVisualizedMesh( timeBins, year, countries, exportCategories, importCategories ); console.timeEnd('getVisualizedMesh'); // add it to scene graph - visualizationMesh.add( mesh ); + visualizationMesh.add( mesh ); // alright we got no data but at least highlight the country we've selected if( mesh.affectedCountries.length == 0 ){ mesh.affectedCountries.push( cName ); - } - - for( var i in mesh.affectedCountries ){ - var countryName = mesh.affectedCountries[i]; - var country = countryData[countryName]; - attachMarkerToCountry( countryName, country.mapColor ); } + /* Removing markers for now until I decide how to use them */ + // for( var i in mesh.affectedCountries ){ + // var countryName = mesh.affectedCountries[i]; + // var country = countryData[countryName]; + // attachMarkerToCountry( countryName, country.mapColor ); + // } + // console.log( mesh.affectedCountries ); highlightCountry( mesh.affectedCountries ); @@ -362,15 +364,15 @@ function selectVisualization( linearData, year, countries, exportCategories, imp } // console.log(rotateTargetY); //lines commented below source of rotation error - //is there a more reliable way to ensure we don't rotate around the globe too much? + //is there a more reliable way to ensure we don't rotate around the globe too much? /* if( Math.abs(rotateTargetY - rotating.rotation.y) > Math.PI ) - rotateTargetY += Math.PI; + rotateTargetY += Math.PI; */ rotateVX *= 0.6; - rotateVY *= 0.6; - } + rotateVY *= 0.6; + } } - + d3Graphs.initGraphs(); } From e869ab52a961b230101816d966aba66f99242d44 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Sat, 31 Jan 2015 11:15:40 -0500 Subject: [PATCH 007/190] Caught a reference to markers I missed --- js/main.js | 201 +++++++++++++++++++++++++++-------------------------- 1 file changed, 101 insertions(+), 100 deletions(-) diff --git a/js/main.js b/js/main.js index 3b01d53..b595ed2 100644 --- a/js/main.js +++ b/js/main.js @@ -20,8 +20,8 @@ var lookupTexture; var backTexture; var worldCanvas; var sphere; -var rotating; -var visualizationMesh; +var rotating; +var visualizationMesh; var mapUniforms; @@ -31,20 +31,20 @@ var mapUniforms; var timeBins; // contains latlon data for each country -var latlonData; +var latlonData; // contains above but organized as a mapped list via ['countryname'] = countryobject // each country object has data like center of country in 3d space, lat lon, country name, and country code -var countryData = new Object(); +var countryData = new Object(); // contains a list of country code to country name for running lookups -var countryLookup; +var countryLookup; var selectableYears = []; -var selectableCountries = []; +var selectableCountries = []; /* - 930100 – military weapons, and includes some light weapons and artillery as well as machine guns and assault rifles etc. + 930100 – military weapons, and includes some light weapons and artillery as well as machine guns and assault rifles etc. 930190 – military firearms – eg assault rifles, machineguns (sub, light, heavy etc), combat shotguns, machine pistols etc 930200 – pistols and revolvers 930320 – Sporting shotguns (anything that isn’t rated as a military item). @@ -68,7 +68,7 @@ for( var i in weaponLookup ){ var name = i; var code = weaponLookup[i]; reverseWeaponLookup[code] = name; -} +} // A list of category colors var categoryColors = { @@ -97,7 +97,7 @@ var assetList = []; // TODO // use underscore and ".after" to load these in order // don't look at me I'm ugly -function start( e ){ +function start( e ){ // detect for webgl and reject everything else if ( ! Detector.webgl ) { Detector.addGetWebGLMessage(); @@ -113,21 +113,21 @@ function start( e ){ loadCountryCodes( function(){ loadWorldPins( - function(){ - loadContentData( - function(){ + function(){ + loadContentData( + function(){ initScene(); - animate(); + animate(); } - ); + ); } ); } ); - }; - }; + }; + }; }; -} +} @@ -143,7 +143,7 @@ var Selection = function(){ for( var i in weaponLookup ){ this.exportCategories[i] = true; this.importCategories[i] = true; - } + } this.getExportCategories = function(){ var list = []; @@ -152,7 +152,7 @@ var Selection = function(){ list.push(i); } return list; - } + } this.getImportCategories = function(){ var list = []; @@ -169,15 +169,15 @@ var Selection = function(){ function initScene() { // ----------------------------------------------------------------------------- - // Let's make a scene + // Let's make a scene scene = new THREE.Scene(); - scene.matrixAutoUpdate = false; - // scene.fog = new THREE.FogExp2( 0xBBBBBB, 0.00003 ); + scene.matrixAutoUpdate = false; + // scene.fog = new THREE.FogExp2( 0xBBBBBB, 0.00003 ); - scene.add( new THREE.AmbientLight( 0x505050 ) ); + scene.add( new THREE.AmbientLight( 0x505050 ) ); light1 = new THREE.SpotLight( 0xeeeeee, 3 ); - light1.position.x = 730; + light1.position.x = 730; light1.position.y = 520; light1.position.z = 626; light1.castShadow = true; @@ -187,15 +187,15 @@ function initScene() { light2.position.x = -640; light2.position.y = -500; light2.position.z = -1000; - scene.add( light2 ); + scene.add( light2 ); rotating = new THREE.Object3D(); scene.add(rotating); - lookupCanvas = document.createElement('canvas'); + lookupCanvas = document.createElement('canvas'); lookupCanvas.width = 256; lookupCanvas.height = 1; - + lookupTexture = new THREE.Texture( lookupCanvas ); lookupTexture.magFilter = THREE.NearestFilter; lookupTexture.minFilter = THREE.NearestFilter; @@ -213,7 +213,7 @@ function initScene() { // outlinedMapTexture.minFilter = THREE.NearestFilter; var uniforms = { - 'mapIndex': { type: 't', value: 0, texture: indexedMapTexture }, + 'mapIndex': { type: 't', value: 0, texture: indexedMapTexture }, 'lookup': { type: 't', value: 1, texture: lookupTexture }, 'outline': { type: 't', value: 2, texture: outlinedMapTexture }, 'outlineLevel': {type: 'f', value: 1 }, @@ -237,26 +237,26 @@ function initScene() { // mapGraphic.needsUpdate = true; backMat = new THREE.MeshBasicMaterial( { - // color: 0xffffff, - // shininess: 10, + // color: 0xffffff, + // shininess: 10, // specular: 0x333333, // map: mapGraphic, // lightMap: mapGraphic } - ); - // backMat.ambient = new THREE.Color(255,255,255); - sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); + ); + // backMat.ambient = new THREE.Color(255,255,255); + sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); // sphere.receiveShadow = true; // sphere.castShadow = true; sphere.doubleSided = false; - sphere.rotation.x = Math.PI; + sphere.rotation.x = Math.PI; sphere.rotation.y = -Math.PI/2; sphere.rotation.z = Math.PI; - sphere.id = "base"; - rotating.add( sphere ); + sphere.id = "base"; + rotating.add( sphere ); - for( var i in timeBins ){ + for( var i in timeBins ){ var bin = timeBins[i].data; for( var s in bin ){ var set = bin[s]; @@ -277,22 +277,22 @@ function initScene() { } console.log( selectableCountries ); - + // load geo data (country lat lons in this case) console.time('loadGeoData'); - loadGeoData( latlonData ); - console.timeEnd('loadGeoData'); + loadGeoData( latlonData ); + console.timeEnd('loadGeoData'); console.time('buildDataVizGeometries'); var vizilines = buildDataVizGeometries(timeBins); console.timeEnd('buildDataVizGeometries'); visualizationMesh = new THREE.Object3D(); - rotating.add(visualizationMesh); + rotating.add(visualizationMesh); buildGUI(); - selectVisualization( timeBins, '2010', ['UNITED STATES'], ['Military Weapons','Civilian Weapons', 'Ammunition'], ['Military Weapons','Civilian Weapons', 'Ammunition'] ); + selectVisualization( timeBins, '2010', ['UNITED STATES'], ['Military Weapons','Civilian Weapons', 'Ammunition'], ['Military Weapons','Civilian Weapons', 'Ammunition'] ); // test for highlighting specific countries // highlightCountry( ["United States", "Switzerland", "China"] ); @@ -303,11 +303,11 @@ function initScene() { renderer = new THREE.WebGLRenderer({antialias:false}); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.autoClear = false; - - renderer.sortObjects = false; - renderer.generateMipmaps = false; - glContainer.appendChild( renderer.domElement ); + renderer.sortObjects = false; + renderer.generateMipmaps = false; + + glContainer.appendChild( renderer.domElement ); // ----------------------------------------------------------------------------- @@ -315,42 +315,42 @@ function initScene() { document.addEventListener( 'mousemove', onDocumentMouseMove, true ); document.addEventListener( 'windowResize', onDocumentResize, false ); - //masterContainer.addEventListener( 'mousedown', onDocumentMouseDown, true ); - //masterContainer.addEventListener( 'mouseup', onDocumentMouseUp, false ); - document.addEventListener( 'mousedown', onDocumentMouseDown, true ); - document.addEventListener( 'mouseup', onDocumentMouseUp, false ); - - masterContainer.addEventListener( 'click', onClick, true ); + //masterContainer.addEventListener( 'mousedown', onDocumentMouseDown, true ); + //masterContainer.addEventListener( 'mouseup', onDocumentMouseUp, false ); + document.addEventListener( 'mousedown', onDocumentMouseDown, true ); + document.addEventListener( 'mouseup', onDocumentMouseUp, false ); + + masterContainer.addEventListener( 'click', onClick, true ); masterContainer.addEventListener( 'mousewheel', onMouseWheel, false ); - - // firefox + + // firefox masterContainer.addEventListener( 'DOMMouseScroll', function(e){ var evt=window.event || e; //equalize event object onMouseWheel(evt); }, false ); - document.addEventListener( 'keydown', onKeyDown, false); + document.addEventListener( 'keydown', onKeyDown, false); // ----------------------------------------------------------------------------- // Setup our camera - camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ); + camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ); camera.position.z = 1400; camera.position.y = 0; - camera.lookAt(scene.width/2, scene.height/2); - scene.add( camera ); + camera.lookAt(scene.width/2, scene.height/2); + scene.add( camera ); - var windowResize = THREEx.WindowResize(renderer, camera) + var windowResize = THREEx.WindowResize(renderer, camera) } - -function animate() { + +function animate() { // Disallow roll for now, this is interfering with keyboard input during search -/* +/* if(keyboard.pressed('o') && keyboard.pressed('shift') == false) - camera.rotation.z -= 0.08; + camera.rotation.z -= 0.08; if(keyboard.pressed('p') && keyboard.pressed('shift') == false) - camera.rotation.z += 0.08; + camera.rotation.z += 0.08; */ if( rotateTargetX !== undefined && rotateTargetY !== undefined ){ @@ -366,14 +366,14 @@ function animate() { // move.multiplyScalar( distance ); // rotateVX = move.x; - // rotateVy = move.y; + // rotateVy = move.y; if( Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1 ){ rotateTargetX = undefined; rotateTargetY = undefined; } } - + rotateX += rotateVX; rotateY += rotateVY; @@ -385,7 +385,7 @@ function animate() { if(dragging || rotateTargetX !== undefined ){ rotateVX *= 0.6; rotateVY *= 0.6; - } + } rotateY += controllers.spin * 0.01; @@ -398,37 +398,38 @@ function animate() { if(rotateX > rotateXMax){ rotateX = rotateXMax; rotateVX *= -0.95; - } + } - TWEEN.update(); + TWEEN.update(); rotating.rotation.x = rotateX; - rotating.rotation.y = rotateY; + rotating.rotation.y = rotateY; + + render(); - render(); - - requestAnimationFrame( animate ); + requestAnimationFrame( animate ); - THREE.SceneUtils.traverseHierarchy( rotating, + THREE.SceneUtils.traverseHierarchy( rotating, function(mesh) { if (mesh.update !== undefined) { mesh.update(); - } + } } - ); + ); - for( var i in markers ){ - var marker = markers[i]; - marker.update(); - } + /* Removing markers until I decide what to do with them */ + // for( var i in markers ){ + // var marker = markers[i]; + // marker.update(); + // } } -function render() { - renderer.clear(); - renderer.render( scene, camera ); -} +function render() { + renderer.clear(); + renderer.render( scene, camera ); +} function findCode(countryName){ countryName = countryName.toUpperCase(); @@ -458,18 +459,18 @@ var countryColorMap = {'PE':1, 'AW':210,'LI':211,'VG':212,'SH':213,'JE':214,'AI':215,'MF_1_':216,'GG':217,'SM':218,'BM':219,'TV':220,'NR':221,'GI':222,'PN':223,'MC':224,'VA':225, 'IM':226,'GU':227,'SG':228}; -function highlightCountry( countries ){ +function highlightCountry( countries ){ var countryCodes = []; for( var i in countries ){ var code = findCode(countries[i]); countryCodes.push(code); } - var ctx = lookupCanvas.getContext('2d'); + var ctx = lookupCanvas.getContext('2d'); ctx.clearRect(0,0,256,1); // color index 0 is the ocean, leave it something neutral - + // this fixes a bug where the fill for ocean was being applied during pick // all non-countries were being pointed to 10 - bolivia // the fact that it didn't select was because bolivia shows up as an invalid country due to country name mismatch @@ -486,7 +487,7 @@ function highlightCountry( countries ){ // } var selectedCountryCode = selectedCountry.countryCode; - + for( var i in countryCodes ){ var countryCode = countryCodes[i]; var colorIndex = countryColorMap[ countryCode ]; @@ -504,12 +505,12 @@ function highlightCountry( countries ){ ctx.fillStyle = fillCSS; ctx.fillRect( colorIndex, 0, 1, 1 ); } - + lookupTexture.needsUpdate = true; } function getHistoricalData( country ){ - var history = []; + var history = []; var countryName = country.countryName; @@ -517,16 +518,16 @@ function getHistoricalData( country ){ var importCategories = selectionData.getImportCategories(); for( var i in timeBins ){ - var yearBin = timeBins[i].data; + var yearBin = timeBins[i].data; var value = {imports: 0, exports:0}; for( var s in yearBin ){ var set = yearBin[s]; var categoryName = reverseWeaponLookup[set.wc]; var exporterCountryName = set.e.toUpperCase(); - var importerCountryName = set.i.toUpperCase(); - var relevantCategory = ( countryName == exporterCountryName && $.inArray(categoryName, exportCategories ) >= 0 ) || - ( countryName == importerCountryName && $.inArray(categoryName, importCategories ) >= 0 ); + var importerCountryName = set.i.toUpperCase(); + var relevantCategory = ( countryName == exporterCountryName && $.inArray(categoryName, exportCategories ) >= 0 ) || + ( countryName == importerCountryName && $.inArray(categoryName, importCategories ) >= 0 ); if( relevantCategory == false ) continue; @@ -534,7 +535,7 @@ function getHistoricalData( country ){ // ignore all unidentified country data if( countryData[exporterCountryName] === undefined || countryData[importerCountryName] === undefined ) continue; - + if( exporterCountryName == countryName ) value.exports += set.v; if( importerCountryName == countryName ) @@ -559,7 +560,7 @@ function getPickColor(){ renderer.autoClear = false; renderer.autoClearColor = false; renderer.autoClearDepth = false; - renderer.autoClearStencil = false; + renderer.autoClearStencil = false; renderer.preserve renderer.clear(); @@ -573,17 +574,17 @@ function getPickColor(){ mx = Math.floor( mx ); my = Math.floor( my ); - var buf = new Uint8Array( 4 ); + var buf = new Uint8Array( 4 ); // console.log(buf); gl.readPixels( mx, my, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, buf ); - // console.log(buf); + // console.log(buf); renderer.autoClear = true; renderer.autoClearColor = true; renderer.autoClearDepth = true; renderer.autoClearStencil = true; - gl.preserveDrawingBuffer = false; + gl.preserveDrawingBuffer = false; mapUniforms['outlineLevel'].value = 1; rotating.add(visualizationMesh); @@ -592,5 +593,5 @@ function getPickColor(){ if( affectedCountries !== undefined ){ highlightCountry(affectedCountries); } - return buf[0]; + return buf[0]; } From d381c7f67d30b358c8994b3de6960c4753e21fd7 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Sun, 1 Feb 2015 22:06:38 +0000 Subject: [PATCH 008/190] Removed some unnecessary UI elements. --- index.html | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/index.html b/index.html index e9656ca..cd4a4c5 100755 --- a/index.html +++ b/index.html @@ -35,13 +35,6 @@

Data Visualization Globe

-
- - - - -
-
@@ -75,7 +68,6 @@

Data Visualization Globe

-
Military
@@ -96,19 +88,6 @@

Data Visualization Globe


-
-
-
-
Information about the data
-
- This data visualization was produced by Google as part of the Google Ideas INFO (Illicit Networks, Forces in Opposition) Summit with support from the Igarape Institute and data provided by the Peace Research Institute Oslo (PRIO) small arms database. The visualization includes >1 million individual import and export data points from annual custom reports and maps the transfer of small arms, light weapons and ammunition across 250 nation states and territories around the world between 1992 and 2010. -
- -
-
From be3c007b3b3c55790bec05bb8c4642895ef1be73 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 2 Feb 2015 11:20:32 -0500 Subject: [PATCH 009/190] Moved third party JS libraries into their own directory in preparation for Grunt. --- index.html | 30 +- js/perlin.js | 56 -- js/shadow_transparent.png | Bin 6633 -> 0 bytes js/ui.controls_test.js | 531 ------------------ style.css | 20 +- {js => thirdparty}/Detector.js | 0 {js => thirdparty}/RequestAnimationFrame.js | 0 {js => thirdparty}/ShaderExtras.js | 0 {js => thirdparty}/Stats.js | 0 {js => thirdparty}/THREEx.KeyboardState.js | 0 {js => thirdparty}/THREEx.WindowResize.js | 0 {js => thirdparty}/Three.js | 0 {js => thirdparty}/ThreeDebug.js | 0 {js => thirdparty}/Tween.js | 0 {js => thirdparty}/canvg.js | 0 {js => thirdparty}/d3.v2.min.js | 0 {js => thirdparty}/dat.gui.min.js | 0 {js => thirdparty}/innersvg.js | 0 {js => thirdparty}/jquery-1.7.1.min.js | 0 .../jquery-ui-1.8.21.custom.min.js | 0 .../jquery.preventMacBackScroll.js | 0 {js => thirdparty}/rgbcolor.js | 0 22 files changed, 25 insertions(+), 612 deletions(-) delete mode 100644 js/perlin.js delete mode 100755 js/shadow_transparent.png delete mode 100644 js/ui.controls_test.js rename {js => thirdparty}/Detector.js (100%) rename {js => thirdparty}/RequestAnimationFrame.js (100%) rename {js => thirdparty}/ShaderExtras.js (100%) rename {js => thirdparty}/Stats.js (100%) rename {js => thirdparty}/THREEx.KeyboardState.js (100%) rename {js => thirdparty}/THREEx.WindowResize.js (100%) rename {js => thirdparty}/Three.js (100%) rename {js => thirdparty}/ThreeDebug.js (100%) rename {js => thirdparty}/Tween.js (100%) rename {js => thirdparty}/canvg.js (100%) rename {js => thirdparty}/d3.v2.min.js (100%) rename {js => thirdparty}/dat.gui.min.js (100%) rename {js => thirdparty}/innersvg.js (100%) rename {js => thirdparty}/jquery-1.7.1.min.js (100%) rename {js => thirdparty}/jquery-ui-1.8.21.custom.min.js (100%) rename {js => thirdparty}/jquery.preventMacBackScroll.js (100%) rename {js => thirdparty}/rgbcolor.js (100%) diff --git a/index.html b/index.html index cd4a4c5..60d991a 100755 --- a/index.html +++ b/index.html @@ -90,20 +90,20 @@

Data Visualization Globe - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -116,7 +116,7 @@

Data Visualization Globe - + diff --git a/js/ui.controls.js b/js/ui.controls.js index 71f97e3..1751810 100644 --- a/js/ui.controls.js +++ b/js/ui.controls.js @@ -32,12 +32,9 @@ var d3Graphs = { $("#hudHeader, #hudButtons").show(); $("#history").show(); $("#graphIcon").show(); - $("#importExportBtns").show(); $("#history ul li").click(d3Graphs.clickTimeline); $("#handle").draggable({axis: 'x',containment: "parent",grid:[this.handleInterval, this.handleInterval], stop: d3Graphs.dropHandle, drag: d3Graphs.dropHandle }); $("#hudButtons .searchBtn").click(d3Graphs.updateViz); - $("#importExportBtns .imex>div").not(".label").click(d3Graphs.importExportBtnClick); - $("#importExportBtns .imex .label").click(d3Graphs.importExportLabelClick); $("#hudButtons .countryTextInput").autocomplete({ source:selectableCountries, autoFocus: true }); $("#hudButtons .countryTextInput").keyup(d3Graphs.countryKeyUp); $("#hudButtons .countryTextInput").focus(d3Graphs.countryFocus); @@ -94,13 +91,9 @@ var d3Graphs = { var w = windowWidth < minWidth ? minWidth : windowWidth; var hudButtonWidth = 489; $('#hudButtons').css('left',w - hudButtonWidth-20); - var importExportButtonWidth = $("#importExportBtns").width(); - $("#importExportBtns").css('left',w-importExportButtonWidth - 20); var barGraphHeight = 800; var barGraphBottomPadding = 10; - console.log(windowHeight+ " " + barGraphHeight + " " + barGraphBottomPadding); var barGraphTopPos = (windowHeight < minHeight ? minHeight : windowHeight) - barGraphHeight - barGraphBottomPadding; - console.log(barGraphTopPos); $("#barGraph").css('top',barGraphTopPos+'px'); }, @@ -140,35 +133,6 @@ var d3Graphs = { return; } - //exports first - var exportArray = [] - var exportBtns = $("#importExportBtns .exports>div").not(".label"); - for(var i = 0; i < exportBtns.length; i++) { - var btn = $(exportBtns[i]); - var weaponTypeKey = btn.attr('class'); - var weaponName = reverseWeaponLookup[weaponTypeKey]; - - if(btn.find('.inactive').length == 0) { - exportArray.push(weaponName); - selectionData.exportCategories[weaponName] = true; - } else { - selectionData.exportCategories[weaponName] = false; - } - } - //imports esecond - var importArray = [] - var importBtns = $("#importExportBtns .imports>div").not(".label"); - for(var i = 0; i < importBtns.length; i++) { - var btn = $(importBtns[i]); - var weaponTypeKey = btn.attr('class'); - var weaponName = reverseWeaponLookup[weaponTypeKey]; - if(btn.find('.inactive').length == 0) { - importArray.push(weaponName); - selectionData.importCategories[weaponName] = true; - } else { - selectionData.importCategories[weaponName] = false; - } - } selectionData.selectedYear = year; selectionData.selectedCountry = country; selectVisualization(timeBins, year,[country],exportArray, importArray); From 51ba4fbc12b049f1c6564b6b0168c1596fd17232 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 2 Feb 2015 12:13:11 -0500 Subject: [PATCH 013/190] Removed the bottom timeline. --- index.html | 34 ---------------------------------- js/ui.controls.js | 16 ---------------- 2 files changed, 50 deletions(-) diff --git a/index.html b/index.html index 61ad881..abad651 100755 --- a/index.html +++ b/index.html @@ -34,40 +34,6 @@

Data Visualization Globe
An interactive visualization of source/destination data over time.

- -
-
-
-
-
RELATIVE PERCENT CHANGE
-
EXPORTS
-
IMPORTS

-
-
-
-
    -
  • 1992
  • -
  • 93
  • -
  • 94
  • -
  • 95
  • -
  • 96
  • -
  • 97
  • -
  • 98
  • -
  • 99
  • -
  • 2000
  • -
  • 01
  • -
  • 02
  • -
  • 03
  • -
  • 04
  • -
  • 05
  • -
  • 06
  • -
  • 07
  • -
  • 08
  • -
  • 09
  • -
  • 2010
  • -
    -
-
diff --git a/js/ui.controls.js b/js/ui.controls.js index 1751810..61ae20d 100644 --- a/js/ui.controls.js +++ b/js/ui.controls.js @@ -30,9 +30,6 @@ var d3Graphs = { this.inited = true; d3Graphs.windowResize(); $("#hudHeader, #hudButtons").show(); - $("#history").show(); - $("#graphIcon").show(); - $("#history ul li").click(d3Graphs.clickTimeline); $("#handle").draggable({axis: 'x',containment: "parent",grid:[this.handleInterval, this.handleInterval], stop: d3Graphs.dropHandle, drag: d3Graphs.dropHandle }); $("#hudButtons .searchBtn").click(d3Graphs.updateViz); $("#hudButtons .countryTextInput").autocomplete({ source:selectableCountries, autoFocus: true }); @@ -85,7 +82,6 @@ var d3Graphs = { windowResize: function() { var windowWidth = $(window).width(); var windowHeight = $(window).height(); - d3Graphs.positionHistory(windowWidth); var minWidth = 1280; var minHeight = 860; var w = windowWidth < minWidth ? minWidth : windowWidth; @@ -97,18 +93,6 @@ var d3Graphs = { $("#barGraph").css('top',barGraphTopPos+'px'); }, - positionHistory: function(windowWidth) { - var graphIconPadding = 20; - var historyWidth = $("#history").width(); - var totalWidth = historyWidth + $("#graphIcon").width() + graphIconPadding; - var historyLeftPos = (windowWidth - totalWidth) / 2.0; - var minLeftPos = 280; - if(historyLeftPos < minLeftPos) { - historyLeftPos = minLeftPos; - } - $("#history").css('left',historyLeftPos+"px"); - $("#graphIcon").css('left',historyLeftPos + historyWidth + graphIconPadding+'px'); - }, countryFocus:function(event) { setTimeout(function() { $('#hudButtons .countryTextInput').select() },50); }, From 2d7de4c94a04e4a12358c521f885f6af52813f40 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 2 Feb 2015 12:21:17 -0500 Subject: [PATCH 014/190] Removed the remainder of the dependencies on the ui.controls module and deleted the module. --- index.html | 1 - js/mousekeyboard.js | 37 +++++----- js/ui.controls.js | 173 -------------------------------------------- js/visualize.js | 2 - 4 files changed, 18 insertions(+), 195 deletions(-) delete mode 100644 js/ui.controls.js diff --git a/index.html b/index.html index abad651..b28412b 100755 --- a/index.html +++ b/index.html @@ -63,7 +63,6 @@

Data Visualization Globe - + @@ -62,7 +63,6 @@

Data Visualization Globe - - + diff --git a/js/main.js b/js/main.js index 9cd19b7..4f0ceaf 100644 --- a/js/main.js +++ b/js/main.js @@ -381,7 +381,7 @@ function animate() { requestAnimationFrame( animate ); - THREE.SceneUtils.traverseHierarchy( rotating, + rotating.traverse( function(mesh) { if( mesh && mesh.update !== undefined) { mesh.update(); diff --git a/js/visualize.js b/js/visualize.js index 6dda356..9f412f5 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -49,7 +49,7 @@ function getVisualizedMesh( linearData ){ } // merge it all together - THREE.GeometryUtils.merge( linesGeo, linearData.lineGeometry ); + linesGeo.merge( linearData.lineGeometry ); var particleColor = lastColor.clone(); var points = linearData.lineGeometry.vertices; @@ -109,12 +109,12 @@ function getVisualizedMesh( linearData ){ var particleGraphic = THREE.ImageUtils.loadTexture("images/map_mask.png"); - var particleMat = new THREE.ParticleBasicMaterial( { map: particleGraphic, color: 0xffffff, size: 60, + var particleMat = new THREE.PointCloudMaterial( { map: particleGraphic, color: 0xffffff, size: 60, blending: THREE.NormalBlending, transparent:true, depthWrite: false, vertexColors: true, sizeAttenuation: true } ); particlesGeo.colors = particleColors; - var pSystem = new THREE.ParticleSystem( particlesGeo, shaderMaterial ); + var pSystem = new THREE.PointCloud( particlesGeo, shaderMaterial ); pSystem.dynamic = true; splineOutline.add( pSystem ); @@ -163,7 +163,7 @@ function getVisualizedMesh( linearData ){ particle.copy( currentPoint ); - particle.lerpSelf( nextPoint, particle.lerpN ); + particle.lerp( nextPoint, particle.lerpN ); } } diff --git a/js/visualize_lines.js b/js/visualize_lines.js index 24d35ae..74240f4 100644 --- a/js/visualize_lines.js +++ b/js/visualize_lines.js @@ -2,12 +2,12 @@ var globeRadius = 1000; var vec3_origin = new THREE.Vector3(0,0,0); function makeConnectionLineGeometry( exporter, importer, value, type ){ - if( exporter.countryName == undefined || importer.countryName == undefined ) + if( exporter.countryName === undefined || importer.countryName === undefined ) return undefined; // console.log("making connection between " + exporter.countryName + " and " + importer.countryName + " with code " + type ); - var distanceBetweenCountryCenter = exporter.center.clone().subSelf(importer.center).length(); + var distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length(); // how high we want to shoot the curve upwards var anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.3; @@ -19,13 +19,13 @@ function makeConnectionLineGeometry( exporter, importer, value, type ){ var end = importer.center; // midpoint for the curve - var mid = start.clone().lerpSelf(end,0.5); - var midLength = mid.length() + var mid = start.clone().lerp(end,0.5); + var midLength = mid.length(); mid.normalize(); mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.4 ); // the normal from start to end - var normal = (new THREE.Vector3()).sub(start,end); + var normal = (new THREE.Vector3()).subVectors(start,end); normal.normalize(); /* @@ -43,8 +43,8 @@ function makeConnectionLineGeometry( exporter, importer, value, type ){ var distanceHalf = distanceBetweenCountryCenter * 0.5; var startAnchor = start; - var midStartAnchor = mid.clone().addSelf( normal.clone().multiplyScalar( distanceHalf ) ); - var midEndAnchor = mid.clone().addSelf( normal.clone().multiplyScalar( -distanceHalf ) ); + var midStartAnchor = mid.clone().add( normal.clone().multiplyScalar( distanceHalf ) ); + var midEndAnchor = mid.clone().add( normal.clone().multiplyScalar( -distanceHalf ) ); var endAnchor = end; // now make a bezier curve out of the above like so in the diagram @@ -89,4 +89,4 @@ function constrain(v, min, max){ if( v > max ) v = max; return v; -} \ No newline at end of file +} diff --git a/thirdparty/Three.js b/thirdparty/Three.js deleted file mode 100755 index c043be7..0000000 --- a/thirdparty/Three.js +++ /dev/null @@ -1,729 +0,0 @@ -// Three.js - http://github.com/mrdoob/three.js -'use strict';var THREE=THREE||{REVISION:"49"};self.Int32Array||(self.Int32Array=Array,self.Float32Array=Array); -(function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},lerpSelf:function(a,b){this.r=this.r+(a.r-this.r)*b;this.g=this.g+(a.g-this.g)*b;this.b=this.b+(a.b-this.b)*b;return this},getHex:function(){return Math.floor(this.r*255)<<16^Math.floor(this.g*255)<<8^Math.floor(this.b*255)},getContextStyle:function(){return"rgb("+Math.floor(this.r*255)+","+Math.floor(this.g*255)+","+Math.floor(this.b*255)+")"},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}}; -THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},subSelf:function(a){this.x=this.x-a.x;this.y=this.y-a.y;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;return this},divideScalar:function(a){if(a){this.x= -this.x/a;this.y=this.y/a}else this.set(0,0);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,a=this.y-a.y;return b*b+a*a},setLength:function(a){return this.normalize().multiplyScalar(a)}, -lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; -THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;return this},addScalar:function(a){this.x=this.x+a;this.y=this.y+ -a;this.z=this.z+a;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},subSelf:function(a){this.x=this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;return this},multiply:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},multiplySelf:function(a){this.x=this.x*a.x;this.y=this.y*a.y;this.z=this.z*a.z;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;return this},divideSelf:function(a){this.x=this.x/a.x;this.y= -this.y/a.y;this.z=this.z/a.z;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a}else this.z=this.y=this.x=0;return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())}, -setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;return this},cross:function(a,b){this.x=a.y*b.z-a.z*b.y;this.y=a.z*b.x-a.x*b.z;this.z=a.x*b.y-a.y*b.x;return this},crossSelf:function(a){var b=this.x,c=this.y,d=this.z;this.x=c*a.z-d*a.y;this.y=d*a.x-b*a.z;this.z=b*a.y-c*a.x;return this},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){return(new THREE.Vector3).sub(this, -a).lengthSq()},getPositionFromMatrix:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},getRotationFromMatrix:function(a,b){var c=b?b.x:1,d=b?b.y:1,e=b?b.z:1,f=a.elements[0]/c,g=a.elements[4]/d,c=a.elements[1]/c,d=a.elements[5]/d,h=a.elements[9]/e,j=a.elements[10]/e;this.y=Math.asin(a.elements[8]/e);e=Math.cos(this.y);if(Math.abs(e)>1.0E-5){this.x=Math.atan2(-h/e,j/e);this.z=Math.atan2(-g/e,f/e)}else{this.x=0;this.z=Math.atan2(c,d)}return this},getScaleFromMatrix:function(a){var b= -this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length(),a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},isZero:function(){return this.lengthSq()<1.0E-4},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}};THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1}; -THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w!==void 0?a.w:1;return this},add:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addSelf:function(a){this.x=this.x+a.x;this.y=this.y+a.y;this.z=this.z+a.z;this.w=this.w+a.w;return this},sub:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},subSelf:function(a){this.x= -this.x-a.x;this.y=this.y-a.y;this.z=this.z-a.z;this.w=this.w-a.w;return this},multiplyScalar:function(a){this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a;return this},divideScalar:function(a){if(a){this.x=this.x/a;this.y=this.y/a;this.z=this.z/a;this.w=this.w/a}else{this.z=this.y=this.x=0;this.w=1}return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.dot(this)},length:function(){return Math.sqrt(this.lengthSq())}, -normalize:function(){return this.divideScalar(this.length())},setLength:function(a){return this.normalize().multiplyScalar(a)},lerpSelf:function(a,b){this.x=this.x+(a.x-this.x)*b;this.y=this.y+(a.y-this.y)*b;this.z=this.z+(a.z-this.z)*b;this.w=this.w+(a.w-this.w)*b;return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Frustum=function(){this.planes=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4]}; -THREE.Frustum.prototype.setFromMatrix=function(a){var b,c=this.planes,d=a.elements,a=d[0];b=d[1];var e=d[2],f=d[3],g=d[4],h=d[5],j=d[6],l=d[7],k=d[8],p=d[9],m=d[10],o=d[11],q=d[12],n=d[13],r=d[14],d=d[15];c[0].set(f-a,l-g,o-k,d-q);c[1].set(f+a,l+g,o+k,d+q);c[2].set(f+b,l+h,o+p,d+n);c[3].set(f-b,l-h,o-p,d-n);c[4].set(f-e,l-j,o-m,d-r);c[5].set(f+e,l+j,o+m,d+r);for(a=0;a<6;a++){b=c[a];b.divideScalar(Math.sqrt(b.x*b.x+b.y*b.y+b.z*b.z))}}; -THREE.Frustum.prototype.contains=function(a){for(var b=this.planes,c=a.matrixWorld,d=c.elements,c=-a.geometry.boundingSphere.radius*c.getMaxScaleOnAxis(),e=0;e<6;e++){a=b[e].x*d[12]+b[e].y*d[13]+b[e].z*d[14]+b[e].w;if(a<=c)return false}return true};THREE.Frustum.__v1=new THREE.Vector3; -THREE.Ray=function(a,b){function c(a,b,c){q.sub(c,a);u=q.dot(b);t=n.add(a,r.copy(b).multiplyScalar(u));return y=c.distanceTo(t)}function d(a,b,c,d){q.sub(d,b);n.sub(c,b);r.sub(a,b);s=q.dot(q);w=q.dot(n);H=q.dot(r);E=n.dot(n);z=n.dot(r);v=1/(s*E-w*w);A=(E*H-w*z)*v;J=(s*z-w*H)*v;return A>=0&&J>=0&&A+J<1}this.origin=a||new THREE.Vector3;this.direction=b||new THREE.Vector3;var e=1.0E-4;this.setPrecision=function(a){e=a};var f=new THREE.Vector3,g=new THREE.Vector3,h=new THREE.Vector3,j=new THREE.Vector3, -l=new THREE.Vector3,k=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3,o=new THREE.Vector3;this.intersectObject=function(a){var b,n=[];if(a instanceof THREE.Particle){var q=c(this.origin,this.direction,a.matrixWorld.getPosition());if(q>a.scale.x)return[];b={distance:q,point:a.position,face:null,object:a};n.push(b)}else if(a instanceof THREE.Mesh){var q=c(this.origin,this.direction,a.matrixWorld.getPosition()),r=THREE.Frustum.__v1.set(a.matrixWorld.getColumnX().length(),a.matrixWorld.getColumnY().length(), -a.matrixWorld.getColumnZ().length());if(q>a.geometry.boundingSphere.radius*Math.max(r.x,Math.max(r.y,r.z)))return n;var s,i,t=a.geometry,u=t.vertices,C;a.matrixRotationWorld.extractRotation(a.matrixWorld);q=0;for(r=t.faces.length;q0:s<0))){o.add(l,k.multiplyScalar(i));if(b instanceof THREE.Face3){f=C.multiplyVector3(f.copy(u[b.a]));g=C.multiplyVector3(g.copy(u[b.b]));h=C.multiplyVector3(h.copy(u[b.c]));if(d(o,f,g,h)){b={distance:l.distanceTo(o),point:o.clone(),face:b,object:a};n.push(b)}}else if(b instanceof THREE.Face4){f=C.multiplyVector3(f.copy(u[b.a]));g=C.multiplyVector3(g.copy(u[b.b]));h=C.multiplyVector3(h.copy(u[b.c]));j=C.multiplyVector3(j.copy(u[b.d]));if(d(o,f,g,j)||d(o,g,h,j)){b={distance:l.distanceTo(o),point:o.clone(), -face:b,object:a};n.push(b)}}}}}}return n};this.intersectObjects=function(a){for(var b=[],c=0,d=a.length;cf?d:f;e=e>g? -e:g}a()};this.add3Points=function(f,g,k,p,m,o){if(h){h=false;b=fk?f>m?f:m:k>m?k:m;e=g>p?g>o?g:o:p>o?p:o}else{b=fk?f>m?f>d?f:d:m>d?m:d:k>m?k>d?k:d:m>d?m:d;e=g>p?g>o?g>e?g:e:o>e?o:e:p>o?p>e?p:e:o>e?o:e}a()};this.addRectangle=function(f){if(h){h=false;b=f.getLeft();c=f.getTop();d=f.getRight();e=f.getBottom()}else{b=bf.getRight()?d:f.getRight();e=e>f.getBottom()?e:f.getBottom()}a()};this.inflate=function(f){b=b-f;c=c-f;d=d+f;e=e+f;a()};this.minSelf=function(f){b=b>f.getLeft()?b:f.getLeft();c=c>f.getTop()?c:f.getTop();d=da.getRight()||ea.getBottom()?false:true};this.empty=function(){h=true;e=d=c=b=0;a()};this.isEmpty=function(){return h}}; -THREE.Math={clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a0?1:0}};THREE.Matrix3=function(){this.elements=new Float32Array(9)}; -THREE.Matrix3.prototype={constructor:THREE.Matrix3,getInverse:function(a){var b=a.elements,a=b[10]*b[5]-b[6]*b[9],c=-b[10]*b[1]+b[2]*b[9],d=b[6]*b[1]-b[2]*b[5],e=-b[10]*b[4]+b[6]*b[8],f=b[10]*b[0]-b[2]*b[8],g=-b[6]*b[0]+b[2]*b[4],h=b[9]*b[4]-b[5]*b[8],j=-b[9]*b[0]+b[1]*b[8],l=b[5]*b[0]-b[1]*b[4],b=b[0]*a+b[1]*e+b[2]*h;b===0&&console.warn("Matrix3.getInverse(): determinant == 0");var b=1/b,k=this.elements;k[0]=b*a;k[1]=b*c;k[2]=b*d;k[3]=b*e;k[4]=b*f;k[5]=b*g;k[6]=b*h;k[7]=b*j;k[8]=b*l;return this}, -transpose:function(){var a,b=this.elements;a=b[1];b[1]=b[3];b[3]=a;a=b[2];b[2]=b[6];b[6]=a;a=b[5];b[5]=b[7];b[7]=a;return this},transposeIntoArray:function(a){var b=this.m;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this}};THREE.Matrix4=function(a,b,c,d,e,f,g,h,j,l,k,p,m,o,q,n){this.elements=new Float32Array(16);this.set(a!==void 0?a:1,b||0,c||0,d||0,e||0,f!==void 0?f:1,g||0,h||0,j||0,l||0,k!==void 0?k:1,p||0,m||0,o||0,q||0,n!==void 0?n:1)}; -THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(a,b,c,d,e,f,g,h,j,l,k,p,m,o,q,n){var r=this.elements;r[0]=a;r[4]=b;r[8]=c;r[12]=d;r[1]=e;r[5]=f;r[9]=g;r[13]=h;r[2]=j;r[6]=l;r[10]=k;r[14]=p;r[3]=m;r[7]=o;r[11]=q;r[15]=n;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},copy:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15]);return this},lookAt:function(a,b,c){var d=this.elements, -e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;g.sub(a,b).normalize();if(g.length()===0)g.z=1;e.cross(c,g).normalize();if(e.length()===0){g.x=g.x+1.0E-4;e.cross(c,g).normalize()}f.cross(g,e);d[0]=e.x;d[4]=f.x;d[8]=g.x;d[1]=e.y;d[5]=f.y;d[9]=g.y;d[2]=e.z;d[6]=f.z;d[10]=g.z;return this},multiply:function(a,b){var c=a.elements,d=b.elements,e=this.elements,f=c[0],g=c[4],h=c[8],j=c[12],l=c[1],k=c[5],p=c[9],m=c[13],o=c[2],q=c[6],n=c[10],r=c[14],u=c[3],t=c[7],y=c[11],c=c[15],s=d[0],w=d[4], -H=d[8],E=d[12],z=d[1],v=d[5],A=d[9],J=d[13],K=d[2],R=d[6],P=d[10],D=d[14],M=d[3],G=d[7],i=d[11],d=d[15];e[0]=f*s+g*z+h*K+j*M;e[4]=f*w+g*v+h*R+j*G;e[8]=f*H+g*A+h*P+j*i;e[12]=f*E+g*J+h*D+j*d;e[1]=l*s+k*z+p*K+m*M;e[5]=l*w+k*v+p*R+m*G;e[9]=l*H+k*A+p*P+m*i;e[13]=l*E+k*J+p*D+m*d;e[2]=o*s+q*z+n*K+r*M;e[6]=o*w+q*v+n*R+r*G;e[10]=o*H+q*A+n*P+r*i;e[14]=o*E+q*J+n*D+r*d;e[3]=u*s+t*z+y*K+c*M;e[7]=u*w+t*v+y*R+c*G;e[11]=u*H+t*A+y*P+c*i;e[15]=u*E+t*J+y*D+c*d;return this},multiplySelf:function(a){return this.multiply(this, -a)},multiplyToArray:function(a,b,c){var d=this.elements;this.multiply(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]=b[0]*a;b[4]=b[4]*a;b[8]=b[8]*a;b[12]=b[12]*a;b[1]=b[1]*a;b[5]=b[5]*a;b[9]=b[9]*a;b[13]=b[13]*a;b[2]=b[2]*a;b[6]=b[6]*a;b[10]=b[10]*a;b[14]=b[14]*a;b[3]=b[3]*a;b[7]=b[7]*a;b[11]=b[11]*a;b[15]= -b[15]*a;return this},multiplyVector3:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=1/(b[3]*c+b[7]*d+b[11]*e+b[15]);a.x=(b[0]*c+b[4]*d+b[8]*e+b[12])*f;a.y=(b[1]*c+b[5]*d+b[9]*e+b[13])*f;a.z=(b[2]*c+b[6]*d+b[10]*e+b[14])*f;return a},multiplyVector4:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w;a.x=b[0]*c+b[4]*d+b[8]*e+b[12]*f;a.y=b[1]*c+b[5]*d+b[9]*e+b[13]*f;a.z=b[2]*c+b[6]*d+b[10]*e+b[14]*f;a.w=b[3]*c+b[7]*d+b[11]*e+b[15]*f;return a},rotateAxis:function(a){var b=this.elements,c=a.x, -d=a.y,e=a.z;a.x=c*b[0]+d*b[4]+e*b[8];a.y=c*b[1]+d*b[5]+e*b[9];a.z=c*b[2]+d*b[6]+e*b[10];a.normalize();return a},crossVector:function(a){var b=this.elements,c=new THREE.Vector4;c.x=b[0]*a.x+b[4]*a.y+b[8]*a.z+b[12]*a.w;c.y=b[1]*a.x+b[5]*a.y+b[9]*a.z+b[13]*a.w;c.z=b[2]*a.x+b[6]*a.y+b[10]*a.z+b[14]*a.w;c.w=a.w?b[3]*a.x+b[7]*a.y+b[11]*a.z+b[15]*a.w:1;return c},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],j=a[13],l=a[2],k=a[6],p=a[10],m=a[14],o=a[3],q=a[7], -n=a[11],a=a[15];return e*h*k*o-d*j*k*o-e*g*p*o+c*j*p*o+d*g*m*o-c*h*m*o-e*h*l*q+d*j*l*q+e*f*p*q-b*j*p*q-d*f*m*q+b*h*m*q+e*g*l*n-c*j*l*n-e*f*k*n+b*j*k*n+c*f*m*n-b*g*m*n-d*g*l*a+c*h*l*a+d*f*k*a-b*h*k*a-c*f*p*a+b*g*p*a},transpose:function(){var a=this.elements,b;b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];a[14]=b;return this},flattenToArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[1];a[2]=b[2]; -a[3]=b[3];a[4]=b[4];a[5]=b[5];a[6]=b[6];a[7]=b[7];a[8]=b[8];a[9]=b[9];a[10]=b[10];a[11]=b[11];a[12]=b[12];a[13]=b[13];a[14]=b[14];a[15]=b[15];return a},flattenToArrayOffset:function(a,b){var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a},getPosition:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[12],a[13], -a[14])},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getColumnX:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[0],a[1],a[2])},getColumnY:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[4],a[5],a[6])},getColumnZ:function(){var a=this.elements;return THREE.Matrix4.__v1.set(a[8],a[9],a[10])},getInverse:function(a){var b=this.elements,c=a.elements,d=c[0],e=c[4],f=c[8],g=c[12],h=c[1],j=c[5],l=c[9],k=c[13],p=c[2],m=c[6],o=c[10],q= -c[14],n=c[3],r=c[7],u=c[11],c=c[15];b[0]=l*q*r-k*o*r+k*m*u-j*q*u-l*m*c+j*o*c;b[4]=g*o*r-f*q*r-g*m*u+e*q*u+f*m*c-e*o*c;b[8]=f*k*r-g*l*r+g*j*u-e*k*u-f*j*c+e*l*c;b[12]=g*l*m-f*k*m-g*j*o+e*k*o+f*j*q-e*l*q;b[1]=k*o*n-l*q*n-k*p*u+h*q*u+l*p*c-h*o*c;b[5]=f*q*n-g*o*n+g*p*u-d*q*u-f*p*c+d*o*c;b[9]=g*l*n-f*k*n-g*h*u+d*k*u+f*h*c-d*l*c;b[13]=f*k*p-g*l*p+g*h*o-d*k*o-f*h*q+d*l*q;b[2]=j*q*n-k*m*n+k*p*r-h*q*r-j*p*c+h*m*c;b[6]=g*m*n-e*q*n-g*p*r+d*q*r+e*p*c-d*m*c;b[10]=e*k*n-g*j*n+g*h*r-d*k*r-e*h*c+d*j*c;b[14]=g*j*p- -e*k*p-g*h*m+d*k*m+e*h*q-d*j*q;b[3]=l*m*n-j*o*n-l*p*r+h*o*r+j*p*u-h*m*u;b[7]=e*o*n-f*m*n+f*p*r-d*o*r-e*p*u+d*m*u;b[11]=f*j*n-e*l*n-f*h*r+d*l*r+e*h*u-d*j*u;b[15]=e*l*p-f*j*p+f*h*m-d*l*m-e*h*o+d*j*o;this.multiplyScalar(1/a.determinant());return this},setRotationFromEuler:function(a,b){var c=this.elements,d=a.x,e=a.y,f=a.z,g=Math.cos(d),d=Math.sin(d),h=Math.cos(e),e=Math.sin(e),j=Math.cos(f),f=Math.sin(f);switch(b){case "YXZ":var l=h*j,k=h*f,p=e*j,m=e*f;c[0]=l+m*d;c[4]=p*d-k;c[8]=g*e;c[1]=g*f;c[5]=g* -j;c[9]=-d;c[2]=k*d-p;c[6]=m+l*d;c[10]=g*h;break;case "ZXY":l=h*j;k=h*f;p=e*j;m=e*f;c[0]=l-m*d;c[4]=-g*f;c[8]=p+k*d;c[1]=k+p*d;c[5]=g*j;c[9]=m-l*d;c[2]=-g*e;c[6]=d;c[10]=g*h;break;case "ZYX":l=g*j;k=g*f;p=d*j;m=d*f;c[0]=h*j;c[4]=p*e-k;c[8]=l*e+m;c[1]=h*f;c[5]=m*e+l;c[9]=k*e-p;c[2]=-e;c[6]=d*h;c[10]=g*h;break;case "YZX":l=g*h;k=g*e;p=d*h;m=d*e;c[0]=h*j;c[4]=m-l*f;c[8]=p*f+k;c[1]=f;c[5]=g*j;c[9]=-d*j;c[2]=-e*j;c[6]=k*f+p;c[10]=l-m*f;break;case "XZY":l=g*h;k=g*e;p=d*h;m=d*e;c[0]=h*j;c[4]=-f;c[8]=e*j; -c[1]=l*f+m;c[5]=g*j;c[9]=k*f-p;c[2]=p*f-k;c[6]=d*j;c[10]=m*f+l;break;default:l=g*j;k=g*f;p=d*j;m=d*f;c[0]=h*j;c[4]=-h*f;c[8]=e;c[1]=k+p*e;c[5]=l-m*e;c[9]=-d*h;c[2]=m-l*e;c[6]=p+k*e;c[10]=g*h}return this},setRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,f=a.w,g=c+c,h=d+d,j=e+e,a=c*g,l=c*h,c=c*j,k=d*h,d=d*j,e=e*j,g=f*g,h=f*h,f=f*j;b[0]=1-(k+e);b[4]=l-f;b[8]=c+h;b[1]=l+f;b[5]=1-(a+e);b[9]=d-g;b[2]=c-h;b[6]=d+g;b[10]=1-(a+k);return this},compose:function(a,b,c){var d=this.elements, -e=THREE.Matrix4.__m1,f=THREE.Matrix4.__m2;e.identity();e.setRotationFromQuaternion(b);f.makeScale(c.x,c.y,c.z);this.multiply(e,f);d[12]=a.x;d[13]=a.y;d[14]=a.z;return this},decompose:function(a,b,c){var d=this.elements,e=THREE.Matrix4.__v1,f=THREE.Matrix4.__v2,g=THREE.Matrix4.__v3;e.set(d[0],d[1],d[2]);f.set(d[4],d[5],d[6]);g.set(d[8],d[9],d[10]);a=a instanceof THREE.Vector3?a:new THREE.Vector3;b=b instanceof THREE.Quaternion?b:new THREE.Quaternion;c=c instanceof THREE.Vector3?c:new THREE.Vector3; -c.x=e.length();c.y=f.length();c.z=g.length();a.x=d[12];a.y=d[13];a.z=d[14];d=THREE.Matrix4.__m1;d.copy(this);d.elements[0]=d.elements[0]/c.x;d.elements[1]=d.elements[1]/c.x;d.elements[2]=d.elements[2]/c.x;d.elements[4]=d.elements[4]/c.y;d.elements[5]=d.elements[5]/c.y;d.elements[6]=d.elements[6]/c.y;d.elements[8]=d.elements[8]/c.z;d.elements[9]=d.elements[9]/c.z;d.elements[10]=d.elements[10]/c.z;b.setFromRotationMatrix(d);return[a,b,c]},extractPosition:function(a){var b=this.elements,a=a.elements; -b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractRotation:function(a){var b=this.elements,a=a.elements,c=THREE.Matrix4.__v1,d=1/c.set(a[0],a[1],a[2]).length(),e=1/c.set(a[4],a[5],a[6]).length(),c=1/c.set(a[8],a[9],a[10]).length();b[0]=a[0]*d;b[1]=a[1]*d;b[2]=a[2]*d;b[4]=a[4]*e;b[5]=a[5]*e;b[6]=a[6]*e;b[8]=a[8]*c;b[9]=a[9]*c;b[10]=a[10]*c;return this},translate:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[12]=b[0]*c+b[4]*d+b[8]*a+b[12];b[13]=b[1]*c+b[5]*d+b[9]*a+b[13];b[14]=b[2]*c+b[6]* -d+b[10]*a+b[14];b[15]=b[3]*c+b[7]*d+b[11]*a+b[15];return this},rotateX:function(a){var b=this.elements,c=b[4],d=b[5],e=b[6],f=b[7],g=b[8],h=b[9],j=b[10],l=b[11],k=Math.cos(a),a=Math.sin(a);b[4]=k*c+a*g;b[5]=k*d+a*h;b[6]=k*e+a*j;b[7]=k*f+a*l;b[8]=k*g-a*c;b[9]=k*h-a*d;b[10]=k*j-a*e;b[11]=k*l-a*f;return this},rotateY:function(a){var b=this.elements,c=b[0],d=b[1],e=b[2],f=b[3],g=b[8],h=b[9],j=b[10],l=b[11],k=Math.cos(a),a=Math.sin(a);b[0]=k*c-a*g;b[1]=k*d-a*h;b[2]=k*e-a*j;b[3]=k*f-a*l;b[8]=k*g+a*c;b[9]= -k*h+a*d;b[10]=k*j+a*e;b[11]=k*l+a*f;return this},rotateZ:function(a){var b=this.elements,c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],j=b[6],l=b[7],k=Math.cos(a),a=Math.sin(a);b[0]=k*c+a*g;b[1]=k*d+a*h;b[2]=k*e+a*j;b[3]=k*f+a*l;b[4]=k*g-a*c;b[5]=k*h-a*d;b[6]=k*j-a*e;b[7]=k*l-a*f;return this},rotateByAxis:function(a,b){var c=this.elements;if(a.x===1&&a.y===0&&a.z===0)return this.rotateX(b);if(a.x===0&&a.y===1&&a.z===0)return this.rotateY(b);if(a.x===0&&a.y===0&&a.z===1)return this.rotateZ(b);var d=a.x, -e=a.y,f=a.z,g=Math.sqrt(d*d+e*e+f*f),d=d/g,e=e/g,f=f/g,g=d*d,h=e*e,j=f*f,l=Math.cos(b),k=Math.sin(b),p=1-l,m=d*e*p,o=d*f*p,p=e*f*p,d=d*k,q=e*k,k=f*k,f=g+(1-g)*l,g=m+k,e=o-q,m=m-k,h=h+(1-h)*l,k=p+d,o=o+q,p=p-d,j=j+(1-j)*l,l=c[0],d=c[1],q=c[2],n=c[3],r=c[4],u=c[5],t=c[6],y=c[7],s=c[8],w=c[9],H=c[10],E=c[11];c[0]=f*l+g*r+e*s;c[1]=f*d+g*u+e*w;c[2]=f*q+g*t+e*H;c[3]=f*n+g*y+e*E;c[4]=m*l+h*r+k*s;c[5]=m*d+h*u+k*w;c[6]=m*q+h*t+k*H;c[7]=m*n+h*y+k*E;c[8]=o*l+p*r+j*s;c[9]=o*d+p*u+j*w;c[10]=o*q+p*t+j*H;c[11]= -o*n+p*y+j*E;return this},scale:function(a){var b=this.elements,c=a.x,d=a.y,a=a.z;b[0]=b[0]*c;b[4]=b[4]*d;b[8]=b[8]*a;b[1]=b[1]*c;b[5]=b[5]*d;b[9]=b[9]*a;b[2]=b[2]*c;b[6]=b[6]*d;b[10]=b[10]*a;b[3]=b[3]*c;b[7]=b[7]*d;b[11]=b[11]*a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this}, -makeRotationX:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a),a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,j=e*f,l=e*g;this.set(j*f+c,j*g-d*h,j*h+d*g,0,j*g+d*h,l*g+c,l*h-d*f,0,j*h- -d*g,l*h+d*f,e*h*h+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){var a=c*Math.tan(a*Math.PI/360),e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a, -b,c,d,e,f){var g=this.elements,h=b-a,j=c-d,l=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/j;g[9]=0;g[13]=-((c+d)/j);g[2]=0;g[6]=0;g[10]=-2/l;g[14]=-((f+e)/l);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},clone:function(){var a=this.elements;return new THREE.Matrix4(a[0],a[4],a[8],a[12],a[1],a[5],a[9],a[13],a[2],a[6],a[10],a[14],a[3],a[7],a[11],a[15])}};THREE.Matrix4.__v1=new THREE.Vector3;THREE.Matrix4.__v2=new THREE.Vector3;THREE.Matrix4.__v3=new THREE.Vector3;THREE.Matrix4.__m1=new THREE.Matrix4; -THREE.Matrix4.__m2=new THREE.Matrix4; -THREE.Object3D=function(){this.id=THREE.Object3DCount++;this.name="";this.parent=void 0;this.children=[];this.up=new THREE.Vector3(0,1,0);this.position=new THREE.Vector3;this.rotation=new THREE.Vector3;this.eulerOrder="XYZ";this.scale=new THREE.Vector3(1,1,1);this.flipSided=this.doubleSided=false;this.renderDepth=null;this.rotationAutoUpdate=true;this.matrix=new THREE.Matrix4;this.matrixWorld=new THREE.Matrix4;this.matrixRotationWorld=new THREE.Matrix4;this.matrixWorldNeedsUpdate=this.matrixAutoUpdate= -true;this.quaternion=new THREE.Quaternion;this.useQuaternion=false;this.boundRadius=0;this.boundRadiusScale=1;this.visible=true;this.receiveShadow=this.castShadow=false;this.frustumCulled=true;this._vector=new THREE.Vector3}; -THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(a){this.matrix.multiply(a,this.matrix);this.scale.getScaleFromMatrix(this.matrix);this.rotation.getRotationFromMatrix(this.matrix,this.scale);this.position.getPositionFromMatrix(this.matrix)},translate:function(a,b){this.matrix.rotateAxis(b);this.position.addSelf(b.multiplyScalar(a))},translateX:function(a){this.translate(a,this._vector.set(1,0,0))},translateY:function(a){this.translate(a,this._vector.set(0,1,0))},translateZ:function(a){this.translate(a, -this._vector.set(0,0,1))},lookAt:function(a){this.matrix.lookAt(a,this.position,this.up);this.rotationAutoUpdate&&this.rotation.getRotationFromMatrix(this.matrix)},add:function(a){if(a===this)console.warn("THREE.Object3D.add: An object can't be added as a child of itself.");else if(a instanceof THREE.Object3D){a.parent!==void 0&&a.parent.remove(a);a.parent=this;this.children.push(a);for(var b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__addObject(a)}},remove:function(a){var b= -this.children.indexOf(a);if(b!==-1){a.parent=void 0;this.children.splice(b,1);for(b=this;b.parent!==void 0;)b=b.parent;b!==void 0&&b instanceof THREE.Scene&&b.__removeObject(a)}},getChildByName:function(a,b){var c,d,e;c=0;for(d=this.children.length;c=0&&f>=0&&g>=0&&h>=0)return true;if(e<0&&f<0||g<0&&h<0)return false;e<0?c=Math.max(c,e/(e-f)):f<0&&(d=Math.min(d,e/(e-f)));g<0?c=Math.max(c,g/(g-h)):h<0&&(d=Math.min(d,g/(g-h)));if(dg&&h.positionScreen.z0)){ea=l[j-2];J.copy(F.positionScreen);K.copy(ea.positionScreen);if(d(J,K)){J.multiplyScalar(1/J.w);K.multiplyScalar(1/K.w);$=u[r]=u[r]||new THREE.RenderableLine;r++;n=$;n.v1.positionScreen.copy(J); -n.v2.positionScreen.copy(K);n.z=Math.max(J.z,K.z);n.material=O.material;w.elements.push(n)}}}}}a=0;for(H=w.sprites.length;a0&&E.z<1){g=s[y]=s[y]||new THREE.RenderableParticle;y++;t=g;t.x=E.x/E.w;t.y=E.y/E.w;t.z=E.z;t.rotation=O.rotation.z;t.scale.x=O.scale.x*Math.abs(t.x-(E.x+e.projectionMatrix.elements[0])/(E.w+e.projectionMatrix.elements[12])); -t.scale.y=O.scale.y*Math.abs(t.y-(E.y+e.projectionMatrix.elements[5])/(E.w+e.projectionMatrix.elements[13]));t.material=O.material;w.elements.push(t)}}}f&&w.elements.sort(c);return w}};THREE.Quaternion=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=d!==void 0?d:1}; -THREE.Quaternion.prototype={constructor:THREE.Quaternion,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this},setFromEuler:function(a){var b=Math.PI/360,c=a.x*b,d=a.y*b,e=a.z*b,a=Math.cos(d),d=Math.sin(d),b=Math.cos(-e),e=Math.sin(-e),f=Math.cos(c),c=Math.sin(c),g=a*b,h=d*e;this.w=g*f-h*c;this.x=g*c+h*f;this.y=d*b*f+a*e*c;this.z=a*e*f-d*b*c;return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c); -this.x=a.x*d;this.y=a.y*d;this.z=a.z*d;this.w=Math.cos(c);return this},setFromRotationMatrix:function(a){var b=Math.pow(a.determinant(),1/3);this.w=Math.sqrt(Math.max(0,b+a.elements[0]+a.elements[5]+a.elements[10]))/2;this.x=Math.sqrt(Math.max(0,b+a.elements[0]-a.elements[5]-a.elements[10]))/2;this.y=Math.sqrt(Math.max(0,b-a.elements[0]+a.elements[5]-a.elements[10]))/2;this.z=Math.sqrt(Math.max(0,b-a.elements[0]-a.elements[5]+a.elements[10]))/2;this.x=a.elements[6]-a.elements[9]<0?-Math.abs(this.x): -Math.abs(this.x);this.y=a.elements[8]-a.elements[2]<0?-Math.abs(this.y):Math.abs(this.y);this.z=a.elements[1]-a.elements[4]<0?-Math.abs(this.z):Math.abs(this.z);this.normalize();return this},calculateW:function(){this.w=-Math.sqrt(Math.abs(1-this.x*this.x-this.y*this.y-this.z*this.z));return this},inverse:function(){this.x=this.x*-1;this.y=this.y*-1;this.z=this.z*-1;return this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},normalize:function(){var a= -Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);if(a===0)this.w=this.z=this.y=this.x=0;else{a=1/a;this.x=this.x*a;this.y=this.y*a;this.z=this.z*a;this.w=this.w*a}return this},multiply:function(a,b){this.x=a.x*b.w+a.y*b.z-a.z*b.y+a.w*b.x;this.y=-a.x*b.z+a.y*b.w+a.z*b.x+a.w*b.y;this.z=a.x*b.y-a.y*b.x+a.z*b.w+a.w*b.z;this.w=-a.x*b.x-a.y*b.y-a.z*b.z+a.w*b.w;return this},multiplySelf:function(a){var b=this.x,c=this.y,d=this.z,e=this.w,f=a.x,g=a.y,h=a.z,a=a.w;this.x=b*a+e*f+c*h-d*g;this.y= -c*a+e*g+d*f-b*h;this.z=d*a+e*h+b*g-c*f;this.w=e*a-b*f-c*g-d*h;return this},multiplyVector3:function(a,b){b||(b=a);var c=a.x,d=a.y,e=a.z,f=this.x,g=this.y,h=this.z,j=this.w,l=j*c+g*e-h*d,k=j*d+h*c-f*e,p=j*e+f*d-g*c,c=-f*c-g*d-h*e;b.x=l*j+c*-f+k*-h-p*-g;b.y=k*j+c*-g+p*-f-l*-h;b.z=p*j+c*-h+l*-g-k*-f;return b},clone:function(){return new THREE.Quaternion(this.x,this.y,this.z,this.w)}}; -THREE.Quaternion.slerp=function(a,b,c,d){var e=a.w*b.w+a.x*b.x+a.y*b.y+a.z*b.z;if(e<0){c.w=-b.w;c.x=-b.x;c.y=-b.y;c.z=-b.z;e=-e}else c.copy(b);if(Math.abs(e)>=1){c.w=a.w;c.x=a.x;c.y=a.y;c.z=a.z;return c}var f=Math.acos(e),e=Math.sqrt(1-e*e);if(Math.abs(e)<0.001){c.w=0.5*(a.w+b.w);c.x=0.5*(a.x+b.x);c.y=0.5*(a.y+b.y);c.z=0.5*(a.z+b.z);return c}b=Math.sin((1-d)*f)/e;d=Math.sin(d*f)/e;c.w=a.w*b+c.w*d;c.x=a.x*b+c.x*d;c.y=a.y*b+c.y*d;c.z=a.z*b+c.z*d;return c};THREE.Vertex=function(){console.warn("THREE.Vertex has been DEPRECATED. Use THREE.Vector3 instead.")}; -THREE.Face3=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d instanceof THREE.Vector3?d:new THREE.Vector3;this.vertexNormals=d instanceof Array?d:[];this.color=e instanceof THREE.Color?e:new THREE.Color;this.vertexColors=e instanceof Array?e:[];this.vertexTangents=[];this.materialIndex=f;this.centroid=new THREE.Vector3}; -THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var a=new THREE.Face3(this.a,this.b,this.c);a.normal.copy(this.normal);a.color.copy(this.color);a.centroid.copy(this.centroid);a.materialIndex=this.materialIndex;var b,c;b=0;for(c=this.vertexNormals.length;b0){var a;a=this.vertices[0];this.boundingBox.min.copy(a);this.boundingBox.max.copy(a);for(var b=this.boundingBox.min,c=this.boundingBox.max,d=1,e=this.vertices.length;dc.x)c.x= -a.x;if(a.yc.y)c.y=a.y;if(a.zc.z)c.z=a.z}}else{this.boundingBox.min.set(0,0,0);this.boundingBox.max.set(0,0,0)}},computeBoundingSphere:function(){if(!this.boundingSphere)this.boundingSphere={radius:0};for(var a,b=0,c=0,d=this.vertices.length;cb&&(b=a)}this.boundingSphere.radius=b},mergeVertices:function(){var a={},b=[],c=[],d,e=Math.pow(10,4),f,g,h;f=0;for(g=this.vertices.length;f0;a--)if(d.indexOf(e["abcd"[a]])!=a){d.splice(a,1);this.faces[f]=new THREE.Face3(d[0],d[1],d[2]);e=0;for(d=this.faceVertexUvs.length;ethis.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1: -f+2;l=this.points[c[0]];k=this.points[c[1]];p=this.points[c[2]];m=this.points[c[3]];h=g*g;j=g*h;d.x=b(l.x,k.x,p.x,m.x,g,h,j);d.y=b(l.y,k.y,p.y,m.y,g,h,j);d.z=b(l.z,k.z,p.z,m.z,g,h,j);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a1&&(K=new THREE.MeshFaceMaterial); -a=new THREE.Mesh(J,K);a.name=m;if(t){a.matrixAutoUpdate=false;a.matrix.set(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}else{a.position.set(w[0],w[1],w[2]);if(E){a.quaternion.set(E[0],E[1],E[2],E[3]);a.useQuaternion=true}else a.rotation.set(H[0],H[1],H[2]);a.scale.set(z[0],z[1],z[2])}a.visible=u.visible;a.doubleSided=u.doubleSided;a.castShadow=u.castShadow;a.receiveShadow=u.receiveShadow;C.scene.add(a);C.objects[m]=a}}else{w=u.position;H=u.rotation;E=u.quaternion; -z=u.scale;E=0;a=new THREE.Object3D;a.name=m;a.position.set(w[0],w[1],w[2]);if(E){a.quaternion.set(E[0],E[1],E[2],E[3]);a.useQuaternion=true}else a.rotation.set(H[0],H[1],H[2]);a.scale.set(z[0],z[1],z[2]);a.visible=u.visible!==void 0?u.visible:false;C.scene.add(a);C.objects[m]=a;C.empties[m]=a}}}function f(a){return function(b){C.geometries[a]=b;e();G=G-1;j.onLoadComplete();h()}}function g(a){return function(b){C.geometries[a]=b}}function h(){j.callbackProgress({totalModels:T,totalTextures:U,loadedModels:T- -G,loadedTextures:U-i},C);j.onLoadProgress();G==0&&i==0&&b(C)}var j=this,l=THREE.Loader.prototype.extractUrlBase(c),k,p,m,o,q,n,r,u,t,y,s,w,H,E,z,v,A,J,K,R,P,D,M,G,i,T,U,C;D=a;c=new THREE.BinaryLoader;M=new THREE.JSONLoader;i=G=0;C={scene:new THREE.Scene,geometries:{},materials:{},textures:{},objects:{},cameras:{},lights:{},fogs:{},empties:{}};if(D.transform){a=D.transform.position;y=D.transform.rotation;v=D.transform.scale;a&&C.scene.position.set(a[0],a[1],a[2]);y&&C.scene.rotation.set(y[0],y[1], -y[2]);v&&C.scene.scale.set(v[0],v[1],v[2]);if(a||y||v){C.scene.updateMatrix();C.scene.updateMatrixWorld()}}a=function(){i=i-1;h();j.onLoadComplete()};for(q in D.cameras){v=D.cameras[q];v.type=="perspective"?R=new THREE.PerspectiveCamera(v.fov,v.aspect,v.near,v.far):v.type=="ortho"&&(R=new THREE.OrthographicCamera(v.left,v.right,v.top,v.bottom,v.near,v.far));w=v.position;y=v.target;v=v.up;R.position.set(w[0],w[1],w[2]);R.target=new THREE.Vector3(y[0],y[1],y[2]);v&&R.up.set(v[0],v[1],v[2]);C.cameras[q]= -R}for(o in D.lights){y=D.lights[o];q=y.color!==void 0?y.color:16777215;R=y.intensity!==void 0?y.intensity:1;if(y.type=="directional"){w=y.direction;s=new THREE.DirectionalLight(q,R);s.position.set(w[0],w[1],w[2]);s.position.normalize()}else if(y.type=="point"){w=y.position;s=y.distance;s=new THREE.PointLight(q,R,s);s.position.set(w[0],w[1],w[2])}else y.type=="ambient"&&(s=new THREE.AmbientLight(q));C.scene.add(s);C.lights[o]=s}for(n in D.fogs){o=D.fogs[n];o.type=="linear"?P=new THREE.Fog(0,o.near, -o.far):o.type=="exp2"&&(P=new THREE.FogExp2(0,o.density));v=o.color;P.color.setRGB(v[0],v[1],v[2]);C.fogs[n]=P}if(C.cameras&&D.defaults.camera)C.currentCamera=C.cameras[D.defaults.camera];if(C.fogs&&D.defaults.fog)C.scene.fog=C.fogs[D.defaults.fog];v=D.defaults.bgcolor;C.bgColor=new THREE.Color;C.bgColor.setRGB(v[0],v[1],v[2]);C.bgColorAlpha=D.defaults.bgalpha;for(k in D.geometries){n=D.geometries[k];if(n.type=="bin_mesh"||n.type=="ascii_mesh"){G=G+1;j.onLoadStart()}}T=G;for(k in D.geometries){n= -D.geometries[k];if(n.type=="cube"){J=new THREE.CubeGeometry(n.width,n.height,n.depth,n.segmentsWidth,n.segmentsHeight,n.segmentsDepth,null,n.flipped,n.sides);C.geometries[k]=J}else if(n.type=="plane"){J=new THREE.PlaneGeometry(n.width,n.height,n.segmentsWidth,n.segmentsHeight);C.geometries[k]=J}else if(n.type=="sphere"){J=new THREE.SphereGeometry(n.radius,n.segmentsWidth,n.segmentsHeight);C.geometries[k]=J}else if(n.type=="cylinder"){J=new THREE.CylinderGeometry(n.topRad,n.botRad,n.height,n.radSegs, -n.heightSegs);C.geometries[k]=J}else if(n.type=="torus"){J=new THREE.TorusGeometry(n.radius,n.tube,n.segmentsR,n.segmentsT);C.geometries[k]=J}else if(n.type=="icosahedron"){J=new THREE.IcosahedronGeometry(n.radius,n.subdivisions);C.geometries[k]=J}else if(n.type=="bin_mesh")c.load(d(n.url,D.urlBaseType),f(k));else if(n.type=="ascii_mesh")M.load(d(n.url,D.urlBaseType),f(k));else if(n.type=="embedded_mesh"){n=D.embeds[n.id];n.metadata=D.metadata;n&&M.createModel(n,g(k),"")}}for(r in D.textures){k=D.textures[r]; -if(k.url instanceof Array){i=i+k.url.length;for(n=0;n1){g=g[1];c[g]||(c[g]={start:Infinity,end:-Infinity});var h=c[g];if(eh.end)h.end=e;b||(b=g)}}a.firstAnimation=b}; -THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){if(!this.geometry.animations)this.geometry.animations={};this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];if(c){this.setFrameRange(c.start,c.end);this.duration=1E3*((c.end-c.start)/b);this.time=0}else console.warn("animation["+a+"] undefined")}; -THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time=this.time+this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||this.time<0){this.direction=this.direction*-1;if(this.time>this.duration){this.time=this.duration;this.directionBackwards=true}if(this.time<0){this.time=0;this.directionBackwards=false}}}else{this.time=this.time%this.duration;if(this.time<0)this.time=this.time+this.duration}a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/ -b),0,this.length-1);if(a!==this.currentKeyframe){this.morphTargetInfluences[this.lastKeyframe]=0;this.morphTargetInfluences[this.currentKeyframe]=1;this.morphTargetInfluences[a]=0;this.lastKeyframe=this.currentKeyframe;this.currentKeyframe=a}b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b};THREE.Ribbon=function(a,b){THREE.Object3D.call(this);this.geometry=a;this.material=b}; -THREE.Ribbon.prototype=new THREE.Object3D;THREE.Ribbon.prototype.constructor=THREE.Ribbon;THREE.LOD=function(){THREE.Object3D.call(this);this.LODs=[]};THREE.LOD.prototype=new THREE.Object3D;THREE.LOD.prototype.constructor=THREE.LOD;THREE.LOD.prototype.supr=THREE.Object3D.prototype;THREE.LOD.prototype.addLevel=function(a,b){b===void 0&&(b=0);for(var b=Math.abs(b),c=0;c1){a.matrixWorldInverse.getInverse(a.matrixWorld);a=a.matrixWorldInverse;a=-(a.elements[2]*this.matrixWorld.elements[12]+a.elements[6]*this.matrixWorld.elements[13]+a.elements[10]*this.matrixWorld.elements[14]+a.elements[14]);this.LODs[0].object3D.visible=true;for(var b=1;b=this.LODs[b].visibleAtDistance){this.LODs[b-1].object3D.visible=false;this.LODs[b].object3D.visible=true}else break;for(;b>1);n=m.y*f+f-(o.offsetHeight>>1);o.style.left=q+"px";o.style.top=n+"px";o.style.zIndex=Math.abs(Math.floor((1-m.z)*d.far/d.near));g&&(o.style[g]="scale("+m.scale.x*e+","+m.scale.y*f+")")}}}}; -THREE.CanvasRenderer=function(a){function b(a){if(t!=a)n.globalAlpha=t=a}function c(a){if(y!=a){switch(a){case THREE.NormalBlending:n.globalCompositeOperation="source-over";break;case THREE.AdditiveBlending:n.globalCompositeOperation="lighter"}y=a}}function d(a){if(s!=a)n.strokeStyle=s=a}function e(a){if(w!=a)n.fillStyle=w=a}console.log("THREE.CanvasRenderer",THREE.REVISION);var a=a||{},f=this,g,h,j,l=new THREE.Projector,k=a.canvas!==void 0?a.canvas:document.createElement("canvas"),p,m,o,q,n=k.getContext("2d"), -r=new THREE.Color(0),u=0,t=1,y=0,s=null,w=null,H=null,E=null,z=null,v,A,J,K,R=new THREE.RenderableVertex,P=new THREE.RenderableVertex,D,M,G,i,T,U,C,Y,F,ea,fa,ia,O=new THREE.Color,Q=new THREE.Color,Z=new THREE.Color,$=new THREE.Color,ha=new THREE.Color,Ma=[],Ka=[],Ra,La,Sa,Na,Kb,lb,gb,Lb,hb,Cb,Wa=new THREE.Rectangle,Ba=new THREE.Rectangle,xa=new THREE.Rectangle,$a=false,aa=new THREE.Color,Ta=new THREE.Color,Qa=new THREE.Color,oa=new THREE.Vector3,ib,Db,Sc,ab,pc,Bc,a=16;ib=document.createElement("canvas"); -ib.width=ib.height=2;Db=ib.getContext("2d");Db.fillStyle="rgba(0,0,0,1)";Db.fillRect(0,0,2,2);Sc=Db.getImageData(0,0,2,2);ab=Sc.data;pc=document.createElement("canvas");pc.width=pc.height=a;Bc=pc.getContext("2d");Bc.translate(-a/2,-a/2);Bc.scale(a,a);a--;this.domElement=k;this.sortElements=this.sortObjects=this.autoClear=true;this.info={render:{vertices:0,faces:0}};this.setSize=function(a,b){p=a;m=b;o=Math.floor(p/2);q=Math.floor(m/2);k.width=p;k.height=m;Wa.set(-o,-q,o,q);Ba.set(-o,-q,o,q);t=1;y= -0;z=E=H=w=s=null};this.setClearColor=function(a,b){r.copy(a);u=b!==void 0?b:1;Ba.set(-o,-q,o,q)};this.setClearColorHex=function(a,b){r.setHex(a);u=b!==void 0?b:1;Ba.set(-o,-q,o,q)};this.clear=function(){n.setTransform(1,0,0,-1,o,q);if(!Ba.isEmpty()){Ba.minSelf(Wa);Ba.inflate(2);u<1&&n.clearRect(Math.floor(Ba.getX()),Math.floor(Ba.getY()),Math.floor(Ba.getWidth()),Math.floor(Ba.getHeight()));if(u>0){c(THREE.NormalBlending);b(1);e("rgba("+Math.floor(r.r*255)+","+Math.floor(r.g*255)+","+Math.floor(r.b* -255)+","+u+")");n.fillRect(Math.floor(Ba.getX()),Math.floor(Ba.getY()),Math.floor(Ba.getWidth()),Math.floor(Ba.getHeight()))}Ba.empty()}};this.render=function(a,k){function m(a){var b,c,d,e;aa.setRGB(0,0,0);Ta.setRGB(0,0,0);Qa.setRGB(0,0,0);b=0;for(c=a.length;b>1;m=k.height>>1;g=f.scale.x*o;j=f.scale.y*q;i=g*l;h=j*m;xa.set(a.x-i,a.y-h,a.x+i,a.y+h);if(Wa.intersects(xa)){n.save();n.translate(a.x,a.y);n.rotate(-f.rotation);n.scale(g,-j);n.translate(-l,-m);n.drawImage(k,0,0);n.restore()}}}else if(g instanceof THREE.ParticleCanvasMaterial){i=f.scale.x*o;h=f.scale.y*q;xa.set(a.x-i,a.y-h,a.x+i,a.y+h);if(Wa.intersects(xa)){d(g.color.getContextStyle()); -e(g.color.getContextStyle());n.save();n.translate(a.x,a.y);n.rotate(-f.rotation);n.scale(i,h);g.program(n);n.restore()}}}function s(a,e,f,g){b(g.opacity);c(g.blending);n.beginPath();n.moveTo(a.positionScreen.x,a.positionScreen.y);n.lineTo(e.positionScreen.x,e.positionScreen.y);n.closePath();if(g instanceof THREE.LineBasicMaterial){a=g.linewidth;if(H!=a)n.lineWidth=H=a;a=g.linecap;if(E!=a)n.lineCap=E=a;a=g.linejoin;if(z!=a)n.lineJoin=z=a;d(g.color.getContextStyle());n.stroke();xa.inflate(g.linewidth* -2)}}function t(a,d,e,g,h,l,m,n){f.info.render.vertices=f.info.render.vertices+3;f.info.render.faces++;b(n.opacity);c(n.blending);D=a.positionScreen.x;M=a.positionScreen.y;G=d.positionScreen.x;i=d.positionScreen.y;T=e.positionScreen.x;U=e.positionScreen.y;w(D,M,G,i,T,U);if(n instanceof THREE.MeshBasicMaterial)if(n.map){if(n.map.mapping instanceof THREE.UVMapping){Na=m.uvs[0];ad(D,M,G,i,T,U,Na[g].u,Na[g].v,Na[h].u,Na[h].v,Na[l].u,Na[l].v,n.map)}}else if(n.envMap){if(n.envMap.mapping instanceof THREE.SphericalReflectionMapping){a= -k.matrixWorldInverse;oa.copy(m.vertexNormalsWorld[g]);Kb=(oa.x*a.elements[0]+oa.y*a.elements[4]+oa.z*a.elements[8])*0.5+0.5;lb=-(oa.x*a.elements[1]+oa.y*a.elements[5]+oa.z*a.elements[9])*0.5+0.5;oa.copy(m.vertexNormalsWorld[h]);gb=(oa.x*a.elements[0]+oa.y*a.elements[4]+oa.z*a.elements[8])*0.5+0.5;Lb=-(oa.x*a.elements[1]+oa.y*a.elements[5]+oa.z*a.elements[9])*0.5+0.5;oa.copy(m.vertexNormalsWorld[l]);hb=(oa.x*a.elements[0]+oa.y*a.elements[4]+oa.z*a.elements[8])*0.5+0.5;Cb=-(oa.x*a.elements[1]+oa.y* -a.elements[5]+oa.z*a.elements[9])*0.5+0.5;ad(D,M,G,i,T,U,Kb,lb,gb,Lb,hb,Cb,n.envMap)}}else n.wireframe?Mb(n.color,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(n.color);else if(n instanceof THREE.MeshLambertMaterial)if($a)if(!n.wireframe&&n.shading==THREE.SmoothShading&&m.vertexNormalsWorld.length==3){Q.r=Z.r=$.r=aa.r;Q.g=Z.g=$.g=aa.g;Q.b=Z.b=$.b=aa.b;p(j,m.v1.positionWorld,m.vertexNormalsWorld[0],Q);p(j,m.v2.positionWorld,m.vertexNormalsWorld[1],Z);p(j,m.v3.positionWorld,m.vertexNormalsWorld[2], -$);Q.r=Math.max(0,Math.min(n.color.r*Q.r,1));Q.g=Math.max(0,Math.min(n.color.g*Q.g,1));Q.b=Math.max(0,Math.min(n.color.b*Q.b,1));Z.r=Math.max(0,Math.min(n.color.r*Z.r,1));Z.g=Math.max(0,Math.min(n.color.g*Z.g,1));Z.b=Math.max(0,Math.min(n.color.b*Z.b,1));$.r=Math.max(0,Math.min(n.color.r*$.r,1));$.g=Math.max(0,Math.min(n.color.g*$.g,1));$.b=Math.max(0,Math.min(n.color.b*$.b,1));ha.r=(Z.r+$.r)*0.5;ha.g=(Z.g+$.g)*0.5;ha.b=(Z.b+$.b)*0.5;Sa=Cc(Q,Z,$,ha);gc(D,M,G,i,T,U,0,0,1,0,0,1,Sa)}else{O.r=aa.r;O.g= -aa.g;O.b=aa.b;p(j,m.centroidWorld,m.normalWorld,O);O.r=Math.max(0,Math.min(n.color.r*O.r,1));O.g=Math.max(0,Math.min(n.color.g*O.g,1));O.b=Math.max(0,Math.min(n.color.b*O.b,1));n.wireframe?Mb(O,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(O)}else n.wireframe?Mb(n.color,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(n.color);else if(n instanceof THREE.MeshDepthMaterial){Ra=k.near;La=k.far;Q.r=Q.g=Q.b=1-ac(a.positionScreen.z,Ra,La);Z.r=Z.g=Z.b=1-ac(d.positionScreen.z, -Ra,La);$.r=$.g=$.b=1-ac(e.positionScreen.z,Ra,La);ha.r=(Z.r+$.r)*0.5;ha.g=(Z.g+$.g)*0.5;ha.b=(Z.b+$.b)*0.5;Sa=Cc(Q,Z,$,ha);gc(D,M,G,i,T,U,0,0,1,0,0,1,Sa)}else if(n instanceof THREE.MeshNormalMaterial){O.r=hc(m.normalWorld.x);O.g=hc(m.normalWorld.y);O.b=hc(m.normalWorld.z);n.wireframe?Mb(O,n.wireframeLinewidth,n.wireframeLinecap,n.wireframeLinejoin):Eb(O)}}function u(a,d,e,g,h,l,n,m,o){f.info.render.vertices=f.info.render.vertices+4;f.info.render.faces++;b(m.opacity);c(m.blending);if(m.map||m.envMap){t(a, -d,g,0,1,3,n,m,o);t(h,e,l,1,2,3,n,m,o)}else{D=a.positionScreen.x;M=a.positionScreen.y;G=d.positionScreen.x;i=d.positionScreen.y;T=e.positionScreen.x;U=e.positionScreen.y;C=g.positionScreen.x;Y=g.positionScreen.y;F=h.positionScreen.x;ea=h.positionScreen.y;fa=l.positionScreen.x;ia=l.positionScreen.y;if(m instanceof THREE.MeshBasicMaterial){y(D,M,G,i,T,U,C,Y);m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(m.color)}else if(m instanceof THREE.MeshLambertMaterial)if($a)if(!m.wireframe&& -m.shading==THREE.SmoothShading&&n.vertexNormalsWorld.length==4){Q.r=Z.r=$.r=ha.r=aa.r;Q.g=Z.g=$.g=ha.g=aa.g;Q.b=Z.b=$.b=ha.b=aa.b;p(j,n.v1.positionWorld,n.vertexNormalsWorld[0],Q);p(j,n.v2.positionWorld,n.vertexNormalsWorld[1],Z);p(j,n.v4.positionWorld,n.vertexNormalsWorld[3],$);p(j,n.v3.positionWorld,n.vertexNormalsWorld[2],ha);Q.r=Math.max(0,Math.min(m.color.r*Q.r,1));Q.g=Math.max(0,Math.min(m.color.g*Q.g,1));Q.b=Math.max(0,Math.min(m.color.b*Q.b,1));Z.r=Math.max(0,Math.min(m.color.r*Z.r,1));Z.g= -Math.max(0,Math.min(m.color.g*Z.g,1));Z.b=Math.max(0,Math.min(m.color.b*Z.b,1));$.r=Math.max(0,Math.min(m.color.r*$.r,1));$.g=Math.max(0,Math.min(m.color.g*$.g,1));$.b=Math.max(0,Math.min(m.color.b*$.b,1));ha.r=Math.max(0,Math.min(m.color.r*ha.r,1));ha.g=Math.max(0,Math.min(m.color.g*ha.g,1));ha.b=Math.max(0,Math.min(m.color.b*ha.b,1));Sa=Cc(Q,Z,$,ha);w(D,M,G,i,C,Y);gc(D,M,G,i,C,Y,0,0,1,0,0,1,Sa);w(F,ea,T,U,fa,ia);gc(F,ea,T,U,fa,ia,1,0,1,1,0,1,Sa)}else{O.r=aa.r;O.g=aa.g;O.b=aa.b;p(j,n.centroidWorld, -n.normalWorld,O);O.r=Math.max(0,Math.min(m.color.r*O.r,1));O.g=Math.max(0,Math.min(m.color.g*O.g,1));O.b=Math.max(0,Math.min(m.color.b*O.b,1));y(D,M,G,i,T,U,C,Y);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(O)}else{y(D,M,G,i,T,U,C,Y);m.wireframe?Mb(m.color,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(m.color)}else if(m instanceof THREE.MeshNormalMaterial){O.r=hc(n.normalWorld.x);O.g=hc(n.normalWorld.y);O.b=hc(n.normalWorld.z);y(D,M,G,i,T,U,C, -Y);m.wireframe?Mb(O,m.wireframeLinewidth,m.wireframeLinecap,m.wireframeLinejoin):Eb(O)}else if(m instanceof THREE.MeshDepthMaterial){Ra=k.near;La=k.far;Q.r=Q.g=Q.b=1-ac(a.positionScreen.z,Ra,La);Z.r=Z.g=Z.b=1-ac(d.positionScreen.z,Ra,La);$.r=$.g=$.b=1-ac(g.positionScreen.z,Ra,La);ha.r=ha.g=ha.b=1-ac(e.positionScreen.z,Ra,La);Sa=Cc(Q,Z,$,ha);w(D,M,G,i,C,Y);gc(D,M,G,i,C,Y,0,0,1,0,0,1,Sa);w(F,ea,T,U,fa,ia);gc(F,ea,T,U,fa,ia,1,0,1,1,0,1,Sa)}}}function w(a,b,c,d,e,f){n.beginPath();n.moveTo(a,b);n.lineTo(c, -d);n.lineTo(e,f);n.lineTo(a,b);n.closePath()}function y(a,b,c,d,e,f,g,i){n.beginPath();n.moveTo(a,b);n.lineTo(c,d);n.lineTo(e,f);n.lineTo(g,i);n.lineTo(a,b);n.closePath()}function Mb(a,b,c,e){if(H!=b)n.lineWidth=H=b;if(E!=c)n.lineCap=E=c;if(z!=e)n.lineJoin=z=e;d(a.getContextStyle());n.stroke();xa.inflate(b*2)}function Eb(a){e(a.getContextStyle());n.fill()}function ad(a,b,c,d,f,g,i,h,j,k,l,m,p){if(p.image.width!=0){if(p.needsUpdate==true||Ma[p.id]==void 0){var o=p.wrapS==THREE.RepeatWrapping,q=p.wrapT== -THREE.RepeatWrapping;Ma[p.id]=n.createPattern(p.image,o&&q?"repeat":o&&!q?"repeat-x":!o&&q?"repeat-y":"no-repeat");p.needsUpdate=false}e(Ma[p.id]);var o=p.offset.x/p.repeat.x,q=p.offset.y/p.repeat.y,Db=p.image.width*p.repeat.x,r=p.image.height*p.repeat.y,i=(i+o)*Db,h=(h+q)*r,c=c-a,d=d-b,f=f-a,g=g-b,j=(j+o)*Db-i,k=(k+q)*r-h,l=(l+o)*Db-i,m=(m+q)*r-h,o=j*m-l*k;if(o==0){if(Ka[p.id]===void 0){b=document.createElement("canvas");b.width=p.image.width;b.height=p.image.height;b=b.getContext("2d");b.drawImage(p.image, -0,0);Ka[p.id]=b.getImageData(0,0,p.image.width,p.image.height).data}b=Ka[p.id];i=(Math.floor(i)+Math.floor(h)*p.image.width)*4;O.setRGB(b[i]/255,b[i+1]/255,b[i+2]/255);Eb(O)}else{o=1/o;p=(m*c-k*f)*o;k=(m*d-k*g)*o;c=(j*f-l*c)*o;d=(j*g-l*d)*o;a=a-p*i-c*h;i=b-k*i-d*h;n.save();n.transform(p,k,c,d,a,i);n.fill();n.restore()}}}function gc(a,b,c,d,e,f,g,i,h,j,k,l,m){var p,o;p=m.width-1;o=m.height-1;g=g*p;i=i*o;c=c-a;d=d-b;e=e-a;f=f-b;h=h*p-g;j=j*o-i;k=k*p-g;l=l*o-i;o=1/(h*l-k*j);p=(l*c-j*e)*o;j=(l*d-j*f)* -o;c=(h*e-k*c)*o;d=(h*f-k*d)*o;a=a-p*g-c*i;b=b-j*g-d*i;n.save();n.transform(p,j,c,d,a,b);n.clip();n.drawImage(m,0,0);n.restore()}function Cc(a,b,c,d){var e=~~(a.r*255),f=~~(a.g*255),a=~~(a.b*255),g=~~(b.r*255),i=~~(b.g*255),b=~~(b.b*255),h=~~(c.r*255),j=~~(c.g*255),c=~~(c.b*255),k=~~(d.r*255),l=~~(d.g*255),d=~~(d.b*255);ab[0]=e<0?0:e>255?255:e;ab[1]=f<0?0:f>255?255:f;ab[2]=a<0?0:a>255?255:a;ab[4]=g<0?0:g>255?255:g;ab[5]=i<0?0:i>255?255:i;ab[6]=b<0?0:b>255?255:b;ab[8]=h<0?0:h>255?255:h;ab[9]=j<0?0: -j>255?255:j;ab[10]=c<0?0:c>255?255:c;ab[12]=k<0?0:k>255?255:k;ab[13]=l<0?0:l>255?255:l;ab[14]=d<0?0:d>255?255:d;Db.putImageData(Sc,0,0);Bc.drawImage(ib,0,0);return pc}function ac(a,b,c){a=(a-b)/(c-b);return a*a*(3-2*a)}function hc(a){a=(a+1)*0.5;return a<0?0:a>1?1:a}function Nb(a,b){var c=b.x-a.x,d=b.y-a.y,e=c*c+d*d;if(e!=0){e=1/Math.sqrt(e);c=c*e;d=d*e;b.x=b.x+c;b.y=b.y+d;a.x=a.x-c;a.y=a.y-d}}var Dc,bd,Ha,eb;this.autoClear?this.clear():n.setTransform(1,0,0,-1,o,q);f.info.render.vertices=0;f.info.render.faces= -0;g=l.projectScene(a,k,this.sortElements);h=g.elements;j=g.lights;($a=j.length>0)&&m(j);Dc=0;for(bd=h.length;Dc1?1:a}console.log("THREE.SVGRenderer",THREE.REVISION);var d=this,e,f,g,h=new THREE.Projector,j=document.createElementNS("http://www.w3.org/2000/svg","svg"),l,k,p,m,o,q,n,r,u=new THREE.Rectangle,t=new THREE.Rectangle,y=false,s=new THREE.Color,w=new THREE.Color,H=new THREE.Color,E=new THREE.Color, -z,v=new THREE.Vector3,A=[],J=[],K,R,P,D=1;this.domElement=j;this.sortElements=this.sortObjects=this.autoClear=true;this.info={render:{vertices:0,faces:0}};this.setQuality=function(a){switch(a){case "high":D=1;break;case "low":D=0}};this.setSize=function(a,b){l=a;k=b;p=l/2;m=k/2;j.setAttribute("viewBox",-p+" "+-m+" "+l+" "+k);j.setAttribute("width",l);j.setAttribute("height",k);u.set(-p,-m,p,m)};this.clear=function(){for(;j.childNodes.length>0;)j.removeChild(j.childNodes[0])};this.render=function(k, -l){var i,v,A,C;this.autoClear&&this.clear();d.info.render.vertices=0;d.info.render.faces=0;e=h.projectScene(k,l,this.sortElements);f=e.elements;g=e.lights;P=R=0;if(y=g.length>0){w.setRGB(0,0,0);H.setRGB(0,0,0);E.setRGB(0,0,0);i=0;for(v=g.length;i 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\nuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\nuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\nuniform float spotLightAngle[ MAX_SPOT_LIGHTS ];\nuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif", -lights_lambert_vertex:"vLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\nvLightBack = vec3( 0.0 );\n#endif\ntransformedNormal = normalize( transformedNormal );\n#if MAX_DIR_LIGHTS > 0\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nfloat dotProduct = dot( transformedNormal, dirVector );\nvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\ndirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\ndirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n#ifdef DOUBLE_SIDED\nvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n#endif\n}\n#endif\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nfloat dotProduct = dot( transformedNormal, lVector );\nvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\npointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\npointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n#ifdef DOUBLE_SIDED\nvLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n#endif\n}\n#endif\n#if MAX_SPOT_LIGHTS > 0\nfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nlVector = normalize( lVector );\nfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - mPosition.xyz ) );\nif ( spotEffect > spotLightAngle[ i ] ) {\nspotEffect = pow( spotEffect, spotLightExponent[ i ] );\nfloat lDistance = 1.0;\nif ( spotLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\nfloat dotProduct = dot( transformedNormal, lVector );\nvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n#ifdef DOUBLE_SIDED\nvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n#ifdef WRAP_AROUND\nvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n#endif\n#endif\n#ifdef WRAP_AROUND\nvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\nspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n#ifdef DOUBLE_SIDED\nspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n#endif\n#endif\nvLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\n#ifdef DOUBLE_SIDED\nvLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\n#endif\n}\n}\n#endif\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\n#ifdef DOUBLE_SIDED\nvLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\n#endif", -lights_phong_pars_vertex:"#ifndef PHONG_PER_PIXEL\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#if MAX_SPOT_LIGHTS > 0\nuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\nuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\nvarying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];\n#endif\n#endif\n#if MAX_SPOT_LIGHTS > 0\nvarying vec3 vWorldPosition;\n#endif",lights_phong_vertex:"#ifndef PHONG_PER_PIXEL\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#if MAX_SPOT_LIGHTS > 0\nfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\nvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( spotLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\nvSpotLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#endif\n#if MAX_SPOT_LIGHTS > 0\nvWorldPosition = mPosition.xyz;\n#endif", -lights_phong_pars_fragment:"uniform vec3 ambientLightColor;\n#if MAX_DIR_LIGHTS > 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n#ifdef PHONG_PER_PIXEL\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n#else\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#endif\n#if MAX_SPOT_LIGHTS > 0\nuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\nuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\nuniform float spotLightAngle[ MAX_SPOT_LIGHTS ];\nuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n#ifdef PHONG_PER_PIXEL\nuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n#else\nvarying vec4 vSpotLight[ MAX_SPOT_LIGHTS ];\n#endif\nvarying vec3 vWorldPosition;\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;", -lights_phong_fragment:"vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#ifdef DOUBLE_SIDED\nnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n#endif\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n#ifdef PHONG_PER_PIXEL\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz + vViewPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\n#else\nvec3 lVector = normalize( vPointLight[ i ].xyz );\nfloat lDistance = vPointLight[ i ].w;\n#endif\nfloat dotProduct = dot( normal, lVector );\n#ifdef WRAP_AROUND\nfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n#else\nfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n#endif\npointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\nvec3 pointHalfVector = normalize( lVector + viewPosition );\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointSpecularWeight = max( pow( pointDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( shininess + 2.0001 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\n#else\npointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance;\n#endif\n}\n#endif\n#if MAX_SPOT_LIGHTS > 0\nvec3 spotDiffuse = vec3( 0.0 );\nvec3 spotSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n#ifdef PHONG_PER_PIXEL\nvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz + vViewPosition.xyz;\nfloat lDistance = 1.0;\nif ( spotLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\n#else\nvec3 lVector = normalize( vSpotLight[ i ].xyz );\nfloat lDistance = vSpotLight[ i ].w;\n#endif\nfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\nif ( spotEffect > spotLightAngle[ i ] ) {\nspotEffect = pow( spotEffect, spotLightExponent[ i ] );\nfloat dotProduct = dot( normal, lVector );\n#ifdef WRAP_AROUND\nfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 spotDiffuseWeight = mix( vec3 ( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n#else\nfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n#endif\nspotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\nvec3 spotHalfVector = normalize( lVector + viewPosition );\nfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\nfloat spotSpecularWeight = max( pow( spotDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( shininess + 2.0001 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( lVector, spotHalfVector ), 5.0 );\nspotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\n#else\nspotSpecular += specular * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * spotEffect;\n#endif\n}\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse = vec3( 0.0 );\nvec3 dirSpecular = vec3( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\nfloat dotProduct = dot( normal, dirVector );\n#ifdef WRAP_AROUND\nfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\nfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\nvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n#else\nfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n#endif\ndirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\nvec3 dirHalfVector = normalize( dirVector + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirSpecularWeight = max( pow( dirDotNormalHalf, shininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( shininess + 2.0001 ) / 8.0;\nvec3 schlick = specular + vec3( 1.0 - specular ) * pow( 1.0 - dot( dirVector, dirHalfVector ), 5.0 );\ndirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n#else\ndirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;\n#endif\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\n#if MAX_SPOT_LIGHTS > 0\ntotalDiffuse += spotDiffuse;\ntotalSpecular += spotSpecular;\n#endif\n#ifdef METAL\ngl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\n#else\ngl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n#endif", -color_pars_fragment:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_fragment:"#ifdef USE_COLOR\ngl_FragColor = gl_FragColor * vec4( vColor, opacity );\n#endif",color_pars_vertex:"#ifdef USE_COLOR\nvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n#ifdef GAMMA_INPUT\nvColor = color * color;\n#else\nvColor = color;\n#endif\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\nuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n#endif",skinning_vertex:"#ifdef USE_SKINNING\ngl_Position = ( boneGlobalMatrices[ int( skinIndex.x ) ] * skinVertexA ) * skinWeight.x;\ngl_Position += ( boneGlobalMatrices[ int( skinIndex.y ) ] * skinVertexB ) * skinWeight.y;\ngl_Position = projectionMatrix * modelViewMatrix * gl_Position;\n#endif", -morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n#ifndef USE_MORPHNORMALS\nuniform float morphTargetInfluences[ 8 ];\n#else\nuniform float morphTargetInfluences[ 4 ];\n#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\nvec3 morphed = vec3( 0.0 );\nmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\nmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\nmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\nmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n#ifndef USE_MORPHNORMALS\nmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\nmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\nmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\nmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n#endif\nmorphed += position;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( morphed, 1.0 );\n#endif", -default_vertex:"#ifndef USE_MORPHTARGETS\n#ifndef USE_SKINNING\ngl_Position = projectionMatrix * mvPosition;\n#endif\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\nvec3 morphedNormal = vec3( 0.0 );\nmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\nmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\nmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\nmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\nmorphedNormal += normal;\nvec3 transformedNormal = normalMatrix * morphedNormal;\n#else\nvec3 transformedNormal = normalMatrix * normal;\n#endif", -shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\nuniform sampler2D shadowMap[ MAX_SHADOWS ];\nuniform vec2 shadowMapSize[ MAX_SHADOWS ];\nuniform float shadowDarkness[ MAX_SHADOWS ];\nuniform float shadowBias[ MAX_SHADOWS ];\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nfloat unpackDepth( const in vec4 rgba_depth ) {\nconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\nfloat depth = dot( rgba_depth, bit_shift );\nreturn depth;\n}\n#endif",shadowmap_fragment:"#ifdef USE_SHADOWMAP\n#ifdef SHADOWMAP_DEBUG\nvec3 frustumColors[3];\nfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\nfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\nfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n#endif\n#ifdef SHADOWMAP_CASCADE\nint inFrustumCount = 0;\n#endif\nfloat fDepth;\nvec3 shadowColor = vec3( 1.0 );\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\nvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\nbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\nbool inFrustum = all( inFrustumVec );\n#ifdef SHADOWMAP_CASCADE\ninFrustumCount += int( inFrustum );\nbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n#else\nbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n#endif\nbool frustumTest = all( frustumTestVec );\nif ( frustumTest ) {\nshadowCoord.z += shadowBias[ i ];\n#ifdef SHADOWMAP_SOFT\nfloat shadow = 0.0;\nconst float shadowDelta = 1.0 / 9.0;\nfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\nfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\nfloat dx0 = -1.25 * xPixelOffset;\nfloat dy0 = -1.25 * yPixelOffset;\nfloat dx1 = 1.25 * xPixelOffset;\nfloat dy1 = 1.25 * yPixelOffset;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\nif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\nshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n#else\nvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\nfloat fDepth = unpackDepth( rgbaDepth );\nif ( fDepth < shadowCoord.z )\nshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n#endif\n}\n#ifdef SHADOWMAP_DEBUG\n#ifdef SHADOWMAP_CASCADE\nif ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n#else\nif ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n#endif\n#endif\n}\n#ifdef GAMMA_OUTPUT\nshadowColor *= shadowColor;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n#endif", -shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\nvarying vec4 vShadowCoord[ MAX_SHADOWS ];\nuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\nfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n#ifdef USE_MORPHTARGETS\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( morphed, 1.0 );\n#else\nvShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );\n#endif\n}\n#endif",alphatest_fragment:"#ifdef ALPHATEST\nif ( gl_FragColor.a < ALPHATEST ) discard;\n#endif", -linear_to_gamma_fragment:"#ifdef GAMMA_OUTPUT\ngl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n#endif"}; -THREE.UniformsUtils={merge:function(a){var b,c,d,e={};for(b=0;b=0)return a.geometry.materials[b.materialIndex]}function d(a){return a instanceof THREE.MeshBasicMaterial&&!a.envMap||a instanceof THREE.MeshDepthMaterial?false:a&&a.shading!==void 0&&a.shading===THREE.SmoothShading?THREE.SmoothShading:THREE.FlatShading}function e(a){return a.map||a.lightMap||a instanceof THREE.ShaderMaterial?true:false}function f(a,b,c){var d,e,f,g,h=a.vertices;g=h.length; -var j=a.colors,k=j.length,l=a.__vertexArray,m=a.__colorArray,n=a.__sortArray,p=a.verticesNeedUpdate,o=a.colorsNeedUpdate,q=a.__webglCustomAttributesList;if(c.sortParticles){xa.copy(Ba);xa.multiplySelf(c.matrixWorld);for(d=0;d=0;c--)a[c].object=== -b&&a.splice(c,1)}function q(a,b){for(var c=a.length-1;c>=0;c--)a[c]===b&&a.splice(c,1)}function n(a,b,c,d,e){if(!d.program||d.needsUpdate){G.initMaterial(d,b,c,e);d.needsUpdate=false}if(d.morphTargets&&!e.__webglMorphTargetInfluences){e.__webglMorphTargetInfluences=new Float32Array(G.maxMorphTargets);for(var f=0,g=G.maxMorphTargets;f0};this.setSize=function(a,b){E.width=a;E.height=b;this.setViewport(0,0,E.width,E.height)};this.setViewport=function(a,b,c,d){Kb=a;lb=b;gb=c;Lb=d;i.viewport(Kb,lb,gb,Lb)};this.setScissor=function(a,b,c,d){i.scissor(a,b,c,d)};this.enableScissorTest=function(a){a?i.enable(i.SCISSOR_TEST):i.disable(i.SCISSOR_TEST)};this.setClearColorHex=function(a,b){P.setHex(a);D=b;i.clearColor(P.r,P.g,P.b,D)};this.setClearColor=function(a, -b){P.copy(a);D=b;i.clearColor(P.r,P.g,P.b,D)};this.getClearColor=function(){return P};this.getClearAlpha=function(){return D};this.clear=function(a,b,c){var d=0;if(a===void 0||a)d=d|i.COLOR_BUFFER_BIT;if(b===void 0||b)d=d|i.DEPTH_BUFFER_BIT;if(c===void 0||c)d=d|i.STENCIL_BUFFER_BIT;i.clear(d)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this);this.renderPluginsPost.push(a)};this.addPrePlugin=function(a){a.init(this);this.renderPluginsPre.push(a)}; -this.deallocateObject=function(a){if(a.__webglInit){a.__webglInit=false;delete a._modelViewMatrix;delete a._normalMatrix;delete a._normalMatrixArray;delete a._modelViewMatrixArray;delete a._objectMatrixArray;if(a instanceof THREE.Mesh)for(var b in a.geometry.geometryGroups){var c=a.geometry.geometryGroups[b];i.deleteBuffer(c.__webglVertexBuffer);i.deleteBuffer(c.__webglNormalBuffer);i.deleteBuffer(c.__webglTangentBuffer);i.deleteBuffer(c.__webglColorBuffer);i.deleteBuffer(c.__webglUVBuffer);i.deleteBuffer(c.__webglUV2Buffer); -i.deleteBuffer(c.__webglSkinVertexABuffer);i.deleteBuffer(c.__webglSkinVertexBBuffer);i.deleteBuffer(c.__webglSkinIndicesBuffer);i.deleteBuffer(c.__webglSkinWeightsBuffer);i.deleteBuffer(c.__webglFaceBuffer);i.deleteBuffer(c.__webglLineBuffer);var d=void 0,e=void 0;if(c.numMorphTargets){d=0;for(e=c.numMorphTargets;d=0&&e.vertexNormalBuffer){i.bindBuffer(i.ARRAY_BUFFER, -e.vertexNormalBuffer);i.vertexAttribPointer(a.normal,e.vertexNormalBuffer.itemSize,i.FLOAT,false,0,f[d].index*12)}if(a.uv>=0&&e.vertexUvBuffer)if(e.vertexUvBuffer){i.bindBuffer(i.ARRAY_BUFFER,e.vertexUvBuffer);i.vertexAttribPointer(a.uv,e.vertexUvBuffer.itemSize,i.FLOAT,false,0,f[d].index*8);i.enableVertexAttribArray(a.uv)}else i.disableVertexAttribArray(a.uv);if(a.color>=0&&e.vertexColorBuffer){i.bindBuffer(i.ARRAY_BUFFER,e.vertexColorBuffer);i.vertexAttribPointer(a.color,e.vertexColorBuffer.itemSize, -i.FLOAT,false,0,f[d].index*16)}i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.vertexIndexBuffer)}i.drawElements(i.TRIANGLES,f[d].count,i.UNSIGNED_SHORT,f[d].start*2);G.info.render.calls++;G.info.render.vertices=G.info.render.vertices+f[d].count;G.info.render.faces=G.info.render.faces+f[d].count/3}}}};this.renderBuffer=function(a,b,c,d,e,f){if(d.visible!==false){var g,h,c=n(a,b,c,d,f),b=c.attributes,a=false,c=e.id*16777215+c.id*2+(d.wireframe?1:0);if(c!==F){F=c;a=true}if(!d.morphTargets&&b.position>=0){if(a){i.bindBuffer(i.ARRAY_BUFFER, -e.__webglVertexBuffer);i.vertexAttribPointer(b.position,3,i.FLOAT,false,0,0)}}else if(f.morphTargetBase){c=d.program.attributes;if(f.morphTargetBase!==-1){i.bindBuffer(i.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]);i.vertexAttribPointer(c.position,3,i.FLOAT,false,0,0)}else if(c.position>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglVertexBuffer);i.vertexAttribPointer(c.position,3,i.FLOAT,false,0,0)}if(f.morphTargetForcedOrder.length){g=0;var j=f.morphTargetForcedOrder;for(h=f.morphTargetInfluences;g< -d.numSupportedMorphTargets&&gk){l=m;k=h[l]}i.bindBuffer(i.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[l]);i.vertexAttribPointer(c["morphTarget"+g],3,i.FLOAT,false,0,0);if(d.morphNormals){i.bindBuffer(i.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[l]);i.vertexAttribPointer(c["morphNormal"+g],3,i.FLOAT,false,0,0)}f.__webglMorphTargetInfluences[g]=k;j[l]=1;k=-1;g++}}d.program.uniforms.morphTargetInfluences!==null&&i.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList){g= -0;for(h=e.__webglCustomAttributesList.length;g=0){i.bindBuffer(i.ARRAY_BUFFER,c.buffer);i.vertexAttribPointer(b[c.buffer.belongsToAttribute],c.size,i.FLOAT,false,0,0)}}}if(b.color>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglColorBuffer);i.vertexAttribPointer(b.color,3,i.FLOAT,false,0,0)}if(b.normal>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglNormalBuffer);i.vertexAttribPointer(b.normal,3,i.FLOAT,false,0,0)}if(b.tangent>=0){i.bindBuffer(i.ARRAY_BUFFER, -e.__webglTangentBuffer);i.vertexAttribPointer(b.tangent,4,i.FLOAT,false,0,0)}if(b.uv>=0)if(e.__webglUVBuffer){i.bindBuffer(i.ARRAY_BUFFER,e.__webglUVBuffer);i.vertexAttribPointer(b.uv,2,i.FLOAT,false,0,0);i.enableVertexAttribArray(b.uv)}else i.disableVertexAttribArray(b.uv);if(b.uv2>=0)if(e.__webglUV2Buffer){i.bindBuffer(i.ARRAY_BUFFER,e.__webglUV2Buffer);i.vertexAttribPointer(b.uv2,2,i.FLOAT,false,0,0);i.enableVertexAttribArray(b.uv2)}else i.disableVertexAttribArray(b.uv2);if(d.skinning&&b.skinVertexA>= -0&&b.skinVertexB>=0&&b.skinIndex>=0&&b.skinWeight>=0){i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinVertexABuffer);i.vertexAttribPointer(b.skinVertexA,4,i.FLOAT,false,0,0);i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinVertexBBuffer);i.vertexAttribPointer(b.skinVertexB,4,i.FLOAT,false,0,0);i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinIndicesBuffer);i.vertexAttribPointer(b.skinIndex,4,i.FLOAT,false,0,0);i.bindBuffer(i.ARRAY_BUFFER,e.__webglSkinWeightsBuffer);i.vertexAttribPointer(b.skinWeight,4,i.FLOAT,false,0,0)}}if(f instanceof -THREE.Mesh){if(d.wireframe){d=d.wireframeLinewidth;if(d!==Na){i.lineWidth(d);Na=d}a&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer);i.drawElements(i.LINES,e.__webglLineCount,i.UNSIGNED_SHORT,0)}else{a&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer);i.drawElements(i.TRIANGLES,e.__webglFaceCount,i.UNSIGNED_SHORT,0)}G.info.render.calls++;G.info.render.vertices=G.info.render.vertices+e.__webglFaceCount;G.info.render.faces=G.info.render.faces+e.__webglFaceCount/3}else if(f instanceof -THREE.Line){f=f.type===THREE.LineStrip?i.LINE_STRIP:i.LINES;d=d.linewidth;if(d!==Na){i.lineWidth(d);Na=d}i.drawArrays(f,0,e.__webglLineCount);G.info.render.calls++}else if(f instanceof THREE.ParticleSystem){i.drawArrays(i.POINTS,0,e.__webglParticleCount);G.info.render.calls++;G.info.render.points=G.info.render.points+e.__webglParticleCount}else if(f instanceof THREE.Ribbon){i.drawArrays(i.TRIANGLE_STRIP,0,e.__webglVertexCount);G.info.render.calls++}}};this.render=function(a,b,c,d){var e,f,k,m,n=a.__lights, -p=a.fog;Y=-1;Ta=true;if(b.parent===void 0){console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it...");a.add(b)}this.autoUpdateScene&&a.updateMatrixWorld();if(!b._viewMatrixArray)b._viewMatrixArray=new Float32Array(16);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.matrixWorldInverse.getInverse(b.matrixWorld);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);Ba.multiply(b.projectionMatrix, -b.matrixWorldInverse);Wa.setFromMatrix(Ba);this.autoUpdateObjects&&this.initWebGLObjects(a);h(this.renderPluginsPre,a,b);G.info.render.calls=0;G.info.render.vertices=0;G.info.render.faces=0;G.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=a.__webglObjects;d=0;for(e=m.length;d=0){t=q.geometry.materials[t];if(t.transparent){o.transparent=t;o.opaque=null}else{o.opaque=t;o.transparent=null}}}else if(t)if(t.transparent){o.transparent=t;o.opaque=null}else{o.opaque=t;o.transparent=null}f.render=true;if(this.sortObjects)if(k.renderDepth)f.z=k.renderDepth;else{$a.copy(k.matrixWorld.getPosition());Ba.multiplyVector3($a);f.z=$a.z}}}this.sortObjects&& -m.sort(g);m=a.__webglObjectsImmediate;d=0;for(e=m.length;d65535){A[z].counter=A[z].counter+1;y=A[z].hash+"_"+A[z].counter;r.geometryGroups[y]===void 0&&(r.geometryGroups[y]={faces3:[],faces4:[],materialIndex:v,vertices:0,numMorphTargets:C, -numMorphNormals:D})}u instanceof THREE.Face3?r.geometryGroups[y].faces3.push(s):r.geometryGroups[y].faces4.push(s);r.geometryGroups[y].vertices=r.geometryGroups[y].vertices+w}r.geometryGroupsList=[];var E=void 0;for(E in r.geometryGroups){r.geometryGroups[E].id=fa++;r.geometryGroupsList.push(r.geometryGroups[E])}}for(j in l.geometryGroups){n=l.geometryGroups[j];if(!n.__webglVertexBuffer){var F=n;F.__webglVertexBuffer=i.createBuffer();F.__webglNormalBuffer=i.createBuffer();F.__webglTangentBuffer=i.createBuffer(); -F.__webglColorBuffer=i.createBuffer();F.__webglUVBuffer=i.createBuffer();F.__webglUV2Buffer=i.createBuffer();F.__webglSkinVertexABuffer=i.createBuffer();F.__webglSkinVertexBBuffer=i.createBuffer();F.__webglSkinIndicesBuffer=i.createBuffer();F.__webglSkinWeightsBuffer=i.createBuffer();F.__webglFaceBuffer=i.createBuffer();F.__webglLineBuffer=i.createBuffer();var H=void 0,K=void 0;if(F.numMorphTargets){F.__webglMorphTargetsBuffers=[];H=0;for(K=F.numMorphTargets;H -0||O.faceVertexUvs.length>0)Q.__uvArray=new Float32Array(P*2);if(O.faceUvs.length>1||O.faceVertexUvs.length>1)Q.__uv2Array=new Float32Array(P*2)}if(J.geometry.skinWeights.length&&J.geometry.skinIndices.length){Q.__skinVertexAArray=new Float32Array(P*4);Q.__skinVertexBArray=new Float32Array(P*4);Q.__skinIndexArray=new Float32Array(P*4);Q.__skinWeightArray=new Float32Array(P*4)}Q.__faceArray=new Uint16Array(Z*3);Q.__lineArray=new Uint16Array(Y*2);var U=void 0,ha=void 0;if(Q.numMorphTargets){Q.__morphTargetsArrays= -[];U=0;for(ha=Q.numMorphTargets;U0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinVertexABuffer);i.bufferData(i.ARRAY_BUFFER,ra,Xa);i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinVertexBBuffer);i.bufferData(i.ARRAY_BUFFER,sa,Xa);i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinIndicesBuffer);i.bufferData(i.ARRAY_BUFFER,ta,Xa);i.bindBuffer(i.ARRAY_BUFFER,ca.__webglSkinWeightsBuffer);i.bufferData(i.ARRAY_BUFFER,ua,Xa)}}if(td&&Tc){I=0;for(S=ka.length;I0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglColorBuffer);i.bufferData(i.ARRAY_BUFFER,Ga,Xa)}}if(sd&&Pa.hasTangents){I=0;for(S=ka.length;I0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglUVBuffer);i.bufferData(i.ARRAY_BUFFER,vc,Xa)}}if(gd&&Yc&&dd){I=0;for(S=ka.length;I0){i.bindBuffer(i.ARRAY_BUFFER,ca.__webglUV2Buffer);i.bufferData(i.ARRAY_BUFFER,wc,Xa)}}if(qd){I=0;for(S=ka.length;I0?"#define VERTEX_TEXTURES":"",G.gammaInput?"#define GAMMA_INPUT":"",G.gammaOutput?"#define GAMMA_OUTPUT":"",G.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_SHADOWS "+c.maxShadows,"#define MAX_BONES "+ -c.maxBones,c.map?"#define USE_MAP":"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.skinning?"#define USE_SKINNING":"",c.morphTargets?"#define USE_MORPHTARGETS":"",c.morphNormals?"#define USE_MORPHNORMALS":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG": -"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",c.sizeAttenuation?"#define USE_SIZEATTENUATION":"","uniform mat4 objectMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\nattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\nattribute vec3 morphTarget0;\nattribute vec3 morphTarget1;\nattribute vec3 morphTarget2;\nattribute vec3 morphTarget3;\n#ifdef USE_MORPHNORMALS\nattribute vec3 morphNormal0;\nattribute vec3 morphNormal1;\nattribute vec3 morphNormal2;\nattribute vec3 morphNormal3;\n#else\nattribute vec3 morphTarget4;\nattribute vec3 morphTarget5;\nattribute vec3 morphTarget6;\nattribute vec3 morphTarget7;\n#endif\n#endif\n#ifdef USE_SKINNING\nattribute vec4 skinVertexA;\nattribute vec4 skinVertexB;\nattribute vec4 skinIndex;\nattribute vec4 skinWeight;\n#endif\n"].join("\n"); -k=["precision "+z+" float;","#define MAX_DIR_LIGHTS "+c.maxDirLights,"#define MAX_POINT_LIGHTS "+c.maxPointLights,"#define MAX_SPOT_LIGHTS "+c.maxSpotLights,"#define MAX_SHADOWS "+c.maxShadows,c.alphaTest?"#define ALPHATEST "+c.alphaTest:"",G.gammaInput?"#define GAMMA_INPUT":"",G.gammaOutput?"#define GAMMA_OUTPUT":"",G.physicallyBasedShading?"#define PHYSICALLY_BASED_SHADING":"",c.useFog&&c.fog?"#define USE_FOG":"",c.useFog&&c.fog instanceof THREE.FogExp2?"#define FOG_EXP2":"",c.map?"#define USE_MAP": -"",c.envMap?"#define USE_ENVMAP":"",c.lightMap?"#define USE_LIGHTMAP":"",c.vertexColors?"#define USE_COLOR":"",c.metal?"#define METAL":"",c.perPixel?"#define PHONG_PER_PIXEL":"",c.wrapAround?"#define WRAP_AROUND":"",c.doubleSided?"#define DOUBLE_SIDED":"",c.shadowMapEnabled?"#define USE_SHADOWMAP":"",c.shadowMapSoft?"#define SHADOWMAP_SOFT":"",c.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",c.shadowMapCascade?"#define SHADOWMAP_CASCADE":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"); -i.attachShader(r,t("fragment",k+n));i.attachShader(r,t("vertex",d+j));i.linkProgram(r);i.getProgramParameter(r,i.LINK_STATUS)||console.error("Could not initialise shader\nVALIDATE_STATUS: "+i.getProgramParameter(r,i.VALIDATE_STATUS)+", gl error ["+i.getError()+"]");r.uniforms={};r.attributes={};var s,d=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","objectMatrix","cameraPosition","boneGlobalMatrices","morphTargetInfluences"];for(s in h)d.push(s);s=d;d=0;for(h=s.length;d=0&&i.enableVertexAttribArray(q.position); -q.color>=0&&i.enableVertexAttribArray(q.color);q.normal>=0&&i.enableVertexAttribArray(q.normal);q.tangent>=0&&i.enableVertexAttribArray(q.tangent);if(a.skinning&&q.skinVertexA>=0&&q.skinVertexB>=0&&q.skinIndex>=0&&q.skinWeight>=0){i.enableVertexAttribArray(q.skinVertexA);i.enableVertexAttribArray(q.skinVertexB);i.enableVertexAttribArray(q.skinIndex);i.enableVertexAttribArray(q.skinWeight)}if(a.attributes)for(f in a.attributes)q[f]!==void 0&&q[f]>=0&&i.enableVertexAttribArray(q[f]);if(a.morphTargets){a.numSupportedMorphTargets= -0;r="morphTarget";for(f=0;f=0){i.enableVertexAttribArray(q[s]);a.numSupportedMorphTargets++}}}if(a.morphNormals){a.numSupportedMorphNormals=0;r="morphNormal";for(f=0;f=0){i.enableVertexAttribArray(q[s]);a.numSupportedMorphNormals++}}}a.uniformsList=[];for(e in a.uniforms)a.uniformsList.push([a.uniforms[e],e])};this.setFaceCulling=function(a,b){if(a){!b||b==="ccw"?i.frontFace(i.CCW):i.frontFace(i.CW);a==="back"?i.cullFace(i.BACK): -a==="front"?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK);i.enable(i.CULL_FACE)}else i.disable(i.CULL_FACE)};this.setObjectFaces=function(a){if(ia!==a.doubleSided){a.doubleSided?i.disable(i.CULL_FACE):i.enable(i.CULL_FACE);ia=a.doubleSided}if(O!==a.flipSided){a.flipSided?i.frontFace(i.CW):i.frontFace(i.CCW);O=a.flipSided}};this.setDepthTest=function(a){if(Ma!==a){a?i.enable(i.DEPTH_TEST):i.disable(i.DEPTH_TEST);Ma=a}};this.setDepthWrite=function(a){if(Ka!==a){i.depthMask(a);Ka=a}};this.setBlending= -function(a,b,c,d){if(a!==Q){switch(a){case THREE.NoBlending:i.disable(i.BLEND);break;case THREE.AdditiveBlending:i.enable(i.BLEND);i.blendEquation(i.FUNC_ADD);i.blendFunc(i.SRC_ALPHA,i.ONE);break;case THREE.SubtractiveBlending:i.enable(i.BLEND);i.blendEquation(i.FUNC_ADD);i.blendFunc(i.ZERO,i.ONE_MINUS_SRC_COLOR);break;case THREE.MultiplyBlending:i.enable(i.BLEND);i.blendEquation(i.FUNC_ADD);i.blendFunc(i.ZERO,i.SRC_COLOR);break;case THREE.CustomBlending:i.enable(i.BLEND);break;default:i.enable(i.BLEND); -i.blendEquationSeparate(i.FUNC_ADD,i.FUNC_ADD);i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA)}Q=a}if(a===THREE.CustomBlending){if(b!==Z){i.blendEquation(H(b));Z=b}if(c!==$||d!==ha){i.blendFunc(H(c),H(d));$=c;ha=d}}else ha=$=Z=null};this.setTexture=function(a,b){if(a.needsUpdate){if(!a.__webglInit){a.__webglInit=true;a.__webglTexture=i.createTexture();G.info.memory.textures++}i.activeTexture(i.TEXTURE0+b);i.bindTexture(i.TEXTURE_2D,a.__webglTexture);i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, -a.premultiplyAlpha);var c=a.image,d=(c.width&c.width-1)===0&&(c.height&c.height-1)===0,e=H(a.format),f=H(a.type);y(i.TEXTURE_2D,a,d);a instanceof THREE.DataTexture?i.texImage2D(i.TEXTURE_2D,0,e,c.width,c.height,0,e,f,c.data):i.texImage2D(i.TEXTURE_2D,0,e,e,f,a.image);a.generateMipmaps&&d&&i.generateMipmap(i.TEXTURE_2D);a.needsUpdate=false;if(a.onUpdate)a.onUpdate()}else{i.activeTexture(i.TEXTURE0+b);i.bindTexture(i.TEXTURE_2D,a.__webglTexture)}};this.setRenderTarget=function(a){var b=a instanceof -THREE.WebGLRenderTargetCube;if(a&&!a.__webglFramebuffer){if(a.depthBuffer===void 0)a.depthBuffer=true;if(a.stencilBuffer===void 0)a.stencilBuffer=true;a.__webglTexture=i.createTexture();var c=(a.width&a.width-1)===0&&(a.height&a.height-1)===0,d=H(a.format),e=H(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];i.bindTexture(i.TEXTURE_CUBE_MAP,a.__webglTexture);y(i.TEXTURE_CUBE_MAP,a,c);for(var f=0;f<6;f++){a.__webglFramebuffer[f]=i.createFramebuffer();a.__webglRenderbuffer[f]=i.createRenderbuffer(); -i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=i.TEXTURE_CUBE_MAP_POSITIVE_X+f;i.bindFramebuffer(i.FRAMEBUFFER,a.__webglFramebuffer[f]);i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,h,g.__webglTexture,0);s(a.__webglRenderbuffer[f],a)}c&&i.generateMipmap(i.TEXTURE_CUBE_MAP)}else{a.__webglFramebuffer=i.createFramebuffer();a.__webglRenderbuffer=i.createRenderbuffer();i.bindTexture(i.TEXTURE_2D,a.__webglTexture);y(i.TEXTURE_2D,a,c);i.texImage2D(i.TEXTURE_2D, -0,d,a.width,a.height,0,d,e,null);d=i.TEXTURE_2D;i.bindFramebuffer(i.FRAMEBUFFER,a.__webglFramebuffer);i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,d,a.__webglTexture,0);s(a.__webglRenderbuffer,a);c&&i.generateMipmap(i.TEXTURE_2D)}b?i.bindTexture(i.TEXTURE_CUBE_MAP,null):i.bindTexture(i.TEXTURE_2D,null);i.bindRenderbuffer(i.RENDERBUFFER,null);i.bindFramebuffer(i.FRAMEBUFFER,null)}if(a){b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer;c=a.width;a=a.height;e=d=0}else{b=null; -c=gb;a=Lb;d=Kb;e=lb}if(b!==C){i.bindFramebuffer(i.FRAMEBUFFER,b);i.viewport(d,e,c,a);C=b}hb=c;Cb=a};this.shadowMapPlugin=new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)}; -THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=c.wrapS!==void 0?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=c.wrapT!==void 0?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=c.magFilter!==void 0?c.magFilter:THREE.LinearFilter;this.minFilter=c.minFilter!==void 0?c.minFilter:THREE.LinearMipMapLinearFilter;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=c.format!==void 0?c.format:THREE.RGBAFormat;this.type=c.type!==void 0?c.type: -THREE.UnsignedByteType;this.depthBuffer=c.depthBuffer!==void 0?c.depthBuffer:true;this.stencilBuffer=c.stencilBuffer!==void 0?c.stencilBuffer:true;this.generateMipmaps=true}; -THREE.WebGLRenderTarget.prototype.clone=function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;return a};THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0}; -THREE.WebGLRenderTargetCube.prototype=new THREE.WebGLRenderTarget;THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;THREE.RenderableVertex=function(){this.positionWorld=new THREE.Vector3;this.positionScreen=new THREE.Vector4;this.visible=true};THREE.RenderableVertex.prototype.copy=function(a){this.positionWorld.copy(a.positionWorld);this.positionScreen.copy(a.positionScreen)}; -THREE.RenderableFace3=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null}; -THREE.RenderableFace4=function(){this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.v3=new THREE.RenderableVertex;this.v4=new THREE.RenderableVertex;this.centroidWorld=new THREE.Vector3;this.centroidScreen=new THREE.Vector3;this.normalWorld=new THREE.Vector3;this.vertexNormalsWorld=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];this.faceMaterial=this.material=null;this.uvs=[[]];this.z=null};THREE.RenderableObject=function(){this.z=this.object=null}; -THREE.RenderableParticle=function(){this.rotation=this.z=this.y=this.x=null;this.scale=new THREE.Vector2;this.material=null};THREE.RenderableLine=function(){this.z=null;this.v1=new THREE.RenderableVertex;this.v2=new THREE.RenderableVertex;this.material=null}; -THREE.ColorUtils={adjustHSV:function(a,b,c,d){var e=THREE.ColorUtils.__hsv;THREE.ColorUtils.rgbToHsv(a,e);e.h=THREE.Math.clamp(e.h+b,0,1);e.s=THREE.Math.clamp(e.s+c,0,1);e.v=THREE.Math.clamp(e.v+d,0,1);a.setHSV(e.h,e.s,e.v)},rgbToHsv:function(a,b){var c=a.r,d=a.g,e=a.b,f=Math.max(Math.max(c,d),e),g=Math.min(Math.min(c,d),e);if(g===f)g=c=0;else{var h=f-g,g=h/f,c=(c===f?(d-e)/h:d===f?2+(e-c)/h:4+(c-d)/h)/6;c<0&&(c=c+1);c>1&&(c=c-1)}b===void 0&&(b={h:0,s:0,v:0});b.h=c;b.s=g;b.v=f;return b}}; -THREE.ColorUtils.__hsv={h:0,s:0,v:0}; -THREE.GeometryUtils={merge:function(a,b){for(var c,d,e=a.vertices.length,f=b instanceof THREE.Mesh?b.geometry:b,g=a.vertices,h=f.vertices,j=a.faces,l=f.faces,k=a.faceVertexUvs[0],p=f.faceVertexUvs[0],m={},o=0;o1){d=1-d;e=1-e}f=1-d-e;g.copy(a);g.multiplyScalar(d);h.copy(b);h.multiplyScalar(e);g.addSelf(h);h.copy(c);h.multiplyScalar(f);g.addSelf(h);return g},randomPointInFace:function(a,b,c){var d,e,f;if(a instanceof -THREE.Face3){d=b.vertices[a.a];e=b.vertices[a.b];f=b.vertices[a.c];return THREE.GeometryUtils.randomPointInTriangle(d,e,f)}if(a instanceof THREE.Face4){d=b.vertices[a.a];e=b.vertices[a.b];f=b.vertices[a.c];var b=b.vertices[a.d],g;if(c)if(a._area1&&a._area2){c=a._area1;g=a._area2}else{c=THREE.GeometryUtils.triangleArea(d,e,b);g=THREE.GeometryUtils.triangleArea(e,f,b);a._area1=c;a._area2=g}else{c=THREE.GeometryUtils.triangleArea(d,e,b);g=THREE.GeometryUtils.triangleArea(e,f,b)}return THREE.GeometryUtils.random()* -(c+g)a?b(c,e-1):l[e] -b||q>b||m>b){j=a.vertices.length;y=e.clone();s=e.clone();if(o>=q&&o>=m){l=l.clone();l.lerpSelf(k,0.5);y.a=f;y.b=j;y.c=h;s.a=j;s.b=g;s.c=h;if(e.vertexNormals.length===3){f=e.vertexNormals[0].clone();f.lerpSelf(e.vertexNormals[1],0.5);y.vertexNormals[1].copy(f);s.vertexNormals[0].copy(f)}if(e.vertexColors.length===3){f=e.vertexColors[0].clone();f.lerpSelf(e.vertexColors[1],0.5);y.vertexColors[1].copy(f);s.vertexColors[0].copy(f)}e=0}else if(q>=o&&q>=m){l=k.clone();l.lerpSelf(p,0.5);y.a=f;y.b=g;y.c= -j;s.a=j;s.b=h;s.c=f;if(e.vertexNormals.length===3){f=e.vertexNormals[1].clone();f.lerpSelf(e.vertexNormals[2],0.5);y.vertexNormals[2].copy(f);s.vertexNormals[0].copy(f);s.vertexNormals[1].copy(e.vertexNormals[2]);s.vertexNormals[2].copy(e.vertexNormals[0])}if(e.vertexColors.length===3){f=e.vertexColors[1].clone();f.lerpSelf(e.vertexColors[2],0.5);y.vertexColors[2].copy(f);s.vertexColors[0].copy(f);s.vertexColors[1].copy(e.vertexColors[2]);s.vertexColors[2].copy(e.vertexColors[0])}e=1}else{l=l.clone(); -l.lerpSelf(p,0.5);y.a=f;y.b=g;y.c=j;s.a=j;s.b=g;s.c=h;if(e.vertexNormals.length===3){f=e.vertexNormals[0].clone();f.lerpSelf(e.vertexNormals[2],0.5);y.vertexNormals[2].copy(f);s.vertexNormals[0].copy(f)}if(e.vertexColors.length===3){f=e.vertexColors[0].clone();f.lerpSelf(e.vertexColors[2],0.5);y.vertexColors[2].copy(f);s.vertexColors[0].copy(f)}e=2}w.push(y,s);a.vertices.push(l);f=0;for(g=a.faceVertexUvs.length;fb||q>b||n>b||r>b){u=a.vertices.length;t=a.vertices.length+1;y=e.clone();s=e.clone();if(o>=q&&o>=n&&o>=r||n>=q&&n>=o&&n>=r){o=l.clone();o.lerpSelf(k,0.5);k=p.clone();k.lerpSelf(m,0.5);y.a=f;y.b=u;y.c=t;y.d=j;s.a=u;s.b=g;s.c=h;s.d=t;if(e.vertexNormals.length===4){f=e.vertexNormals[0].clone();f.lerpSelf(e.vertexNormals[1],0.5);g=e.vertexNormals[2].clone();g.lerpSelf(e.vertexNormals[3],0.5);y.vertexNormals[1].copy(f); -y.vertexNormals[2].copy(g);s.vertexNormals[0].copy(f);s.vertexNormals[3].copy(g)}if(e.vertexColors.length===4){f=e.vertexColors[0].clone();f.lerpSelf(e.vertexColors[1],0.5);g=e.vertexColors[2].clone();g.lerpSelf(e.vertexColors[3],0.5);y.vertexColors[1].copy(f);y.vertexColors[2].copy(g);s.vertexColors[0].copy(f);s.vertexColors[3].copy(g)}e=0}else{o=k.clone();o.lerpSelf(p,0.5);k=m.clone();k.lerpSelf(l,0.5);y.a=f;y.b=g;y.c=u;y.d=t;s.a=t;s.b=u;s.c=h;s.d=j;if(e.vertexNormals.length===4){f=e.vertexNormals[1].clone(); -f.lerpSelf(e.vertexNormals[2],0.5);g=e.vertexNormals[3].clone();g.lerpSelf(e.vertexNormals[0],0.5);y.vertexNormals[2].copy(f);y.vertexNormals[3].copy(g);s.vertexNormals[0].copy(g);s.vertexNormals[1].copy(f)}if(e.vertexColors.length===4){f=e.vertexColors[1].clone();f.lerpSelf(e.vertexColors[2],0.5);g=e.vertexColors[3].clone();g.lerpSelf(e.vertexColors[0],0.5);y.vertexColors[2].copy(f);y.vertexColors[3].copy(g);s.vertexColors[0].copy(g);s.vertexColors[1].copy(f)}e=1}w.push(y,s);a.vertices.push(o,k); -f=0;for(g=a.faceVertexUvs.length;fe-1?e-1:p+1,q=k-1<0?0:k-1,n=k+1>d-1?d-1:k+1,r=[],u=[0,0,h[(p*d+k)*4]/255*b];r.push([-1,0,h[(p*d+q)*4]/255*b]);r.push([-1,-1,h[(m*d+q)*4]/255*b]);r.push([0, --1,h[(m*d+k)*4]/255*b]);r.push([1,-1,h[(m*d+n)*4]/255*b]);r.push([1,0,h[(p*d+n)*4]/255*b]);r.push([1,1,h[(o*d+n)*4]/255*b]);r.push([0,1,h[(o*d+k)*4]/255*b]);r.push([-1,1,h[(o*d+q)*4]/255*b]);m=[];q=r.length;for(o=0;o 0\nuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\nuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n#endif\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\n#ifdef WRAP_AROUND\nuniform vec3 wrapRGB;\n#endif\nvarying vec3 vViewPosition;", -THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,"void main() {\ngl_FragColor = vec4( vec3( 1.0 ), uOpacity );\nvec3 specularTex = vec3( 1.0 );\nvec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;\nnormalTex.xy *= uNormalScale;\nnormalTex = normalize( normalTex );\nif( enableDiffuse ) {\n#ifdef GAMMA_INPUT\nvec4 texelColor = texture2D( tDiffuse, vUv );\ntexelColor.xyz *= texelColor.xyz;\ngl_FragColor = gl_FragColor * texelColor;\n#else\ngl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );\n#endif\n}\nif( enableAO ) {\n#ifdef GAMMA_INPUT\nvec4 aoColor = texture2D( tAO, vUv );\naoColor.xyz *= aoColor.xyz;\ngl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;\n#else\ngl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;\n#endif\n}\nif( enableSpecular )\nspecularTex = texture2D( tSpecular, vUv ).xyz;\nmat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );\nvec3 finalNormal = tsb * normalTex;\nvec3 normal = normalize( finalNormal );\nvec3 viewPosition = normalize( vViewPosition );\n#if MAX_POINT_LIGHTS > 0\nvec3 pointDiffuse = vec3( 0.0 );\nvec3 pointSpecular = vec3( 0.0 );\nfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\nvec3 pointVector = normalize( vPointLight[ i ].xyz );\nfloat pointDistance = vPointLight[ i ].w;\n#ifdef WRAP_AROUND\nfloat pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );\nfloat pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );\nvec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n#else\nfloat pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );\n#endif\npointDiffuse += pointDistance * pointLightColor[ i ] * uDiffuseColor * pointDiffuseWeight;\nvec3 pointHalfVector = normalize( pointVector + viewPosition );\nfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\nfloat pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, uShininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( uShininess + 2.0001 ) / 8.0;\nvec3 schlick = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( pointVector, pointHalfVector ), 5.0 );\npointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * pointDistance * specularNormalization;\n#else\npointSpecular += pointDistance * pointLightColor[ i ] * uSpecularColor * pointSpecularWeight * pointDiffuseWeight;\n#endif\n}\n#endif\n#if MAX_DIR_LIGHTS > 0\nvec3 dirDiffuse = vec3( 0.0 );\nvec3 dirSpecular = vec3( 0.0 );\nfor( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {\nvec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\nvec3 dirVector = normalize( lDirection.xyz );\n#ifdef WRAP_AROUND\nfloat directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );\nfloat directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );\nvec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );\n#else\nfloat dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );\n#endif\ndirDiffuse += directionalLightColor[ i ] * uDiffuseColor * dirDiffuseWeight;\nvec3 dirHalfVector = normalize( dirVector + viewPosition );\nfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\nfloat dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, uShininess ), 0.0 );\n#ifdef PHYSICALLY_BASED_SHADING\nfloat specularNormalization = ( uShininess + 2.0001 ) / 8.0;\nvec3 schlick = uSpecularColor + vec3( 1.0 - uSpecularColor ) * pow( 1.0 - dot( dirVector, dirHalfVector ), 5.0 );\ndirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n#else\ndirSpecular += directionalLightColor[ i ] * uSpecularColor * dirSpecularWeight * dirDiffuseWeight;\n#endif\n}\n#endif\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n#if MAX_DIR_LIGHTS > 0\ntotalDiffuse += dirDiffuse;\ntotalSpecular += dirSpecular;\n#endif\n#if MAX_POINT_LIGHTS > 0\ntotalDiffuse += pointDiffuse;\ntotalSpecular += pointSpecular;\n#endif\ngl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor) + totalSpecular;\nif ( enableReflection ) {\nvec3 wPos = cameraPosition - vViewPosition;\nvec3 vReflect = reflect( normalize( wPos ), normal );\nvec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );\n#ifdef GAMMA_INPUT\ncubeColor.xyz *= cubeColor.xyz;\n#endif\ngl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * uReflectivity );\n}", -THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"}"].join("\n"),vertexShader:["attribute vec4 tangent;\nuniform vec2 uOffset;\nuniform vec2 uRepeat;\n#ifdef VERTEX_TEXTURES\nuniform sampler2D tDisplacement;\nuniform float uDisplacementScale;\nuniform float uDisplacementBias;\n#endif\nvarying vec3 vTangent;\nvarying vec3 vBinormal;\nvarying vec3 vNormal;\nvarying vec2 vUv;\n#if MAX_POINT_LIGHTS > 0\nuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\nuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\nvarying vec4 vPointLight[ MAX_POINT_LIGHTS ];\n#endif\nvarying vec3 vViewPosition;", -THREE.ShaderChunk.shadowmap_pars_vertex,"void main() {\nvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\nvViewPosition = -mvPosition.xyz;\nvNormal = normalMatrix * normal;\nvTangent = normalMatrix * tangent.xyz;\nvBinormal = cross( vNormal, vTangent ) * tangent.w;\nvUv = uv * uRepeat + uOffset;\n#if MAX_POINT_LIGHTS > 0\nfor( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {\nvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\nvec3 lVector = lPosition.xyz - mvPosition.xyz;\nfloat lDistance = 1.0;\nif ( pointLightDistance[ i ] > 0.0 )\nlDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\nlVector = normalize( lVector );\nvPointLight[ i ] = vec4( lVector, lDistance );\n}\n#endif\n#ifdef VERTEX_TEXTURES\nvec3 dv = texture2D( tDisplacement, uv ).xyz;\nfloat df = uDisplacementScale * dv.x + uDisplacementBias;\nvec4 displacedPosition = vec4( normalize( vNormal.xyz ) * df, 0.0 ) + mvPosition;\ngl_Position = projectionMatrix * displacedPosition;\n#else\ngl_Position = projectionMatrix * mvPosition;\n#endif", -THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:1,texture:null},tFlip:{type:"f",value:-1}},vertexShader:"varying vec3 vViewPosition;\nvoid main() {\nvec4 mPosition = objectMatrix * vec4( position, 1.0 );\nvViewPosition = cameraPosition - mPosition.xyz;\ngl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vViewPosition;\nvoid main() {\nvec3 wPos = cameraPosition - vViewPosition;\ngl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );\n}"}}}); -THREE.BufferGeometry=function(){this.id=THREE.GeometryCount++;this.vertexColorArray=this.vertexUvArray=this.vertexNormalArray=this.vertexPositionArray=this.vertexIndexArray=this.vertexColorBuffer=this.vertexUvBuffer=this.vertexNormalBuffer=this.vertexPositionBuffer=this.vertexIndexBuffer=null;this.dynamic=false;this.boundingSphere=this.boundingBox=null;this.morphTargets=[]};THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,computeBoundingBox:function(){},computeBoundingSphere:function(){}}; -THREE.Curve=function(){};THREE.Curve.prototype.getPoint=function(){console.log("Warning, getPoint() not implemented!");return null};THREE.Curve.prototype.getPointAt=function(a){return this.getPoint(this.getUtoTmapping(a))};THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPoint(b/a));return c};THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;b<=a;b++)c.push(this.getPointAt(b/a));return c}; -THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]};THREE.Curve.prototype.getLengths=function(a){a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200);if(this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=false;var b=[],c,d=this.getPoint(0),e,f=0;b.push(0);for(e=1;e<=a;e++){c=this.getPoint(e/a);f=f+c.distanceTo(d);b.push(f);d=c}return this.cacheArcLengths=b}; -THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=true;this.getLengths()};THREE.Curve.prototype.getUtoTmapping=function(a,b){var c=this.getLengths(),d=0,e=c.length,f;f=b?b:a*c[e-1];for(var g=0,h=e-1,j;g<=h;){d=Math.floor(g+(h-g)/2);j=c[d]-f;if(j<0)g=d+1;else if(j>0)h=d-1;else{h=d;break}}d=h;if(c[d]==f)return d/(e-1);g=c[d];return c=(d+(f-g)/(c[d+1]-g))/(e-1)};THREE.Curve.prototype.getNormalVector=function(a){a=this.getTangent(a);return new THREE.Vector2(-a.y,a.x)}; -THREE.Curve.prototype.getTangent=function(a){var b=a-1.0E-4,a=a+1.0E-4;b<0&&(b=0);a>1&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().subSelf(b).normalize()};THREE.Curve.prototype.getTangentAt=function(a){return this.getTangent(this.getUtoTmapping(a))};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=new THREE.Curve;THREE.LineCurve.prototype.constructor=THREE.LineCurve; -THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().subSelf(this.v1);b.multiplyScalar(a).addSelf(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(){return this.v2.clone().subSelf(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=new THREE.Curve;THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; -THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return new THREE.Vector2(b,a)};THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);a=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);b=new THREE.Vector2(b,a);b.normalize();return b}; -THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=new THREE.Curve;THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve;THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)}; -THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b};THREE.SplineCurve=function(a){this.points=a==void 0?[]:a};THREE.SplineCurve.prototype=new THREE.Curve;THREE.SplineCurve.prototype.constructor=THREE.SplineCurve; -THREE.SplineCurve.prototype.getPoint=function(a){var b=new THREE.Vector2,c=[],d=this.points,e;e=(d.length-1)*a;a=Math.floor(e);e=e-a;c[0]=a==0?a:a-1;c[1]=a;c[2]=a>d.length-2?d.length-1:a+1;c[3]=a>d.length-3?d.length-1:a+2;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);return b}; -THREE.ArcCurve=function(a,b,c,d,e,f){this.aX=a;this.aY=b;this.aRadius=c;this.aStartAngle=d;this.aEndAngle=e;this.aClockwise=f};THREE.ArcCurve.prototype=new THREE.Curve;THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.ArcCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;this.aClockwise||(a=1-a);b=this.aStartAngle+a*b;a=this.aX+this.aRadius*Math.cos(b);b=this.aY+this.aRadius*Math.sin(b);return new THREE.Vector2(a,b)}; -THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){var a=(c-a)*0.5,d=(d-b)*0.5,f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}}; -THREE.Curve.create=function(a,b){a.prototype=new THREE.Curve;a.prototype.constructor=a;a.prototype.getPoint=b;return a};THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.sub(this.v2,this.v1);b.multiplyScalar(a);b.addSelf(this.v1);return b}); -THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b,c;b=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);c=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);a=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return new THREE.Vector3(b,c,a)}); -THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b,c;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);c=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);a=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new THREE.Vector3(b,c,a)}); -THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=a==void 0?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e,a=(d.length-1)*a;e=Math.floor(a);a=a-e;c[0]=e==0?e:e-1;c[1]=e;c[2]=e>d.length-2?d.length-1:e+1;c[3]=e>d.length-3?d.length-1:e+2;e=d[c[0]];var f=d[c[1]],g=d[c[2]],c=d[c[3]];b.x=THREE.Curve.Utils.interpolate(e.x,f.x,g.x,c.x,a);b.y=THREE.Curve.Utils.interpolate(e.y,f.y,g.y,c.y,a);b.z=THREE.Curve.Utils.interpolate(e.z,f.z,g.z,c.z,a);return b}); -THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=a==void 0?[]:a},function(a){var b=new THREE.Vector3,c=[],d=this.points,e;e=(d.length-0)*a;a=Math.floor(e);e=e-a;a=a+(a>0?0:(Math.floor(Math.abs(a)/d.length)+1)*d.length);c[0]=(a-1)%d.length;c[1]=a%d.length;c[2]=(a+1)%d.length;c[3]=(a+2)%d.length;b.x=THREE.Curve.Utils.interpolate(d[c[0]].x,d[c[1]].x,d[c[2]].x,d[c[3]].x,e);b.y=THREE.Curve.Utils.interpolate(d[c[0]].y,d[c[1]].y,d[c[2]].y,d[c[3]].y,e);b.z=THREE.Curve.Utils.interpolate(d[c[0]].z, -d[c[1]].z,d[c[2]].z,d[c[3]].z,e);return b});THREE.CurvePath=function(){this.curves=[];this.bends=[];this.autoClose=false};THREE.CurvePath.prototype=new THREE.Curve;THREE.CurvePath.prototype.constructor=THREE.CurvePath;THREE.CurvePath.prototype.add=function(a){this.curves.push(a)};THREE.CurvePath.prototype.checkConnection=function(){}; -THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))};THREE.CurvePath.prototype.getPoint=function(a){for(var b=a*this.getLength(),c=this.getCurveLengths(),a=0;a=b){b=c[a]-b;a=this.curves[a];b=1-b/a.getLength();return a.getPointAt(b)}a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; -THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb)b=f.x;else if(f.xc)c=f.y;else if(f.y0){g=c[c.length-1]; -o=g.x;q=g.y}else{g=this.actions[d-1].args;o=g[g.length-2];q=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b2(n,o,p,h);n=THREE.Shape.Utils.b2(n,q,m,j);c.push(new THREE.Vector2(g,n))}break;case THREE.PathActions.BEZIER_CURVE_TO:h=f[4];j=f[5];p=f[0];m=f[1];l=f[2];k=f[3];if(c.length>0){g=c[c.length-1];o=g.x;q=g.y}else{g=this.actions[d-1].args;o=g[g.length-2];q=g[g.length-1]}for(f=1;f<=a;f++){n=f/a;g=THREE.Shape.Utils.b3(n,o,p,l,h);n=THREE.Shape.Utils.b3(n,q,m,k,j);c.push(new THREE.Vector2(g, -n))}break;case THREE.PathActions.CSPLINE_THRU:g=this.actions[d-1].args;n=[new THREE.Vector2(g[g.length-2],g[g.length-1])];g=a*f[0].length;n=n.concat(f[0]);n=new THREE.SplineCurve(n);for(f=1;f<=g;f++)c.push(n.getPointAt(f/g));break;case THREE.PathActions.ARC:h=f[0];j=f[1];l=f[2];p=f[3];m=!!f[5];k=f[4]-p;o=a*2;for(f=1;f<=o;f++){n=f/o;m||(n=1-n);n=p+n*k;g=h+l*Math.cos(n);n=j+l*Math.sin(n);c.push(new THREE.Vector2(g,n))}}}d=c[c.length-1];Math.abs(d.x-c[0].x)<1.0E-10&&Math.abs(d.y-c[0].y)<1.0E-10&&c.splice(c.length- -1,1);b&&c.push(c[0]);return c};THREE.Path.prototype.transform=function(a,b){this.getBoundingBox();return this.getWrapPoints(this.getPoints(b),a)};THREE.Path.prototype.nltransform=function(a,b,c,d,e,f){var g=this.getPoints(),h,j,l,k,p;h=0;for(j=g.length;h=0?h-1:c.length-1;f=g-1>=0?g-1:l.length-1;var n=[l[g],c[h],c[e]];p=THREE.FontUtils.Triangulate.area(n);var r=[l[g],l[f],c[h]];m=THREE.FontUtils.Triangulate.area(r);o=h;k=g;h=h+1;g=g+ --1;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+l.length);g=g%l.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:l.length-1;n=[l[g],c[h],c[e]];n=THREE.FontUtils.Triangulate.area(n);r=[l[g],l[f],c[h]];r=THREE.FontUtils.Triangulate.area(r);if(p+m>n+r){h=o;g=k;h<0&&(h=h+c.length);h=h%c.length;g<0&&(g=g+l.length);g=g%l.length;e=h-1>=0?h-1:c.length-1;f=g-1>=0?g-1:l.length-1}p=c.slice(0,h);m=c.slice(h);o=l.slice(g);k=l.slice(0,g);f=[l[g],l[f],c[h]];q.push([l[g],c[h],c[e]]);q.push(f);c=p.concat(o).concat(k).concat(m)}return{shape:c, -isolatedPts:q,allpoints:d}},triangulateShape:function(a,b){var c=THREE.Shape.Utils.removeHoles(a,b),d=c.allpoints,e=c.isolatedPts,c=THREE.FontUtils.Triangulate(c.shape,false),f,g,h,j,l={};f=0;for(g=d.length;f1){console.log("THREE.Animation.update: Warning! Scale out of bounds:"+d+" on bone "+o);d=d<0?0:1}if(c==="pos"){c=a.position;if(this.interpolationType===THREE.AnimationHandler.LINEAR){c.x=e[0]+(f[0]-e[0])*d;c.y=e[1]+(f[1]-e[1])*d;c.z=e[2]+(f[2]-e[2])*d}else if(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType=== -THREE.AnimationHandler.CATMULLROM_FORWARD){this.points[0]=this.getPrevKeyWith("pos",o,g.index-1).pos;this.points[1]=e;this.points[2]=f;this.points[3]=this.getNextKeyWith("pos",o,h.index+1).pos;d=d*0.33+0.33;e=this.interpolateCatmullRom(this.points,d);c.x=e[0];c.y=e[1];c.z=e[2];if(this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD){d=this.interpolateCatmullRom(this.points,d*1.01);this.target.set(d[0],d[1],d[2]);this.target.subSelf(c);this.target.y=0;this.target.normalize();d=Math.atan2(this.target.x, -this.target.z);a.rotation.set(0,d,0)}}}else if(c==="rot")THREE.Quaternion.slerp(e,f,a.quaternion,d);else if(c==="scl"){c=a.scale;c.x=e[0]+(f[0]-e[0])*d;c.y=e[1]+(f[1]-e[1])*d;c.z=e[2]+(f[2]-e[2])*d}}}}if(this.JITCompile&&k[0][l]===void 0){this.hierarchy[0].updateMatrixWorld(true);for(o=0;oa.length-2?f:f+1;c[3]=f>a.length-3?f:f+2;f=a[c[0]];h=a[c[1]];j=a[c[2]];l=a[c[3]];c=e*e;g=e*c;d[0]=this.interpolate(f[0],h[0],j[0],l[0],e,c,g);d[1]=this.interpolate(f[1],h[1],j[1],l[1],e,c,g);d[2]=this.interpolate(f[2],h[2],j[2],l[2],e,c,g);return d}; -THREE.Animation.prototype.interpolate=function(a,b,c,d,e,f,g){a=(c-a)*0.5;d=(d-b)*0.5;return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};THREE.Animation.prototype.getNextKeyWith=function(a,b,c){for(var d=this.data.hierarchy[b].keys,c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c0?c:0:c>=0?c:c+d.length;c>=0;c--)if(d[c][a]!==void 0)return d[c];return this.data.hierarchy[b].keys[d.length-1]}; -THREE.KeyFrameAnimation=function(a,b,c){this.root=a;this.data=THREE.AnimationHandler.get(b);this.hierarchy=THREE.AnimationHandler.parse(a);this.currentTime=0;this.timeScale=0.001;this.isPlaying=false;this.loop=this.isPaused=true;this.JITCompile=c!==void 0?c:true;a=0;for(b=this.hierarchy.length;a=g?b.interpolate(c,g):b.interpolate(c,c.time)}this.data.hierarchy[a].node.updateMatrix();d.matrixWorldNeedsUpdate=true}}if(this.JITCompile&&f[0][e]===void 0){this.hierarchy[0].updateMatrixWorld(true); -for(a=0;a=0?c:c+b.length;c>=0;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]}; -THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1);f.lookAt(new THREE.Vector3(0,1,0));this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1);g.lookAt(new THREE.Vector3(0,-1,0));this.add(g);var h=new THREE.PerspectiveCamera(90, -1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var j=new THREE.PerspectiveCamera(90,1,a,b);j.up.set(0,-1,0);j.lookAt(new THREE.Vector3(0,0,-1));this.add(j);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,m=c.generateMipmaps;c.generateMipmaps=false;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=1;a.render(b,e,c);c.activeCubeFace= -2;a.render(b,f,c);c.activeCubeFace=3;a.render(b,g,c);c.activeCubeFace=4;a.render(b,h,c);c.generateMipmaps=m;c.activeCubeFace=5;a.render(b,j,c)}};THREE.CubeCamera.prototype=new THREE.Object3D;THREE.CubeCamera.prototype.constructor=THREE.CubeCamera; -THREE.CombinedCamera=function(a,b,c,d,e,f,g){THREE.Camera.call(this);this.fov=c;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2;this.cameraO=new THREE.OrthographicCamera(a/-2,a/2,b/2,b/-2,f,g);this.cameraP=new THREE.PerspectiveCamera(c,a/b,d,e);this.zoom=1;this.toPerspective()};THREE.CombinedCamera.prototype=new THREE.Camera;THREE.CombinedCamera.prototype.constructor=THREE.CombinedCamera; -THREE.CombinedCamera.prototype.toPerspective=function(){this.near=this.cameraP.near;this.far=this.cameraP.far;this.cameraP.fov=this.fov/this.zoom;this.cameraP.updateProjectionMatrix();this.projectionMatrix=this.cameraP.projectionMatrix;this.inPersepectiveMode=true;this.inOrthographicMode=false}; -THREE.CombinedCamera.prototype.toOrthographic=function(){var a=this.cameraP.aspect,b=(this.cameraP.near+this.cameraP.far)/2,b=Math.tan(this.fov/2)*b,a=2*b*a/2,b=b/this.zoom,a=a/this.zoom;this.cameraO.left=-a;this.cameraO.right=a;this.cameraO.top=b;this.cameraO.bottom=-b;this.cameraO.updateProjectionMatrix();this.near=this.cameraO.near;this.far=this.cameraO.far;this.projectionMatrix=this.cameraO.projectionMatrix;this.inPersepectiveMode=false;this.inOrthographicMode=true}; -THREE.CombinedCamera.prototype.setSize=function(a,b){this.cameraP.aspect=a/b;this.left=-a/2;this.right=a/2;this.top=b/2;this.bottom=-b/2};THREE.CombinedCamera.prototype.setFov=function(a){this.fov=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.updateProjectionMatrix=function(){if(this.inPersepectiveMode)this.toPerspective();else{this.toPerspective();this.toOrthographic()}}; -THREE.CombinedCamera.prototype.setLens=function(a,b){var c=2*Math.atan((b!==void 0?b:24)/(a*2))*(180/Math.PI);this.setFov(c);return c};THREE.CombinedCamera.prototype.setZoom=function(a){this.zoom=a;this.inPersepectiveMode?this.toPerspective():this.toOrthographic()};THREE.CombinedCamera.prototype.toFrontView=function(){this.rotation.x=0;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=false}; -THREE.CombinedCamera.prototype.toBackView=function(){this.rotation.x=0;this.rotation.y=Math.PI;this.rotation.z=0;this.rotationAutoUpdate=false};THREE.CombinedCamera.prototype.toLeftView=function(){this.rotation.x=0;this.rotation.y=-Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=false};THREE.CombinedCamera.prototype.toRightView=function(){this.rotation.x=0;this.rotation.y=Math.PI/2;this.rotation.z=0;this.rotationAutoUpdate=false}; -THREE.CombinedCamera.prototype.toTopView=function(){this.rotation.x=-Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=false};THREE.CombinedCamera.prototype.toBottomView=function(){this.rotation.x=Math.PI/2;this.rotation.y=0;this.rotation.z=0;this.rotationAutoUpdate=false}; -THREE.FirstPersonControls=function(a,b){function c(a,b){return function(){b.apply(a,arguments)}}this.object=a;this.target=new THREE.Vector3(0,0,0);this.domElement=b!==void 0?b:document;this.movementSpeed=1;this.lookSpeed=0.005;this.noFly=false;this.lookVertical=true;this.autoForward=false;this.activeLook=true;this.heightSpeed=false;this.heightCoef=1;this.heightMin=0;this.constrainVertical=false;this.verticalMin=0;this.verticalMax=Math.PI;this.theta=this.phi=this.lon=this.lat=this.mouseY=this.mouseX= -this.autoSpeedFactor=0;this.mouseDragOn=this.freeze=this.moveRight=this.moveLeft=this.moveBackward=this.moveForward=false;if(this.domElement===document){this.viewHalfX=window.innerWidth/2;this.viewHalfY=window.innerHeight/2}else{this.viewHalfX=this.domElement.offsetWidth/2;this.viewHalfY=this.domElement.offsetHeight/2;this.domElement.setAttribute("tabindex",-1)}this.onMouseDown=function(a){this.domElement!==document&&this.domElement.focus();a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward= -true;break;case 2:this.moveBackward=true}this.mouseDragOn=true};this.onMouseUp=function(a){a.preventDefault();a.stopPropagation();if(this.activeLook)switch(a.button){case 0:this.moveForward=false;break;case 2:this.moveBackward=false}this.mouseDragOn=false};this.onMouseMove=function(a){if(this.domElement===document){this.mouseX=a.pageX-this.viewHalfX;this.mouseY=a.pageY-this.viewHalfY}else{this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX;this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY}}; -this.onKeyDown=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=true;break;case 37:case 65:this.moveLeft=true;break;case 40:case 83:this.moveBackward=true;break;case 39:case 68:this.moveRight=true;break;case 82:this.moveUp=true;break;case 70:this.moveDown=true;break;case 81:this.freeze=!this.freeze}};this.onKeyUp=function(a){switch(a.keyCode){case 38:case 87:this.moveForward=false;break;case 37:case 65:this.moveLeft=false;break;case 40:case 83:this.moveBackward=false;break;case 39:case 68:this.moveRight= -false;break;case 82:this.moveUp=false;break;case 70:this.moveDown=false}};this.update=function(a){var b=0;if(!this.freeze){if(this.heightSpeed){b=THREE.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=a*b*this.heightCoef}else this.autoSpeedFactor=0;b=a*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(b+this.autoSpeedFactor));this.moveBackward&&this.object.translateZ(b);this.moveLeft&&this.object.translateX(-b); -this.moveRight&&this.object.translateX(b);this.moveUp&&this.object.translateY(b);this.moveDown&&this.object.translateY(-b);a=a*this.lookSpeed;this.activeLook||(a=0);this.lon=this.lon+this.mouseX*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*a;this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;var b=this.target,c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)* -Math.sin(this.theta);b=1;this.constrainVertical&&(b=Math.PI/(this.verticalMax-this.verticalMin));this.lon=this.lon+this.mouseX*a;if(this.lookVertical)this.lat=this.lat-this.mouseY*a*b;this.lat=Math.max(-85,Math.min(85,this.lat));this.phi=(90-this.lat)*Math.PI/180;this.theta=this.lon*Math.PI/180;if(this.constrainVertical)this.phi=THREE.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax);b=this.target;c=this.object.position;b.x=c.x+100*Math.sin(this.phi)*Math.cos(this.theta);b.y=c.y+ -100*Math.cos(this.phi);b.z=c.z+100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(b)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",c(this,this.onMouseMove),false);this.domElement.addEventListener("mousedown",c(this,this.onMouseDown),false);this.domElement.addEventListener("mouseup",c(this,this.onMouseUp),false);this.domElement.addEventListener("keydown",c(this,this.onKeyDown),false);this.domElement.addEventListener("keyup", -c(this,this.onKeyUp),false)}; -THREE.PathControls=function(a,b){function c(a){return(a=a*2)<1?0.5*a*a:-0.5*(--a*(a-2)-1)}function d(a,b){return function(){b.apply(a,arguments)}}function e(a,b,c,d){var e={name:c,fps:0.6,length:d,hierarchy:[]},f,g=b.getControlPointsArray(),h=b.getLength(),r=g.length,u=0;f=r-1;b={parent:-1,keys:[]};b.keys[0]={time:0,pos:g[0],rot:[0,0,0,1],scl:[1,1,1]};b.keys[f]={time:d,pos:g[f],rot:[0,0,0,1],scl:[1,1,1]};for(f=1;f=0?a:a+g;b=this.verticalAngleMap.srcRange;a=this.verticalAngleMap.dstRange; -b=THREE.Math.mapLinear(this.phi,b[0],b[1],a[0],a[1]);var d=a[1]-a[0];this.phi=c((b-a[0])/d)*d+a[0];b=this.horizontalAngleMap.srcRange;a=this.horizontalAngleMap.dstRange;b=THREE.Math.mapLinear(this.theta,b[0],b[1],a[0],a[1]);d=a[1]-a[0];this.theta=c((b-a[0])/d)*d+a[0];a=this.target.position;a.x=100*Math.sin(this.phi)*Math.cos(this.theta);a.y=100*Math.cos(this.phi);a.z=100*Math.sin(this.phi)*Math.sin(this.theta);this.object.lookAt(this.target.position)};this.onMouseMove=function(a){if(this.domElement=== -document){this.mouseX=a.pageX-this.viewHalfX;this.mouseY=a.pageY-this.viewHalfY}else{this.mouseX=a.pageX-this.domElement.offsetLeft-this.viewHalfX;this.mouseY=a.pageY-this.domElement.offsetTop-this.viewHalfY}};this.init=function(){this.spline=new THREE.Spline;this.spline.initFromArray(this.waypoints);this.useConstantSpeed&&this.spline.reparametrizeByArcLength(this.resamplingCoef);if(this.createDebugDummy){var a=new THREE.MeshLambertMaterial({color:30719}),b=new THREE.MeshLambertMaterial({color:65280}), -c=new THREE.CubeGeometry(10,10,20),g=new THREE.CubeGeometry(2,2,10);this.animationParent=new THREE.Mesh(c,a);a=new THREE.Mesh(g,b);a.position.set(0,10,0);this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.object);this.animationParent.add(this.target);this.animationParent.add(a)}else{this.animation=e(this.animationParent,this.spline,this.id,this.duration);this.animationParent.add(this.target);this.animationParent.add(this.object)}if(this.createDebugPath){var a= -this.debugPath,b=this.spline,g=f(b,10),c=f(b,10),h=new THREE.LineBasicMaterial({color:16711680,linewidth:3}),g=new THREE.Line(g,h),c=new THREE.ParticleSystem(c,new THREE.ParticleBasicMaterial({color:16755200,size:3}));g.scale.set(1,1,1);a.add(g);c.scale.set(1,1,1);a.add(c);for(var g=new THREE.SphereGeometry(1,16,8),h=new THREE.MeshBasicMaterial({color:65280}),o=0;o0){var b=this.getContainerDimensions(),c=b.size[0]/2,g=b.size[1]/2;this.moveState.yawLeft=-(a.pageX-b.offset[0]-c)/c;this.moveState.pitchDown=(a.pageY-b.offset[1]-g)/g;this.updateRotationVector()}};this.mouseup=function(a){a.preventDefault();a.stopPropagation();if(this.dragToLook){this.mouseStatus--;this.moveState.yawLeft=this.moveState.pitchDown=0}else switch(a.button){case 0:this.moveForward= -false;break;case 2:this.moveBackward=false}this.updateRotationVector()};this.update=function(a){var b=a*this.movementSpeed,a=a*this.rollSpeed;this.object.translateX(this.moveVector.x*b);this.object.translateY(this.moveVector.y*b);this.object.translateZ(this.moveVector.z*b);this.tmpQuaternion.set(this.rotationVector.x*a,this.rotationVector.y*a,this.rotationVector.z*a,1).normalize();this.object.quaternion.multiplySelf(this.tmpQuaternion);this.object.matrix.setPosition(this.object.position);this.object.matrix.setRotationFromQuaternion(this.object.quaternion); -this.object.matrixWorldNeedsUpdate=true};this.updateMovementVector=function(){var a=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right;this.moveVector.y=-this.moveState.down+this.moveState.up;this.moveVector.z=-a+this.moveState.back};this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp;this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft;this.rotationVector.z= --this.moveState.rollRight+this.moveState.rollLeft};this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}};this.domElement.addEventListener("mousemove",c(this,this.mousemove),false);this.domElement.addEventListener("mousedown",c(this,this.mousedown),false);this.domElement.addEventListener("mouseup", -c(this,this.mouseup),false);this.domElement.addEventListener("keydown",c(this,this.keydown),false);this.domElement.addEventListener("keyup",c(this,this.keyup),false);this.updateMovementVector();this.updateRotationVector()}; -THREE.RollControls=function(a,b){this.object=a;this.domElement=b!==void 0?b:document;this.mouseLook=true;this.autoForward=false;this.rollSpeed=this.movementSpeed=this.lookSpeed=1;this.constrainVertical=[-0.9,0.9];this.object.matrixAutoUpdate=false;this.forward=new THREE.Vector3(0,0,1);this.roll=0;var c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Matrix4,g=false,h=1,j=0,l=0,k=0,p=0,m=0,o=window.innerWidth/2,q=window.innerHeight/2;this.update=function(a){if(this.mouseLook){var b= -a*this.lookSpeed;this.rotateHorizontally(b*p);this.rotateVertically(b*m)}b=a*this.movementSpeed;this.object.translateZ(-b*(j>0||this.autoForward&&!(j<0)?1:j));this.object.translateX(b*l);this.object.translateY(b*k);if(g)this.roll=this.roll+this.rollSpeed*a*h;if(this.forward.y>this.constrainVertical[1]){this.forward.y=this.constrainVertical[1];this.forward.normalize()}else if(this.forward.y1?d.normalize():d.z=Math.sqrt(1-e*e);g.copy(c.object.position).subSelf(c.target);e=c.object.up.clone().setLength(d.y);e.addSelf(c.object.up.clone().crossSelf(g).setLength(d.x));e.addSelf(g.setLength(d.z));return e};this.rotateCamera=function(){var a=Math.acos(h.dot(j)/h.length()/j.length());if(a){var b=(new THREE.Vector3).cross(h,j).normalize(),d=new THREE.Quaternion,a=a*c.rotateSpeed; -d.setFromAxisAngle(b,-a);d.multiplyVector3(g);d.multiplyVector3(c.object.up);d.multiplyVector3(j);if(c.staticMoving)h=j;else{d.setFromAxisAngle(b,a*(c.dynamicDampingFactor-1));d.multiplyVector3(h)}}};this.zoomCamera=function(){var a=1+(k.y-l.y)*c.zoomSpeed;if(a!==1&&a>0){g.multiplyScalar(a);c.staticMoving?l=k:l.y=l.y+(k.y-l.y)*this.dynamicDampingFactor}};this.panCamera=function(){var a=m.clone().subSelf(p);if(a.lengthSq()){a.multiplyScalar(g.length()*c.panSpeed);var b=g.clone().crossSelf(c.object.up).setLength(a.x); -b.addSelf(c.object.up.clone().setLength(a.y));c.object.position.addSelf(b);c.target.addSelf(b);c.staticMoving?p=m:p.addSelf(a.sub(m,p).multiplyScalar(c.dynamicDampingFactor))}};this.checkDistances=function(){if(!c.noZoom||!c.noPan){c.object.position.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.setLength(c.maxDistance);g.lengthSq()0){c.dispatchEvent(o);d.copy(c.object.position)}};this.domElement.addEventListener("contextmenu",function(a){a.preventDefault()},false);this.domElement.addEventListener("mousemove",function(a){if(c.enabled){if(e){h=j=c.getMouseProjectionOnBall(a.clientX,a.clientY);l=k=c.getMouseOnScreen(a.clientX,a.clientY);p= -m=c.getMouseOnScreen(a.clientX,a.clientY);e=false}f!==-1&&(f===0&&!c.noRotate?j=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?k=c.getMouseOnScreen(a.clientX,a.clientY):f===2&&!c.noPan&&(m=c.getMouseOnScreen(a.clientX,a.clientY)))}},false);this.domElement.addEventListener("mousedown",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();if(f===-1){f=a.button;f===0&&!c.noRotate?h=j=c.getMouseProjectionOnBall(a.clientX,a.clientY):f===1&&!c.noZoom?l=k=c.getMouseOnScreen(a.clientX, -a.clientY):this.noPan||(p=m=c.getMouseOnScreen(a.clientX,a.clientY))}}},false);this.domElement.addEventListener("mouseup",function(a){if(c.enabled){a.preventDefault();a.stopPropagation();f=-1}},false);window.addEventListener("keydown",function(a){if(c.enabled&&f===-1){a.keyCode===c.keys[0]&&!c.noRotate?f=0:a.keyCode===c.keys[1]&&!c.noZoom?f=1:a.keyCode===c.keys[2]&&!c.noPan&&(f=2);f!==-1&&(e=true)}},false);window.addEventListener("keyup",function(){c.enabled&&f!==-1&&(f=-1)},false)}; -THREE.CubeGeometry=function(a,b,c,d,e,f,g,h){function j(a,b,c,g,h,j,k,m){var n,p=d||1,o=e||1,q=h/2,r=j/2,t=l.vertices.length;if(a==="x"&&b==="y"||a==="y"&&b==="x")n="z";else if(a==="x"&&b==="z"||a==="z"&&b==="x"){n="y";o=f||1}else if(a==="z"&&b==="y"||a==="y"&&b==="z"){n="x";p=f||1}var i=p+1,u=o+1,y=h/p,C=j/o,Y=new THREE.Vector3;Y[n]=k>0?1:-1;for(h=0;h0){this.vertices.push(new THREE.Vector3(0, -g,0));for(h=0;h0){this.vertices.push(new THREE.Vector3(0,-g,0));for(h=0;ha&&(a=a+Math.PI*2);c=(b+a)/2;a=-Math.cos(c);c=-Math.sin(c);return new THREE.Vector2(a,c)}return d.multiplyScalar(g).addSelf(h).subSelf(a).clone()}function e(c,d){var e,f;for(F=c.length;--F>=0;){e=F;f=F-1;f<0&&(f= -c.length-1);for(var g=0,h=m+k*2,g=0;g=0;D--){G=D/k;i=j*(1-G);M=l*Math.sin(G*Math.PI/2);F=0;for(G=P.length;F0)for(l=0;l2;){if(p--<=0){console.log("Warning, unable to triangulate polygon!");break}j=l;e<=j&&(j=0);l=j+1;e<=l&&(l=0);k=l+1;e<=k&&(k=0);var m;a:{m=a;var o=j,q=l,n=k,r=e,u=g,t=void 0,y=void 0,s=void 0,w=void 0,H=void 0, -E=void 0,z=void 0,v=void 0,A=void 0,y=m[u[o]].x,s=m[u[o]].y,w=m[u[q]].x,H=m[u[q]].y,E=m[u[n]].x,z=m[u[n]].y;if(1.0E-10>(w-y)*(z-s)-(H-s)*(E-y))m=false;else{for(t=0;t=0&&R>=0&&D>=0){m=false;break a}}m=true}}if(m){f.push([a[g[j]], -a[g[l]],a[g[k]]]);h.push([g[j],g[l],g[k]]);j=l;for(k=l+1;k1.0E-4){h.normalize();d=Math.acos(e[l-1].dot(e[l]));j.makeRotationAxis(h,d).multiplyVector3(f[l])}g[l].cross(e[l],f[l])}if(c){d=Math.acos(f[0].dot(f[b-1]));d=d/(b-1);e[0].dot(h.cross(f[0],f[b-1]))>0&&(d=-d);for(l=1;l0;)this.smooth(a)}; -THREE.SubdivisionModifier.prototype.smooth=function(a){function b(){m.debug&&console.log.apply(console,arguments)}function c(){console&&console.log.apply(console,arguments)}function d(a,c,d,e,g,h,i){var j=new THREE.Face4(a,c,d,e,null,g.color,g.material);if(m.useOldVertexColors){j.vertexColors=[];for(var l,n,o,q=0;q<4;q++){o=h[q];l=new THREE.Color;l.setRGB(0,0,0);for(var r=0;r=y&&a1){var j=h[1];d[j]||(d[j]={start:Infinity,end:-Infinity});h=d[j];if(fh.end)h.end=f;c||(c=j)}}for(j in d){h=d[j];this.createAnimation(j,h.start,h.end,a)}this.firstAnimation=c}; -THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a]){a.direction=1;a.directionBackwards=false}};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a]){a.direction=-1;a.directionBackwards=true}};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];if(c){c.fps=b;c.duration=(c.end-c.start)/c.fps}}; -THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];if(c){c.duration=b;c.fps=(c.end-c.start)/c.duration}};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];if(c)c.weight=b};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];if(c)c.time=b};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; -THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];if(b){b.time=0;b.active=true}else console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=false}; -THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||d.time<0){d.direction=d.direction*-1;if(d.time>d.duration){d.time=d.duration;d.directionBackwards=true}if(d.time<0){d.time=0;d.directionBackwards=false}}}else{d.time=d.time%d.duration;if(d.time<0)d.time=d.time+d.duration}var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/ -e),0,d.length-1),g=d.weight;if(f!==d.currentFrame){this.morphTargetInfluences[d.lastFrame]=0;this.morphTargetInfluences[d.currentFrame]=1*g;this.morphTargetInfluences[f]=0;d.lastFrame=d.currentFrame;d.currentFrame=f}e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; -THREE.LensFlarePlugin=function(){function a(a){var c=b.createProgram(),d=b.createShader(b.FRAGMENT_SHADER),e=b.createShader(b.VERTEX_SHADER);b.shaderSource(d,a.fragmentShader);b.shaderSource(e,a.vertexShader);b.compileShader(d);b.compileShader(e);b.attachShader(c,d);b.attachShader(c,e);b.linkProgram(c);return c}var b,c,d,e,f,g,h,j,l,k,p,m,o;this.init=function(q){b=q.context;c=q;d=new Float32Array(16);e=new Uint16Array(6);q=0;d[q++]=-1;d[q++]=-1;d[q++]=0;d[q++]=0;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]= -0;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=1;d[q++]=-1;d[q++]=1;d[q++]=0;d[q++]=1;q=0;e[q++]=0;e[q++]=1;e[q++]=2;e[q++]=0;e[q++]=2;e[q++]=3;f=b.createBuffer();g=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,f);b.bufferData(b.ARRAY_BUFFER,d,b.STATIC_DRAW);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.bufferData(b.ELEMENT_ARRAY_BUFFER,e,b.STATIC_DRAW);h=b.createTexture();j=b.createTexture();b.bindTexture(b.TEXTURE_2D,h);b.texImage2D(b.TEXTURE_2D,0,b.RGB,16,16,0,b.RGB,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D, -b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);b.bindTexture(b.TEXTURE_2D,j);b.texImage2D(b.TEXTURE_2D,0,b.RGBA,16,16,0,b.RGBA,b.UNSIGNED_BYTE,null);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.NEAREST); -b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.NEAREST);if(b.getParameter(b.MAX_VERTEX_TEXTURE_IMAGE_UNITS)<=0){l=false;k=a(THREE.ShaderFlares.lensFlare)}else{l=true;k=a(THREE.ShaderFlares.lensFlareVertexTexture)}p={};m={};p.vertex=b.getAttribLocation(k,"position");p.uv=b.getAttribLocation(k,"uv");m.renderType=b.getUniformLocation(k,"renderType");m.map=b.getUniformLocation(k,"map");m.occlusionMap=b.getUniformLocation(k,"occlusionMap");m.opacity=b.getUniformLocation(k,"opacity");m.color=b.getUniformLocation(k, -"color");m.scale=b.getUniformLocation(k,"scale");m.rotation=b.getUniformLocation(k,"rotation");m.screenPosition=b.getUniformLocation(k,"screenPosition");o=false};this.render=function(a,d,e,u){var a=a.__webglFlares,t=a.length;if(t){var y=new THREE.Vector3,s=u/e,w=e*0.5,H=u*0.5,E=16/u,z=new THREE.Vector2(E*s,E),v=new THREE.Vector3(1,1,0),A=new THREE.Vector2(1,1),J=m,E=p;b.useProgram(k);if(!o){b.enableVertexAttribArray(p.vertex);b.enableVertexAttribArray(p.uv);o=true}b.uniform1i(J.occlusionMap,0);b.uniform1i(J.map, -1);b.bindBuffer(b.ARRAY_BUFFER,f);b.vertexAttribPointer(E.vertex,2,b.FLOAT,false,16,0);b.vertexAttribPointer(E.uv,2,b.FLOAT,false,16,8);b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,g);b.disable(b.CULL_FACE);b.depthMask(false);var K,R,P,D,M;for(K=0;K0&&A.x0&& -A.y0.001&&M.scale>0.001){v.x=M.x;v.y=M.y;v.z=M.z;E=M.size*M.scale/u;z.x=E*s;z.y=E;b.uniform3f(J.screenPosition,v.x,v.y,v.z);b.uniform2f(J.scale,z.x,z.y);b.uniform1f(J.rotation,M.rotation);b.uniform1f(J.opacity,M.opacity); -b.uniform3f(J.color,M.color.r,M.color.g,M.color.b);c.setBlending(M.blending,M.blendEquation,M.blendSrc,M.blendDst);c.setTexture(M.texture,1);b.drawElements(b.TRIANGLES,6,b.UNSIGNED_SHORT,0)}}}}b.enable(b.CULL_FACE);b.enable(b.DEPTH_TEST);b.depthMask(true)}}}; -THREE.ShadowMapPlugin=function(){var a,b,c,d,e=new THREE.Frustum,f=new THREE.Matrix4,g=new THREE.Vector3,h=new THREE.Vector3;this.init=function(e){a=e.context;b=e;var e=THREE.ShaderLib.depthRGBA,f=THREE.UniformsUtils.clone(e.uniforms);c=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f});d=new THREE.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:f,morphTargets:true});c._shadowPass=true;d._shadowPass=true};this.render= -function(a,c){b.shadowMapEnabled&&b.shadowMapAutoUpdate&&this.update(a,c)};this.update=function(j,l){var k,p,m,o,q,n,r,u,t,y=[];o=0;a.clearColor(1,1,1,1);a.disable(a.BLEND);a.enable(a.CULL_FACE);b.shadowMapCullFrontFaces?a.cullFace(a.FRONT):a.cullFace(a.BACK);b.setDepthTest(true);k=0;for(p=j.__lights.length;kh.x)h.x=u.x;if(u.yh.y)h.y=u.y;if(u.zh.z)h.z=u.z}o.left=g.x;o.right=h.x;o.top=h.y;o.bottom=g.y;o.updateProjectionMatrix()}o=m.shadowMap;n=m.shadowMatrix;q=m.shadowCamera;q.position.copy(m.matrixWorld.getPosition());q.lookAt(m.target.matrixWorld.getPosition());q.updateMatrixWorld();q.matrixWorldInverse.getInverse(q.matrixWorld); -if(m.cameraHelper)m.cameraHelper.lines.visible=m.shadowCameraVisible;m.shadowCameraVisible&&m.cameraHelper.update();n.set(0.5,0,0,0.5,0,0.5,0,0.5,0,0,0.5,0.5,0,0,0,1);n.multiplySelf(q.projectionMatrix);n.multiplySelf(q.matrixWorldInverse);if(!q._viewMatrixArray)q._viewMatrixArray=new Float32Array(16);if(!q._projectionMatrixArray)q._projectionMatrixArray=new Float32Array(16);q.matrixWorldInverse.flattenToArray(q._viewMatrixArray);q.projectionMatrix.flattenToArray(q._projectionMatrixArray);f.multiply(q.projectionMatrix, -q.matrixWorldInverse);e.setFromMatrix(f);b.setRenderTarget(o);b.clear();t=j.__webglObjects;m=0;for(o=t.length;m - - var i, f, p, q, t; - - if ( v === 0 ) { - - this.r = this.g = this.b = 0; - - } else { - - i = Math.floor( h * 6 ); - f = ( h * 6 ) - i; - p = v * ( 1 - s ); - q = v * ( 1 - ( s * f ) ); - t = v * ( 1 - ( s * ( 1 - f ) ) ); - - switch ( i ) { - - case 1: this.r = q; this.g = v; this.b = p; break; - case 2: this.r = p; this.g = v; this.b = t; break; - case 3: this.r = p; this.g = q; this.b = v; break; - case 4: this.r = t; this.g = p; this.b = v; break; - case 5: this.r = v; this.g = p; this.b = q; break; - case 6: // fall through - case 0: this.r = v; this.g = t; this.b = p; break; - - } - - } - - return this; - - }, - - setHex: function ( hex ) { - - hex = Math.floor( hex ); - - this.r = ( hex >> 16 & 255 ) / 255; - this.g = ( hex >> 8 & 255 ) / 255; - this.b = ( hex & 255 ) / 255; - - return this; - - }, - - getHex: function () { - - return Math.floor( this.r * 255 ) << 16 ^ Math.floor( this.g * 255 ) << 8 ^ Math.floor( this.b * 255 ); - - }, - - getContextStyle: function () { - - return 'rgb(' + Math.floor( this.r * 255 ) + ',' + Math.floor( this.g * 255 ) + ',' + Math.floor( this.b * 255 ) + ')'; - - }, - - clone: function () { - - return new THREE.Color().setRGB( this.r, this.g, this.b ); - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author philogb / http://blog.thejit.org/ - * @author egraether / http://egraether.com/ - * @author zz85 / http://www.lab4games.net/zz85/blog - */ - -THREE.Vector2 = function ( x, y ) { - - this.x = x || 0; - this.y = y || 0; - -}; - -THREE.Vector2.prototype = { - - constructor: THREE.Vector2, - - set: function ( x, y ) { - - this.x = x; - this.y = y; - - return this; - - }, - - copy: function ( v ) { - - this.x = v.x; - this.y = v.y; - - return this; - - }, - - clone: function () { - - return new THREE.Vector2( this.x, this.y ); - - }, - - - add: function ( v1, v2 ) { - - this.x = v1.x + v2.x; - this.y = v1.y + v2.y; - - return this; - - }, - - addSelf: function ( v ) { - - this.x += v.x; - this.y += v.y; - - return this; - - }, - - sub: function ( v1, v2 ) { - - this.x = v1.x - v2.x; - this.y = v1.y - v2.y; - - return this; - - }, - - subSelf: function ( v ) { - - this.x -= v.x; - this.y -= v.y; - - return this; - - }, - - multiplyScalar: function ( s ) { - - this.x *= s; - this.y *= s; - - return this; - - }, - - divideScalar: function ( s ) { - - if ( s ) { - - this.x /= s; - this.y /= s; - - } else { - - this.set( 0, 0 ); - - } - - return this; - - }, - - - negate: function() { - - return this.multiplyScalar( -1 ); - - }, - - dot: function ( v ) { - - return this.x * v.x + this.y * v.y; - - }, - - lengthSq: function () { - - return this.x * this.x + this.y * this.y; - - }, - - length: function () { - - return Math.sqrt( this.lengthSq() ); - - }, - - normalize: function () { - - return this.divideScalar( this.length() ); - - }, - - distanceTo: function ( v ) { - - return Math.sqrt( this.distanceToSquared( v ) ); - - }, - - distanceToSquared: function ( v ) { - - var dx = this.x - v.x, dy = this.y - v.y; - return dx * dx + dy * dy; - - }, - - - setLength: function ( l ) { - - return this.normalize().multiplyScalar( l ); - - }, - - equals: function( v ) { - - return ( ( v.x === this.x ) && ( v.y === this.y ) ); - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author kile / http://kile.stravaganza.org/ - * @author philogb / http://blog.thejit.org/ - * @author mikael emtinger / http://gomo.se/ - * @author egraether / http://egraether.com/ - */ - -THREE.Vector3 = function ( x, y, z ) { - - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - -}; - - -THREE.Vector3.prototype = { - - constructor: THREE.Vector3, - - set: function ( x, y, z ) { - - this.x = x; - this.y = y; - this.z = z; - - return this; - - }, - - setX: function ( x ) { - - this.x = x; - - return this; - - }, - - setY: function ( y ) { - - this.y = y; - - return this; - - }, - - setZ: function ( z ) { - - this.z = z; - - return this; - - }, - - copy: function ( v ) { - - this.x = v.x; - this.y = v.y; - this.z = v.z; - - return this; - - }, - - clone: function () { - - return new THREE.Vector3( this.x, this.y, this.z ); - - }, - - - add: function ( v1, v2 ) { - - this.x = v1.x + v2.x; - this.y = v1.y + v2.y; - this.z = v1.z + v2.z; - - return this; - - }, - - addSelf: function ( v ) { - - this.x += v.x; - this.y += v.y; - this.z += v.z; - - return this; - - }, - - addScalar: function ( s ) { - - this.x += s; - this.y += s; - this.z += s; - - return this; - - }, - - sub: function ( v1, v2 ) { - - this.x = v1.x - v2.x; - this.y = v1.y - v2.y; - this.z = v1.z - v2.z; - - return this; - - }, - - subSelf: function ( v ) { - - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - - return this; - - }, - - multiply: function ( a, b ) { - - this.x = a.x * b.x; - this.y = a.y * b.y; - this.z = a.z * b.z; - - return this; - - }, - - multiplySelf: function ( v ) { - - this.x *= v.x; - this.y *= v.y; - this.z *= v.z; - - return this; - - }, - - multiplyScalar: function ( s ) { - - this.x *= s; - this.y *= s; - this.z *= s; - - return this; - - }, - - divideSelf: function ( v ) { - - this.x /= v.x; - this.y /= v.y; - this.z /= v.z; - - return this; - - }, - - divideScalar: function ( s ) { - - if ( s ) { - - this.x /= s; - this.y /= s; - this.z /= s; - - } else { - - this.x = 0; - this.y = 0; - this.z = 0; - - } - - return this; - - }, - - - negate: function() { - - return this.multiplyScalar( -1 ); - - }, - - dot: function ( v ) { - - return this.x * v.x + this.y * v.y + this.z * v.z; - - }, - - lengthSq: function () { - - return this.x * this.x + this.y * this.y + this.z * this.z; - - }, - - length: function () { - - return Math.sqrt( this.lengthSq() ); - - }, - - lengthManhattan: function () { - - // correct version - // return Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ); - - return this.x + this.y + this.z; - - }, - - normalize: function () { - - return this.divideScalar( this.length() ); - - }, - - setLength: function ( l ) { - - return this.normalize().multiplyScalar( l ); - - }, - - - cross: function ( a, b ) { - - this.x = a.y * b.z - a.z * b.y; - this.y = a.z * b.x - a.x * b.z; - this.z = a.x * b.y - a.y * b.x; - - return this; - - }, - - crossSelf: function ( v ) { - - var x = this.x, y = this.y, z = this.z; - - this.x = y * v.z - z * v.y; - this.y = z * v.x - x * v.z; - this.z = x * v.y - y * v.x; - - return this; - - }, - - - distanceTo: function ( v ) { - - return Math.sqrt( this.distanceToSquared( v ) ); - - }, - - distanceToSquared: function ( v ) { - - return new THREE.Vector3().sub( this, v ).lengthSq(); - - }, - - - setPositionFromMatrix: function ( m ) { - - this.x = m.n14; - this.y = m.n24; - this.z = m.n34; - - }, - - setRotationFromMatrix: function ( m ) { - - var cosY = Math.cos( this.y ); - - this.y = Math.asin( m.n13 ); - - if ( Math.abs( cosY ) > 0.00001 ) { - - this.x = Math.atan2( - m.n23 / cosY, m.n33 / cosY ); - this.z = Math.atan2( - m.n12 / cosY, m.n11 / cosY ); - - } else { - - this.x = 0; - this.z = Math.atan2( m.n21, m.n22 ); - - } - - }, - - isZero: function () { - - return ( this.lengthSq() < 0.0001 /* almostZero */ ); - - } - -}; -/** - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author philogb / http://blog.thejit.org/ - * @author mikael emtinger / http://gomo.se/ - * @author egraether / http://egraether.com/ - */ - -THREE.Vector4 = function ( x, y, z, w ) { - - this.x = x || 0; - this.y = y || 0; - this.z = z || 0; - this.w = ( w !== undefined ) ? w : 1; - -}; - -THREE.Vector4.prototype = { - - constructor: THREE.Vector4, - - set: function ( x, y, z, w ) { - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - - }, - - copy: function ( v ) { - - this.x = v.x; - this.y = v.y; - this.z = v.z; - this.w = ( v.w !== undefined ) ? v.w : 1; - - }, - - clone: function () { - - return new THREE.Vector4( this.x, this.y, this.z, this.w ); - - }, - - - add: function ( v1, v2 ) { - - this.x = v1.x + v2.x; - this.y = v1.y + v2.y; - this.z = v1.z + v2.z; - this.w = v1.w + v2.w; - - return this; - - }, - - addSelf: function ( v ) { - - this.x += v.x; - this.y += v.y; - this.z += v.z; - this.w += v.w; - - return this; - - }, - - sub: function ( v1, v2 ) { - - this.x = v1.x - v2.x; - this.y = v1.y - v2.y; - this.z = v1.z - v2.z; - this.w = v1.w - v2.w; - - return this; - - }, - - subSelf: function ( v ) { - - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - this.w -= v.w; - - return this; - - }, - - multiplyScalar: function ( s ) { - - this.x *= s; - this.y *= s; - this.z *= s; - this.w *= s; - - return this; - - }, - - divideScalar: function ( s ) { - - if ( s ) { - - this.x /= s; - this.y /= s; - this.z /= s; - this.w /= s; - - } else { - - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 1; - - } - - return this; - - }, - - - negate: function() { - - return this.multiplyScalar( -1 ); - - }, - - dot: function ( v ) { - - return this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w; - - }, - - lengthSq: function () { - - return this.dot( this ); - - }, - - length: function () { - - return Math.sqrt( this.lengthSq() ); - - }, - - normalize: function () { - - return this.divideScalar( this.length() ); - - }, - - setLength: function ( l ) { - - return this.normalize().multiplyScalar( l ); - - }, - - - lerpSelf: function ( v, alpha ) { - - this.x += ( v.x - this.x ) * alpha; - this.y += ( v.y - this.y ) * alpha; - this.z += ( v.z - this.z ) * alpha; - this.w += ( v.w - this.w ) * alpha; - - return this; - - } - -}; -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Frustum = function ( ) { - - this.planes = [ - - new THREE.Vector4(), - new THREE.Vector4(), - new THREE.Vector4(), - new THREE.Vector4(), - new THREE.Vector4(), - new THREE.Vector4() - - ]; - -}; - -THREE.Frustum.prototype.setFromMatrix = function ( m ) { - - var i, plane, - planes = this.planes; - - planes[ 0 ].set( m.n41 - m.n11, m.n42 - m.n12, m.n43 - m.n13, m.n44 - m.n14 ); - planes[ 1 ].set( m.n41 + m.n11, m.n42 + m.n12, m.n43 + m.n13, m.n44 + m.n14 ); - planes[ 2 ].set( m.n41 + m.n21, m.n42 + m.n22, m.n43 + m.n23, m.n44 + m.n24 ); - planes[ 3 ].set( m.n41 - m.n21, m.n42 - m.n22, m.n43 - m.n23, m.n44 - m.n24 ); - planes[ 4 ].set( m.n41 - m.n31, m.n42 - m.n32, m.n43 - m.n33, m.n44 - m.n34 ); - planes[ 5 ].set( m.n41 + m.n31, m.n42 + m.n32, m.n43 + m.n33, m.n44 + m.n34 ); - - for ( i = 0; i < 6; i ++ ) { - - plane = planes[ i ]; - plane.divideScalar( Math.sqrt( plane.x * plane.x + plane.y * plane.y + plane.z * plane.z ) ); - - } - -}; - -THREE.Frustum.prototype.contains = function ( object ) { - - var distance, - planes = this.planes, - matrix = object.matrixWorld, - scale = THREE.Frustum.__v1.set( matrix.getColumnX().length(), matrix.getColumnY().length(), matrix.getColumnZ().length() ), - radius = - object.geometry.boundingSphere.radius * Math.max( scale.x, Math.max( scale.y, scale.z ) ); - - for ( var i = 0; i < 6; i ++ ) { - - distance = planes[ i ].x * matrix.n14 + planes[ i ].y * matrix.n24 + planes[ i ].z * matrix.n34 + planes[ i ].w; - if ( distance <= radius ) return false; - - } - - return true; - -}; - -THREE.Frustum.__v1 = new THREE.Vector3(); -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.Ray = function ( origin, direction ) { - - this.origin = origin || new THREE.Vector3(); - this.direction = direction || new THREE.Vector3(); - - this.intersectScene = function ( scene ) { - - return this.intersectObjects( scene.children ); - - }; - - this.intersectObjects = function ( objects ) { - - var i, l, object, - intersects = []; - - for ( i = 0, l = objects.length; i < l; i ++ ) { - - Array.prototype.push.apply( intersects, this.intersectObject( objects[ i ] ) ); - - } - - intersects.sort( function ( a, b ) { return a.distance - b.distance; } ); - - return intersects; - - }; - - var a = new THREE.Vector3(); - var b = new THREE.Vector3(); - var c = new THREE.Vector3(); - var d = new THREE.Vector3(); - - var originCopy = new THREE.Vector3(); - var directionCopy = new THREE.Vector3(); - - var vector = new THREE.Vector3(); - var normal = new THREE.Vector3(); - var intersectPoint = new THREE.Vector3() - - this.intersectObject = function ( object ) { - - var intersect, intersects = []; - - for ( var i = 0, l = object.children.length; i < l; i ++ ) { - - Array.prototype.push.apply( intersects, this.intersectObject( object.children[ i ] ) ); - - } - - if ( object instanceof THREE.Particle ) { - - var distance = distanceFromIntersection( this.origin, this.direction, object.matrixWorld.getPosition() ); - - if ( distance > object.scale.x ) { - - return []; - - } - - intersect = { - - distance: distance, - point: object.position, - face: null, - object: object - - }; - - intersects.push( intersect ); - - } else if ( object instanceof THREE.Mesh ) { - - // Checking boundingSphere - - var distance = distanceFromIntersection( this.origin, this.direction, object.matrixWorld.getPosition() ); - var scale = THREE.Frustum.__v1.set( object.matrixWorld.getColumnX().length(), object.matrixWorld.getColumnY().length(), object.matrixWorld.getColumnZ().length() ); - - if ( distance > object.geometry.boundingSphere.radius * Math.max( scale.x, Math.max( scale.y, scale.z ) ) ) { - - return intersects; - - } - - // Checking faces - - var f, fl, face, dot, scalar, - geometry = object.geometry, - vertices = geometry.vertices, - objMatrix; - - object.matrixRotationWorld.extractRotation( object.matrixWorld ); - - for ( f = 0, fl = geometry.faces.length; f < fl; f ++ ) { - - face = geometry.faces[ f ]; - - originCopy.copy( this.origin ); - directionCopy.copy( this.direction ); - - objMatrix = object.matrixWorld; - - // determine if ray intersects the plane of the face - // note: this works regardless of the direction of the face normal - - vector = objMatrix.multiplyVector3( vector.copy( face.centroid ) ).subSelf( originCopy ); - normal = object.matrixRotationWorld.multiplyVector3( normal.copy( face.normal ) ); - dot = directionCopy.dot( normal ); - - // bail if ray and plane are parallel - - if ( Math.abs( dot ) < 0.0001 ) continue; - - // calc distance to plane - - scalar = normal.dot( vector ) / dot; - - // if negative distance, then plane is behind ray - - if ( scalar < 0 ) continue; - - if ( object.doubleSided || ( object.flipSided ? dot > 0 : dot < 0 ) ) { - - intersectPoint.add( originCopy, directionCopy.multiplyScalar( scalar ) ); - - if ( face instanceof THREE.Face3 ) { - - a = objMatrix.multiplyVector3( a.copy( vertices[ face.a ].position ) ); - b = objMatrix.multiplyVector3( b.copy( vertices[ face.b ].position ) ); - c = objMatrix.multiplyVector3( c.copy( vertices[ face.c ].position ) ); - - if ( pointInFace3( intersectPoint, a, b, c ) ) { - - intersect = { - - distance: originCopy.distanceTo( intersectPoint ), - point: intersectPoint.clone(), - face: face, - object: object - - }; - - intersects.push( intersect ); - - } - - } else if ( face instanceof THREE.Face4 ) { - - a = objMatrix.multiplyVector3( a.copy( vertices[ face.a ].position ) ); - b = objMatrix.multiplyVector3( b.copy( vertices[ face.b ].position ) ); - c = objMatrix.multiplyVector3( c.copy( vertices[ face.c ].position ) ); - d = objMatrix.multiplyVector3( d.copy( vertices[ face.d ].position ) ); - - if ( pointInFace3( intersectPoint, a, b, d ) || pointInFace3( intersectPoint, b, c, d ) ) { - - intersect = { - - distance: originCopy.distanceTo( intersectPoint ), - point: intersectPoint.clone(), - face: face, - object: object - - }; - - intersects.push( intersect ); - - } - - } - - } - - } - - } - - return intersects; - - } - - var v0 = new THREE.Vector3(), v1 = new THREE.Vector3(), v2 = new THREE.Vector3(); - var dot, intersect, distance; - - function distanceFromIntersection( origin, direction, position ) { - - v0.sub( position, origin ); - dot = v0.dot( direction ); - - intersect = v1.add( origin, v2.copy( direction ).multiplyScalar( dot ) ); - distance = position.distanceTo( intersect ); - - return distance; - - } - - // http://www.blackpawn.com/texts/pointinpoly/default.html - - var dot00, dot01, dot02, dot11, dot12, invDenom, u, v; - - function pointInFace3( p, a, b, c ) { - - v0.sub( c, a ); - v1.sub( b, a ); - v2.sub( p, a ); - - dot00 = v0.dot( v0 ); - dot01 = v0.dot( v1 ); - dot02 = v0.dot( v2 ); - dot11 = v1.dot( v1 ); - dot12 = v1.dot( v2 ); - - invDenom = 1 / ( dot00 * dot11 - dot01 * dot01 ); - u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom; - v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom; - - return ( u >= 0 ) && ( v >= 0 ) && ( u + v < 1 ); - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.Rectangle = function () { - - var _left, _top, _right, _bottom, - _width, _height, _isEmpty = true; - - function resize() { - - _width = _right - _left; - _height = _bottom - _top; - - } - - this.getX = function () { - - return _left; - - }; - - this.getY = function () { - - return _top; - - }; - - this.getWidth = function () { - - return _width; - - }; - - this.getHeight = function () { - - return _height; - - }; - - this.getLeft = function() { - - return _left; - - }; - - this.getTop = function() { - - return _top; - - }; - - this.getRight = function() { - - return _right; - - }; - - this.getBottom = function() { - - return _bottom; - - }; - - this.set = function ( left, top, right, bottom ) { - - _isEmpty = false; - - _left = left; _top = top; - _right = right; _bottom = bottom; - - resize(); - - }; - - this.addPoint = function ( x, y ) { - - if ( _isEmpty ) { - - _isEmpty = false; - _left = x; _top = y; - _right = x; _bottom = y; - - resize(); - - } else { - - _left = _left < x ? _left : x; // Math.min( _left, x ); - _top = _top < y ? _top : y; // Math.min( _top, y ); - _right = _right > x ? _right : x; // Math.max( _right, x ); - _bottom = _bottom > y ? _bottom : y; // Math.max( _bottom, y ); - - resize(); - } - - }; - - this.add3Points = function ( x1, y1, x2, y2, x3, y3 ) { - - if (_isEmpty) { - - _isEmpty = false; - _left = x1 < x2 ? ( x1 < x3 ? x1 : x3 ) : ( x2 < x3 ? x2 : x3 ); - _top = y1 < y2 ? ( y1 < y3 ? y1 : y3 ) : ( y2 < y3 ? y2 : y3 ); - _right = x1 > x2 ? ( x1 > x3 ? x1 : x3 ) : ( x2 > x3 ? x2 : x3 ); - _bottom = y1 > y2 ? ( y1 > y3 ? y1 : y3 ) : ( y2 > y3 ? y2 : y3 ); - - resize(); - - } else { - - _left = x1 < x2 ? ( x1 < x3 ? ( x1 < _left ? x1 : _left ) : ( x3 < _left ? x3 : _left ) ) : ( x2 < x3 ? ( x2 < _left ? x2 : _left ) : ( x3 < _left ? x3 : _left ) ); - _top = y1 < y2 ? ( y1 < y3 ? ( y1 < _top ? y1 : _top ) : ( y3 < _top ? y3 : _top ) ) : ( y2 < y3 ? ( y2 < _top ? y2 : _top ) : ( y3 < _top ? y3 : _top ) ); - _right = x1 > x2 ? ( x1 > x3 ? ( x1 > _right ? x1 : _right ) : ( x3 > _right ? x3 : _right ) ) : ( x2 > x3 ? ( x2 > _right ? x2 : _right ) : ( x3 > _right ? x3 : _right ) ); - _bottom = y1 > y2 ? ( y1 > y3 ? ( y1 > _bottom ? y1 : _bottom ) : ( y3 > _bottom ? y3 : _bottom ) ) : ( y2 > y3 ? ( y2 > _bottom ? y2 : _bottom ) : ( y3 > _bottom ? y3 : _bottom ) ); - - resize(); - - }; - - }; - - this.addRectangle = function ( r ) { - - if ( _isEmpty ) { - - _isEmpty = false; - _left = r.getLeft(); _top = r.getTop(); - _right = r.getRight(); _bottom = r.getBottom(); - - resize(); - - } else { - - _left = _left < r.getLeft() ? _left : r.getLeft(); // Math.min(_left, r.getLeft() ); - _top = _top < r.getTop() ? _top : r.getTop(); // Math.min(_top, r.getTop() ); - _right = _right > r.getRight() ? _right : r.getRight(); // Math.max(_right, r.getRight() ); - _bottom = _bottom > r.getBottom() ? _bottom : r.getBottom(); // Math.max(_bottom, r.getBottom() ); - - resize(); - - } - - }; - - this.inflate = function ( v ) { - - _left -= v; _top -= v; - _right += v; _bottom += v; - - resize(); - - }; - - this.minSelf = function ( r ) { - - _left = _left > r.getLeft() ? _left : r.getLeft(); // Math.max( _left, r.getLeft() ); - _top = _top > r.getTop() ? _top : r.getTop(); // Math.max( _top, r.getTop() ); - _right = _right < r.getRight() ? _right : r.getRight(); // Math.min( _right, r.getRight() ); - _bottom = _bottom < r.getBottom() ? _bottom : r.getBottom(); // Math.min( _bottom, r.getBottom() ); - - resize(); - - }; - - this.intersects = function ( r ) { - - // http://gamemath.com/2011/09/detecting-whether-two-boxes-overlap/ - - if ( _right < r.getLeft() ) return false; - if ( _left > r.getRight() ) return false; - if ( _bottom < r.getTop() ) return false; - if ( _top > r.getBottom() ) return false; - - return true; - - }; - - this.empty = function () { - - _isEmpty = true; - - _left = 0; _top = 0; - _right = 0; _bottom = 0; - - resize(); - - }; - - this.isEmpty = function () { - - return _isEmpty; - - }; - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Math = { - - // Clamp value to range - - clamp: function ( x, a, b ) { - - return ( x < a ) ? a : ( ( x > b ) ? b : x ); - - }, - - // Clamp value to range to range - - mapLinear: function ( x, a1, a2, b1, b2 ) { - - return b1 + ( x - a1 ) * ( b2 - b1 ) / ( a2 - a1 ); - - }, - - // Random float from <0, 1> with 16 bits of randomness - // (standard Math.random() creates repetitive patterns when applied over larger space) - - random16: function () { - - return ( 65280 * Math.random() + 255 * Math.random() ) / 65535; - - }, - - // Random integer from interval - - randInt: function ( low, high ) { - - return low + Math.floor( Math.random() * ( high - low + 1 ) ); - - }, - - // Random float from interval - - randFloat: function ( low, high ) { - - return low + Math.random() * ( high - low ); - - }, - - // Random float from <-range/2, range/2> interval - - randFloatSpread: function ( range ) { - - return range * ( 0.5 - Math.random() ); - - } - -}; -THREE.Matrix3 = function () { - - this.m = []; - -}; - -THREE.Matrix3.prototype = { - - constructor: THREE.Matrix3, - - transpose: function () { - - var tmp, m = this.m; - - tmp = m[1]; m[1] = m[3]; m[3] = tmp; - tmp = m[2]; m[2] = m[6]; m[6] = tmp; - tmp = m[5]; m[5] = m[7]; m[7] = tmp; - - return this; - - }, - - transposeIntoArray: function ( r ) { - - var m = this.m; - - r[ 0 ] = m[ 0 ]; - r[ 1 ] = m[ 3 ]; - r[ 2 ] = m[ 6 ]; - r[ 3 ] = m[ 1 ]; - r[ 4 ] = m[ 4 ]; - r[ 5 ] = m[ 7 ]; - r[ 6 ] = m[ 2 ]; - r[ 7 ] = m[ 5 ]; - r[ 8 ] = m[ 8 ]; - - return this; - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author philogb / http://blog.thejit.org/ - * @author jordi_ros / http://plattsoft.com - * @author D1plo1d / http://github.com/D1plo1d - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author timknip / http://www.floorplanner.com/ - */ - -THREE.Matrix4 = function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { - - this.set( - - ( n11 !== undefined ) ? n11 : 1, n12 || 0, n13 || 0, n14 || 0, - n21 || 0, ( n22 !== undefined ) ? n22 : 1, n23 || 0, n24 || 0, - n31 || 0, n32 || 0, ( n33 !== undefined ) ? n33 : 1, n34 || 0, - n41 || 0, n42 || 0, n43 || 0, ( n44 !== undefined ) ? n44 : 1 - - ); - - this.flat = new Array( 16 ); - this.m33 = new THREE.Matrix3(); - -}; - -THREE.Matrix4.prototype = { - - constructor: THREE.Matrix4, - - set: function ( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) { - - this.n11 = n11; this.n12 = n12; this.n13 = n13; this.n14 = n14; - this.n21 = n21; this.n22 = n22; this.n23 = n23; this.n24 = n24; - this.n31 = n31; this.n32 = n32; this.n33 = n33; this.n34 = n34; - this.n41 = n41; this.n42 = n42; this.n43 = n43; this.n44 = n44; - - return this; - - }, - - identity: function () { - - this.set( - - 1, 0, 0, 0, - 0, 1, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - copy: function ( m ) { - - this.set( - - m.n11, m.n12, m.n13, m.n14, - m.n21, m.n22, m.n23, m.n24, - m.n31, m.n32, m.n33, m.n34, - m.n41, m.n42, m.n43, m.n44 - - ); - - return this; - - }, - - lookAt: function ( eye, center, up ) { - - var x = THREE.Matrix4.__v1, y = THREE.Matrix4.__v2, z = THREE.Matrix4.__v3; - - z.sub( eye, center ).normalize(); - - if ( z.length() === 0 ) { - - z.z = 1; - - } - - x.cross( up, z ).normalize(); - - if ( x.length() === 0 ) { - - z.x += 0.0001; - x.cross( up, z ).normalize(); - - } - - y.cross( z, x ).normalize(); - - - this.n11 = x.x; this.n12 = y.x; this.n13 = z.x; - this.n21 = x.y; this.n22 = y.y; this.n23 = z.y; - this.n31 = x.z; this.n32 = y.z; this.n33 = z.z; - - return this; - - }, - - multiply: function ( a, b ) { - - var a11 = a.n11, a12 = a.n12, a13 = a.n13, a14 = a.n14, - a21 = a.n21, a22 = a.n22, a23 = a.n23, a24 = a.n24, - a31 = a.n31, a32 = a.n32, a33 = a.n33, a34 = a.n34, - a41 = a.n41, a42 = a.n42, a43 = a.n43, a44 = a.n44, - - b11 = b.n11, b12 = b.n12, b13 = b.n13, b14 = b.n14, - b21 = b.n21, b22 = b.n22, b23 = b.n23, b24 = b.n24, - b31 = b.n31, b32 = b.n32, b33 = b.n33, b34 = b.n34, - b41 = b.n41, b42 = b.n42, b43 = b.n43, b44 = b.n44; - - this.n11 = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41; - this.n12 = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42; - this.n13 = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43; - this.n14 = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44; - - this.n21 = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41; - this.n22 = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42; - this.n23 = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43; - this.n24 = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44; - - this.n31 = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41; - this.n32 = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42; - this.n33 = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43; - this.n34 = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44; - - this.n41 = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41; - this.n42 = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42; - this.n43 = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43; - this.n44 = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44; - - return this; - - }, - - multiplySelf: function ( m ) { - - return this.multiply( this, m ); - - }, - - multiplyToArray: function ( a, b, r ) { - - this.multiply( a, b ); - - r[ 0 ] = this.n11; r[ 1 ] = this.n21; r[ 2 ] = this.n31; r[ 3 ] = this.n41; - r[ 4 ] = this.n12; r[ 5 ] = this.n22; r[ 6 ] = this.n32; r[ 7 ] = this.n42; - r[ 8 ] = this.n13; r[ 9 ] = this.n23; r[ 10 ] = this.n33; r[ 11 ] = this.n43; - r[ 12 ] = this.n14; r[ 13 ] = this.n24; r[ 14 ] = this.n34; r[ 15 ] = this.n44; - - return this; - - }, - - multiplyScalar: function ( s ) { - - this.n11 *= s; this.n12 *= s; this.n13 *= s; this.n14 *= s; - this.n21 *= s; this.n22 *= s; this.n23 *= s; this.n24 *= s; - this.n31 *= s; this.n32 *= s; this.n33 *= s; this.n34 *= s; - this.n41 *= s; this.n42 *= s; this.n43 *= s; this.n44 *= s; - - return this; - - }, - - multiplyVector3: function ( v ) { - - var vx = v.x, vy = v.y, vz = v.z, - d = 1 / ( this.n41 * vx + this.n42 * vy + this.n43 * vz + this.n44 ); - - v.x = ( this.n11 * vx + this.n12 * vy + this.n13 * vz + this.n14 ) * d; - v.y = ( this.n21 * vx + this.n22 * vy + this.n23 * vz + this.n24 ) * d; - v.z = ( this.n31 * vx + this.n32 * vy + this.n33 * vz + this.n34 ) * d; - - return v; - - }, - - multiplyVector4: function ( v ) { - - var vx = v.x, vy = v.y, vz = v.z, vw = v.w; - - v.x = this.n11 * vx + this.n12 * vy + this.n13 * vz + this.n14 * vw; - v.y = this.n21 * vx + this.n22 * vy + this.n23 * vz + this.n24 * vw; - v.z = this.n31 * vx + this.n32 * vy + this.n33 * vz + this.n34 * vw; - v.w = this.n41 * vx + this.n42 * vy + this.n43 * vz + this.n44 * vw; - - return v; - - }, - - rotateAxis: function ( v ) { - - var vx = v.x, vy = v.y, vz = v.z; - - v.x = vx * this.n11 + vy * this.n12 + vz * this.n13; - v.y = vx * this.n21 + vy * this.n22 + vz * this.n23; - v.z = vx * this.n31 + vy * this.n32 + vz * this.n33; - - v.normalize(); - - return v; - - }, - - crossVector: function ( a ) { - - var v = new THREE.Vector4(); - - v.x = this.n11 * a.x + this.n12 * a.y + this.n13 * a.z + this.n14 * a.w; - v.y = this.n21 * a.x + this.n22 * a.y + this.n23 * a.z + this.n24 * a.w; - v.z = this.n31 * a.x + this.n32 * a.y + this.n33 * a.z + this.n34 * a.w; - - v.w = ( a.w ) ? this.n41 * a.x + this.n42 * a.y + this.n43 * a.z + this.n44 * a.w : 1; - - return v; - - }, - - determinant: function () { - - var n11 = this.n11, n12 = this.n12, n13 = this.n13, n14 = this.n14, - n21 = this.n21, n22 = this.n22, n23 = this.n23, n24 = this.n24, - n31 = this.n31, n32 = this.n32, n33 = this.n33, n34 = this.n34, - n41 = this.n41, n42 = this.n42, n43 = this.n43, n44 = this.n44; - - //TODO: make this more efficient - //( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm ) - return ( - n14 * n23 * n32 * n41- - n13 * n24 * n32 * n41- - n14 * n22 * n33 * n41+ - n12 * n24 * n33 * n41+ - - n13 * n22 * n34 * n41- - n12 * n23 * n34 * n41- - n14 * n23 * n31 * n42+ - n13 * n24 * n31 * n42+ - - n14 * n21 * n33 * n42- - n11 * n24 * n33 * n42- - n13 * n21 * n34 * n42+ - n11 * n23 * n34 * n42+ - - n14 * n22 * n31 * n43- - n12 * n24 * n31 * n43- - n14 * n21 * n32 * n43+ - n11 * n24 * n32 * n43+ - - n12 * n21 * n34 * n43- - n11 * n22 * n34 * n43- - n13 * n22 * n31 * n44+ - n12 * n23 * n31 * n44+ - - n13 * n21 * n32 * n44- - n11 * n23 * n32 * n44- - n12 * n21 * n33 * n44+ - n11 * n22 * n33 * n44 - ); - - }, - - transpose: function () { - - var tmp; - - tmp = this.n21; this.n21 = this.n12; this.n12 = tmp; - tmp = this.n31; this.n31 = this.n13; this.n13 = tmp; - tmp = this.n32; this.n32 = this.n23; this.n23 = tmp; - - tmp = this.n41; this.n41 = this.n14; this.n14 = tmp; - tmp = this.n42; this.n42 = this.n24; this.n24 = tmp; - tmp = this.n43; this.n43 = this.n34; this.n34 = tmp; - - return this; - - }, - - clone: function () { - - var m = new THREE.Matrix4(); - - m.n11 = this.n11; m.n12 = this.n12; m.n13 = this.n13; m.n14 = this.n14; - m.n21 = this.n21; m.n22 = this.n22; m.n23 = this.n23; m.n24 = this.n24; - m.n31 = this.n31; m.n32 = this.n32; m.n33 = this.n33; m.n34 = this.n34; - m.n41 = this.n41; m.n42 = this.n42; m.n43 = this.n43; m.n44 = this.n44; - - return m; - - }, - - flatten: function () { - - this.flat[ 0 ] = this.n11; this.flat[ 1 ] = this.n21; this.flat[ 2 ] = this.n31; this.flat[ 3 ] = this.n41; - this.flat[ 4 ] = this.n12; this.flat[ 5 ] = this.n22; this.flat[ 6 ] = this.n32; this.flat[ 7 ] = this.n42; - this.flat[ 8 ] = this.n13; this.flat[ 9 ] = this.n23; this.flat[ 10 ] = this.n33; this.flat[ 11 ] = this.n43; - this.flat[ 12 ] = this.n14; this.flat[ 13 ] = this.n24; this.flat[ 14 ] = this.n34; this.flat[ 15 ] = this.n44; - - return this.flat; - - }, - - flattenToArray: function ( flat ) { - - flat[ 0 ] = this.n11; flat[ 1 ] = this.n21; flat[ 2 ] = this.n31; flat[ 3 ] = this.n41; - flat[ 4 ] = this.n12; flat[ 5 ] = this.n22; flat[ 6 ] = this.n32; flat[ 7 ] = this.n42; - flat[ 8 ] = this.n13; flat[ 9 ] = this.n23; flat[ 10 ] = this.n33; flat[ 11 ] = this.n43; - flat[ 12 ] = this.n14; flat[ 13 ] = this.n24; flat[ 14 ] = this.n34; flat[ 15 ] = this.n44; - - return flat; - - }, - - flattenToArrayOffset: function( flat, offset ) { - - flat[ offset ] = this.n11; - flat[ offset + 1 ] = this.n21; - flat[ offset + 2 ] = this.n31; - flat[ offset + 3 ] = this.n41; - - flat[ offset + 4 ] = this.n12; - flat[ offset + 5 ] = this.n22; - flat[ offset + 6 ] = this.n32; - flat[ offset + 7 ] = this.n42; - - flat[ offset + 8 ] = this.n13; - flat[ offset + 9 ] = this.n23; - flat[ offset + 10 ] = this.n33; - flat[ offset + 11 ] = this.n43; - - flat[ offset + 12 ] = this.n14; - flat[ offset + 13 ] = this.n24; - flat[ offset + 14 ] = this.n34; - flat[ offset + 15 ] = this.n44; - - return flat; - - }, - - setTranslation: function( x, y, z ) { - - this.set( - - 1, 0, 0, x, - 0, 1, 0, y, - 0, 0, 1, z, - 0, 0, 0, 1 - - ); - - return this; - - }, - - setScale: function ( x, y, z ) { - - this.set( - - x, 0, 0, 0, - 0, y, 0, 0, - 0, 0, z, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - setRotationX: function ( theta ) { - - var c = Math.cos( theta ), s = Math.sin( theta ); - - this.set( - - 1, 0, 0, 0, - 0, c, -s, 0, - 0, s, c, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - setRotationY: function( theta ) { - - var c = Math.cos( theta ), s = Math.sin( theta ); - - this.set( - - c, 0, s, 0, - 0, 1, 0, 0, - -s, 0, c, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - setRotationZ: function( theta ) { - - var c = Math.cos( theta ), s = Math.sin( theta ); - - this.set( - - c, -s, 0, 0, - s, c, 0, 0, - 0, 0, 1, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - setRotationAxis: function( axis, angle ) { - - // Based on http://www.gamedev.net/reference/articles/article1199.asp - - var c = Math.cos( angle ), - s = Math.sin( angle ), - t = 1 - c, - x = axis.x, y = axis.y, z = axis.z, - tx = t * x, ty = t * y; - - this.set( - - tx * x + c, tx * y - s * z, tx * z + s * y, 0, - tx * y + s * z, ty * y + c, ty * z - s * x, 0, - tx * z - s * y, ty * z + s * x, t * z * z + c, 0, - 0, 0, 0, 1 - - ); - - return this; - - }, - - setPosition: function ( v ) { - - this.n14 = v.x; - this.n24 = v.y; - this.n34 = v.z; - - return this; - - }, - - getPosition: function () { - - return THREE.Matrix4.__v1.set( this.n14, this.n24, this.n34 ); - - }, - - getColumnX: function () { - - return THREE.Matrix4.__v1.set( this.n11, this.n21, this.n31 ); - - }, - - getColumnY: function () { - - return THREE.Matrix4.__v1.set( this.n12, this.n22, this.n32 ); - - }, - - getColumnZ: function() { - - return THREE.Matrix4.__v1.set( this.n13, this.n23, this.n33 ); - - }, - - getInverse: function ( m ) { - - // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm - - var n11 = m.n11, n12 = m.n12, n13 = m.n13, n14 = m.n14, - n21 = m.n21, n22 = m.n22, n23 = m.n23, n24 = m.n24, - n31 = m.n31, n32 = m.n32, n33 = m.n33, n34 = m.n34, - n41 = m.n41, n42 = m.n42, n43 = m.n43, n44 = m.n44; - - this.n11 = n23*n34*n42 - n24*n33*n42 + n24*n32*n43 - n22*n34*n43 - n23*n32*n44 + n22*n33*n44; - this.n12 = n14*n33*n42 - n13*n34*n42 - n14*n32*n43 + n12*n34*n43 + n13*n32*n44 - n12*n33*n44; - this.n13 = n13*n24*n42 - n14*n23*n42 + n14*n22*n43 - n12*n24*n43 - n13*n22*n44 + n12*n23*n44; - this.n14 = n14*n23*n32 - n13*n24*n32 - n14*n22*n33 + n12*n24*n33 + n13*n22*n34 - n12*n23*n34; - this.n21 = n24*n33*n41 - n23*n34*n41 - n24*n31*n43 + n21*n34*n43 + n23*n31*n44 - n21*n33*n44; - this.n22 = n13*n34*n41 - n14*n33*n41 + n14*n31*n43 - n11*n34*n43 - n13*n31*n44 + n11*n33*n44; - this.n23 = n14*n23*n41 - n13*n24*n41 - n14*n21*n43 + n11*n24*n43 + n13*n21*n44 - n11*n23*n44; - this.n24 = n13*n24*n31 - n14*n23*n31 + n14*n21*n33 - n11*n24*n33 - n13*n21*n34 + n11*n23*n34; - this.n31 = n22*n34*n41 - n24*n32*n41 + n24*n31*n42 - n21*n34*n42 - n22*n31*n44 + n21*n32*n44; - this.n32 = n14*n32*n41 - n12*n34*n41 - n14*n31*n42 + n11*n34*n42 + n12*n31*n44 - n11*n32*n44; - this.n33 = n12*n24*n41 - n14*n22*n41 + n14*n21*n42 - n11*n24*n42 - n12*n21*n44 + n11*n22*n44; - this.n34 = n14*n22*n31 - n12*n24*n31 - n14*n21*n32 + n11*n24*n32 + n12*n21*n34 - n11*n22*n34; - this.n41 = n23*n32*n41 - n22*n33*n41 - n23*n31*n42 + n21*n33*n42 + n22*n31*n43 - n21*n32*n43; - this.n42 = n12*n33*n41 - n13*n32*n41 + n13*n31*n42 - n11*n33*n42 - n12*n31*n43 + n11*n32*n43; - this.n43 = n13*n22*n41 - n12*n23*n41 - n13*n21*n42 + n11*n23*n42 + n12*n21*n43 - n11*n22*n43; - this.n44 = n12*n23*n31 - n13*n22*n31 + n13*n21*n32 - n11*n23*n32 - n12*n21*n33 + n11*n22*n33; - this.multiplyScalar( 1 / m.determinant() ); - - return this; - - }, - - setRotationFromEuler: function( v, order ) { - - var x = v.x, y = v.y, z = v.z, - a = Math.cos( x ), b = Math.sin( x ), - c = Math.cos( y ), d = Math.sin( y ), - e = Math.cos( z ), f = Math.sin( z ); - - switch ( order ) { - - case 'YXZ': - - var ce = c * e, cf = c * f, de = d * e, df = d * f; - - this.n11 = ce + df * b; - this.n12 = de * b - cf; - this.n13 = a * d; - - this.n21 = a * f; - this.n22 = a * e; - this.n23 = - b; - - this.n31 = cf * b - de; - this.n32 = df + ce * b; - this.n33 = a * c; - break; - - case 'ZXY': - - var ce = c * e, cf = c * f, de = d * e, df = d * f; - - this.n11 = ce - df * b; - this.n12 = - a * f; - this.n13 = de + cf * b; - - this.n21 = cf + de * b; - this.n22 = a * e; - this.n23 = df - ce * b; - - this.n31 = - a * d; - this.n32 = b; - this.n33 = a * c; - break; - - case 'ZYX': - - var ae = a * e, af = a * f, be = b * e, bf = b * f; - - this.n11 = c * e; - this.n12 = be * d - af; - this.n13 = ae * d + bf; - - this.n21 = c * f; - this.n22 = bf * d + ae; - this.n23 = af * d - be; - - this.n31 = - d; - this.n32 = b * c; - this.n33 = a * c; - break; - - case 'YZX': - - var ac = a * c, ad = a * d, bc = b * c, bd = b * d; - - this.n11 = c * e; - this.n12 = bd - ac * f; - this.n13 = bc * f + ad; - - this.n21 = f; - this.n22 = a * e; - this.n23 = - b * e; - - this.n31 = - d * e; - this.n32 = ad * f + bc; - this.n33 = ac - bd * f; - break; - - case 'XZY': - - var ac = a * c, ad = a * d, bc = b * c, bd = b * d; - - this.n11 = c * e; - this.n12 = - f; - this.n13 = d * e; - - this.n21 = ac * f + bd; - this.n22 = a * e; - this.n23 = ad * f - bc; - - this.n31 = bc * f - ad; - this.n32 = b * e; - this.n33 = bd * f + ac; - break; - - default: // 'XYZ' - - var ae = a * e, af = a * f, be = b * e, bf = b * f; - - this.n11 = c * e; - this.n12 = - c * f; - this.n13 = d; - - this.n21 = af + be * d; - this.n22 = ae - bf * d; - this.n23 = - b * c; - - this.n31 = bf - ae * d; - this.n32 = be + af * d; - this.n33 = a * c; - break; - - } - - return this; - - }, - - - setRotationFromQuaternion: function( q ) { - - var x = q.x, y = q.y, z = q.z, w = q.w, - x2 = x + x, y2 = y + y, z2 = z + z, - xx = x * x2, xy = x * y2, xz = x * z2, - yy = y * y2, yz = y * z2, zz = z * z2, - wx = w * x2, wy = w * y2, wz = w * z2; - - this.n11 = 1 - ( yy + zz ); - this.n12 = xy - wz; - this.n13 = xz + wy; - - this.n21 = xy + wz; - this.n22 = 1 - ( xx + zz ); - this.n23 = yz - wx; - - this.n31 = xz - wy; - this.n32 = yz + wx; - this.n33 = 1 - ( xx + yy ); - - return this; - - }, - - scale: function ( v ) { - - var x = v.x, y = v.y, z = v.z; - - this.n11 *= x; this.n12 *= y; this.n13 *= z; - this.n21 *= x; this.n22 *= y; this.n23 *= z; - this.n31 *= x; this.n32 *= y; this.n33 *= z; - this.n41 *= x; this.n42 *= y; this.n43 *= z; - - return this; - - }, - - compose: function ( translation, rotation, scale ) { - - var mRotation = THREE.Matrix4.__m1; - var mScale = THREE.Matrix4.__m2; - - mRotation.identity(); - mRotation.setRotationFromQuaternion( rotation ); - - mScale.setScale( scale.x, scale.y, scale.z ); - - this.multiply( mRotation, mScale ); - - this.n14 = translation.x; - this.n24 = translation.y; - this.n34 = translation.z; - - return this; - - }, - - decompose: function ( translation, rotation, scale ) { - - // grab the axis vectors - - var x = THREE.Matrix4.__v1; - var y = THREE.Matrix4.__v2; - var z = THREE.Matrix4.__v3; - - x.set( this.n11, this.n21, this.n31 ); - y.set( this.n12, this.n22, this.n32 ); - z.set( this.n13, this.n23, this.n33 ); - - translation = ( translation instanceof THREE.Vector3 ) ? translation : new THREE.Vector3(); - rotation = ( rotation instanceof THREE.Quaternion ) ? rotation : new THREE.Quaternion(); - scale = ( scale instanceof THREE.Vector3 ) ? scale : new THREE.Vector3(); - - scale.x = x.length(); - scale.y = y.length(); - scale.z = z.length(); - - translation.x = this.n14; - translation.y = this.n24; - translation.z = this.n34; - - // scale the rotation part - - var matrix = THREE.Matrix4.__m1; - - matrix.copy( this ); - - matrix.n11 /= scale.x; - matrix.n21 /= scale.x; - matrix.n31 /= scale.x; - - matrix.n12 /= scale.y; - matrix.n22 /= scale.y; - matrix.n32 /= scale.y; - - matrix.n13 /= scale.z; - matrix.n23 /= scale.z; - matrix.n33 /= scale.z; - - rotation.setFromRotationMatrix( matrix ); - - return [ translation, rotation, scale ]; - - }, - - extractPosition: function ( m ) { - - this.n14 = m.n14; - this.n24 = m.n24; - this.n34 = m.n34; - - return this; - - }, - - extractRotation: function ( m ) { - - var vector = THREE.Matrix4.__v1; - - var scaleX = 1 / vector.set( m.n11, m.n21, m.n31 ).length(); - var scaleY = 1 / vector.set( m.n12, m.n22, m.n32 ).length(); - var scaleZ = 1 / vector.set( m.n13, m.n23, m.n33 ).length(); - - this.n11 = m.n11 * scaleX; - this.n21 = m.n21 * scaleX; - this.n31 = m.n31 * scaleX; - - this.n12 = m.n12 * scaleY; - this.n22 = m.n22 * scaleY; - this.n32 = m.n32 * scaleY; - - this.n13 = m.n13 * scaleZ; - this.n23 = m.n23 * scaleZ; - this.n33 = m.n33 * scaleZ; - - return this; - - }, - - rotateByAxis: function ( axis, angle ) { - - // optimize by checking axis - if ( axis.x === 1 && axis.y === 0 && axis.z === 0 ) { - - return this.rotateX( angle ); - - } else if ( axis.x === 0 && axis.y === 1 && axis.z === 0 ) { - - return this.rotateY( angle ); - - } else if ( axis.x === 0 && axis.y === 0 && axis.z === 1 ) { - - return this.rotateZ( angle ); - - } - - var x = axis.x, - y = axis.y, - z = axis.z, - n = Math.sqrt(x * x + y * y + z * z); - - x /= n; - y /= n; - z /= n; - - var xx = x * x, - yy = y * y, - zz = z * z, - c = Math.cos(angle), - s = Math.sin(angle), - oneMinusCosine = 1 - c, - xy = x * y * oneMinusCosine, - xz = x * z * oneMinusCosine, - yz = y * z * oneMinusCosine, - xs = x * s, - ys = y * s, - zs = z * s, - - r11 = xx + (1 - xx) * c, - r21 = xy + zs, - r31 = xz - ys, - r12 = xy - zs, - r22 = yy + (1 - yy) * c, - r32 = yz + xs, - r13 = xz + ys, - r23 = yz - xs, - r33 = zz + (1 - zz) * c, - - m11 = this.n11, - m21 = this.n21, - m31 = this.n31, - m41 = this.n41, - m12 = this.n12, - m22 = this.n22, - m32 = this.n32, - m42 = this.n42, - m13 = this.n13, - m23 = this.n23, - m33 = this.n33, - m43 = this.n43, - m14 = this.n14, - m24 = this.n24, - m34 = this.n34, - m44 = this.n44; - - this.n11 = r11 * m11 + r21 * m12 + r31 * m13; - this.n21 = r11 * m21 + r21 * m22 + r31 * m23; - this.n31 = r11 * m31 + r21 * m32 + r31 * m33; - this.n41 = r11 * m41 + r21 * m42 + r31 * m43; - - this.n12 = r12 * m11 + r22 * m12 + r32 * m13; - this.n22 = r12 * m21 + r22 * m22 + r32 * m23; - this.n32 = r12 * m31 + r22 * m32 + r32 * m33; - this.n42 = r12 * m41 + r22 * m42 + r32 * m43; - - this.n13 = r13 * m11 + r23 * m12 + r33 * m13; - this.n23 = r13 * m21 + r23 * m22 + r33 * m23; - this.n33 = r13 * m31 + r23 * m32 + r33 * m33; - this.n43 = r13 * m41 + r23 * m42 + r33 * m43; - - return this; - - }, - - rotateX: function ( angle ) { - - var m12 = this.n12, - m22 = this.n22, - m32 = this.n32, - m42 = this.n42, - m13 = this.n13, - m23 = this.n23, - m33 = this.n33, - m43 = this.n43, - c = Math.cos(angle), - s = Math.sin(angle); - - this.n12 = c * m12 + s * m13; - this.n22 = c * m22 + s * m23; - this.n32 = c * m32 + s * m33; - this.n42 = c * m42 + s * m43; - - this.n13 = c * m13 - s * m12; - this.n23 = c * m23 - s * m22; - this.n33 = c * m33 - s * m32; - this.n43 = c * m43 - s * m42; - - return this; - - }, - - rotateY: function ( angle ) { - - var m11 = this.n11, - m21 = this.n21, - m31 = this.n31, - m41 = this.n41, - m13 = this.n13, - m23 = this.n23, - m33 = this.n33, - m43 = this.n43, - c = Math.cos(angle), - s = Math.sin(angle); - - this.n11 = c * m11 - s * m13; - this.n21 = c * m21 - s * m23; - this.n31 = c * m31 - s * m33; - this.n41 = c * m41 - s * m43; - - this.n13 = c * m13 + s * m11; - this.n23 = c * m23 + s * m21; - this.n33 = c * m33 + s * m31; - this.n43 = c * m43 + s * m41; - - return this; - - }, - - rotateZ: function ( angle ) { - - var m11 = this.n11, - m21 = this.n21, - m31 = this.n31, - m41 = this.n41, - m12 = this.n12, - m22 = this.n22, - m32 = this.n32, - m42 = this.n42, - c = Math.cos(angle), - s = Math.sin(angle); - - this.n11 = c * m11 + s * m12; - this.n21 = c * m21 + s * m22; - this.n31 = c * m31 + s * m32; - this.n41 = c * m41 + s * m42; - - this.n12 = c * m12 - s * m11; - this.n22 = c * m22 - s * m21; - this.n32 = c * m32 - s * m31; - this.n42 = c * m42 - s * m41; - - return this; - - }, - - translate: function ( v ) { - - var x = v.x, y = v.y, z = v.z; - - this.n14 = this.n11 * x + this.n12 * y + this.n13 * z + this.n14; - this.n24 = this.n21 * x + this.n22 * y + this.n23 * z + this.n24; - this.n34 = this.n31 * x + this.n32 * y + this.n33 * z + this.n34; - this.n44 = this.n41 * x + this.n42 * y + this.n43 * z + this.n44; - - return this; - - } - -}; - -THREE.Matrix4.makeInvert3x3 = function ( m1 ) { - - // input: THREE.Matrix4, output: THREE.Matrix3 - // ( based on http://code.google.com/p/webgl-mjs/ ) - - var m33 = m1.m33, m33m = m33.m, - a11 = m1.n33 * m1.n22 - m1.n32 * m1.n23, - a21 = - m1.n33 * m1.n21 + m1.n31 * m1.n23, - a31 = m1.n32 * m1.n21 - m1.n31 * m1.n22, - a12 = - m1.n33 * m1.n12 + m1.n32 * m1.n13, - a22 = m1.n33 * m1.n11 - m1.n31 * m1.n13, - a32 = - m1.n32 * m1.n11 + m1.n31 * m1.n12, - a13 = m1.n23 * m1.n12 - m1.n22 * m1.n13, - a23 = - m1.n23 * m1.n11 + m1.n21 * m1.n13, - a33 = m1.n22 * m1.n11 - m1.n21 * m1.n12, - - det = m1.n11 * a11 + m1.n21 * a12 + m1.n31 * a13, - - idet; - - // no inverse - - if ( det === 0 ) { - - return null; - - } - - idet = 1.0 / det; - - m33m[ 0 ] = idet * a11; m33m[ 1 ] = idet * a21; m33m[ 2 ] = idet * a31; - m33m[ 3 ] = idet * a12; m33m[ 4 ] = idet * a22; m33m[ 5 ] = idet * a32; - m33m[ 6 ] = idet * a13; m33m[ 7 ] = idet * a23; m33m[ 8 ] = idet * a33; - - return m33; - -} - -THREE.Matrix4.makeFrustum = function ( left, right, bottom, top, near, far ) { - - var m, x, y, a, b, c, d; - - m = new THREE.Matrix4(); - - x = 2 * near / ( right - left ); - y = 2 * near / ( top - bottom ); - - a = ( right + left ) / ( right - left ); - b = ( top + bottom ) / ( top - bottom ); - c = - ( far + near ) / ( far - near ); - d = - 2 * far * near / ( far - near ); - - m.n11 = x; m.n12 = 0; m.n13 = a; m.n14 = 0; - m.n21 = 0; m.n22 = y; m.n23 = b; m.n24 = 0; - m.n31 = 0; m.n32 = 0; m.n33 = c; m.n34 = d; - m.n41 = 0; m.n42 = 0; m.n43 = - 1; m.n44 = 0; - - return m; - -}; - -THREE.Matrix4.makePerspective = function ( fov, aspect, near, far ) { - - var ymax, ymin, xmin, xmax; - - ymax = near * Math.tan( fov * Math.PI / 360 ); - ymin = - ymax; - xmin = ymin * aspect; - xmax = ymax * aspect; - - return THREE.Matrix4.makeFrustum( xmin, xmax, ymin, ymax, near, far ); - -}; - -THREE.Matrix4.makeOrtho = function ( left, right, top, bottom, near, far ) { - - var m, x, y, z, w, h, p; - - m = new THREE.Matrix4(); - - w = right - left; - h = top - bottom; - p = far - near; - - x = ( right + left ) / w; - y = ( top + bottom ) / h; - z = ( far + near ) / p; - - m.n11 = 2 / w; m.n12 = 0; m.n13 = 0; m.n14 = -x; - m.n21 = 0; m.n22 = 2 / h; m.n23 = 0; m.n24 = -y; - m.n31 = 0; m.n32 = 0; m.n33 = -2 / p; m.n34 = -z; - m.n41 = 0; m.n42 = 0; m.n43 = 0; m.n44 = 1; - - return m; - -}; - -THREE.Matrix4.__v1 = new THREE.Vector3(); -THREE.Matrix4.__v2 = new THREE.Vector3(); -THREE.Matrix4.__v3 = new THREE.Vector3(); - -THREE.Matrix4.__m1 = new THREE.Matrix4(); -THREE.Matrix4.__m2 = new THREE.Matrix4(); -/** - * @author mr.doob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Object3D = function () { - - this.name = ''; - - this.id = THREE.Object3DCount ++; - - this.parent = undefined; - this.children = []; - - this.up = new THREE.Vector3( 0, 1, 0 ); - - this.position = new THREE.Vector3(); - this.rotation = new THREE.Vector3(); - this.eulerOrder = 'XYZ'; - this.scale = new THREE.Vector3( 1, 1, 1 ); - - this.dynamic = false; // when true it retains arrays so they can be updated with __dirty* - - this.doubleSided = false; - this.flipSided = false; - - this.renderDepth = null; - - this.rotationAutoUpdate = true; - - this.matrix = new THREE.Matrix4(); - this.matrixWorld = new THREE.Matrix4(); - this.matrixRotationWorld = new THREE.Matrix4(); - - this.matrixAutoUpdate = true; - this.matrixWorldNeedsUpdate = true; - - this.quaternion = new THREE.Quaternion(); - this.useQuaternion = false; - - this.boundRadius = 0.0; - this.boundRadiusScale = 1.0; - - this.visible = true; - - this.castShadow = false; - this.receiveShadow = false; - - this.frustumCulled = true; - - this._vector = new THREE.Vector3(); - -}; - - -THREE.Object3D.prototype = { - - constructor: THREE.Object3D, - - translate: function ( distance, axis ) { - - this.matrix.rotateAxis( axis ); - this.position.addSelf( axis.multiplyScalar( distance ) ); - - }, - - translateX: function ( distance ) { - - this.translate( distance, this._vector.set( 1, 0, 0 ) ); - - }, - - translateY: function ( distance ) { - - this.translate( distance, this._vector.set( 0, 1, 0 ) ); - - }, - - translateZ: function ( distance ) { - - this.translate( distance, this._vector.set( 0, 0, 1 ) ); - - }, - - lookAt: function ( vector ) { - - // TODO: Add hierarchy support. - - this.matrix.lookAt( vector, this.position, this.up ); - - if ( this.rotationAutoUpdate ) { - - this.rotation.setRotationFromMatrix( this.matrix ); - - } - - }, - - add: function ( object ) { - - if ( this.children.indexOf( object ) === - 1 ) { - - if ( object.parent !== undefined ) { - - object.parent.remove( object ); - - } - - object.parent = this; - this.children.push( object ); - - // add to scene - - var scene = this; - - while ( scene.parent !== undefined ) { - - scene = scene.parent; - - } - - if ( scene !== undefined && scene instanceof THREE.Scene ) { - - scene.addObject( object ); - - } - - } - - }, - - remove: function ( object ) { - - var index = this.children.indexOf( object ); - - if ( index !== - 1 ) { - - object.parent = undefined; - this.children.splice( index, 1 ); - - // remove from scene - - var scene = this; - - while ( scene.parent !== undefined ) { - - scene = scene.parent; - - } - - if ( scene !== undefined && scene instanceof THREE.Scene ) { - - scene.removeObject( object ); - - } - - } - - }, - - getChildByName: function ( name, doRecurse ) { - - var c, cl, child, recurseResult; - - for ( c = 0, cl = this.children.length; c < cl; c ++ ) { - - child = this.children[ c ]; - - if ( child.name === name ) { - - return child; - - } - - if ( doRecurse ) { - - recurseResult = child.getChildByName( name, doRecurse ); - - if ( recurseResult !== undefined ) { - - return recurseResult; - - } - - } - - } - - return undefined; - - }, - - updateMatrix: function () { - - this.matrix.setPosition( this.position ); - - if ( this.useQuaternion ) { - - this.matrix.setRotationFromQuaternion( this.quaternion ); - - } else { - - this.matrix.setRotationFromEuler( this.rotation, this.eulerOrder ); - - } - - if ( this.scale.x !== 1 || this.scale.y !== 1 || this.scale.z !== 1 ) { - - this.matrix.scale( this.scale ); - this.boundRadiusScale = Math.max( this.scale.x, Math.max( this.scale.y, this.scale.z ) ); - - } - - this.matrixWorldNeedsUpdate = true; - - }, - - updateMatrixWorld: function ( force ) { - - this.matrixAutoUpdate && this.updateMatrix(); - - // update matrixWorld - - if ( this.matrixWorldNeedsUpdate || force ) { - - if ( this.parent ) { - - this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix ); - - } else { - - this.matrixWorld.copy( this.matrix ); - - } - - this.matrixWorldNeedsUpdate = false; - - force = true; - - } - - // update children - - for ( var i = 0, l = this.children.length; i < l; i ++ ) { - - this.children[ i ].updateMatrixWorld( force ); - - } - - } - -}; - -THREE.Object3DCount = 0; -/** - * @author mr.doob / http://mrdoob.com/ - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author julianwa / https://github.com/julianwa - */ - -THREE.Projector = function() { - - var _object, _objectCount, _objectPool = [], - _vertex, _vertexCount, _vertexPool = [], - _face, _face3Count, _face3Pool = [], _face4Count, _face4Pool = [], - _line, _lineCount, _linePool = [], - _particle, _particleCount, _particlePool = [], - - _renderData = { objects: [], sprites: [], lights: [], elements: [] }, - - _vector3 = new THREE.Vector3(), - _vector4 = new THREE.Vector4(), - - _projScreenMatrix = new THREE.Matrix4(), - _projScreenobjectMatrixWorld = new THREE.Matrix4(), - - _frustum = new THREE.Frustum(), - - _clippedVertex1PositionScreen = new THREE.Vector4(), - _clippedVertex2PositionScreen = new THREE.Vector4(), - - _face3VertexNormals; - - this.projectVector = function ( vector, camera ) { - - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - _projScreenMatrix.multiply( camera.projectionMatrix, camera.matrixWorldInverse ); - _projScreenMatrix.multiplyVector3( vector ); - - return vector; - - }; - - this.unprojectVector = function ( vector, camera ) { - - camera.projectionMatrixInverse.getInverse( camera.projectionMatrix ); - - _projScreenMatrix.multiply( camera.matrixWorld, camera.projectionMatrixInverse ); - _projScreenMatrix.multiplyVector3( vector ); - - return vector; - - }; - - /** - * Translates a 2D point from NDC to a THREE.Ray - * that can be used for picking. - * @vector - THREE.Vector3 that represents 2D point - * @camera - THREE.Camera - */ - this.pickingRay = function ( vector, camera ) { - - var end, ray, t; - - // set two vectors with opposing z values - vector.z = -1.0; - end = new THREE.Vector3( vector.x, vector.y, 1.0 ); - - this.unprojectVector( vector, camera ); - this.unprojectVector( end, camera ); - - // find direction from vector to end - end.subSelf( vector ).normalize(); - - return new THREE.Ray( vector, end ); - - }; - - this.projectGraph = function ( root, sort ) { - - _objectCount = 0; - - _renderData.objects.length = 0; - _renderData.sprites.length = 0; - _renderData.lights.length = 0; - - var projectObject = function ( object ) { - - if ( object.visible === false ) return; - - if ( ( object instanceof THREE.Mesh || object instanceof THREE.Line ) && - ( object.frustumCulled === false || _frustum.contains( object ) ) ) { - - _projScreenMatrix.multiplyVector3( _vector3.copy( object.position ) ); - - _object = getNextObjectInPool(); - _object.object = object; - _object.z = _vector3.z; - - _renderData.objects.push( _object ); - - } else if ( object instanceof THREE.Sprite || object instanceof THREE.Particle ) { - - _projScreenMatrix.multiplyVector3( _vector3.copy( object.position ) ); - - _object = getNextObjectInPool(); - _object.object = object; - _object.z = _vector3.z; - - _renderData.sprites.push( _object ); - - } else if ( object instanceof THREE.Light ) { - - _renderData.lights.push( object ); - - } - - for ( var c = 0, cl = object.children.length; c < cl; c ++ ) { - - projectObject( object.children[ c ] ); - - } - - }; - - projectObject( root ); - - sort && _renderData.objects.sort( painterSort ); - - return _renderData; - - }; - - this.projectScene = function ( scene, camera, sort ) { - - var near = camera.near, far = camera.far, - o, ol, v, vl, f, fl, n, nl, c, cl, u, ul, object, - objectMatrixWorld, objectMatrixWorldRotation, objectMaterial, - geometry, geometryMaterials, vertices, vertex, vertexPositionScreen, - faces, face, faceVertexNormals, normal, faceVertexUvs, uvs, - v1, v2, v3, v4; - - _face3Count = 0; - _face4Count = 0; - _lineCount = 0; - _particleCount = 0; - - _renderData.elements.length = 0; - - if ( camera.parent === undefined ) { - - console.warn( 'DEPRECATED: Camera hasn\'t been added to a Scene. Adding it...' ); - scene.add( camera ); - - } - - scene.updateMatrixWorld(); - - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - _projScreenMatrix.multiply( camera.projectionMatrix, camera.matrixWorldInverse ); - - _frustum.setFromMatrix( _projScreenMatrix ); - - _renderData = this.projectGraph( scene, false ); - - for ( o = 0, ol = _renderData.objects.length; o < ol; o++ ) { - - object = _renderData.objects[ o ].object; - - objectMatrixWorld = object.matrixWorld; - objectMaterial = object.material; - - _vertexCount = 0; - - if ( object instanceof THREE.Mesh ) { - - geometry = object.geometry; - geometryMaterials = object.geometry.materials; - vertices = geometry.vertices; - faces = geometry.faces; - faceVertexUvs = geometry.faceVertexUvs; - - objectMatrixWorldRotation = object.matrixRotationWorld.extractRotation( objectMatrixWorld ); - - for ( v = 0, vl = vertices.length; v < vl; v ++ ) { - - _vertex = getNextVertexInPool(); - _vertex.positionWorld.copy( vertices[ v ].position ); - - objectMatrixWorld.multiplyVector3( _vertex.positionWorld ); - - _vertex.positionScreen.copy( _vertex.positionWorld ); - _projScreenMatrix.multiplyVector4( _vertex.positionScreen ); - - _vertex.positionScreen.x /= _vertex.positionScreen.w; - _vertex.positionScreen.y /= _vertex.positionScreen.w; - - _vertex.visible = _vertex.positionScreen.z > near && _vertex.positionScreen.z < far; - - } - - for ( f = 0, fl = faces.length; f < fl; f ++ ) { - - face = faces[ f ]; - - if ( face instanceof THREE.Face3 ) { - - v1 = _vertexPool[ face.a ]; - v2 = _vertexPool[ face.b ]; - v3 = _vertexPool[ face.c ]; - - if ( v1.visible && v2.visible && v3.visible && - ( object.doubleSided || ( object.flipSided != - ( v3.positionScreen.x - v1.positionScreen.x ) * ( v2.positionScreen.y - v1.positionScreen.y ) - - ( v3.positionScreen.y - v1.positionScreen.y ) * ( v2.positionScreen.x - v1.positionScreen.x ) < 0 ) ) ) { - - _face = getNextFace3InPool(); - - _face.v1.copy( v1 ); - _face.v2.copy( v2 ); - _face.v3.copy( v3 ); - - } else { - - continue; - - } - - } else if ( face instanceof THREE.Face4 ) { - - v1 = _vertexPool[ face.a ]; - v2 = _vertexPool[ face.b ]; - v3 = _vertexPool[ face.c ]; - v4 = _vertexPool[ face.d ]; - - if ( v1.visible && v2.visible && v3.visible && v4.visible && - ( object.doubleSided || ( object.flipSided != - ( ( v4.positionScreen.x - v1.positionScreen.x ) * ( v2.positionScreen.y - v1.positionScreen.y ) - - ( v4.positionScreen.y - v1.positionScreen.y ) * ( v2.positionScreen.x - v1.positionScreen.x ) < 0 || - ( v2.positionScreen.x - v3.positionScreen.x ) * ( v4.positionScreen.y - v3.positionScreen.y ) - - ( v2.positionScreen.y - v3.positionScreen.y ) * ( v4.positionScreen.x - v3.positionScreen.x ) < 0 ) ) ) ) { - - _face = getNextFace4InPool(); - - _face.v1.copy( v1 ); - _face.v2.copy( v2 ); - _face.v3.copy( v3 ); - _face.v4.copy( v4 ); - - } else { - - continue; - - } - - } - - _face.normalWorld.copy( face.normal ); - objectMatrixWorldRotation.multiplyVector3( _face.normalWorld ); - - _face.centroidWorld.copy( face.centroid ); - objectMatrixWorld.multiplyVector3( _face.centroidWorld ); - - _face.centroidScreen.copy( _face.centroidWorld ); - _projScreenMatrix.multiplyVector3( _face.centroidScreen ); - - faceVertexNormals = face.vertexNormals; - - for ( n = 0, nl = faceVertexNormals.length; n < nl; n ++ ) { - - normal = _face.vertexNormalsWorld[ n ]; - normal.copy( faceVertexNormals[ n ] ); - objectMatrixWorldRotation.multiplyVector3( normal ); - - } - - for ( c = 0, cl = faceVertexUvs.length; c < cl; c ++ ) { - - uvs = faceVertexUvs[ c ][ f ]; - - if ( !uvs ) continue; - - for ( u = 0, ul = uvs.length; u < ul; u ++ ) { - - _face.uvs[ c ][ u ] = uvs[ u ]; - - } - - } - - _face.material = objectMaterial; - _face.faceMaterial = face.materialIndex !== null ? geometryMaterials[ face.materialIndex ] : null; - - _face.z = _face.centroidScreen.z; - - _renderData.elements.push( _face ); - - } - - } else if ( object instanceof THREE.Line ) { - - _projScreenobjectMatrixWorld.multiply( _projScreenMatrix, objectMatrixWorld ); - - vertices = object.geometry.vertices; - - v1 = getNextVertexInPool(); - v1.positionScreen.copy( vertices[ 0 ].position ); - _projScreenobjectMatrixWorld.multiplyVector4( v1.positionScreen ); - - for ( v = 1, vl = vertices.length; v < vl; v++ ) { - - v1 = getNextVertexInPool(); - v1.positionScreen.copy( vertices[ v ].position ); - _projScreenobjectMatrixWorld.multiplyVector4( v1.positionScreen ); - - v2 = _vertexPool[ _vertexCount - 2 ]; - - _clippedVertex1PositionScreen.copy( v1.positionScreen ); - _clippedVertex2PositionScreen.copy( v2.positionScreen ); - - if ( clipLine( _clippedVertex1PositionScreen, _clippedVertex2PositionScreen ) ) { - - // Perform the perspective divide - _clippedVertex1PositionScreen.multiplyScalar( 1 / _clippedVertex1PositionScreen.w ); - _clippedVertex2PositionScreen.multiplyScalar( 1 / _clippedVertex2PositionScreen.w ); - - _line = getNextLineInPool(); - _line.v1.positionScreen.copy( _clippedVertex1PositionScreen ); - _line.v2.positionScreen.copy( _clippedVertex2PositionScreen ); - - _line.z = Math.max( _clippedVertex1PositionScreen.z, _clippedVertex2PositionScreen.z ); - - _line.material = objectMaterial; - - _renderData.elements.push( _line ); - - } - - } - - } - - } - - for ( o = 0, ol = _renderData.sprites.length; o < ol; o++ ) { - - object = _renderData.sprites[ o ].object; - - objectMatrixWorld = object.matrixWorld; - - if ( object instanceof THREE.Particle ) { - - _vector4.set( objectMatrixWorld.n14, objectMatrixWorld.n24, objectMatrixWorld.n34, 1 ); - _projScreenMatrix.multiplyVector4( _vector4 ); - - _vector4.z /= _vector4.w; - - if ( _vector4.z > 0 && _vector4.z < 1 ) { - - _particle = getNextParticleInPool(); - _particle.x = _vector4.x / _vector4.w; - _particle.y = _vector4.y / _vector4.w; - _particle.z = _vector4.z; - - _particle.rotation = object.rotation.z; - - _particle.scale.x = object.scale.x * Math.abs( _particle.x - ( _vector4.x + camera.projectionMatrix.n11 ) / ( _vector4.w + camera.projectionMatrix.n14 ) ); - _particle.scale.y = object.scale.y * Math.abs( _particle.y - ( _vector4.y + camera.projectionMatrix.n22 ) / ( _vector4.w + camera.projectionMatrix.n24 ) ); - - _particle.material = object.material; - - _renderData.elements.push( _particle ); - - } - - } - - } - - sort && _renderData.elements.sort( painterSort ); - - return _renderData; - - }; - - // Pools - - function getNextObjectInPool() { - - var object = _objectPool[ _objectCount ] = _objectPool[ _objectCount ] || new THREE.RenderableObject(); - - _objectCount ++; - - return object; - - } - - function getNextVertexInPool() { - - var vertex = _vertexPool[ _vertexCount ] = _vertexPool[ _vertexCount ] || new THREE.RenderableVertex(); - - _vertexCount ++; - - return vertex; - - } - - function getNextFace3InPool() { - - var face = _face3Pool[ _face3Count ] = _face3Pool[ _face3Count ] || new THREE.RenderableFace3(); - - _face3Count ++; - - return face; - - } - - function getNextFace4InPool() { - - var face = _face4Pool[ _face4Count ] = _face4Pool[ _face4Count ] || new THREE.RenderableFace4(); - - _face4Count ++; - - return face; - - } - - function getNextLineInPool() { - - var line = _linePool[ _lineCount ] = _linePool[ _lineCount ] || new THREE.RenderableLine(); - - _lineCount ++; - - return line; - - } - - function getNextParticleInPool() { - - var particle = _particlePool[ _particleCount ] = _particlePool[ _particleCount ] || new THREE.RenderableParticle(); - _particleCount ++; - return particle; - - } - - // - - function painterSort( a, b ) { - - return b.z - a.z; - - } - - function clipLine( s1, s2 ) { - - var alpha1 = 0, alpha2 = 1, - - // Calculate the boundary coordinate of each vertex for the near and far clip planes, - // Z = -1 and Z = +1, respectively. - bc1near = s1.z + s1.w, - bc2near = s2.z + s2.w, - bc1far = - s1.z + s1.w, - bc2far = - s2.z + s2.w; - - if ( bc1near >= 0 && bc2near >= 0 && bc1far >= 0 && bc2far >= 0 ) { - - // Both vertices lie entirely within all clip planes. - return true; - - } else if ( ( bc1near < 0 && bc2near < 0) || (bc1far < 0 && bc2far < 0 ) ) { - - // Both vertices lie entirely outside one of the clip planes. - return false; - - } else { - - // The line segment spans at least one clip plane. - - if ( bc1near < 0 ) { - - // v1 lies outside the near plane, v2 inside - alpha1 = Math.max( alpha1, bc1near / ( bc1near - bc2near ) ); - - } else if ( bc2near < 0 ) { - - // v2 lies outside the near plane, v1 inside - alpha2 = Math.min( alpha2, bc1near / ( bc1near - bc2near ) ); - - } - - if ( bc1far < 0 ) { - - // v1 lies outside the far plane, v2 inside - alpha1 = Math.max( alpha1, bc1far / ( bc1far - bc2far ) ); - - } else if ( bc2far < 0 ) { - - // v2 lies outside the far plane, v2 inside - alpha2 = Math.min( alpha2, bc1far / ( bc1far - bc2far ) ); - - } - - if ( alpha2 < alpha1 ) { - - // The line segment spans two boundaries, but is outside both of them. - // (This can't happen when we're only clipping against just near/far but good - // to leave the check here for future usage if other clip planes are added.) - return false; - - } else { - - // Update the s1 and s2 vertices to match the clipped line segment. - s1.lerpSelf( s2, alpha1 ); - s2.lerpSelf( s1, 1 - alpha2 ); - - return true; - - } - - } - - } - -}; -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Quaternion = function( x, y, z, w ) { - - this.set( - - x || 0, - y || 0, - z || 0, - w !== undefined ? w : 1 - - ); - -}; - -THREE.Quaternion.prototype = { - - constructor: THREE.Quaternion, - - set: function ( x, y, z, w ) { - - this.x = x; - this.y = y; - this.z = z; - this.w = w; - - return this; - - }, - - copy: function ( q ) { - - this.x = q.x; - this.y = q.y; - this.z = q.z; - this.w = q.w; - - return this; - - }, - - setFromEuler: function ( vec3 ) { - - var c = Math.PI / 360, // 0.5 * Math.PI / 360, // 0.5 is an optimization - x = vec3.x * c, - y = vec3.y * c, - z = vec3.z * c, - - c1 = Math.cos( y ), - s1 = Math.sin( y ), - c2 = Math.cos( -z ), - s2 = Math.sin( -z ), - c3 = Math.cos( x ), - s3 = Math.sin( x ), - - c1c2 = c1 * c2, - s1s2 = s1 * s2; - - this.w = c1c2 * c3 - s1s2 * s3; - this.x = c1c2 * s3 + s1s2 * c3; - this.y = s1 * c2 * c3 + c1 * s2 * s3; - this.z = c1 * s2 * c3 - s1 * c2 * s3; - - return this; - - }, - - setFromAxisAngle: function ( axis, angle ) { - - // from http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm - // axis have to be normalized - - var halfAngle = angle / 2, - s = Math.sin( halfAngle ); - - this.x = axis.x * s; - this.y = axis.y * s; - this.z = axis.z * s; - this.w = Math.cos( halfAngle ); - - return this; - - }, - - setFromRotationMatrix: function ( m ) { - // Adapted from: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm - function copySign(a, b) { - return b < 0 ? -Math.abs(a) : Math.abs(a); - } - var absQ = Math.pow(m.determinant(), 1.0 / 3.0); - this.w = Math.sqrt( Math.max( 0, absQ + m.n11 + m.n22 + m.n33 ) ) / 2; - this.x = Math.sqrt( Math.max( 0, absQ + m.n11 - m.n22 - m.n33 ) ) / 2; - this.y = Math.sqrt( Math.max( 0, absQ - m.n11 + m.n22 - m.n33 ) ) / 2; - this.z = Math.sqrt( Math.max( 0, absQ - m.n11 - m.n22 + m.n33 ) ) / 2; - this.x = copySign( this.x, ( m.n32 - m.n23 ) ); - this.y = copySign( this.y, ( m.n13 - m.n31 ) ); - this.z = copySign( this.z, ( m.n21 - m.n12 ) ); - this.normalize(); - return this; - }, - - calculateW : function () { - - this.w = - Math.sqrt( Math.abs( 1.0 - this.x * this.x - this.y * this.y - this.z * this.z ) ); - - return this; - - }, - - inverse: function () { - - this.x *= -1; - this.y *= -1; - this.z *= -1; - - return this; - - }, - - length: function () { - - return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); - - }, - - normalize: function () { - - var l = Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w ); - - if ( l === 0 ) { - - this.x = 0; - this.y = 0; - this.z = 0; - this.w = 0; - - } else { - - l = 1 / l; - - this.x = this.x * l; - this.y = this.y * l; - this.z = this.z * l; - this.w = this.w * l; - - } - - return this; - - }, - - multiplySelf: function ( quat2 ) { - - var qax = this.x, qay = this.y, qaz = this.z, qaw = this.w, - qbx = quat2.x, qby = quat2.y, qbz = quat2.z, qbw = quat2.w; - - this.x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby; - this.y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz; - this.z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx; - this.w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz; - - return this; - - }, - - multiply: function ( q1, q2 ) { - - // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm - - this.x = q1.x * q2.w + q1.y * q2.z - q1.z * q2.y + q1.w * q2.x; - this.y = -q1.x * q2.z + q1.y * q2.w + q1.z * q2.x + q1.w * q2.y; - this.z = q1.x * q2.y - q1.y * q2.x + q1.z * q2.w + q1.w * q2.z; - this.w = -q1.x * q2.x - q1.y * q2.y - q1.z * q2.z + q1.w * q2.w; - - return this; - - }, - - multiplyVector3: function ( vec, dest ) { - - if( !dest ) { dest = vec; } - - var x = vec.x, y = vec.y, z = vec.z, - qx = this.x, qy = this.y, qz = this.z, qw = this.w; - - // calculate quat * vec - - var ix = qw * x + qy * z - qz * y, - iy = qw * y + qz * x - qx * z, - iz = qw * z + qx * y - qy * x, - iw = -qx * x - qy * y - qz * z; - - // calculate result * inverse quat - - dest.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; - dest.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; - dest.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; - - return dest; - - } - -} - -THREE.Quaternion.slerp = function ( qa, qb, qm, t ) { - - // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/ - - var cosHalfTheta = qa.w * qb.w + qa.x * qb.x + qa.y * qb.y + qa.z * qb.z; - - if (cosHalfTheta < 0) { - qm.w = -qb.w; qm.x = -qb.x; qm.y = -qb.y; qm.z = -qb.z; - cosHalfTheta = -cosHalfTheta; - } else { - qm.copy(qb); - } - - if ( Math.abs( cosHalfTheta ) >= 1.0 ) { - - qm.w = qa.w; qm.x = qa.x; qm.y = qa.y; qm.z = qa.z; - return qm; - - } - - var halfTheta = Math.acos( cosHalfTheta ), - sinHalfTheta = Math.sqrt( 1.0 - cosHalfTheta * cosHalfTheta ); - - if ( Math.abs( sinHalfTheta ) < 0.001 ) { - - qm.w = 0.5 * ( qa.w + qb.w ); - qm.x = 0.5 * ( qa.x + qb.x ); - qm.y = 0.5 * ( qa.y + qb.y ); - qm.z = 0.5 * ( qa.z + qb.z ); - - return qm; - - } - - var ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta, - ratioB = Math.sin( t * halfTheta ) / sinHalfTheta; - - qm.w = ( qa.w * ratioA + qm.w * ratioB ); - qm.x = ( qa.x * ratioA + qm.x * ratioB ); - qm.y = ( qa.y * ratioA + qm.y * ratioB ); - qm.z = ( qa.z * ratioA + qm.z * ratioB ); - - return qm; - -} -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.Vertex = function ( position ) { - - this.position = position || new THREE.Vector3(); - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Face3 = function ( a, b, c, normal, color, materialIndex ) { - - this.a = a; - this.b = b; - this.c = c; - - this.normal = normal instanceof THREE.Vector3 ? normal : new THREE.Vector3(); - this.vertexNormals = normal instanceof Array ? normal : [ ]; - - this.color = color instanceof THREE.Color ? color : new THREE.Color(); - this.vertexColors = color instanceof Array ? color : []; - - this.vertexTangents = []; - - this.materialIndex = materialIndex; - - this.centroid = new THREE.Vector3(); - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Face4 = function ( a, b, c, d, normal, color, materialIndex ) { - - this.a = a; - this.b = b; - this.c = c; - this.d = d; - - this.normal = normal instanceof THREE.Vector3 ? normal : new THREE.Vector3(); - this.vertexNormals = normal instanceof Array ? normal : [ ]; - - this.color = color instanceof THREE.Color ? color : new THREE.Color(); - this.vertexColors = color instanceof Array ? color : []; - - this.vertexTangents = []; - - this.materialIndex = materialIndex; - - this.centroid = new THREE.Vector3(); - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.UV = function ( u, v ) { - - this.u = u || 0; - this.v = v || 0; - -}; - -THREE.UV.prototype = { - - constructor: THREE.UV, - - set: function ( u, v ) { - - this.u = u; - this.v = v; - - return this; - - }, - - copy: function ( uv ) { - - this.u = uv.u; - this.v = uv.v; - - return this; - - }, - - clone: function () { - - return new THREE.UV( this.u, this.v ); - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author kile / http://kile.stravaganza.org/ - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - * @author zz85 / http://www.lab4games.net/zz85/blog - */ - -THREE.Geometry = function () { - - this.id = THREE.GeometryCount ++; - - this.vertices = []; - this.colors = []; // one-to-one vertex colors, used in ParticleSystem, Line and Ribbon - - this.materials = []; - - this.faces = []; - - this.faceUvs = [[]]; - this.faceVertexUvs = [[]]; - - this.morphTargets = []; - this.morphColors = []; - - this.skinWeights = []; - this.skinIndices = []; - - this.boundingBox = null; - this.boundingSphere = null; - - this.hasTangents = false; - - this.dynamic = false; // unless set to true the *Arrays will be deleted once sent to a buffer. - -}; - -THREE.Geometry.prototype = { - - constructor : THREE.Geometry, - - applyMatrix: function ( matrix ) { - - var matrixRotation = new THREE.Matrix4(); - matrixRotation.extractRotation( matrix, new THREE.Vector3( 1, 1, 1 ) ); - - for ( var i = 0, il = this.vertices.length; i < il; i ++ ) { - - var vertex = this.vertices[ i ]; - - matrix.multiplyVector3( vertex.position ); - - } - - for ( var i = 0, il = this.faces.length; i < il; i ++ ) { - - var face = this.faces[ i ]; - - matrixRotation.multiplyVector3( face.normal ); - - for ( var j = 0, jl = face.vertexNormals.length; j < jl; j ++ ) { - - matrixRotation.multiplyVector3( face.vertexNormals[ j ] ); - - } - - matrix.multiplyVector3( face.centroid ); - - } - - }, - - computeCentroids: function () { - - var f, fl, face; - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - face.centroid.set( 0, 0, 0 ); - - if ( face instanceof THREE.Face3 ) { - - face.centroid.addSelf( this.vertices[ face.a ].position ); - face.centroid.addSelf( this.vertices[ face.b ].position ); - face.centroid.addSelf( this.vertices[ face.c ].position ); - face.centroid.divideScalar( 3 ); - - } else if ( face instanceof THREE.Face4 ) { - - face.centroid.addSelf( this.vertices[ face.a ].position ); - face.centroid.addSelf( this.vertices[ face.b ].position ); - face.centroid.addSelf( this.vertices[ face.c ].position ); - face.centroid.addSelf( this.vertices[ face.d ].position ); - face.centroid.divideScalar( 4 ); - - } - - } - - }, - - computeFaceNormals: function () { - - var n, nl, v, vl, vertex, f, fl, face, vA, vB, vC, - cb = new THREE.Vector3(), ab = new THREE.Vector3(); - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - vA = this.vertices[ face.a ]; - vB = this.vertices[ face.b ]; - vC = this.vertices[ face.c ]; - - cb.sub( vC.position, vB.position ); - ab.sub( vA.position, vB.position ); - cb.crossSelf( ab ); - - if ( !cb.isZero() ) { - - cb.normalize(); - - } - - face.normal.copy( cb ); - - } - - }, - - computeVertexNormals: function () { - - var v, vl, f, fl, face, vertices; - - // create internal buffers for reuse when calling this method repeatedly - // (otherwise memory allocation / deallocation every frame is big resource hog) - - if ( this.__tmpVertices === undefined ) { - - this.__tmpVertices = new Array( this.vertices.length ); - vertices = this.__tmpVertices; - - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { - - vertices[ v ] = new THREE.Vector3(); - - } - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - if ( face instanceof THREE.Face3 ) { - - face.vertexNormals = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ]; - - } else if ( face instanceof THREE.Face4 ) { - - face.vertexNormals = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ]; - - } - - } - - } else { - - vertices = this.__tmpVertices; - - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { - - vertices[ v ].set( 0, 0, 0 ); - - } - - } - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - if ( face instanceof THREE.Face3 ) { - - vertices[ face.a ].addSelf( face.normal ); - vertices[ face.b ].addSelf( face.normal ); - vertices[ face.c ].addSelf( face.normal ); - - } else if ( face instanceof THREE.Face4 ) { - - vertices[ face.a ].addSelf( face.normal ); - vertices[ face.b ].addSelf( face.normal ); - vertices[ face.c ].addSelf( face.normal ); - vertices[ face.d ].addSelf( face.normal ); - - } - - } - - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { - - vertices[ v ].normalize(); - - } - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - if ( face instanceof THREE.Face3 ) { - - face.vertexNormals[ 0 ].copy( vertices[ face.a ] ); - face.vertexNormals[ 1 ].copy( vertices[ face.b ] ); - face.vertexNormals[ 2 ].copy( vertices[ face.c ] ); - - } else if ( face instanceof THREE.Face4 ) { - - face.vertexNormals[ 0 ].copy( vertices[ face.a ] ); - face.vertexNormals[ 1 ].copy( vertices[ face.b ] ); - face.vertexNormals[ 2 ].copy( vertices[ face.c ] ); - face.vertexNormals[ 3 ].copy( vertices[ face.d ] ); - - } - - } - - }, - - computeTangents: function () { - - // based on http://www.terathon.com/code/tangent.html - // tangents go to vertices - - var f, fl, v, vl, i, il, vertexIndex, - face, uv, vA, vB, vC, uvA, uvB, uvC, - x1, x2, y1, y2, z1, z2, - s1, s2, t1, t2, r, t, test, - tan1 = [], tan2 = [], - sdir = new THREE.Vector3(), tdir = new THREE.Vector3(), - tmp = new THREE.Vector3(), tmp2 = new THREE.Vector3(), - n = new THREE.Vector3(), w; - - for ( v = 0, vl = this.vertices.length; v < vl; v ++ ) { - - tan1[ v ] = new THREE.Vector3(); - tan2[ v ] = new THREE.Vector3(); - - } - - function handleTriangle( context, a, b, c, ua, ub, uc ) { - - vA = context.vertices[ a ].position; - vB = context.vertices[ b ].position; - vC = context.vertices[ c ].position; - - uvA = uv[ ua ]; - uvB = uv[ ub ]; - uvC = uv[ uc ]; - - x1 = vB.x - vA.x; - x2 = vC.x - vA.x; - y1 = vB.y - vA.y; - y2 = vC.y - vA.y; - z1 = vB.z - vA.z; - z2 = vC.z - vA.z; - - s1 = uvB.u - uvA.u; - s2 = uvC.u - uvA.u; - t1 = uvB.v - uvA.v; - t2 = uvC.v - uvA.v; - - r = 1.0 / ( s1 * t2 - s2 * t1 ); - sdir.set( ( t2 * x1 - t1 * x2 ) * r, - ( t2 * y1 - t1 * y2 ) * r, - ( t2 * z1 - t1 * z2 ) * r ); - tdir.set( ( s1 * x2 - s2 * x1 ) * r, - ( s1 * y2 - s2 * y1 ) * r, - ( s1 * z2 - s2 * z1 ) * r ); - - tan1[ a ].addSelf( sdir ); - tan1[ b ].addSelf( sdir ); - tan1[ c ].addSelf( sdir ); - - tan2[ a ].addSelf( tdir ); - tan2[ b ].addSelf( tdir ); - tan2[ c ].addSelf( tdir ); - - } - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - uv = this.faceVertexUvs[ 0 ][ f ]; // use UV layer 0 for tangents - - if ( face instanceof THREE.Face3 ) { - - handleTriangle( this, face.a, face.b, face.c, 0, 1, 2 ); - - } else if ( face instanceof THREE.Face4 ) { - - handleTriangle( this, face.a, face.b, face.c, 0, 1, 2 ); - handleTriangle( this, face.a, face.b, face.d, 0, 1, 3 ); - - } - - } - - var faceIndex = [ 'a', 'b', 'c', 'd' ]; - - for ( f = 0, fl = this.faces.length; f < fl; f ++ ) { - - face = this.faces[ f ]; - - for ( i = 0; i < face.vertexNormals.length; i++ ) { - - n.copy( face.vertexNormals[ i ] ); - - vertexIndex = face[ faceIndex[ i ] ]; - - t = tan1[ vertexIndex ]; - - // Gram-Schmidt orthogonalize - - tmp.copy( t ); - tmp.subSelf( n.multiplyScalar( n.dot( t ) ) ).normalize(); - - // Calculate handedness - - tmp2.cross( face.vertexNormals[ i ], t ); - test = tmp2.dot( tan2[ vertexIndex ] ); - w = (test < 0.0) ? -1.0 : 1.0; - - face.vertexTangents[ i ] = new THREE.Vector4( tmp.x, tmp.y, tmp.z, w ); - - } - - } - - this.hasTangents = true; - - }, - - computeBoundingBox: function () { - - if ( this.vertices.length > 0 ) { - - var position, firstPosition = this.vertices[ 0 ].position; - - if ( ! this.boundingBox ) { - - this.boundingBox = { min: firstPosition.clone(), max: firstPosition.clone() }; - - } else { - - this.boundingBox.min.copy( firstPosition ); - this.boundingBox.max.copy( firstPosition ); - - } - - var min = this.boundingBox.min, - max = this.boundingBox.max; - - for ( var v = 1, vl = this.vertices.length; v < vl; v ++ ) { - - position = this.vertices[ v ].position; - - if ( position.x < min.x ) { - - min.x = position.x; - - } else if ( position.x > max.x ) { - - max.x = position.x; - - } - - if ( position.y < min.y ) { - - min.y = position.y; - - } else if ( position.y > max.y ) { - - max.y = position.y; - - } - - if ( position.z < min.z ) { - - min.z = position.z; - - } else if ( position.z > max.z ) { - - max.z = position.z; - - } - - } - - } - - }, - - computeBoundingSphere: function () { - - var radius, maxRadius = 0; - - for ( var v = 0, vl = this.vertices.length; v < vl; v ++ ) { - - radius = this.vertices[ v ].position.length(); - if ( radius > maxRadius ) maxRadius = radius; - - } - - this.boundingSphere = { radius: maxRadius }; - - }, - - /* - * Checks for duplicate vertices with hashmap. - * Duplicated vertices are removed - * and faces' vertices are updated. - */ - - mergeVertices: function() { - - var verticesMap = {}; // Hashmap for looking up vertice by position coordinates (and making sure they are unique) - var unique = [], changes = []; - - var v, key; - var precisionPoints = 4; // number of decimal points, eg. 4 for epsilon of 0.0001 - var precision = Math.pow( 10, precisionPoints ); - var i,il, face; - - for ( i = 0, il = this.vertices.length; i < il; i ++ ) { - - v = this.vertices[ i ].position; - key = [ Math.round( v.x * precision ), Math.round( v.y * precision ), Math.round( v.z * precision ) ].join( '_' ); - - if ( verticesMap[ key ] === undefined ) { - - verticesMap[ key ] = i; - unique.push( this.vertices[ i ] ); - changes[ i ] = unique.length - 1; - - } else { - - //console.log('Duplicate vertex found. ', i, ' could be using ', verticesMap[key]); - changes[ i ] = changes[ verticesMap[ key ] ]; - - } - - }; - - - // Start to patch face indices - - for( i = 0, il = this.faces.length; i < il; i ++ ) { - - face = this.faces[ i ]; - - if ( face instanceof THREE.Face3 ) { - - face.a = changes[ face.a ]; - face.b = changes[ face.b ]; - face.c = changes[ face.c ]; - - } else if ( face instanceof THREE.Face4 ) { - - face.a = changes[ face.a ]; - face.b = changes[ face.b ]; - face.c = changes[ face.c ]; - face.d = changes[ face.d ]; - - } - - } - - // Use unique set of vertices - - this.vertices = unique; - - } - -}; - -THREE.GeometryCount = 0; -/** - * Spline from Tween.js, slightly optimized (and trashed) - * http://sole.github.com/tween.js/examples/05_spline.html - * - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Spline = function ( points ) { - - this.points = points; - - var c = [], v3 = { x: 0, y: 0, z: 0 }, - point, intPoint, weight, w2, w3, - pa, pb, pc, pd; - - this.initFromArray = function( a ) { - - this.points = []; - - for ( var i = 0; i < a.length; i++ ) { - - this.points[ i ] = { x: a[ i ][ 0 ], y: a[ i ][ 1 ], z: a[ i ][ 2 ] }; - - } - - }; - - this.getPoint = function ( k ) { - - point = ( this.points.length - 1 ) * k; - intPoint = Math.floor( point ); - weight = point - intPoint; - - c[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1; - c[ 1 ] = intPoint; - c[ 2 ] = intPoint > this.points.length - 2 ? intPoint : intPoint + 1; - c[ 3 ] = intPoint > this.points.length - 3 ? intPoint : intPoint + 2; - - pa = this.points[ c[ 0 ] ]; - pb = this.points[ c[ 1 ] ]; - pc = this.points[ c[ 2 ] ]; - pd = this.points[ c[ 3 ] ]; - - w2 = weight * weight; - w3 = weight * w2; - - v3.x = interpolate( pa.x, pb.x, pc.x, pd.x, weight, w2, w3 ); - v3.y = interpolate( pa.y, pb.y, pc.y, pd.y, weight, w2, w3 ); - v3.z = interpolate( pa.z, pb.z, pc.z, pd.z, weight, w2, w3 ); - - return v3; - - }; - - this.getControlPointsArray = function () { - - var i, p, l = this.points.length, - coords = []; - - for ( i = 0; i < l; i ++ ) { - - p = this.points[ i ]; - coords[ i ] = [ p.x, p.y, p.z ]; - - } - - return coords; - - }; - - // approximate length by summing linear segments - - this.getLength = function ( nSubDivisions ) { - - var i, index, nSamples, position, - point = 0, intPoint = 0, oldIntPoint = 0, - oldPosition = new THREE.Vector3(), - tmpVec = new THREE.Vector3(), - chunkLengths = [], - totalLength = 0; - - // first point has 0 length - - chunkLengths[ 0 ] = 0; - - if ( !nSubDivisions ) nSubDivisions = 100; - - nSamples = this.points.length * nSubDivisions; - - oldPosition.copy( this.points[ 0 ] ); - - for ( i = 1; i < nSamples; i ++ ) { - - index = i / nSamples; - - position = this.getPoint( index ); - tmpVec.copy( position ); - - totalLength += tmpVec.distanceTo( oldPosition ); - - oldPosition.copy( position ); - - point = ( this.points.length - 1 ) * index; - intPoint = Math.floor( point ); - - if ( intPoint != oldIntPoint ) { - - chunkLengths[ intPoint ] = totalLength; - oldIntPoint = intPoint; - - } - - } - - // last point ends with total length - - chunkLengths[ chunkLengths.length ] = totalLength; - - return { chunks: chunkLengths, total: totalLength }; - - }; - - this.reparametrizeByArcLength = function ( samplingCoef ) { - - var i, j, - index, indexCurrent, indexNext, - linearDistance, realDistance, - sampling, position, - newpoints = [], - tmpVec = new THREE.Vector3(), - sl = this.getLength(); - - newpoints.push( tmpVec.copy( this.points[ 0 ] ).clone() ); - - for ( i = 1; i < this.points.length; i++ ) { - - //tmpVec.copy( this.points[ i - 1 ] ); - //linearDistance = tmpVec.distanceTo( this.points[ i ] ); - - realDistance = sl.chunks[ i ] - sl.chunks[ i - 1 ]; - - sampling = Math.ceil( samplingCoef * realDistance / sl.total ); - - indexCurrent = ( i - 1 ) / ( this.points.length - 1 ); - indexNext = i / ( this.points.length - 1 ); - - for ( j = 1; j < sampling - 1; j++ ) { - - index = indexCurrent + j * ( 1 / sampling ) * ( indexNext - indexCurrent ); - - position = this.getPoint( index ); - newpoints.push( tmpVec.copy( position ).clone() ); - - } - - newpoints.push( tmpVec.copy( this.points[ i ] ).clone() ); - - } - - this.points = newpoints; - - }; - - // Catmull-Rom - - function interpolate( p0, p1, p2, p3, t, t2, t3 ) { - - var v0 = ( p2 - p0 ) * 0.5, - v1 = ( p3 - p1 ) * 0.5; - - return ( 2 * ( p1 - p2 ) + v0 + v1 ) * t3 + ( - 3 * ( p1 - p2 ) - 2 * v0 - v1 ) * t2 + v0 * t + p1; - - }; - -}; -/** - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - */ - -THREE.Edge = function( v1, v2, vi1, vi2 ) { - - this.vertices = [ v1, v2 ]; // vertex references - this.vertexIndices = [ vi1, vi2 ]; // vertex indices - - this.faces = []; // face references - this.faceIndices = []; // face indices - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - */ - -THREE.Camera = function () { - - if ( arguments.length ) { - - console.warn( 'DEPRECATED: Camera() is now PerspectiveCamera() or OrthographicCamera().' ); - return new THREE.PerspectiveCamera( arguments[ 0 ], arguments[ 1 ], arguments[ 2 ], arguments[ 3 ] ); - - } - - THREE.Object3D.call( this ); - - this.matrixWorldInverse = new THREE.Matrix4(); - - this.projectionMatrix = new THREE.Matrix4(); - this.projectionMatrixInverse = new THREE.Matrix4(); - - -}; - -THREE.Camera.prototype = new THREE.Object3D(); -THREE.Camera.prototype.constructor = THREE.Camera; - -THREE.Camera.prototype.lookAt = function ( vector ) { - - // TODO: Add hierarchy support. - - this.matrix.lookAt( this.position, vector, this.up ); - - if ( this.rotationAutoUpdate ) { - - this.rotation.setRotationFromMatrix( this.matrix ); - - } - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.OrthographicCamera = function ( left, right, top, bottom, near, far ) { - - THREE.Camera.call( this ); - - this.left = left; - this.right = right; - this.top = top; - this.bottom = bottom; - - this.near = ( near !== undefined ) ? near : 0.1; - this.far = ( far !== undefined ) ? far : 2000; - - this.updateProjectionMatrix(); - -}; - -THREE.OrthographicCamera.prototype = new THREE.Camera(); -THREE.OrthographicCamera.prototype.constructor = THREE.OrthographicCamera; - -THREE.OrthographicCamera.prototype.updateProjectionMatrix = function () { - - this.projectionMatrix = THREE.Matrix4.makeOrtho( this.left, this.right, this.top, this.bottom, this.near, this.far ); - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author greggman / http://games.greggman.com/ - * @author zz85 / http://www.lab4games.net/zz85/blog - */ - -THREE.PerspectiveCamera = function ( fov, aspect, near, far ) { - - THREE.Camera.call( this ); - - this.fov = fov !== undefined ? fov : 50; - this.aspect = aspect !== undefined ? aspect : 1; - this.near = near !== undefined ? near : 0.1; - this.far = far !== undefined ? far : 2000; - - this.updateProjectionMatrix(); - -}; - -THREE.PerspectiveCamera.prototype = new THREE.Camera(); -THREE.PerspectiveCamera.prototype.constructor = THREE.PerspectiveCamera; - - -/** - * Uses Focal Length (in mm) to estimate and set FOV - * 35mm (fullframe) camera is used if frame size is not specified; - * Formula based on http://www.bobatkins.com/photography/technical/field_of_view.html - */ - -THREE.PerspectiveCamera.prototype.setLens = function ( focalLength, frameSize ) { - - frameSize = frameSize !== undefined ? frameSize : 43.25; // 36x24mm - - this.fov = 2 * Math.atan( frameSize / ( focalLength * 2 ) ); - this.fov = 180 / Math.PI * this.fov; - - this.updateProjectionMatrix(); - -} - - -/** - * Sets an offset in a larger frustum. This is useful for multi-window or - * multi-monitor/multi-machine setups. - * - * For example, if you have 3x2 monitors and each monitor is 1920x1080 and - * the monitors are in grid like this - * - * +---+---+---+ - * | A | B | C | - * +---+---+---+ - * | D | E | F | - * +---+---+---+ - * - * then for each monitor you would call it like this - * - * var w = 1920; - * var h = 1080; - * var fullWidth = w * 3; - * var fullHeight = h * 2; - * - * --A-- - * camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); - * --B-- - * camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); - * --C-- - * camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); - * --D-- - * camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); - * --E-- - * camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); - * --F-- - * camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); - * - * Note there is no reason monitors have to be the same size or in a grid. - */ - -THREE.PerspectiveCamera.prototype.setViewOffset = function ( fullWidth, fullHeight, x, y, width, height ) { - - this.fullWidth = fullWidth; - this.fullHeight = fullHeight; - this.x = x; - this.y = y; - this.width = width; - this.height = height; - - this.updateProjectionMatrix(); - -}; - - -THREE.PerspectiveCamera.prototype.updateProjectionMatrix = function () { - - if ( this.fullWidth ) { - - var aspect = this.fullWidth / this.fullHeight; - var top = Math.tan( this.fov * Math.PI / 360 ) * this.near; - var bottom = -top; - var left = aspect * bottom; - var right = aspect * top; - var width = Math.abs( right - left ); - var height = Math.abs( top - bottom ); - - this.projectionMatrix = THREE.Matrix4.makeFrustum( - left + this.x * width / this.fullWidth, - left + ( this.x + this.width ) * width / this.fullWidth, - top - ( this.y + this.height ) * height / this.fullHeight, - top - this.y * height / this.fullHeight, - this.near, - this.far ); - - } else { - - this.projectionMatrix = THREE.Matrix4.makePerspective( this.fov, this.aspect, this.near, this.far ); - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Light = function ( hex ) { - - THREE.Object3D.call( this ); - - this.color = new THREE.Color( hex ); - -}; - -THREE.Light.prototype = new THREE.Object3D(); -THREE.Light.prototype.constructor = THREE.Light; -THREE.Light.prototype.supr = THREE.Object3D.prototype; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.AmbientLight = function ( hex ) { - - THREE.Light.call( this, hex ); - -}; - -THREE.AmbientLight.prototype = new THREE.Light(); -THREE.AmbientLight.prototype.constructor = THREE.AmbientLight; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.DirectionalLight = function ( hex, intensity, distance ) { - - THREE.Light.call( this, hex ); - - this.position = new THREE.Vector3( 0, 1, 0 ); - this.target = new THREE.Object3D(); - - this.intensity = ( intensity !== undefined ) ? intensity : 1; - this.distance = ( distance !== undefined ) ? distance : 0; - - this.castShadow = false; - this.onlyShadow = false; - - // - - this.shadowCameraLeft = -500; - this.shadowCameraRight = 500; - this.shadowCameraTop = 500; - this.shadowCameraBottom = -500; - - this.shadowCameraVisible = false; - - this.shadowBias = 0; - this.shadowDarkness = 0.5; - - this.shadowMapWidth = 512; - this.shadowMapHeight = 512; - - // - - this.shadowMap = null; - this.shadowMapSize = null; - this.shadowCamera = null; - this.shadowMatrix = null; - -}; - -THREE.DirectionalLight.prototype = new THREE.Light(); -THREE.DirectionalLight.prototype.constructor = THREE.DirectionalLight; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.PointLight = function ( hex, intensity, distance ) { - - THREE.Light.call( this, hex ); - - this.position = new THREE.Vector3( 0, 0, 0 ); - this.intensity = ( intensity !== undefined ) ? intensity : 1; - this.distance = ( distance !== undefined ) ? distance : 0; - -}; - -THREE.PointLight.prototype = new THREE.Light(); -THREE.PointLight.prototype.constructor = THREE.PointLight; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.SpotLight = function ( hex, intensity, distance, castShadow ) { - - THREE.Light.call( this, hex ); - - this.position = new THREE.Vector3( 0, 1, 0 ); - this.target = new THREE.Object3D(); - - this.intensity = ( intensity !== undefined ) ? intensity : 1; - this.distance = ( distance !== undefined ) ? distance : 0; - - this.castShadow = ( castShadow !== undefined ) ? castShadow : false; - this.onlyShadow = false; - - // - - this.shadowCameraNear = 50; - this.shadowCameraFar = 5000; - this.shadowCameraFov = 50; - - this.shadowCameraVisible = false; - - this.shadowBias = 0; - this.shadowDarkness = 0.5; - - this.shadowMapWidth = 512; - this.shadowMapHeight = 512; - - // - - this.shadowMap = null; - this.shadowMapSize = null; - this.shadowCamera = null; - this.shadowMatrix = null; - -}; - -THREE.SpotLight.prototype = new THREE.Light(); -THREE.SpotLight.prototype.constructor = THREE.SpotLight; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.Material = function ( parameters ) { - - parameters = parameters || {}; - - this.name = ''; - - this.id = THREE.MaterialCount ++; - - this.opacity = parameters.opacity !== undefined ? parameters.opacity : 1; - this.transparent = parameters.transparent !== undefined ? parameters.transparent : false; - - this.blending = parameters.blending !== undefined ? parameters.blending : THREE.NormalBlending; - - this.depthTest = parameters.depthTest !== undefined ? parameters.depthTest : true; - this.depthWrite = parameters.depthWrite !== undefined ? parameters.depthWrite : true; - - this.polygonOffset = parameters.polygonOffset !== undefined ? parameters.polygonOffset : false; - this.polygonOffsetFactor = parameters.polygonOffsetFactor !== undefined ? parameters.polygonOffsetFactor : 0; - this.polygonOffsetUnits = parameters.polygonOffsetUnits !== undefined ? parameters.polygonOffsetUnits : 0; - - this.alphaTest = parameters.alphaTest !== undefined ? parameters.alphaTest : 0; - - this.overdraw = parameters.overdraw !== undefined ? parameters.overdraw : false; // Boolean for fixing antialiasing gaps in CanvasRenderer - -} - -THREE.MaterialCount = 0; - -THREE.NoShading = 0; -THREE.FlatShading = 1; -THREE.SmoothShading = 2; - -THREE.NoColors = 0; -THREE.FaceColors = 1; -THREE.VertexColors = 2; - -THREE.NormalBlending = 0; -THREE.AdditiveBlending = 1; -THREE.SubtractiveBlending = 2; -THREE.MultiplyBlending = 3; -THREE.AdditiveAlphaBlending = 4; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * - * blending: THREE.NormalBlending, - * depthTest: , - * - * linewidth: , - * linecap: "round", - * linejoin: "round", - * - * vertexColors: - * - * fog: - * } - */ - -THREE.LineBasicMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.color = parameters.color !== undefined ? new THREE.Color( parameters.color ) : new THREE.Color( 0xffffff ); - - this.linewidth = parameters.linewidth !== undefined ? parameters.linewidth : 1; - this.linecap = parameters.linecap !== undefined ? parameters.linecap : 'round'; - this.linejoin = parameters.linejoin !== undefined ? parameters.linejoin : 'round'; - - this.vertexColors = parameters.vertexColors ? parameters.vertexColors : false; - - this.fog = parameters.fog !== undefined ? parameters.fog : true; - -}; - -THREE.LineBasicMaterial.prototype = new THREE.Material(); -THREE.LineBasicMaterial.prototype.constructor = THREE.LineBasicMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * - * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * shading: THREE.SmoothShading, - * blending: THREE.NormalBlending, - * depthTest: , - * - * wireframe: , - * wireframeLinewidth: , - * - * vertexColors: false / THREE.VertexColors / THREE.FaceColors, - * skinning: , - * - * fog: - * } - */ - -THREE.MeshBasicMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.color = parameters.color !== undefined ? new THREE.Color( parameters.color ) : new THREE.Color( 0xffffff ); - - this.map = parameters.map !== undefined ? parameters.map : null; - - this.lightMap = parameters.lightMap !== undefined ? parameters.lightMap : null; - - this.envMap = parameters.envMap !== undefined ? parameters.envMap : null; - this.combine = parameters.combine !== undefined ? parameters.combine : THREE.MultiplyOperation; - this.reflectivity = parameters.reflectivity !== undefined ? parameters.reflectivity : 1; - this.refractionRatio = parameters.refractionRatio !== undefined ? parameters.refractionRatio : 0.98; - - this.fog = parameters.fog !== undefined ? parameters.fog : true; - - this.shading = parameters.shading !== undefined ? parameters.shading : THREE.SmoothShading; - - this.wireframe = parameters.wireframe !== undefined ? parameters.wireframe : false; - this.wireframeLinewidth = parameters.wireframeLinewidth !== undefined ? parameters.wireframeLinewidth : 1; - this.wireframeLinecap = parameters.wireframeLinecap !== undefined ? parameters.wireframeLinecap : 'round'; - this.wireframeLinejoin = parameters.wireframeLinejoin !== undefined ? parameters.wireframeLinejoin : 'round'; - - this.vertexColors = parameters.vertexColors !== undefined ? parameters.vertexColors : false; - - this.skinning = parameters.skinning !== undefined ? parameters.skinning : false; - this.morphTargets = parameters.morphTargets !== undefined ? parameters.morphTargets : false; - -}; - -THREE.MeshBasicMaterial.prototype = new THREE.Material(); -THREE.MeshBasicMaterial.prototype.constructor = THREE.MeshBasicMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * ambient: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * - * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * shading: THREE.SmoothShading, - * blending: THREE.NormalBlending, - * depthTest: , - * - * wireframe: , - * wireframeLinewidth: , - * - * vertexColors: false / THREE.VertexColors / THREE.FaceColors, - * skinning: , - * - * fog: - * } - */ - -THREE.MeshLambertMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.color = parameters.color !== undefined ? new THREE.Color( parameters.color ) : new THREE.Color( 0xffffff ); - this.ambient = parameters.ambient !== undefined ? new THREE.Color( parameters.ambient ) : new THREE.Color( 0x050505 ); - - this.wrapAround = parameters.wrapAround !== undefined ? parameters.wrapAround: false; - this.wrapRGB = new THREE.Vector3( 1, 1, 1 ); - - this.map = parameters.map !== undefined ? parameters.map : null; - - this.lightMap = parameters.lightMap !== undefined ? parameters.lightMap : null; - - this.envMap = parameters.envMap !== undefined ? parameters.envMap : null; - this.combine = parameters.combine !== undefined ? parameters.combine : THREE.MultiplyOperation; - this.reflectivity = parameters.reflectivity !== undefined ? parameters.reflectivity : 1; - this.refractionRatio = parameters.refractionRatio !== undefined ? parameters.refractionRatio : 0.98; - - this.fog = parameters.fog !== undefined ? parameters.fog : true; - - this.shading = parameters.shading !== undefined ? parameters.shading : THREE.SmoothShading; - - this.wireframe = parameters.wireframe !== undefined ? parameters.wireframe : false; - this.wireframeLinewidth = parameters.wireframeLinewidth !== undefined ? parameters.wireframeLinewidth : 1; - this.wireframeLinecap = parameters.wireframeLinecap !== undefined ? parameters.wireframeLinecap : 'round'; - this.wireframeLinejoin = parameters.wireframeLinejoin !== undefined ? parameters.wireframeLinejoin : 'round'; - - this.vertexColors = parameters.vertexColors !== undefined ? parameters.vertexColors : false; - - this.skinning = parameters.skinning !== undefined ? parameters.skinning : false; - this.morphTargets = parameters.morphTargets !== undefined ? parameters.morphTargets : false; - -}; - -THREE.MeshLambertMaterial.prototype = new THREE.Material(); -THREE.MeshLambertMaterial.prototype.constructor = THREE.MeshLambertMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * ambient: , - * specular: , - * shininess: , - * opacity: , - * - * map: new THREE.Texture( ), - * - * lightMap: new THREE.Texture( ), - * - * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ), - * combine: THREE.Multiply, - * reflectivity: , - * refractionRatio: , - * - * shading: THREE.SmoothShading, - * blending: THREE.NormalBlending, - * depthTest: , - * - * wireframe: , - * wireframeLinewidth: , - * - * vertexColors: false / THREE.VertexColors / THREE.FaceColors, - * skinning: , - * - * fog: - * } - */ - -THREE.MeshPhongMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.color = parameters.color !== undefined ? new THREE.Color( parameters.color ) : new THREE.Color( 0xffffff ); - this.ambient = parameters.ambient !== undefined ? new THREE.Color( parameters.ambient ) : new THREE.Color( 0x050505 ); - this.specular = parameters.specular !== undefined ? new THREE.Color( parameters.specular ) : new THREE.Color( 0x111111 ); - this.shininess = parameters.shininess !== undefined ? parameters.shininess : 30; - - this.metal = parameters.metal !== undefined ? parameters.metal : false; - this.perPixel = parameters.perPixel !== undefined ? parameters.perPixel : false; - - this.wrapAround = parameters.wrapAround !== undefined ? parameters.wrapAround: false; - this.wrapRGB = new THREE.Vector3( 1, 1, 1 ); - - this.map = parameters.map !== undefined ? parameters.map : null; - - this.lightMap = parameters.lightMap !== undefined ? parameters.lightMap : null; - - this.envMap = parameters.envMap !== undefined ? parameters.envMap : null; - this.combine = parameters.combine !== undefined ? parameters.combine : THREE.MultiplyOperation; - this.reflectivity = parameters.reflectivity !== undefined ? parameters.reflectivity : 1; - this.refractionRatio = parameters.refractionRatio !== undefined ? parameters.refractionRatio : 0.98; - - this.fog = parameters.fog !== undefined ? parameters.fog : true; - - this.shading = parameters.shading !== undefined ? parameters.shading : THREE.SmoothShading; - - this.wireframe = parameters.wireframe !== undefined ? parameters.wireframe : false; - this.wireframeLinewidth = parameters.wireframeLinewidth !== undefined ? parameters.wireframeLinewidth : 1; - this.wireframeLinecap = parameters.wireframeLinecap !== undefined ? parameters.wireframeLinecap : 'round'; - this.wireframeLinejoin = parameters.wireframeLinejoin !== undefined ? parameters.wireframeLinejoin : 'round'; - - this.vertexColors = parameters.vertexColors !== undefined ? parameters.vertexColors : false; - - this.skinning = parameters.skinning !== undefined ? parameters.skinning : false; - this.morphTargets = parameters.morphTargets !== undefined ? parameters.morphTargets : false; - -}; - -THREE.MeshPhongMaterial.prototype = new THREE.Material(); -THREE.MeshPhongMaterial.prototype.constructor = THREE.MeshPhongMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * opacity: , - - * blending: THREE.NormalBlending, - * depthTest: , - - * wireframe: , - * wireframeLinewidth: - * } - */ - -THREE.MeshDepthMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.shading = parameters.shading !== undefined ? parameters.shading : THREE.SmoothShading; // doesn't really apply here, normals are not used - - this.wireframe = parameters.wireframe !== undefined ? parameters.wireframe : false; - this.wireframeLinewidth = parameters.wireframeLinewidth !== undefined ? parameters.wireframeLinewidth : 1; - //this.morphTargets = parameters.morphTargets !== undefined ? parameters.morphTargets : false; - // this.morphTargets = true; - -}; - -THREE.MeshDepthMaterial.prototype = new THREE.Material(); -THREE.MeshDepthMaterial.prototype.constructor = THREE.MeshDepthMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - * - * parameters = { - * opacity: , - - * shading: THREE.FlatShading, - * blending: THREE.NormalBlending, - * depthTest: , - - * wireframe: , - * wireframeLinewidth: - * } - */ - -THREE.MeshNormalMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.shading = parameters.shading ? parameters.shading : THREE.FlatShading; - - this.wireframe = parameters.wireframe ? parameters.wireframe : false; - this.wireframeLinewidth = parameters.wireframeLinewidth ? parameters.wireframeLinewidth : 1; - -}; - -THREE.MeshNormalMaterial.prototype = new THREE.Material(); -THREE.MeshNormalMaterial.prototype.constructor = THREE.MeshNormalMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.MeshFaceMaterial = function () { - -}; -THREE.MeshShaderMaterial = function ( parameters ) { - - console.warn( 'DEPRECATED: MeshShaderMaterial() is now ShaderMaterial().' ); - - return new THREE.ShaderMaterial( parameters ); - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * color: , - * opacity: , - * map: new THREE.Texture( ), - * - * size: , - * - * blending: THREE.NormalBlending, - * depthTest: , - * - * vertexColors: , - * - * fog: - * } - */ - -THREE.ParticleBasicMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.color = parameters.color !== undefined ? new THREE.Color( parameters.color ) : new THREE.Color( 0xffffff ); - - this.map = parameters.map !== undefined ? parameters.map : null; - - this.size = parameters.size !== undefined ? parameters.size : 1; - this.sizeAttenuation = parameters.sizeAttenuation !== undefined ? parameters.sizeAttenuation : true; - - this.vertexColors = parameters.vertexColors !== undefined ? parameters.vertexColors : false; - - this.fog = parameters.fog !== undefined ? parameters.fog : true; - -}; - -THREE.ParticleBasicMaterial.prototype = new THREE.Material(); -THREE.ParticleBasicMaterial.prototype.constructor = THREE.ParticleBasicMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - * - * parameters = { - * color: , - * program: , - * opacity: , - * blending: THREE.NormalBlending - * } - */ - -THREE.ParticleCanvasMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.color = parameters.color !== undefined ? new THREE.Color( parameters.color ) : new THREE.Color( 0xffffff ); - this.program = parameters.program !== undefined ? parameters.program : function ( context, color ) {}; - -}; - -THREE.ParticleCanvasMaterial.prototype = new THREE.Material(); -THREE.ParticleCanvasMaterial.prototype.constructor = THREE.ParticleCanvasMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.ParticleDOMMaterial = function ( domElement ) { - - THREE.Material.call( this ); - - this.domElement = domElement; - -}; -/** - * @author alteredq / http://alteredqualia.com/ - * - * parameters = { - * fragmentShader: , - * vertexShader: , - - * uniforms: { "parameter1": { type: "f", value: 1.0 }, "parameter2": { type: "i" value2: 2 } }, - - * shading: THREE.SmoothShading, - * blending: THREE.NormalBlending, - * depthTest: , - - * wireframe: , - * wireframeLinewidth: , - - * lights: , - * vertexColors: , - * skinning: , - * morphTargets: , - * } - */ - -THREE.ShaderMaterial = function ( parameters ) { - - THREE.Material.call( this, parameters ); - - parameters = parameters || {}; - - this.fragmentShader = parameters.fragmentShader !== undefined ? parameters.fragmentShader : "void main() {}"; - this.vertexShader = parameters.vertexShader !== undefined ? parameters.vertexShader : "void main() {}"; - this.uniforms = parameters.uniforms !== undefined ? parameters.uniforms : {}; - this.attributes = parameters.attributes; - - this.shading = parameters.shading !== undefined ? parameters.shading : THREE.SmoothShading; - - this.wireframe = parameters.wireframe !== undefined ? parameters.wireframe : false; - this.wireframeLinewidth = parameters.wireframeLinewidth !== undefined ? parameters.wireframeLinewidth : 1; - - this.fog = parameters.fog !== undefined ? parameters.fog : false; // set to use scene fog - this.lights = parameters.lights !== undefined ? parameters.lights : false; // set to use scene lights - this.vertexColors = parameters.vertexColors !== undefined ? parameters.vertexColors : false; // set to use "color" attribute stream - this.skinning = parameters.skinning !== undefined ? parameters.skinning : false; // set to use skinning attribute streams - this.morphTargets = parameters.morphTargets !== undefined ? parameters.morphTargets : false; // set to use morph targets - -}; - -THREE.ShaderMaterial.prototype = new THREE.Material(); -THREE.ShaderMaterial.prototype.constructor = THREE.ShaderMaterial; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author szimek / https://github.com/szimek/ - */ - -THREE.Texture = function ( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type ) { - - this.id = THREE.TextureCount ++; - - this.image = image; - - this.mapping = mapping !== undefined ? mapping : new THREE.UVMapping(); - - this.wrapS = wrapS !== undefined ? wrapS : THREE.ClampToEdgeWrapping; - this.wrapT = wrapT !== undefined ? wrapT : THREE.ClampToEdgeWrapping; - - this.magFilter = magFilter !== undefined ? magFilter : THREE.LinearFilter; - this.minFilter = minFilter !== undefined ? minFilter : THREE.LinearMipMapLinearFilter; - - this.format = format !== undefined ? format : THREE.RGBAFormat; - this.type = type !== undefined ? type : THREE.UnsignedByteType; - - this.offset = new THREE.Vector2( 0, 0 ); - this.repeat = new THREE.Vector2( 1, 1 ); - - this.generateMipmaps = true; - - this.needsUpdate = false; - this.onUpdate = null; - -}; - -THREE.Texture.prototype = { - - constructor: THREE.Texture, - - clone: function () { - - var clonedTexture = new THREE.Texture( this.image, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter, this.format, this.type ); - - clonedTexture.offset.copy( this.offset ); - clonedTexture.repeat.copy( this.repeat ); - - return clonedTexture; - - } - -}; - -THREE.TextureCount = 0; - -THREE.MultiplyOperation = 0; -THREE.MixOperation = 1; - -// Mapping modes - -THREE.CubeReflectionMapping = function () {}; -THREE.CubeRefractionMapping = function () {}; - -THREE.LatitudeReflectionMapping = function () {}; -THREE.LatitudeRefractionMapping = function () {}; - -THREE.SphericalReflectionMapping = function () {}; -THREE.SphericalRefractionMapping = function () {}; - -THREE.UVMapping = function () {}; - -// Wrapping modes - -THREE.RepeatWrapping = 0; -THREE.ClampToEdgeWrapping = 1; -THREE.MirroredRepeatWrapping = 2; - -// Filters - -THREE.NearestFilter = 3; -THREE.NearestMipMapNearestFilter = 4; -THREE.NearestMipMapLinearFilter = 5; -THREE.LinearFilter = 6; -THREE.LinearMipMapNearestFilter = 7; -THREE.LinearMipMapLinearFilter = 8; - -// Types - -THREE.ByteType = 9; -THREE.UnsignedByteType = 10; -THREE.ShortType = 11; -THREE.UnsignedShortType = 12; -THREE.IntType = 13; -THREE.UnsignedIntType = 14; -THREE.FloatType = 15; - -// Formats - -THREE.AlphaFormat = 16; -THREE.RGBFormat = 17; -THREE.RGBAFormat = 18; -THREE.LuminanceFormat = 19; -THREE.LuminanceAlphaFormat = 20; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.DataTexture = function ( data, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter ) { - - THREE.Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter, format, type ); - - this.image = { data: data, width: width, height: height }; - -}; - -THREE.DataTexture.prototype = new THREE.Texture(); -THREE.DataTexture.prototype.constructor = THREE.DataTexture; - -THREE.DataTexture.prototype.clone = function () { - - var clonedTexture = new THREE.DataTexture( this.image.data, this.image.width, this.image.height, this.format, this.type, this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter ); - - clonedTexture.offset.copy( this.offset ); - clonedTexture.repeat.copy( this.repeat ); - - return clonedTexture; - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.Particle = function ( material ) { - - THREE.Object3D.call( this ); - - this.material = material; - -}; - -THREE.Particle.prototype = new THREE.Object3D(); -THREE.Particle.prototype.constructor = THREE.Particle; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.ParticleSystem = function ( geometry, material ) { - - THREE.Object3D.call( this ); - - this.geometry = geometry; - this.material = material; - - this.sortParticles = false; - - if ( this.geometry ) { - - // calc bound radius - - if( !this.geometry.boundingSphere ) { - - this.geometry.computeBoundingSphere(); - - } - - this.boundRadius = geometry.boundingSphere.radius; - - } - - this.frustumCulled = false; - -}; - -THREE.ParticleSystem.prototype = new THREE.Object3D(); -THREE.ParticleSystem.prototype.constructor = THREE.ParticleSystem; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.Line = function ( geometry, material, type ) { - - THREE.Object3D.call( this ); - - this.geometry = geometry; - this.material = material; - - this.type = ( type !== undefined ) ? type : THREE.LineStrip; - - if ( this.geometry ) { - - if ( ! this.geometry.boundingSphere ) { - - this.geometry.computeBoundingSphere(); - - } - - } - -}; - -THREE.LineStrip = 0; -THREE.LinePieces = 1; - -THREE.Line.prototype = new THREE.Object3D(); -THREE.Line.prototype.constructor = THREE.Line; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author mikael emtinger / http://gomo.se/ - */ - -THREE.Mesh = function ( geometry, material ) { - - THREE.Object3D.call( this ); - - this.geometry = geometry; - this.material = material; - - if ( material instanceof Array ) { - - console.warn( 'DEPRECATED: Mesh material can no longer be an Array. Using material at index 0...' ); - this.material = material[ 0 ]; - - } - - if ( this.geometry ) { - - // calc bound radius - - if( ! this.geometry.boundingSphere ) { - - this.geometry.computeBoundingSphere(); - - } - - this.boundRadius = geometry.boundingSphere.radius; - - - // setup morph targets - - if( this.geometry.morphTargets.length ) { - - this.morphTargetBase = -1; - this.morphTargetForcedOrder = []; - this.morphTargetInfluences = []; - this.morphTargetDictionary = {}; - - for( var m = 0; m < this.geometry.morphTargets.length; m ++ ) { - - this.morphTargetInfluences.push( 0 ); - this.morphTargetDictionary[ this.geometry.morphTargets[ m ].name ] = m; - - } - - } - - } - -} - -THREE.Mesh.prototype = new THREE.Object3D(); -THREE.Mesh.prototype.constructor = THREE.Mesh; -THREE.Mesh.prototype.supr = THREE.Object3D.prototype; - - -/* - * Get Morph Target Index by Name - */ - -THREE.Mesh.prototype.getMorphTargetIndexByName = function( name ) { - - if ( this.morphTargetDictionary[ name ] !== undefined ) { - - return this.morphTargetDictionary[ name ]; - } - - console.log( "THREE.Mesh.getMorphTargetIndexByName: morph target " + name + " does not exist. Returning 0." ); - return 0; - -} -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Bone = function( belongsToSkin ) { - - THREE.Object3D.call( this ); - - this.skin = belongsToSkin; - this.skinMatrix = new THREE.Matrix4(); - -}; - -THREE.Bone.prototype = new THREE.Object3D(); -THREE.Bone.prototype.constructor = THREE.Bone; -THREE.Bone.prototype.supr = THREE.Object3D.prototype; - - -THREE.Bone.prototype.update = function( parentSkinMatrix, forceUpdate ) { - - // update local - - if ( this.matrixAutoUpdate ) { - - forceUpdate |= this.updateMatrix(); - - } - - // update skin matrix - - if ( forceUpdate || this.matrixWorldNeedsUpdate ) { - - if( parentSkinMatrix ) { - - this.skinMatrix.multiply( parentSkinMatrix, this.matrix ); - - } else { - - this.skinMatrix.copy( this.matrix ); - - } - - this.matrixWorldNeedsUpdate = false; - forceUpdate = true; - - } - - // update children - - var child, i, l = this.children.length; - - for ( i = 0; i < l; i ++ ) { - - this.children[ i ].update( this.skinMatrix, forceUpdate ); - - } - -}; - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.SkinnedMesh = function( geometry, material ) { - - THREE.Mesh.call( this, geometry, material ); - - // init bones - - this.identityMatrix = new THREE.Matrix4(); - - this.bones = []; - this.boneMatrices = []; - - var b, bone, gbone, p, q, s; - - if ( this.geometry.bones !== undefined ) { - - for ( b = 0; b < this.geometry.bones.length; b ++ ) { - - gbone = this.geometry.bones[ b ]; - - p = gbone.pos; - q = gbone.rotq; - s = gbone.scl; - - bone = this.addBone(); - - bone.name = gbone.name; - bone.position.set( p[0], p[1], p[2] ); - bone.quaternion.set( q[0], q[1], q[2], q[3] ); - bone.useQuaternion = true; - - if ( s !== undefined ) { - - bone.scale.set( s[0], s[1], s[2] ); - - } else { - - bone.scale.set( 1, 1, 1 ); - - } - - } - - for ( b = 0; b < this.bones.length; b ++ ) { - - gbone = this.geometry.bones[ b ]; - bone = this.bones[ b ]; - - if ( gbone.parent === -1 ) { - - this.add( bone ); - - } else { - - this.bones[ gbone.parent ].add( bone ); - - } - - } - - this.boneMatrices = new Float32Array( 16 * this.bones.length ); - - this.pose(); - - } - -}; - -THREE.SkinnedMesh.prototype = new THREE.Mesh(); -THREE.SkinnedMesh.prototype.constructor = THREE.SkinnedMesh; - -THREE.SkinnedMesh.prototype.addBone = function( bone ) { - - if ( bone === undefined ) { - - bone = new THREE.Bone( this ); - - } - - this.bones.push( bone ); - - return bone; - -}; - -THREE.SkinnedMesh.prototype.updateMatrixWorld = function ( force ) { - - this.matrixAutoUpdate && this.updateMatrix(); - - // update matrixWorld - - if ( this.matrixWorldNeedsUpdate || force ) { - - if ( this.parent ) { - - this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix ); - - } else { - - this.matrixWorld.copy( this.matrix ); - - } - - this.matrixWorldNeedsUpdate = false; - - force = true; - - } - - // update children - - for ( var i = 0, l = this.children.length; i < l; i ++ ) { - - var child = this.children[ i ]; - - if ( child instanceof THREE.Bone ) { - - child.update( this.identityMatrix, false ); - - } else { - - child.updateMatrixWorld( true ); - - } - - } - - // flatten bone matrices to array - - var b, bl = this.bones.length, - ba = this.bones, - bm = this.boneMatrices; - - for ( b = 0; b < bl; b ++ ) { - - ba[ b ].skinMatrix.flattenToArrayOffset( bm, b * 16 ); - - } - -}; - -/* - * Pose - */ - -THREE.SkinnedMesh.prototype.pose = function() { - - this.updateMatrixWorld( true ); - - var bim, bone, boneInverses = []; - - for ( var b = 0; b < this.bones.length; b ++ ) { - - bone = this.bones[ b ]; - - var inverseMatrix = new THREE.Matrix4(); - inverseMatrix.getInverse( bone.skinMatrix ); - - boneInverses.push( inverseMatrix ); - - bone.skinMatrix.flattenToArrayOffset( this.boneMatrices, b * 16 ); - - } - - // project vertices to local - - if ( this.geometry.skinVerticesA === undefined ) { - - this.geometry.skinVerticesA = []; - this.geometry.skinVerticesB = []; - - var orgVertex, vertex; - - for ( var i = 0; i < this.geometry.skinIndices.length; i ++ ) { - - orgVertex = this.geometry.vertices[ i ].position; - - var indexA = this.geometry.skinIndices[ i ].x; - var indexB = this.geometry.skinIndices[ i ].y; - - vertex = new THREE.Vector3( orgVertex.x, orgVertex.y, orgVertex.z ); - this.geometry.skinVerticesA.push( boneInverses[ indexA ].multiplyVector3( vertex ) ); - - vertex = new THREE.Vector3( orgVertex.x, orgVertex.y, orgVertex.z ); - this.geometry.skinVerticesB.push( boneInverses[ indexB ].multiplyVector3( vertex ) ); - - // todo: add more influences - - // normalize weights - - if ( this.geometry.skinWeights[ i ].x + this.geometry.skinWeights[ i ].y !== 1 ) { - - var len = ( 1.0 - ( this.geometry.skinWeights[ i ].x + this.geometry.skinWeights[ i ].y ) ) * 0.5; - this.geometry.skinWeights[ i ].x += len; - this.geometry.skinWeights[ i ].y += len; - - } - - } - - } - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.MorphAnimMesh = function( geometry, material ) { - - THREE.Mesh.call( this, geometry, material ); - - // API - - this.duration = 1000; // milliseconds - this.mirroredLoop = false; - this.time = 0; - - // internals - - this.lastKeyframe = 0; - this.currentKeyframe = 0; - - this.direction = 1; - this.directionBackwards = false; - -}; - -THREE.MorphAnimMesh.prototype = new THREE.Mesh(); -THREE.MorphAnimMesh.prototype.constructor = THREE.MorphAnimMesh; - -THREE.MorphAnimMesh.prototype.updateAnimation = function ( delta ) { - - var frameTime = this.duration / ( this.geometry.morphTargets.length - 1 ); - - this.time += this.direction * delta; - - if ( this.mirroredLoop ) { - - if ( this.time > this.duration || this.time < 0 ) { - - this.direction *= -1; - - if ( this.time > this.duration ) { - - this.time = this.duration; - this.directionBackwards = true; - - } - - if ( this.time < 0 ) { - - this.time = 0; - this.directionBackwards = false; - - } - - } - - } else { - - this.time = this.time % this.duration; - - } - - var keyframe = THREE.Math.clamp( Math.floor( this.time / frameTime ), 0, this.geometry.morphTargets.length - 1 ); - - if ( keyframe != this.currentKeyframe ) { - - this.morphTargetInfluences[ this.lastKeyframe ] = 0; - this.morphTargetInfluences[ this.currentKeyframe ] = 1; - - this.morphTargetInfluences[ keyframe ] = 0; - - this.lastKeyframe = this.currentKeyframe; - this.currentKeyframe = keyframe; - - } - - var mix = ( this.time % frameTime ) / frameTime; - - if ( this.directionBackwards ) { - - mix = 1 - mix; - - } - - this.morphTargetInfluences[ this.currentKeyframe ] = mix; - this.morphTargetInfluences[ this.lastKeyframe ] = 1 - mix; - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Ribbon = function ( geometry, material ) { - - THREE.Object3D.call( this ); - - this.geometry = geometry; - this.material = material; - -}; - -THREE.Ribbon.prototype = new THREE.Object3D(); -THREE.Ribbon.prototype.constructor = THREE.Ribbon; -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.LOD = function () { - - THREE.Object3D.call( this ); - - this.LODs = []; - -}; - -THREE.LOD.prototype = new THREE.Object3D(); -THREE.LOD.prototype.constructor = THREE.LOD; -THREE.LOD.prototype.supr = THREE.Object3D.prototype; - -THREE.LOD.prototype.addLevel = function ( object3D, visibleAtDistance ) { - - if ( visibleAtDistance === undefined ) { - - visibleAtDistance = 0; - - } - - visibleAtDistance = Math.abs( visibleAtDistance ); - - for ( var l = 0; l < this.LODs.length; l ++ ) { - - if ( visibleAtDistance < this.LODs[ l ].visibleAtDistance ) { - - break; - - } - - } - - this.LODs.splice( l, 0, { visibleAtDistance: visibleAtDistance, object3D: object3D } ); - this.add( object3D ); - -}; - -THREE.LOD.prototype.update = function ( camera ) { - - if ( this.LODs.length > 1 ) { - - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - var inverse = camera.matrixWorldInverse; - var distance = -( inverse.n31 * this.position.x + inverse.n32 * this.position.y + inverse.n33 * this.position.z + inverse.n34 ); - - this.LODs[ 0 ].object3D.visible = true; - - for ( var l = 1; l < this.LODs.length; l ++ ) { - - if( distance >= this.LODs[ l ].visibleAtDistance ) { - - this.LODs[ l - 1 ].object3D.visible = false; - this.LODs[ l ].object3D.visible = true; - - } else { - - break; - - } - - } - - for( ; l < this.LODs.length; l ++ ) { - - this.LODs[ l ].object3D.visible = false; - - } - - } - -}; -/** - * @author mikael emtinger / http://gomo.se/ - */ - -THREE.Sprite = function ( parameters ) { - - THREE.Object3D.call( this ); - - this.color = ( parameters.color !== undefined ) ? new THREE.Color( parameters.color ) : new THREE.Color( 0xffffff ); - this.map = ( parameters.map !== undefined ) ? parameters.map : new THREE.Texture(); - this.blending = ( parameters.blending !== undefined ) ? parameters.blending : THREE.NormalBlending; - - this.useScreenCoordinates = ( parameters.useScreenCoordinates !== undefined ) ? parameters.useScreenCoordinates : true; - this.mergeWith3D = ( parameters.mergeWith3D !== undefined ) ? parameters.mergeWith3D : !this.useScreenCoordinates; - this.affectedByDistance = ( parameters.affectedByDistance !== undefined ) ? parameters.affectedByDistance : !this.useScreenCoordinates; - this.scaleByViewport = ( parameters.scaleByViewport !== undefined ) ? parameters.scaleByViewport : !this.affectedByDistance; - this.alignment = ( parameters.alignment instanceof THREE.Vector2 ) ? parameters.alignment : THREE.SpriteAlignment.center; - - this.rotation3d = this.rotation; - this.rotation = 0; - this.opacity = 1; - - this.uvOffset = new THREE.Vector2( 0, 0 ); - this.uvScale = new THREE.Vector2( 1, 1 ); - -}; - -THREE.Sprite.prototype = new THREE.Object3D(); -THREE.Sprite.prototype.constructor = THREE.Sprite; - - -/* - * Custom update matrix - */ - -THREE.Sprite.prototype.updateMatrix = function () { - - this.matrix.setPosition( this.position ); - - this.rotation3d.set( 0, 0, this.rotation ); - this.matrix.setRotationFromEuler( this.rotation3d ); - - if ( this.scale.x !== 1 || this.scale.y !== 1 ) { - - this.matrix.scale( this.scale ); - this.boundRadiusScale = Math.max( this.scale.x, this.scale.y ); - - } - - this.matrixWorldNeedsUpdate = true; - -}; - -/* - * Alignment - */ - -THREE.SpriteAlignment = {}; -THREE.SpriteAlignment.topLeft = new THREE.Vector2( 1, -1 ); -THREE.SpriteAlignment.topCenter = new THREE.Vector2( 0, -1 ); -THREE.SpriteAlignment.topRight = new THREE.Vector2( -1, -1 ); -THREE.SpriteAlignment.centerLeft = new THREE.Vector2( 1, 0 ); -THREE.SpriteAlignment.center = new THREE.Vector2( 0, 0 ); -THREE.SpriteAlignment.centerRight = new THREE.Vector2( -1, 0 ); -THREE.SpriteAlignment.bottomLeft = new THREE.Vector2( 1, 1 ); -THREE.SpriteAlignment.bottomCenter = new THREE.Vector2( 0, 1 ); -THREE.SpriteAlignment.bottomRight = new THREE.Vector2( -1, 1 ); -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.Scene = function () { - - THREE.Object3D.call( this ); - - this.fog = null; - this.overrideMaterial = null; - - this.matrixAutoUpdate = false; - - this.objects = []; - this.lights = []; - - this.__objectsAdded = []; - this.__objectsRemoved = []; - -}; - -THREE.Scene.prototype = new THREE.Object3D(); -THREE.Scene.prototype.constructor = THREE.Scene; - -THREE.Scene.prototype.addObject = function ( object ) { - - if ( object instanceof THREE.Light ) { - - if ( this.lights.indexOf( object ) === - 1 ) { - - this.lights.push( object ); - - } - - } else if ( !( object instanceof THREE.Camera || object instanceof THREE.Bone ) ) { - - if ( this.objects.indexOf( object ) === - 1 ) { - - this.objects.push( object ); - this.__objectsAdded.push( object ); - - // check if previously removed - - var i = this.__objectsRemoved.indexOf( object ); - - if ( i !== -1 ) { - - this.__objectsRemoved.splice( i, 1 ); - - } - - } - - } - - for ( var c = 0; c < object.children.length; c ++ ) { - - this.addObject( object.children[ c ] ); - - } - -}; - -THREE.Scene.prototype.removeObject = function ( object ) { - - if ( object instanceof THREE.Light ) { - - var i = this.lights.indexOf( object ); - - if ( i !== -1 ) { - - this.lights.splice( i, 1 ); - - } - - } else if ( !( object instanceof THREE.Camera ) ) { - - var i = this.objects.indexOf( object ); - - if( i !== -1 ) { - - this.objects.splice( i, 1 ); - this.__objectsRemoved.push( object ); - - // check if previously added - - var ai = this.__objectsAdded.indexOf( object ); - - if ( ai !== -1 ) { - - this.__objectsAdded.splice( ai, 1 ); - - } - - } - - } - - for ( var c = 0; c < object.children.length; c ++ ) { - - this.removeObject( object.children[ c ] ); - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Fog = function ( hex, near, far ) { - - this.color = new THREE.Color( hex ); - - this.near = ( near !== undefined ) ? near : 1; - this.far = ( far !== undefined ) ? far : 1000; - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.FogExp2 = function ( hex, density ) { - - this.color = new THREE.Color( hex ); - this.density = ( density !== undefined ) ? density : 0.00025; - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.DOMRenderer = function () { - - var _renderList = null, - _projector = new THREE.Projector(), - _div = document.createElement( 'div' ), - _width, _height, _widthHalf, _heightHalf; - - this.domElement = _div; - - this.setSize = function ( width, height ) { - - _width = width; _height = height; - _widthHalf = _width / 2; _heightHalf = _height / 2; - - }; - - this.render = function ( scene, camera ) { - - var e, el, m, ml, element, material, dom, v1x, v1y; - - _renderList = _projector.projectScene( scene, camera ); - - for ( e = 0, el = _renderList.length; e < el; e++ ) { - - element = _renderList[ e ]; - - if ( element instanceof THREE.RenderableParticle ) { - - v1x = element.x * _widthHalf + _widthHalf; v1y = element.y * _heightHalf + _heightHalf; - - for ( m = 0, ml = element.material.length; m < ml; m++ ) { - - material = element.material[ m ]; - - if ( material instanceof THREE.ParticleDOMMaterial ) { - - dom = material.domElement; - dom.style.left = v1x + 'px'; - dom.style.top = v1y + 'px'; - - } - - } - - } - - } - - }; - -} -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.CanvasRenderer = function ( parameters ) { - - parameters = parameters || {}; - - var _this = this, - _renderData, _elements, _lights, - _projector = new THREE.Projector(), - - _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElement( 'canvas' ), - - _canvasWidth, _canvasHeight, _canvasWidthHalf, _canvasHeightHalf, - _context = _canvas.getContext( '2d' ), - - _clearColor = new THREE.Color( 0x000000 ), - _clearOpacity = 0, - - _contextGlobalAlpha = 1, - _contextGlobalCompositeOperation = 0, - _contextStrokeStyle = null, - _contextFillStyle = null, - _contextLineWidth = null, - _contextLineCap = null, - _contextLineJoin = null, - - _v1, _v2, _v3, _v4, - _v5 = new THREE.RenderableVertex(), - _v6 = new THREE.RenderableVertex(), - - _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, - _v4x, _v4y, _v5x, _v5y, _v6x, _v6y, - - _color = new THREE.Color(), - _color1 = new THREE.Color(), - _color2 = new THREE.Color(), - _color3 = new THREE.Color(), - _color4 = new THREE.Color(), - - _patterns = [], _imagedatas = [], - - _near, _far, - - _image, _uvs, - _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, - - _clipRect = new THREE.Rectangle(), - _clearRect = new THREE.Rectangle(), - _bboxRect = new THREE.Rectangle(), - - _enableLighting = false, - _ambientLight = new THREE.Color(), - _directionalLights = new THREE.Color(), - _pointLights = new THREE.Color(), - - _pi2 = Math.PI * 2, - _vector3 = new THREE.Vector3(), // Needed for PointLight - - _pixelMap, _pixelMapContext, _pixelMapImage, _pixelMapData, - _gradientMap, _gradientMapContext, _gradientMapQuality = 16; - - _pixelMap = document.createElement( 'canvas' ); - _pixelMap.width = _pixelMap.height = 2; - - _pixelMapContext = _pixelMap.getContext( '2d' ); - _pixelMapContext.fillStyle = 'rgba(0,0,0,1)'; - _pixelMapContext.fillRect( 0, 0, 2, 2 ); - - _pixelMapImage = _pixelMapContext.getImageData( 0, 0, 2, 2 ); - _pixelMapData = _pixelMapImage.data; - - _gradientMap = document.createElement( 'canvas' ); - _gradientMap.width = _gradientMap.height = _gradientMapQuality; - - _gradientMapContext = _gradientMap.getContext( '2d' ); - _gradientMapContext.translate( - _gradientMapQuality / 2, - _gradientMapQuality / 2 ); - _gradientMapContext.scale( _gradientMapQuality, _gradientMapQuality ); - - _gradientMapQuality --; // Fix UVs - - this.domElement = _canvas; - - this.autoClear = true; - this.sortObjects = true; - this.sortElements = true; - - this.info = { - - render: { - - vertices: 0, - faces: 0 - - } - - } - - this.setSize = function ( width, height ) { - - _canvasWidth = width; - _canvasHeight = height; - _canvasWidthHalf = Math.floor( _canvasWidth / 2 ); - _canvasHeightHalf = Math.floor( _canvasHeight / 2 ); - - _canvas.width = _canvasWidth; - _canvas.height = _canvasHeight; - - _clipRect.set( - _canvasWidthHalf, - _canvasHeightHalf, _canvasWidthHalf, _canvasHeightHalf ); - _clearRect.set( - _canvasWidthHalf, - _canvasHeightHalf, _canvasWidthHalf, _canvasHeightHalf ); - - _contextGlobalAlpha = 1; - _contextGlobalCompositeOperation = 0; - _contextStrokeStyle = null; - _contextFillStyle = null; - _contextLineWidth = null; - _contextLineCap = null; - _contextLineJoin = null; - - }; - - this.setClearColor = function( color, opacity ) { - - _clearColor.copy( color ); - _clearOpacity = opacity; - - _clearRect.set( - _canvasWidthHalf, - _canvasHeightHalf, _canvasWidthHalf, _canvasHeightHalf ); - - }; - - this.setClearColorHex = function( hex, opacity ) { - - _clearColor.setHex( hex ); - _clearOpacity = opacity; - - _clearRect.set( - _canvasWidthHalf, - _canvasHeightHalf, _canvasWidthHalf, _canvasHeightHalf ); - - }; - - this.clear = function () { - - _context.setTransform( 1, 0, 0, - 1, _canvasWidthHalf, _canvasHeightHalf ); - - if ( !_clearRect.isEmpty() ) { - - _clearRect.minSelf( _clipRect ); - _clearRect.inflate( 2 ); - - if ( _clearOpacity < 1 ) { - - _context.clearRect( Math.floor( _clearRect.getX() ), Math.floor( _clearRect.getY() ), Math.floor( _clearRect.getWidth() ), Math.floor( _clearRect.getHeight() ) ); - - } - - if ( _clearOpacity > 0 ) { - - setBlending( THREE.NormalBlending ); - setOpacity( 1 ); - - setFillStyle( 'rgba(' + Math.floor( _clearColor.r * 255 ) + ',' + Math.floor( _clearColor.g * 255 ) + ',' + Math.floor( _clearColor.b * 255 ) + ',' + _clearOpacity + ')' ); - - _context.fillRect( Math.floor( _clearRect.getX() ), Math.floor( _clearRect.getY() ), Math.floor( _clearRect.getWidth() ), Math.floor( _clearRect.getHeight() ) ); - - } - - _clearRect.empty(); - - } - - - }; - - this.render = function ( scene, camera ) { - - var e, el, element, material; - - this.autoClear ? this.clear() : _context.setTransform( 1, 0, 0, - 1, _canvasWidthHalf, _canvasHeightHalf ); - - _this.info.render.vertices = 0; - _this.info.render.faces = 0; - - _renderData = _projector.projectScene( scene, camera, this.sortElements ); - _elements = _renderData.elements; - _lights = _renderData.lights; - - - _context.fillStyle = 'rgba( 0, 255, 255, 0.5 )'; - _context.fillRect( _clipRect.getX(), _clipRect.getY(), _clipRect.getWidth(), _clipRect.getHeight() ); - - - _enableLighting = _lights.length > 0; - - if ( _enableLighting ) { - - calculateLights( _lights ); - - } - - for ( e = 0, el = _elements.length; e < el; e++ ) { - - element = _elements[ e ]; - - material = element.material; - material = material instanceof THREE.MeshFaceMaterial ? element.faceMaterial : material; - - if ( material == null || material.opacity == 0 ) continue; - - _bboxRect.empty(); - - if ( element instanceof THREE.RenderableParticle ) { - - _v1 = element; - _v1.x *= _canvasWidthHalf; _v1.y *= _canvasHeightHalf; - - renderParticle( _v1, element, material, scene ); - - } else if ( element instanceof THREE.RenderableLine ) { - - _v1 = element.v1; _v2 = element.v2; - - _v1.positionScreen.x *= _canvasWidthHalf; _v1.positionScreen.y *= _canvasHeightHalf; - _v2.positionScreen.x *= _canvasWidthHalf; _v2.positionScreen.y *= _canvasHeightHalf; - - _bboxRect.addPoint( _v1.positionScreen.x, _v1.positionScreen.y ); - _bboxRect.addPoint( _v2.positionScreen.x, _v2.positionScreen.y ); - - if ( _clipRect.intersects( _bboxRect ) ) { - - renderLine( _v1, _v2, element, material, scene ); - - } - - - } else if ( element instanceof THREE.RenderableFace3 ) { - - _v1 = element.v1; _v2 = element.v2; _v3 = element.v3; - - _v1.positionScreen.x *= _canvasWidthHalf; _v1.positionScreen.y *= _canvasHeightHalf; - _v2.positionScreen.x *= _canvasWidthHalf; _v2.positionScreen.y *= _canvasHeightHalf; - _v3.positionScreen.x *= _canvasWidthHalf; _v3.positionScreen.y *= _canvasHeightHalf; - - if ( material.overdraw ) { - - expand( _v1.positionScreen, _v2.positionScreen ); - expand( _v2.positionScreen, _v3.positionScreen ); - expand( _v3.positionScreen, _v1.positionScreen ); - - } - - _bboxRect.add3Points( _v1.positionScreen.x, _v1.positionScreen.y, - _v2.positionScreen.x, _v2.positionScreen.y, - _v3.positionScreen.x, _v3.positionScreen.y ); - - if ( _clipRect.intersects( _bboxRect ) ) { - - renderFace3( _v1, _v2, _v3, 0, 1, 2, element, material, scene ); - - } - - } else if ( element instanceof THREE.RenderableFace4 ) { - - _v1 = element.v1; _v2 = element.v2; _v3 = element.v3; _v4 = element.v4; - - _v1.positionScreen.x *= _canvasWidthHalf; _v1.positionScreen.y *= _canvasHeightHalf; - _v2.positionScreen.x *= _canvasWidthHalf; _v2.positionScreen.y *= _canvasHeightHalf; - _v3.positionScreen.x *= _canvasWidthHalf; _v3.positionScreen.y *= _canvasHeightHalf; - _v4.positionScreen.x *= _canvasWidthHalf; _v4.positionScreen.y *= _canvasHeightHalf; - - _v5.positionScreen.copy( _v2.positionScreen ); - _v6.positionScreen.copy( _v4.positionScreen ); - - if ( material.overdraw ) { - - expand( _v1.positionScreen, _v2.positionScreen ); - expand( _v2.positionScreen, _v4.positionScreen ); - expand( _v4.positionScreen, _v1.positionScreen ); - - expand( _v3.positionScreen, _v5.positionScreen ); - expand( _v3.positionScreen, _v6.positionScreen ); - - } - - _bboxRect.addPoint( _v1.positionScreen.x, _v1.positionScreen.y ); - _bboxRect.addPoint( _v2.positionScreen.x, _v2.positionScreen.y ); - _bboxRect.addPoint( _v3.positionScreen.x, _v3.positionScreen.y ); - _bboxRect.addPoint( _v4.positionScreen.x, _v4.positionScreen.y ); - - if ( _clipRect.intersects( _bboxRect ) ) { - - renderFace4( _v1, _v2, _v3, _v4, _v5, _v6, element, material, scene ); - - } - - } - - /* - _context.lineWidth = 1; - _context.strokeStyle = 'rgba( 0, 255, 0, 0.5 )'; - _context.strokeRect( _bboxRect.getX(), _bboxRect.getY(), _bboxRect.getWidth(), _bboxRect.getHeight() ); - */ - - _clearRect.addRectangle( _bboxRect ); - - - } - - - _context.lineWidth = 1; - _context.strokeStyle = 'rgba( 255, 0, 0, 0.5 )'; - _context.strokeRect( _clearRect.getX(), _clearRect.getY(), _clearRect.getWidth(), _clearRect.getHeight() ); - - - _context.setTransform( 1, 0, 0, 1, 0, 0 ); - - // - - function calculateLights( lights ) { - - var l, ll, light, lightColor; - - _ambientLight.setRGB( 0, 0, 0 ); - _directionalLights.setRGB( 0, 0, 0 ); - _pointLights.setRGB( 0, 0, 0 ); - - for ( l = 0, ll = lights.length; l < ll; l ++ ) { - - light = lights[ l ]; - lightColor = light.color; - - if ( light instanceof THREE.AmbientLight ) { - - _ambientLight.r += lightColor.r; - _ambientLight.g += lightColor.g; - _ambientLight.b += lightColor.b; - - } else if ( light instanceof THREE.DirectionalLight ) { - - // for particles - - _directionalLights.r += lightColor.r; - _directionalLights.g += lightColor.g; - _directionalLights.b += lightColor.b; - - } else if ( light instanceof THREE.PointLight ) { - - // for particles - - _pointLights.r += lightColor.r; - _pointLights.g += lightColor.g; - _pointLights.b += lightColor.b; - - } - - } - - } - - function calculateLight( lights, position, normal, color ) { - - var l, ll, light, lightColor, lightPosition, amount; - - for ( l = 0, ll = lights.length; l < ll; l ++ ) { - - light = lights[ l ]; - lightColor = light.color; - - if ( light instanceof THREE.DirectionalLight ) { - - lightPosition = light.matrixWorld.getPosition(); - - amount = normal.dot( lightPosition ); - - if ( amount <= 0 ) continue; - - amount *= light.intensity; - - color.r += lightColor.r * amount; - color.g += lightColor.g * amount; - color.b += lightColor.b * amount; - - } else if ( light instanceof THREE.PointLight ) { - - lightPosition = light.matrixWorld.getPosition(); - - amount = normal.dot( _vector3.sub( lightPosition, position ).normalize() ); - - if ( amount <= 0 ) continue; - - amount *= light.distance == 0 ? 1 : 1 - Math.min( position.distanceTo( lightPosition ) / light.distance, 1 ); - - if ( amount == 0 ) continue; - - amount *= light.intensity; - - color.r += lightColor.r * amount; - color.g += lightColor.g * amount; - color.b += lightColor.b * amount; - - } - - } - - } - - function renderParticle ( v1, element, material, scene ) { - - setOpacity( material.opacity ); - setBlending( material.blending ); - - var width, height, scaleX, scaleY, - bitmap, bitmapWidth, bitmapHeight; - - if ( material instanceof THREE.ParticleBasicMaterial ) { - - if ( material.map ) { - - bitmap = material.map.image; - bitmapWidth = bitmap.width >> 1; - bitmapHeight = bitmap.height >> 1; - - scaleX = element.scale.x * _canvasWidthHalf; - scaleY = element.scale.y * _canvasHeightHalf; - - width = scaleX * bitmapWidth; - height = scaleY * bitmapHeight; - - // TODO: Rotations break this... - - _bboxRect.set( v1.x - width, v1.y - height, v1.x + width, v1.y + height ); - - if ( !_clipRect.intersects( _bboxRect ) ) { - - return; - - } - - _context.save(); - _context.translate( v1.x, v1.y ); - _context.rotate( - element.rotation ); - _context.scale( scaleX, - scaleY ); - - _context.translate( - bitmapWidth, - bitmapHeight ); - _context.drawImage( bitmap, 0, 0 ); - - _context.restore(); - - } - - - _context.beginPath(); - _context.moveTo( v1.x - 10, v1.y ); - _context.lineTo( v1.x + 10, v1.y ); - _context.moveTo( v1.x, v1.y - 10 ); - _context.lineTo( v1.x, v1.y + 10 ); - _context.closePath(); - _context.strokeStyle = 'rgb(255,255,0)'; - _context.stroke(); - - - } else if ( material instanceof THREE.ParticleCanvasMaterial ) { - - width = element.scale.x * _canvasWidthHalf; - height = element.scale.y * _canvasHeightHalf; - - _bboxRect.set( v1.x - width, v1.y - height, v1.x + width, v1.y + height ); - - if ( !_clipRect.intersects( _bboxRect ) ) { - - return; - - } - - setStrokeStyle( material.color.getContextStyle() ); - setFillStyle( material.color.getContextStyle() ); - - _context.save(); - _context.translate( v1.x, v1.y ); - _context.rotate( - element.rotation ); - _context.scale( width, height ); - - material.program( _context ); - - _context.restore(); - - } - - } - - function renderLine( v1, v2, element, material, scene ) { - - setOpacity( material.opacity ); - setBlending( material.blending ); - - _context.beginPath(); - _context.moveTo( v1.positionScreen.x, v1.positionScreen.y ); - _context.lineTo( v2.positionScreen.x, v2.positionScreen.y ); - _context.closePath(); - - if ( material instanceof THREE.LineBasicMaterial ) { - - setLineWidth( material.linewidth ); - setLineCap( material.linecap ); - setLineJoin( material.linejoin ); - setStrokeStyle( material.color.getContextStyle() ); - - _context.stroke(); - _bboxRect.inflate( material.linewidth * 2 ); - - } - - } - - function renderFace3( v1, v2, v3, uv1, uv2, uv3, element, material, scene ) { - - _this.info.render.vertices += 3; - _this.info.render.faces ++; - - setOpacity( material.opacity ); - setBlending( material.blending ); - - _v1x = v1.positionScreen.x; _v1y = v1.positionScreen.y; - _v2x = v2.positionScreen.x; _v2y = v2.positionScreen.y; - _v3x = v3.positionScreen.x; _v3y = v3.positionScreen.y; - - drawTriangle( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y ); - - if ( material instanceof THREE.MeshBasicMaterial ) { - - if ( material.map/* && !material.wireframe*/ ) { - - if ( material.map.mapping instanceof THREE.UVMapping ) { - - _uvs = element.uvs[ 0 ]; - patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uvs[ uv1 ].u, _uvs[ uv1 ].v, _uvs[ uv2 ].u, _uvs[ uv2 ].v, _uvs[ uv3 ].u, _uvs[ uv3 ].v, material.map ); - - } - - - } else if ( material.envMap ) { - - if ( material.envMap.mapping instanceof THREE.SphericalReflectionMapping ) { - - var cameraMatrix = camera.matrixWorldInverse; - - _vector3.copy( element.vertexNormalsWorld[ uv1 ] ); - _uv1x = ( _vector3.x * cameraMatrix.n11 + _vector3.y * cameraMatrix.n12 + _vector3.z * cameraMatrix.n13 ) * 0.5 + 0.5; - _uv1y = - ( _vector3.x * cameraMatrix.n21 + _vector3.y * cameraMatrix.n22 + _vector3.z * cameraMatrix.n23 ) * 0.5 + 0.5; - - _vector3.copy( element.vertexNormalsWorld[ uv2 ] ); - _uv2x = ( _vector3.x * cameraMatrix.n11 + _vector3.y * cameraMatrix.n12 + _vector3.z * cameraMatrix.n13 ) * 0.5 + 0.5; - _uv2y = - ( _vector3.x * cameraMatrix.n21 + _vector3.y * cameraMatrix.n22 + _vector3.z * cameraMatrix.n23 ) * 0.5 + 0.5; - - _vector3.copy( element.vertexNormalsWorld[ uv3 ] ); - _uv3x = ( _vector3.x * cameraMatrix.n11 + _vector3.y * cameraMatrix.n12 + _vector3.z * cameraMatrix.n13 ) * 0.5 + 0.5; - _uv3y = - ( _vector3.x * cameraMatrix.n21 + _vector3.y * cameraMatrix.n22 + _vector3.z * cameraMatrix.n23 ) * 0.5 + 0.5; - - patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uv1x, _uv1y, _uv2x, _uv2y, _uv3x, _uv3y, material.envMap ); - - }/* else if ( material.envMap.mapping == THREE.SphericalRefractionMapping ) { - - - - }*/ - - - } else { - - material.wireframe ? strokePath( material.color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( material.color ); - - } - - } else if ( material instanceof THREE.MeshLambertMaterial ) { - - if ( material.map && !material.wireframe ) { - - if ( material.map.mapping instanceof THREE.UVMapping ) { - - _uvs = element.uvs[ 0 ]; - patternPath( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _uvs[ uv1 ].u, _uvs[ uv1 ].v, _uvs[ uv2 ].u, _uvs[ uv2 ].v, _uvs[ uv3 ].u, _uvs[ uv3 ].v, material.map ); - - } - - setBlending( THREE.SubtractiveBlending ); - - } - - if ( _enableLighting ) { - - if ( !material.wireframe && material.shading == THREE.SmoothShading && element.vertexNormalsWorld.length == 3 ) { - - _color1.r = _color2.r = _color3.r = _ambientLight.r; - _color1.g = _color2.g = _color3.g = _ambientLight.g; - _color1.b = _color2.b = _color3.b = _ambientLight.b; - - calculateLight( _lights, element.v1.positionWorld, element.vertexNormalsWorld[ 0 ], _color1 ); - calculateLight( _lights, element.v2.positionWorld, element.vertexNormalsWorld[ 1 ], _color2 ); - calculateLight( _lights, element.v3.positionWorld, element.vertexNormalsWorld[ 2 ], _color3 ); - - _color1.r = Math.max( 0, Math.min( material.color.r * _color1.r, 1 ) ); - _color1.g = Math.max( 0, Math.min( material.color.g * _color1.g, 1 ) ); - _color1.b = Math.max( 0, Math.min( material.color.b * _color1.b, 1 ) ); - - _color2.r = Math.max( 0, Math.min( material.color.r * _color2.r, 1 ) ); - _color2.g = Math.max( 0, Math.min( material.color.g * _color2.g, 1 ) ); - _color2.b = Math.max( 0, Math.min( material.color.b * _color2.b, 1 ) ); - - _color3.r = Math.max( 0, Math.min( material.color.r * _color3.r, 1 ) ); - _color3.g = Math.max( 0, Math.min( material.color.g * _color3.g, 1 ) ); - _color3.b = Math.max( 0, Math.min( material.color.b * _color3.b, 1 ) ); - - _color4.r = ( _color2.r + _color3.r ) * 0.5; - _color4.g = ( _color2.g + _color3.g ) * 0.5; - _color4.b = ( _color2.b + _color3.b ) * 0.5; - - _image = getGradientTexture( _color1, _color2, _color3, _color4 ); - - clipImage( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, 0, 0, 1, 0, 0, 1, _image ); - - } else { - - _color.r = _ambientLight.r; - _color.g = _ambientLight.g; - _color.b = _ambientLight.b; - - calculateLight( _lights, element.centroidWorld, element.normalWorld, _color ); - - _color.r = Math.max( 0, Math.min( material.color.r * _color.r, 1 ) ); - _color.g = Math.max( 0, Math.min( material.color.g * _color.g, 1 ) ); - _color.b = Math.max( 0, Math.min( material.color.b * _color.b, 1 ) ); - - material.wireframe ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( _color ); - - } - - } else { - - material.wireframe ? strokePath( material.color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( material.color ); - - } - - } else if ( material instanceof THREE.MeshDepthMaterial ) { - - _near = camera.near; - _far = camera.far; - - _color1.r = _color1.g = _color1.b = 1 - smoothstep( v1.positionScreen.z, _near, _far ); - _color2.r = _color2.g = _color2.b = 1 - smoothstep( v2.positionScreen.z, _near, _far ); - _color3.r = _color3.g = _color3.b = 1 - smoothstep( v3.positionScreen.z, _near, _far ); - - _color4.r = ( _color2.r + _color3.r ) * 0.5; - _color4.g = ( _color2.g + _color3.g ) * 0.5; - _color4.b = ( _color2.b + _color3.b ) * 0.5; - - _image = getGradientTexture( _color1, _color2, _color3, _color4 ); - - clipImage( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, 0, 0, 1, 0, 0, 1, _image ); - - } else if ( material instanceof THREE.MeshNormalMaterial ) { - - _color.r = normalToComponent( element.normalWorld.x ); - _color.g = normalToComponent( element.normalWorld.y ); - _color.b = normalToComponent( element.normalWorld.z ); - - material.wireframe ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( _color ); - - } - - } - - function renderFace4( v1, v2, v3, v4, v5, v6, element, material, scene ) { - - _this.info.render.vertices += 4; - _this.info.render.faces ++; - - setOpacity( material.opacity ); - setBlending( material.blending ); - - if ( material.map || material.envMap ) { - - // Let renderFace3() handle this - - renderFace3( v1, v2, v4, 0, 1, 3, element, material, scene ); - renderFace3( v5, v3, v6, 1, 2, 3, element, material, scene ); - - return; - - } - - _v1x = v1.positionScreen.x; _v1y = v1.positionScreen.y; - _v2x = v2.positionScreen.x; _v2y = v2.positionScreen.y; - _v3x = v3.positionScreen.x; _v3y = v3.positionScreen.y; - _v4x = v4.positionScreen.x; _v4y = v4.positionScreen.y; - _v5x = v5.positionScreen.x; _v5y = v5.positionScreen.y; - _v6x = v6.positionScreen.x; _v6y = v6.positionScreen.y; - - if ( material instanceof THREE.MeshBasicMaterial ) { - - drawQuad( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _v4x, _v4y ); - - material.wireframe ? strokePath( material.color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( material.color ); - - } else if ( material instanceof THREE.MeshLambertMaterial ) { - - if ( _enableLighting ) { - - if ( !material.wireframe && material.shading == THREE.SmoothShading && element.vertexNormalsWorld.length == 4 ) { - - _color1.r = _color2.r = _color3.r = _color4.r = _ambientLight.r; - _color1.g = _color2.g = _color3.g = _color4.g = _ambientLight.g; - _color1.b = _color2.b = _color3.b = _color4.b = _ambientLight.b; - - calculateLight( _lights, element.v1.positionWorld, element.vertexNormalsWorld[ 0 ], _color1 ); - calculateLight( _lights, element.v2.positionWorld, element.vertexNormalsWorld[ 1 ], _color2 ); - calculateLight( _lights, element.v4.positionWorld, element.vertexNormalsWorld[ 3 ], _color3 ); - calculateLight( _lights, element.v3.positionWorld, element.vertexNormalsWorld[ 2 ], _color4 ); - - _color1.r = Math.max( 0, Math.min( material.color.r * _color1.r, 1 ) ); - _color1.g = Math.max( 0, Math.min( material.color.g * _color1.g, 1 ) ); - _color1.b = Math.max( 0, Math.min( material.color.b * _color1.b, 1 ) ); - - _color2.r = Math.max( 0, Math.min( material.color.r * _color2.r, 1 ) ); - _color2.g = Math.max( 0, Math.min( material.color.g * _color2.g, 1 ) ); - _color2.b = Math.max( 0, Math.min( material.color.b * _color2.b, 1 ) ); - - _color3.r = Math.max( 0, Math.min( material.color.r * _color3.r, 1 ) ); - _color3.g = Math.max( 0, Math.min( material.color.g * _color3.g, 1 ) ); - _color3.b = Math.max( 0, Math.min( material.color.b * _color3.b, 1 ) ); - - _color4.r = Math.max( 0, Math.min( material.color.r * _color4.r, 1 ) ); - _color4.g = Math.max( 0, Math.min( material.color.g * _color4.g, 1 ) ); - _color4.b = Math.max( 0, Math.min( material.color.b * _color4.b, 1 ) ); - - _image = getGradientTexture( _color1, _color2, _color3, _color4 ); - - // TODO: UVs are incorrect, v4->v3? - - drawTriangle( _v1x, _v1y, _v2x, _v2y, _v4x, _v4y ); - clipImage( _v1x, _v1y, _v2x, _v2y, _v4x, _v4y, 0, 0, 1, 0, 0, 1, _image ); - - drawTriangle( _v5x, _v5y, _v3x, _v3y, _v6x, _v6y ); - clipImage( _v5x, _v5y, _v3x, _v3y, _v6x, _v6y, 1, 0, 1, 1, 0, 1, _image ); - - } else { - - _color.r = _ambientLight.r; - _color.g = _ambientLight.g; - _color.b = _ambientLight.b; - - calculateLight( _lights, element.centroidWorld, element.normalWorld, _color ); - - _color.r = Math.max( 0, Math.min( material.color.r * _color.r, 1 ) ); - _color.g = Math.max( 0, Math.min( material.color.g * _color.g, 1 ) ); - _color.b = Math.max( 0, Math.min( material.color.b * _color.b, 1 ) ); - - drawQuad( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _v4x, _v4y ); - - material.wireframe ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( _color ); - - } - - } else { - - drawQuad( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _v4x, _v4y ); - - material.wireframe ? strokePath( material.color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( material.color ); - - } - - } else if ( material instanceof THREE.MeshNormalMaterial ) { - - _color.r = normalToComponent( element.normalWorld.x ); - _color.g = normalToComponent( element.normalWorld.y ); - _color.b = normalToComponent( element.normalWorld.z ); - - drawQuad( _v1x, _v1y, _v2x, _v2y, _v3x, _v3y, _v4x, _v4y ); - - material.wireframe ? strokePath( _color, material.wireframeLinewidth, material.wireframeLinecap, material.wireframeLinejoin ) : fillPath( _color ); - - } else if ( material instanceof THREE.MeshDepthMaterial ) { - - _near = camera.near; - _far = camera.far; - - _color1.r = _color1.g = _color1.b = 1 - smoothstep( v1.positionScreen.z, _near, _far ); - _color2.r = _color2.g = _color2.b = 1 - smoothstep( v2.positionScreen.z, _near, _far ); - _color3.r = _color3.g = _color3.b = 1 - smoothstep( v4.positionScreen.z, _near, _far ); - _color4.r = _color4.g = _color4.b = 1 - smoothstep( v3.positionScreen.z, _near, _far ); - - _image = getGradientTexture( _color1, _color2, _color3, _color4 ); - - // TODO: UVs are incorrect, v4->v3? - - drawTriangle( _v1x, _v1y, _v2x, _v2y, _v4x, _v4y ); - clipImage( _v1x, _v1y, _v2x, _v2y, _v4x, _v4y, 0, 0, 1, 0, 0, 1, _image ); - - drawTriangle( _v5x, _v5y, _v3x, _v3y, _v6x, _v6y ); - clipImage( _v5x, _v5y, _v3x, _v3y, _v6x, _v6y, 1, 0, 1, 1, 0, 1, _image ); - - } - - } - - // - - function drawTriangle( x0, y0, x1, y1, x2, y2 ) { - - _context.beginPath(); - _context.moveTo( x0, y0 ); - _context.lineTo( x1, y1 ); - _context.lineTo( x2, y2 ); - _context.lineTo( x0, y0 ); - _context.closePath(); - - } - - function drawQuad( x0, y0, x1, y1, x2, y2, x3, y3 ) { - - _context.beginPath(); - _context.moveTo( x0, y0 ); - _context.lineTo( x1, y1 ); - _context.lineTo( x2, y2 ); - _context.lineTo( x3, y3 ); - _context.lineTo( x0, y0 ); - _context.closePath(); - - } - - function strokePath( color, linewidth, linecap, linejoin ) { - - setLineWidth( linewidth ); - setLineCap( linecap ); - setLineJoin( linejoin ); - setStrokeStyle( color.getContextStyle() ); - - _context.stroke(); - - _bboxRect.inflate( linewidth * 2 ); - - } - - function fillPath( color ) { - - setFillStyle( color.getContextStyle() ); - _context.fill(); - - } - - function patternPath( x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, u2, v2, texture ) { - - if ( texture.image.width == 0 ) return; - - if ( texture.needsUpdate == true || _patterns[ texture.id ] == undefined ) { - - var repeatX = texture.wrapS == THREE.RepeatWrapping; - var repeatY = texture.wrapT == THREE.RepeatWrapping; - - _patterns[ texture.id ] = _context.createPattern( texture.image, repeatX && repeatY ? 'repeat' : repeatX && !repeatY ? 'repeat-x' : !repeatX && repeatY ? 'repeat-y' : 'no-repeat' ); - - texture.needsUpdate = false; - - } - - setFillStyle( _patterns[ texture.id ] ); - - // http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 - - var a, b, c, d, e, f, det, idet, - offsetX = texture.offset.x / texture.repeat.x, - offsetY = texture.offset.y / texture.repeat.y, - width = texture.image.width * texture.repeat.x, - height = texture.image.height * texture.repeat.y; - - u0 = ( u0 + offsetX ) * width; - v0 = ( v0 + offsetY ) * height; - - u1 = ( u1 + offsetX ) * width; - v1 = ( v1 + offsetY ) * height; - - u2 = ( u2 + offsetX ) * width; - v2 = ( v2 + offsetY ) * height; - - x1 -= x0; y1 -= y0; - x2 -= x0; y2 -= y0; - - u1 -= u0; v1 -= v0; - u2 -= u0; v2 -= v0; - - det = u1 * v2 - u2 * v1; - - if ( det == 0 ) { - - if ( _imagedatas[ texture.id ] === undefined ) { - - var canvas = document.createElement( 'canvas' ) - canvas.width = texture.image.width; - canvas.height = texture.image.height; - - var context = canvas.getContext( '2d' ); - context.drawImage( texture.image, 0, 0 ); - - _imagedatas[ texture.id ] = context.getImageData( 0, 0, texture.image.width, texture.image.height ).data; - - // variables cannot be deleted in ES5 strict mode - //delete canvas; - - } - - var data = _imagedatas[ texture.id ]; - var index = ( Math.floor( u0 ) + Math.floor( v0 ) * texture.image.width ) * 4; - - _color.setRGB( data[ index ] / 255, data[ index + 1 ] / 255, data[ index + 2 ] / 255 ); - fillPath( _color ); - - return; - - } - - idet = 1 / det; - - a = ( v2 * x1 - v1 * x2 ) * idet; - b = ( v2 * y1 - v1 * y2 ) * idet; - c = ( u1 * x2 - u2 * x1 ) * idet; - d = ( u1 * y2 - u2 * y1 ) * idet; - - e = x0 - a * u0 - c * v0; - f = y0 - b * u0 - d * v0; - - _context.save(); - _context.transform( a, b, c, d, e, f ); - _context.fill(); - _context.restore(); - - } - - function clipImage( x0, y0, x1, y1, x2, y2, u0, v0, u1, v1, u2, v2, image ) { - - // http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 - - var a, b, c, d, e, f, det, idet, - width = image.width - 1, - height = image.height - 1; - - u0 *= width; v0 *= height; - u1 *= width; v1 *= height; - u2 *= width; v2 *= height; - - x1 -= x0; y1 -= y0; - x2 -= x0; y2 -= y0; - - u1 -= u0; v1 -= v0; - u2 -= u0; v2 -= v0; - - det = u1 * v2 - u2 * v1; - - idet = 1 / det; - - a = ( v2 * x1 - v1 * x2 ) * idet; - b = ( v2 * y1 - v1 * y2 ) * idet; - c = ( u1 * x2 - u2 * x1 ) * idet; - d = ( u1 * y2 - u2 * y1 ) * idet; - - e = x0 - a * u0 - c * v0; - f = y0 - b * u0 - d * v0; - - _context.save(); - _context.transform( a, b, c, d, e, f ); - _context.clip(); - _context.drawImage( image, 0, 0 ); - _context.restore(); - - } - - function getGradientTexture( color1, color2, color3, color4 ) { - - // http://mrdoob.com/blog/post/710 - - var c1r = ~~ ( color1.r * 255 ), c1g = ~~ ( color1.g * 255 ), c1b = ~~ ( color1.b * 255 ), - c2r = ~~ ( color2.r * 255 ), c2g = ~~ ( color2.g * 255 ), c2b = ~~ ( color2.b * 255 ), - c3r = ~~ ( color3.r * 255 ), c3g = ~~ ( color3.g * 255 ), c3b = ~~ ( color3.b * 255 ), - c4r = ~~ ( color4.r * 255 ), c4g = ~~ ( color4.g * 255 ), c4b = ~~ ( color4.b * 255 ); - - _pixelMapData[ 0 ] = c1r < 0 ? 0 : c1r > 255 ? 255 : c1r; - _pixelMapData[ 1 ] = c1g < 0 ? 0 : c1g > 255 ? 255 : c1g; - _pixelMapData[ 2 ] = c1b < 0 ? 0 : c1b > 255 ? 255 : c1b; - - _pixelMapData[ 4 ] = c2r < 0 ? 0 : c2r > 255 ? 255 : c2r; - _pixelMapData[ 5 ] = c2g < 0 ? 0 : c2g > 255 ? 255 : c2g; - _pixelMapData[ 6 ] = c2b < 0 ? 0 : c2b > 255 ? 255 : c2b; - - _pixelMapData[ 8 ] = c3r < 0 ? 0 : c3r > 255 ? 255 : c3r; - _pixelMapData[ 9 ] = c3g < 0 ? 0 : c3g > 255 ? 255 : c3g; - _pixelMapData[ 10 ] = c3b < 0 ? 0 : c3b > 255 ? 255 : c3b; - - _pixelMapData[ 12 ] = c4r < 0 ? 0 : c4r > 255 ? 255 : c4r; - _pixelMapData[ 13 ] = c4g < 0 ? 0 : c4g > 255 ? 255 : c4g; - _pixelMapData[ 14 ] = c4b < 0 ? 0 : c4b > 255 ? 255 : c4b; - - _pixelMapContext.putImageData( _pixelMapImage, 0, 0 ); - _gradientMapContext.drawImage( _pixelMap, 0, 0 ); - - return _gradientMap; - - } - - function smoothstep( value, min, max ) { - - var x = ( value - min ) / ( max - min ); - return x * x * ( 3 - 2 * x ); - - } - - function normalToComponent( normal ) { - - var component = ( normal + 1 ) * 0.5; - return component < 0 ? 0 : ( component > 1 ? 1 : component ); - - } - - // Hide anti-alias gaps - - function expand( v1, v2 ) { - - var x = v2.x - v1.x, y = v2.y - v1.y, - det = x * x + y * y, idet; - - if ( det == 0 ) return; - - idet = 1 / Math.sqrt( det ); - - x *= idet; y *= idet; - - v2.x += x; v2.y += y; - v1.x -= x; v1.y -= y; - - } - }; - - // Context cached methods. - - function setOpacity( value ) { - - if ( _contextGlobalAlpha != value ) { - - _context.globalAlpha = _contextGlobalAlpha = value; - - } - - } - - function setBlending( value ) { - - if ( _contextGlobalCompositeOperation != value ) { - - switch ( value ) { - - case THREE.NormalBlending: - - _context.globalCompositeOperation = 'source-over'; - - break; - - case THREE.AdditiveBlending: - - _context.globalCompositeOperation = 'lighter'; - - break; - - case THREE.SubtractiveBlending: - - _context.globalCompositeOperation = 'darker'; - - break; - - } - - _contextGlobalCompositeOperation = value; - - } - - } - - function setLineWidth( value ) { - - if ( _contextLineWidth != value ) { - - _context.lineWidth = _contextLineWidth = value; - - } - - } - - function setLineCap( value ) { - - // "butt", "round", "square" - - if ( _contextLineCap != value ) { - - _context.lineCap = _contextLineCap = value; - - } - - } - - function setLineJoin( value ) { - - // "round", "bevel", "miter" - - if ( _contextLineJoin != value ) { - - _context.lineJoin = _contextLineJoin = value; - - } - - } - - function setStrokeStyle( style ) { - - if ( _contextStrokeStyle != style ) { - - _context.strokeStyle = _contextStrokeStyle = style; - - } - - } - - function setFillStyle( style ) { - - if ( _contextFillStyle != style ) { - - _context.fillStyle = _contextFillStyle = style; - - } - - } - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.SVGRenderer = function () { - - var _this = this, - _renderData, _elements, _lights, - _projector = new THREE.Projector(), - _svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'), - _svgWidth, _svgHeight, _svgWidthHalf, _svgHeightHalf, - - _v1, _v2, _v3, _v4, - - _clipRect = new THREE.Rectangle(), - _bboxRect = new THREE.Rectangle(), - - _enableLighting = false, - _color = new THREE.Color(), - _ambientLight = new THREE.Color(), - _directionalLights = new THREE.Color(), - _pointLights = new THREE.Color(), - - _w, // z-buffer to w-buffer - _vector3 = new THREE.Vector3(), // Needed for PointLight - - _svgPathPool = [], _svgCirclePool = [], _svgLinePool = [], - _svgNode, _pathCount, _circleCount, _lineCount, - _quality = 1; - - this.domElement = _svg; - - this.autoClear = true; - this.sortObjects = true; - this.sortElements = true; - - this.info = { - - render: { - - vertices: 0, - faces: 0 - - } - - } - - this.setQuality = function( quality ) { - - switch(quality) { - - case "high": _quality = 1; break; - case "low": _quality = 0; break; - - } - - }; - - this.setSize = function( width, height ) { - - _svgWidth = width; _svgHeight = height; - _svgWidthHalf = _svgWidth / 2; _svgHeightHalf = _svgHeight / 2; - - _svg.setAttribute( 'viewBox', ( - _svgWidthHalf ) + ' ' + ( - _svgHeightHalf ) + ' ' + _svgWidth + ' ' + _svgHeight ); - _svg.setAttribute( 'width', _svgWidth ); - _svg.setAttribute( 'height', _svgHeight ); - - _clipRect.set( - _svgWidthHalf, - _svgHeightHalf, _svgWidthHalf, _svgHeightHalf ); - - }; - - this.clear = function () { - - while ( _svg.childNodes.length > 0 ) { - - _svg.removeChild( _svg.childNodes[ 0 ] ); - - } - - }; - - this.render = function ( scene, camera ) { - - var e, el, element, material; - - this.autoClear && this.clear(); - - _this.info.render.vertices = 0; - _this.info.render.faces = 0; - - _renderData = _projector.projectScene( scene, camera, this.sortElements ); - _elements = _renderData.elements; - _lights = _renderData.lights; - - _pathCount = 0; _circleCount = 0; _lineCount = 0; - - _enableLighting = _lights.length > 0; - - if ( _enableLighting ) { - - calculateLights( _lights ); - - } - - for ( e = 0, el = _elements.length; e < el; e ++ ) { - - element = _elements[ e ]; - - material = element.material; - material = material instanceof THREE.MeshFaceMaterial ? element.faceMaterial : material; - - if ( material == null || material.opacity == 0 ) continue; - - _bboxRect.empty(); - - if ( element instanceof THREE.RenderableParticle ) { - - _v1 = element; - _v1.x *= _svgWidthHalf; _v1.y *= -_svgHeightHalf; - - renderParticle( _v1, element, material, scene ); - - } else if ( element instanceof THREE.RenderableLine ) { - - _v1 = element.v1; _v2 = element.v2; - - _v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf; - _v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf; - - _bboxRect.addPoint( _v1.positionScreen.x, _v1.positionScreen.y ); - _bboxRect.addPoint( _v2.positionScreen.x, _v2.positionScreen.y ); - - if ( !_clipRect.intersects( _bboxRect ) ) { - - continue; - - } - - renderLine( _v1, _v2, element, material, scene ); - - } else if ( element instanceof THREE.RenderableFace3 ) { - - _v1 = element.v1; _v2 = element.v2; _v3 = element.v3; - - _v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= - _svgHeightHalf; - _v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= - _svgHeightHalf; - _v3.positionScreen.x *= _svgWidthHalf; _v3.positionScreen.y *= - _svgHeightHalf; - - _bboxRect.addPoint( _v1.positionScreen.x, _v1.positionScreen.y ); - _bboxRect.addPoint( _v2.positionScreen.x, _v2.positionScreen.y ); - _bboxRect.addPoint( _v3.positionScreen.x, _v3.positionScreen.y ); - - if ( !_clipRect.intersects( _bboxRect ) ) { - - continue; - - } - - renderFace3( _v1, _v2, _v3, element, material, scene ); - - } else if ( element instanceof THREE.RenderableFace4 ) { - - _v1 = element.v1; _v2 = element.v2; _v3 = element.v3; _v4 = element.v4; - - _v1.positionScreen.x *= _svgWidthHalf; _v1.positionScreen.y *= -_svgHeightHalf; - _v2.positionScreen.x *= _svgWidthHalf; _v2.positionScreen.y *= -_svgHeightHalf; - _v3.positionScreen.x *= _svgWidthHalf; _v3.positionScreen.y *= -_svgHeightHalf; - _v4.positionScreen.x *= _svgWidthHalf; _v4.positionScreen.y *= -_svgHeightHalf; - - _bboxRect.addPoint( _v1.positionScreen.x, _v1.positionScreen.y ); - _bboxRect.addPoint( _v2.positionScreen.x, _v2.positionScreen.y ); - _bboxRect.addPoint( _v3.positionScreen.x, _v3.positionScreen.y ); - _bboxRect.addPoint( _v4.positionScreen.x, _v4.positionScreen.y ); - - if ( !_clipRect.intersects( _bboxRect) ) { - - continue; - - } - - renderFace4( _v1, _v2, _v3, _v4, element, material, scene ); - - } - - } - - }; - - function calculateLights( lights ) { - - var l, ll, light, lightColor; - - _ambientLight.setRGB( 0, 0, 0 ); - _directionalLights.setRGB( 0, 0, 0 ); - _pointLights.setRGB( 0, 0, 0 ); - - for ( l = 0, ll = lights.length; l < ll; l++ ) { - - light = lights[ l ]; - lightColor = light.color; - - if ( light instanceof THREE.AmbientLight ) { - - _ambientLight.r += lightColor.r; - _ambientLight.g += lightColor.g; - _ambientLight.b += lightColor.b; - - } else if ( light instanceof THREE.DirectionalLight ) { - - _directionalLights.r += lightColor.r; - _directionalLights.g += lightColor.g; - _directionalLights.b += lightColor.b; - - } else if ( light instanceof THREE.PointLight ) { - - _pointLights.r += lightColor.r; - _pointLights.g += lightColor.g; - _pointLights.b += lightColor.b; - - } - - } - - } - - function calculateLight( lights, position, normal, color ) { - - var l, ll, light, lightColor, lightPosition, amount; - - for ( l = 0, ll = lights.length; l < ll; l ++ ) { - - light = lights[ l ]; - lightColor = light.color; - - if ( light instanceof THREE.DirectionalLight ) { - - lightPosition = light.matrixWorld.getPosition(); - - amount = normal.dot( lightPosition ); - - if ( amount <= 0 ) continue; - - amount *= light.intensity; - - color.r += lightColor.r * amount; - color.g += lightColor.g * amount; - color.b += lightColor.b * amount; - - } else if ( light instanceof THREE.PointLight ) { - - lightPosition = light.matrixWorld.getPosition(); - - amount = normal.dot( _vector3.sub( lightPosition, position ).normalize() ); - - if ( amount <= 0 ) continue; - - amount *= light.distance == 0 ? 1 : 1 - Math.min( position.distanceTo( lightPosition ) / light.distance, 1 ); - - if ( amount == 0 ) continue; - - amount *= light.intensity; - - color.r += lightColor.r * amount; - color.g += lightColor.g * amount; - color.b += lightColor.b * amount; - - } - - } - - } - - function renderParticle( v1, element, material, scene ) { - - /* - _svgNode = getCircleNode( _circleCount++ ); - _svgNode.setAttribute( 'cx', v1.x ); - _svgNode.setAttribute( 'cy', v1.y ); - _svgNode.setAttribute( 'r', element.scale.x * _svgWidthHalf ); - - if ( material instanceof THREE.ParticleCircleMaterial ) { - - if ( _enableLighting ) { - - _color.r = _ambientLight.r + _directionalLights.r + _pointLights.r; - _color.g = _ambientLight.g + _directionalLights.g + _pointLights.g; - _color.b = _ambientLight.b + _directionalLights.b + _pointLights.b; - - _color.r = material.color.r * _color.r; - _color.g = material.color.g * _color.g; - _color.b = material.color.b * _color.b; - - _color.updateStyleString(); - - } else { - - _color = material.color; - - } - - _svgNode.setAttribute( 'style', 'fill: ' + _color.__styleString ); - - } - - _svg.appendChild( _svgNode ); - */ - - } - - function renderLine ( v1, v2, element, material, scene ) { - - _svgNode = getLineNode( _lineCount ++ ); - - _svgNode.setAttribute( 'x1', v1.positionScreen.x ); - _svgNode.setAttribute( 'y1', v1.positionScreen.y ); - _svgNode.setAttribute( 'x2', v2.positionScreen.x ); - _svgNode.setAttribute( 'y2', v2.positionScreen.y ); - - if ( material instanceof THREE.LineBasicMaterial ) { - - _svgNode.setAttribute( 'style', 'fill: none; stroke: ' + material.color.getContextStyle() + '; stroke-width: ' + material.linewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.linecap + '; stroke-linejoin: ' + material.linejoin ); - - _svg.appendChild( _svgNode ); - - } - - } - - function renderFace3( v1, v2, v3, element, material, scene ) { - - _this.info.render.vertices += 3; - _this.info.render.faces ++; - - _svgNode = getPathNode( _pathCount ++ ); - _svgNode.setAttribute( 'd', 'M ' + v1.positionScreen.x + ' ' + v1.positionScreen.y + ' L ' + v2.positionScreen.x + ' ' + v2.positionScreen.y + ' L ' + v3.positionScreen.x + ',' + v3.positionScreen.y + 'z' ); - - if ( material instanceof THREE.MeshBasicMaterial ) { - - _color.copy( material.color ); - - } else if ( material instanceof THREE.MeshLambertMaterial ) { - - if ( _enableLighting ) { - - _color.r = _ambientLight.r; - _color.g = _ambientLight.g; - _color.b = _ambientLight.b; - - calculateLight( _lights, element.centroidWorld, element.normalWorld, _color ); - - _color.r = Math.max( 0, Math.min( material.color.r * _color.r, 1 ) ); - _color.g = Math.max( 0, Math.min( material.color.g * _color.g, 1 ) ); - _color.b = Math.max( 0, Math.min( material.color.b * _color.b, 1 ) ); - - } else { - - _color.copy( material.color ); - - } - - } else if ( material instanceof THREE.MeshDepthMaterial ) { - - _w = 1 - ( material.__2near / (material.__farPlusNear - element.z * material.__farMinusNear) ); - _color.setRGB( _w, _w, _w ); - - } else if ( material instanceof THREE.MeshNormalMaterial ) { - - _color.setRGB( normalToComponent( element.normalWorld.x ), normalToComponent( element.normalWorld.y ), normalToComponent( element.normalWorld.z ) ); - - } - - if ( material.wireframe ) { - - _svgNode.setAttribute( 'style', 'fill: none; stroke: ' + _color.getContextStyle() + '; stroke-width: ' + material.wireframeLinewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.wireframeLinecap + '; stroke-linejoin: ' + material.wireframeLinejoin ); - - } else { - - _svgNode.setAttribute( 'style', 'fill: ' + _color.getContextStyle() + '; fill-opacity: ' + material.opacity ); - - } - - _svg.appendChild( _svgNode ); - - } - - function renderFace4( v1, v2, v3, v4, element, material, scene ) { - - _this.info.render.vertices += 4; - _this.info.render.faces ++; - - _svgNode = getPathNode( _pathCount ++ ); - _svgNode.setAttribute( 'd', 'M ' + v1.positionScreen.x + ' ' + v1.positionScreen.y + ' L ' + v2.positionScreen.x + ' ' + v2.positionScreen.y + ' L ' + v3.positionScreen.x + ',' + v3.positionScreen.y + ' L ' + v4.positionScreen.x + ',' + v4.positionScreen.y + 'z' ); - - if ( material instanceof THREE.MeshBasicMaterial ) { - - _color.copy( material.color ); - - } else if ( material instanceof THREE.MeshLambertMaterial ) { - - if ( _enableLighting ) { - - _color.r = _ambientLight.r; - _color.g = _ambientLight.g; - _color.b = _ambientLight.b; - - calculateLight( _lights, element.centroidWorld, element.normalWorld, _color ); - - _color.r = Math.max( 0, Math.min( material.color.r * _color.r, 1 ) ); - _color.g = Math.max( 0, Math.min( material.color.g * _color.g, 1 ) ); - _color.b = Math.max( 0, Math.min( material.color.b * _color.b, 1 ) ); - - } else { - - _color.copy( material.color ); - - } - - } else if ( material instanceof THREE.MeshDepthMaterial ) { - - _w = 1 - ( material.__2near / (material.__farPlusNear - element.z * material.__farMinusNear) ); - _color.setRGB( _w, _w, _w ); - - } else if ( material instanceof THREE.MeshNormalMaterial ) { - - _color.setRGB( normalToComponent( element.normalWorld.x ), normalToComponent( element.normalWorld.y ), normalToComponent( element.normalWorld.z ) ); - - } - - if ( material.wireframe ) { - - _svgNode.setAttribute( 'style', 'fill: none; stroke: ' + _color.getContextStyle() + '; stroke-width: ' + material.wireframeLinewidth + '; stroke-opacity: ' + material.opacity + '; stroke-linecap: ' + material.wireframeLinecap + '; stroke-linejoin: ' + material.wireframeLinejoin ); - - } else { - - _svgNode.setAttribute( 'style', 'fill: ' + _color.getContextStyle() + '; fill-opacity: ' + material.opacity ); - - } - - _svg.appendChild( _svgNode ); - - } - - function getLineNode( id ) { - - if ( _svgLinePool[ id ] == null ) { - - _svgLinePool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'line' ); - - if ( _quality == 0 ) { - - _svgLinePool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed - - } - - return _svgLinePool[ id ]; - - } - - return _svgLinePool[ id ]; - - } - - function getPathNode( id ) { - - if ( _svgPathPool[ id ] == null ) { - - _svgPathPool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' ); - - if ( _quality == 0 ) { - - _svgPathPool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed - - } - - return _svgPathPool[ id ]; - - } - - return _svgPathPool[ id ]; - - } - - function getCircleNode( id ) { - - if ( _svgCirclePool[id] == null ) { - - _svgCirclePool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'circle' ); - - if ( _quality == 0 ) { - - _svgCirclePool[id].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed - - } - - return _svgCirclePool[ id ]; - - } - - return _svgCirclePool[ id ]; - - } - - function normalToComponent( normal ) { - - var component = ( normal + 1 ) * 0.5; - return component < 0 ? 0 : ( component > 1 ? 1 : component ); - - } - - function pad( str ) { - - while ( str.length < 6 ) str = '0' + str; - return str; - - } - -}; -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - * @author mikael emtinger / http://gomo.se/ - */ - -THREE.ShaderChunk = { - - // FOG - - fog_pars_fragment: [ - - "#ifdef USE_FOG", - - "uniform vec3 fogColor;", - - "#ifdef FOG_EXP2", - - "uniform float fogDensity;", - - "#else", - - "uniform float fogNear;", - "uniform float fogFar;", - - "#endif", - - "#endif" - - ].join("\n"), - - fog_fragment: [ - - "#ifdef USE_FOG", - - "float depth = gl_FragCoord.z / gl_FragCoord.w;", - - "#ifdef FOG_EXP2", - - "const float LOG2 = 1.442695;", - "float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", - "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", - - "#else", - - "float fogFactor = smoothstep( fogNear, fogFar, depth );", - - "#endif", - - "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", - - "#endif" - - ].join("\n"), - - // ENVIRONMENT MAP - - envmap_pars_fragment: [ - - "#ifdef USE_ENVMAP", - - "varying vec3 vReflect;", - - "uniform float reflectivity;", - "uniform samplerCube envMap;", - "uniform float flipEnvMap;", - "uniform int combine;", - - "#endif" - - ].join("\n"), - - envmap_fragment: [ - - "#ifdef USE_ENVMAP", - - "vec4 cubeColor = textureCube( envMap, vec3( flipEnvMap * vReflect.x, vReflect.yz ) );", - - "#ifdef GAMMA_INPUT", - - "cubeColor.xyz *= cubeColor.xyz;", - - "#endif", - - "if ( combine == 1 ) {", - - "gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, reflectivity );", - - "} else {", - - "gl_FragColor.xyz = gl_FragColor.xyz * cubeColor.xyz;", - - "}", - - "#endif" - - ].join("\n"), - - envmap_pars_vertex: [ - - "#ifdef USE_ENVMAP", - - "varying vec3 vReflect;", - - "uniform float refractionRatio;", - "uniform bool useRefract;", - - "#endif" - - ].join("\n"), - - envmap_vertex : [ - - "#ifdef USE_ENVMAP", - - "vec4 mPosition = objectMatrix * vec4( position, 1.0 );", - "vec3 nWorld = mat3( objectMatrix[ 0 ].xyz, objectMatrix[ 1 ].xyz, objectMatrix[ 2 ].xyz ) * normal;", - - "if ( useRefract ) {", - - "vReflect = refract( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ), refractionRatio );", - - "} else {", - - "vReflect = reflect( normalize( mPosition.xyz - cameraPosition ), normalize( nWorld.xyz ) );", - - "}", - - "#endif" - - ].join("\n"), - - // COLOR MAP (particles) - - map_particle_pars_fragment: [ - - "#ifdef USE_MAP", - - "uniform sampler2D map;", - - "#endif" - - ].join("\n"), - - - map_particle_fragment: [ - - "#ifdef USE_MAP", - - "gl_FragColor = gl_FragColor * texture2D( map, gl_PointCoord );", - - "#endif" - - ].join("\n"), - - // COLOR MAP (triangles) - - map_pars_vertex: [ - - "#ifdef USE_MAP", - - "varying vec2 vUv;", - "uniform vec4 offsetRepeat;", - - "#endif" - - ].join("\n"), - - map_pars_fragment: [ - - "#ifdef USE_MAP", - - "varying vec2 vUv;", - "uniform sampler2D map;", - - "#endif" - - ].join("\n"), - - map_vertex: [ - - "#ifdef USE_MAP", - - "vUv = uv * offsetRepeat.zw + offsetRepeat.xy;", - - "#endif" - - ].join("\n"), - - map_fragment: [ - - "#ifdef USE_MAP", - - "#ifdef GAMMA_INPUT", - - "vec4 texelColor = texture2D( map, vUv );", - "texelColor.xyz *= texelColor.xyz;", - - "gl_FragColor = gl_FragColor * texelColor;", - - "#else", - - "gl_FragColor = gl_FragColor * texture2D( map, vUv );", - - "#endif", - - "#endif" - - ].join("\n"), - - // LIGHT MAP - - lightmap_pars_fragment: [ - - "#ifdef USE_LIGHTMAP", - - "varying vec2 vUv2;", - "uniform sampler2D lightMap;", - - "#endif" - - ].join("\n"), - - lightmap_pars_vertex: [ - - "#ifdef USE_LIGHTMAP", - - "varying vec2 vUv2;", - - "#endif" - - ].join("\n"), - - lightmap_fragment: [ - - "#ifdef USE_LIGHTMAP", - - "gl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );", - - "#endif" - - ].join("\n"), - - lightmap_vertex: [ - - "#ifdef USE_LIGHTMAP", - - "vUv2 = uv2;", - - "#endif" - - ].join("\n"), - - // LIGHTS LAMBERT - - lights_lambert_pars_vertex: [ - - "uniform vec3 ambient;", - "uniform vec3 diffuse;", - - "uniform vec3 ambientLightColor;", - - "#if MAX_DIR_LIGHTS > 0", - - "uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];", - "uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];", - - "#endif", - - "#if MAX_POINT_LIGHTS > 0", - - "uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];", - "uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];", - "uniform float pointLightDistance[ MAX_POINT_LIGHTS ];", - - "#endif", - - "#ifdef WRAP_AROUND", - - "uniform vec3 wrapRGB;", - - "#endif", - - ].join("\n"), - - lights_lambert_vertex: [ - - "vLightWeighting = vec3( 0.0 );", - - "#if MAX_DIR_LIGHTS > 0", - - "for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {", - - "vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );", - "vec3 dirVector = normalize( lDirection.xyz );", - - "#ifdef WRAP_AROUND", - - "float directionalLightWeightingFull = max( dot( transformedNormal, dirVector ), 0.0 );", - "float directionalLightWeightingHalf = max( 0.5 * dot( transformedNormal, dirVector ) + 0.5, 0.0 );", - - "vec3 directionalLightWeighting = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );", - - "#else", - - "float directionalLightWeighting = max( dot( transformedNormal, dirVector ), 0.0 );", - - "#endif", - - "vLightWeighting += directionalLightColor[ i ] * directionalLightWeighting;", - - "}", - - "#endif", - - "#if MAX_POINT_LIGHTS > 0", - - "for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {", - - "vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );", - "vec3 lVector = lPosition.xyz - mvPosition.xyz;", - - "float lDistance = 1.0;", - "if ( pointLightDistance[ i ] > 0.0 )", - "lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );", - - "lVector = normalize( lVector );", - - "#ifdef WRAP_AROUND", - - "float pointLightWeightingFull = max( dot( transformedNormal, lVector ), 0.0 );", - "float pointLightWeightingHalf = max( 0.5 * dot( transformedNormal, lVector ) + 0.5, 0.0 );", - - "vec3 pointLightWeighting = mix( vec3 ( pointLightWeightingFull ), vec3( pointLightWeightingHalf ), wrapRGB );", - - "#else", - - "float pointLightWeighting = max( dot( transformedNormal, lVector ), 0.0 );", - - "#endif", - - "vLightWeighting += pointLightColor[ i ] * pointLightWeighting * lDistance;", - - "}", - - "#endif", - - "vLightWeighting = vLightWeighting * diffuse + ambient * ambientLightColor;", - - ].join("\n"), - - // LIGHTS PHONG - - lights_phong_pars_vertex: [ - - "#if MAX_POINT_LIGHTS > 0", - "#ifndef PHONG_PER_PIXEL", - - "uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];", - "uniform float pointLightDistance[ MAX_POINT_LIGHTS ];", - - "varying vec4 vPointLight[ MAX_POINT_LIGHTS ];", - - "#endif", - "#endif" - - ].join("\n"), - - - lights_phong_vertex: [ - - "#if MAX_POINT_LIGHTS > 0", - "#ifndef PHONG_PER_PIXEL", - - "for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {", - - "vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );", - "vec3 lVector = lPosition.xyz - mvPosition.xyz;", - - "float lDistance = 1.0;", - "if ( pointLightDistance[ i ] > 0.0 )", - "lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );", - - "vPointLight[ i ] = vec4( lVector, lDistance );", - - "}", - - "#endif", - "#endif" - - ].join("\n"), - - lights_phong_pars_fragment: [ - - "uniform vec3 ambientLightColor;", - - "#if MAX_DIR_LIGHTS > 0", - - "uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];", - "uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];", - - "#endif", - - "#if MAX_POINT_LIGHTS > 0", - - "uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];", - - "#ifdef PHONG_PER_PIXEL", - - "uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];", - "uniform float pointLightDistance[ MAX_POINT_LIGHTS ];", - - "#else", - - "varying vec4 vPointLight[ MAX_POINT_LIGHTS ];", - - "#endif", - - "#endif", - - "#ifdef WRAP_AROUND", - - "uniform vec3 wrapRGB;", - - "#endif", - - "varying vec3 vViewPosition;", - "varying vec3 vNormal;" - - ].join("\n"), - - lights_phong_fragment: [ - - "vec3 normal = normalize( vNormal );", - "vec3 viewPosition = normalize( vViewPosition );", - - "#if MAX_POINT_LIGHTS > 0", - - "vec3 pointDiffuse = vec3( 0.0 );", - "vec3 pointSpecular = vec3( 0.0 );", - - "for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {", - - "#ifdef PHONG_PER_PIXEL", - - "vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );", - "vec3 lVector = lPosition.xyz + vViewPosition.xyz;", - - "float lDistance = 1.0;", - "if ( pointLightDistance[ i ] > 0.0 )", - "lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );", - - "lVector = normalize( lVector );", - - "#else", - - "vec3 lVector = normalize( vPointLight[ i ].xyz );", - "float lDistance = vPointLight[ i ].w;", - - "#endif", - - // diffuse - - "#ifdef WRAP_AROUND", - - "float pointDiffuseWeightFull = max( dot( normal, lVector ), 0.0 );", - "float pointDiffuseWeightHalf = max( 0.5 * dot( normal, lVector ) + 0.5, 0.0 );", - - "vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );", - - "#else", - - "float pointDiffuseWeight = max( dot( normal, lVector ), 0.0 );", - - "#endif", - - "pointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;", - - // specular - - "vec3 pointHalfVector = normalize( lVector + viewPosition );", - "float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );", - "float pointSpecularWeight = max( pow( pointDotNormalHalf, shininess ), 0.0 );", - - "#ifdef PHYSICALLY_BASED_SHADING", - - "vec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( lVector, pointHalfVector ), 5.0 );", - "pointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance;", - - "#else", - - "pointSpecular += specular * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance;", - - "#endif", - - "}", - - "#endif", - - "#if MAX_DIR_LIGHTS > 0", - - "vec3 dirDiffuse = vec3( 0.0 );", - "vec3 dirSpecular = vec3( 0.0 );" , - - "for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {", - - "vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );", - "vec3 dirVector = normalize( lDirection.xyz );", - - // diffuse - - "#ifdef WRAP_AROUND", - - "float dirDiffuseWeightFull = max( dot( normal, dirVector ), 0.0 );", - "float dirDiffuseWeightHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );", - - "vec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );", - - "#else", - - "float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );", - - "#endif", - - "dirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;", - - // specular - - "vec3 dirHalfVector = normalize( dirVector + viewPosition );", - "float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );", - "float dirSpecularWeight = max( pow( dirDotNormalHalf, shininess ), 0.0 );", - - "#ifdef PHYSICALLY_BASED_SHADING", - - /* - // fresnel term from skin shader - "const float F0 = 0.128;", - - "float base = 1.0 - dot( viewPosition, dirHalfVector );", - "float exponential = pow( base, 5.0 );", - - "float fresnel = exponential + F0 * ( 1.0 - exponential );", - */ - - /* - // fresnel term from fresnel shader - "const float mFresnelBias = 0.08;", - "const float mFresnelScale = 0.3;", - "const float mFresnelPower = 5.0;", - - "float fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );", - */ - - // normalization factor - //float specularNormalization = ( shininess + 2.0 ) / 8.0; - - //"dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;", - - "vec3 schlick = specular + vec3( 1.0 - specular ) * pow( dot( dirVector, dirHalfVector ), 5.0 );", - "dirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;", - - "#else", - - "dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight;", - - "#endif", - - "}", - - "#endif", - - "vec3 totalDiffuse = vec3( 0.0 );", - "vec3 totalSpecular = vec3( 0.0 );", - - "#if MAX_DIR_LIGHTS > 0", - - "totalDiffuse += dirDiffuse;", - "totalSpecular += dirSpecular;", - - "#endif", - - "#if MAX_POINT_LIGHTS > 0", - - "totalDiffuse += pointDiffuse;", - "totalSpecular += pointSpecular;", - - "#endif", - - "#ifdef METAL", - - "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient + totalSpecular );", - - "#else", - - "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * ambient ) + totalSpecular;", - - "#endif" - - ].join("\n"), - - // VERTEX COLORS - - color_pars_fragment: [ - - "#ifdef USE_COLOR", - - "varying vec3 vColor;", - - "#endif" - - ].join("\n"), - - - color_fragment: [ - - "#ifdef USE_COLOR", - - "gl_FragColor = gl_FragColor * vec4( vColor, opacity );", - - "#endif" - - ].join("\n"), - - color_pars_vertex: [ - - "#ifdef USE_COLOR", - - "varying vec3 vColor;", - - "#endif" - - ].join("\n"), - - - color_vertex: [ - - "#ifdef USE_COLOR", - - "#ifdef GAMMA_INPUT", - - "vColor = color * color;", - - "#else", - - "vColor = color;", - - "#endif", - - "#endif" - - ].join("\n"), - - // SKINNING - - skinning_pars_vertex: [ - - "#ifdef USE_SKINNING", - - "uniform mat4 boneGlobalMatrices[ MAX_BONES ];", - - "#endif" - - ].join("\n"), - - skinning_vertex: [ - - "#ifdef USE_SKINNING", - - "gl_Position = ( boneGlobalMatrices[ int( skinIndex.x ) ] * skinVertexA ) * skinWeight.x;", - "gl_Position += ( boneGlobalMatrices[ int( skinIndex.y ) ] * skinVertexB ) * skinWeight.y;", - - // this doesn't work, no idea why - //"gl_Position = projectionMatrix * cameraInverseMatrix * objectMatrix * gl_Position;", - - "gl_Position = projectionMatrix * viewMatrix * objectMatrix * gl_Position;", - - "#endif" - - ].join("\n"), - - // MORPHING - - morphtarget_pars_vertex: [ - - "#ifdef USE_MORPHTARGETS", - - "uniform float morphTargetInfluences[ 8 ];", - - "#endif" - - ].join("\n"), - - morphtarget_vertex: [ - - "#ifdef USE_MORPHTARGETS", - - "vec3 morphed = vec3( 0.0, 0.0, 0.0 );", - "morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];", - "morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];", - "morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];", - "morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];", - "morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];", - "morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];", - "morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];", - "morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];", - "morphed += position;", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( morphed, 1.0 );", - - "#endif" - - ].join("\n"), - - default_vertex : [ - - "#ifndef USE_MORPHTARGETS", - "#ifndef USE_SKINNING", - - "gl_Position = projectionMatrix * mvPosition;", - - "#endif", - "#endif" - - ].join("\n"), - - // SHADOW MAP - - // based on SpiderGL shadow map and Fabien Sanglard's GLSL shadow mapping examples - // http://spidergl.org/example.php?id=6 - // http://fabiensanglard.net/shadowmapping - - shadowmap_pars_fragment: [ - - "#ifdef USE_SHADOWMAP", - - "uniform sampler2D shadowMap[ MAX_SHADOWS ];", - "uniform vec2 shadowMapSize[ MAX_SHADOWS ];", - - "uniform float shadowDarkness[ MAX_SHADOWS ];", - "uniform float shadowBias[ MAX_SHADOWS ];", - - "varying vec4 vShadowCoord[ MAX_SHADOWS ];", - - "float unpackDepth( const in vec4 rgba_depth ) {", - - "const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );", - "float depth = dot( rgba_depth, bit_shift );", - "return depth;", - - "}", - - "#endif" - - ].join("\n"), - - shadowmap_fragment: [ - - "#ifdef USE_SHADOWMAP", - - "vec3 shadowColor = vec3( 1.0 );", - "float fDepth;", - - "for( int i = 0; i < MAX_SHADOWS; i ++ ) {", - - "vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;", - - // don't shadow pixels behind far plane of light frustum - - "if ( shadowCoord.z <= 1.0 ) {", - - "shadowCoord.z += shadowBias[ i ];", - - // using "if ( all )" for ATI OpenGL shader compiler - // "if ( something && something )" breaks it - - // don't shadow pixels outside of light frustum - - "bvec4 shadowTest = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );", - - "if ( all( shadowTest ) ) {", - - "#ifdef SHADOWMAP_SOFT", - - // Percentage-close filtering - // (9 pixel kernel) - // http://fabiensanglard.net/shadowmappingPCF/ - - "float shadow = 0.0;", - - /* - // this breaks shader compiler / validator on some ATI cards when using OpenGL - // must enroll loop manually - - "for ( float y = -1.25; y <= 1.25; y += 1.25 )", - "for ( float x = -1.25; x <= 1.25; x += 1.25 ) {", - - "vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );", - - // doesn't seem to produce any noticeable visual difference compared to simple "texture2D" lookup - //"vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );", - - "float fDepth = unpackDepth( rgbaDepth );", - - "if ( fDepth < shadowCoord.z )", - "shadow += 1.0;", - - "}", - - "shadow /= 9.0;", - - */ - - "const float shadowDelta = 1.0 / 9.0;", - - "float xPixelOffset = 1.0 / shadowMapSize[ i ].x;", - "float yPixelOffset = 1.0 / shadowMapSize[ i ].y;", - - "float dx0 = -1.25 * xPixelOffset;", - "float dy0 = -1.25 * yPixelOffset;", - "float dx1 = 1.25 * xPixelOffset;", - "float dy1 = 1.25 * yPixelOffset;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );", - "if ( fDepth < shadowCoord.z ) shadow += shadowDelta;", - - "shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );", - - "#else", - - "vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );", - "float fDepth = unpackDepth( rgbaDepth );", - - "if ( fDepth < shadowCoord.z )", - - // spot with multiple shadows is darker - - "shadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );", - - // spot with multiple shadows has the same color as single shadow spot - - //"shadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );", - - "#endif", - - "}", - - "}", - - - // uncomment to see light frustum boundaries - //"if ( !( shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0 ) )", - // "gl_FragColor.xyz = gl_FragColor.xyz * vec3( 1.0, 0.0, 0.0 );", - - "}", - - "#ifdef GAMMA_OUTPUT", - - "shadowColor *= shadowColor;", - - "#endif", - - "gl_FragColor.xyz = gl_FragColor.xyz * shadowColor;", - - "#endif" - - ].join("\n"), - - shadowmap_pars_vertex: [ - - "#ifdef USE_SHADOWMAP", - - "varying vec4 vShadowCoord[ MAX_SHADOWS ];", - "uniform mat4 shadowMatrix[ MAX_SHADOWS ];", - - "#endif" - - ].join("\n"), - - shadowmap_vertex: [ - - "#ifdef USE_SHADOWMAP", - - "for( int i = 0; i < MAX_SHADOWS; i ++ ) {", - - "#ifdef USE_MORPHTARGETS", - - "vShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( morphed, 1.0 );", - - "#else", - - "vShadowCoord[ i ] = shadowMatrix[ i ] * objectMatrix * vec4( position, 1.0 );", - - "#endif", - - "}", - - "#endif" - - ].join("\n"), - - // ALPHATEST - - alphatest_fragment: [ - - "#ifdef ALPHATEST", - - "if ( gl_FragColor.a < ALPHATEST ) discard;", - - "#endif" - - ].join("\n"), - - // LINEAR SPACE - - linear_to_gamma_fragment: [ - - "#ifdef GAMMA_OUTPUT", - - "gl_FragColor.xyz = sqrt( gl_FragColor.xyz );", - - "#endif" - - ].join("\n"), - - -}; - -THREE.UniformsUtils = { - - merge: function ( uniforms ) { - - var u, p, tmp, merged = {}; - - for ( u = 0; u < uniforms.length; u++ ) { - - tmp = this.clone( uniforms[ u ] ); - - for ( p in tmp ) { - - merged[ p ] = tmp[ p ]; - - } - - } - - return merged; - - }, - - clone: function ( uniforms_src ) { - - var u, p, parameter, parameter_src, uniforms_dst = {}; - - for ( u in uniforms_src ) { - - uniforms_dst[ u ] = {}; - - for ( p in uniforms_src[ u ] ) { - - parameter_src = uniforms_src[ u ][ p ]; - - if ( parameter_src instanceof THREE.Color || - parameter_src instanceof THREE.Vector2 || - parameter_src instanceof THREE.Vector3 || - parameter_src instanceof THREE.Vector4 || - parameter_src instanceof THREE.Matrix4 || - parameter_src instanceof THREE.Texture ) { - - uniforms_dst[ u ][ p ] = parameter_src.clone(); - - } else if ( parameter_src instanceof Array ) { - - uniforms_dst[ u ][ p ] = parameter_src.slice(); - - } else { - - uniforms_dst[ u ][ p ] = parameter_src; - - } - - } - - } - - return uniforms_dst; - - } - -}; - -THREE.UniformsLib = { - - common: { - - "diffuse" : { type: "c", value: new THREE.Color( 0xeeeeee ) }, - "opacity" : { type: "f", value: 1.0 }, - - "map" : { type: "t", value: 0, texture: null }, - "offsetRepeat" : { type: "v4", value: new THREE.Vector4( 0, 0, 1, 1 ) }, - - "lightMap" : { type: "t", value: 2, texture: null }, - - "envMap" : { type: "t", value: 1, texture: null }, - "flipEnvMap" : { type: "f", value: -1 }, - "useRefract" : { type: "i", value: 0 }, - "reflectivity" : { type: "f", value: 1.0 }, - "refractionRatio" : { type: "f", value: 0.98 }, - "combine" : { type: "i", value: 0 }, - - "morphTargetInfluences" : { type: "f", value: 0 } - - }, - - fog : { - - "fogDensity" : { type: "f", value: 0.00025 }, - "fogNear" : { type: "f", value: 1 }, - "fogFar" : { type: "f", value: 2000 }, - "fogColor" : { type: "c", value: new THREE.Color( 0xffffff ) } - - }, - - lights: { - - "ambientLightColor" : { type: "fv", value: [] }, - "directionalLightDirection" : { type: "fv", value: [] }, - "directionalLightColor" : { type: "fv", value: [] }, - "pointLightColor" : { type: "fv", value: [] }, - "pointLightPosition" : { type: "fv", value: [] }, - "pointLightDistance" : { type: "fv1", value: [] } - - }, - - particle: { - - "psColor" : { type: "c", value: new THREE.Color( 0xeeeeee ) }, - "opacity" : { type: "f", value: 1.0 }, - "size" : { type: "f", value: 1.0 }, - "scale" : { type: "f", value: 1.0 }, - "map" : { type: "t", value: 0, texture: null }, - - "fogDensity" : { type: "f", value: 0.00025 }, - "fogNear" : { type: "f", value: 1 }, - "fogFar" : { type: "f", value: 2000 }, - "fogColor" : { type: "c", value: new THREE.Color( 0xffffff ) } - - }, - - shadowmap: { - - "shadowMap": { type: "tv", value: 6, texture: [] }, - "shadowMapSize": { type: "v2v", value: [] }, - - "shadowBias" : { type: "fv1", value: [] }, - "shadowDarkness": { type: "fv1", value: [] }, - - "shadowMatrix" : { type: "m4v", value: [] }, - - } - -}; - -THREE.ShaderLib = { - - 'depth': { - - uniforms: { - - "mNear": { type: "f", value: 1.0 }, - "mFar" : { type: "f", value: 2000.0 }, - "opacity" : { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - // "#ifdef USE_MORPHTARGETS", - // "uniform float morphTargetInfluences[ 8 ];", - // "#endif", - - "void main() {", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - // "#ifdef USE_MORPHTARGETS", - // "vec3 morphed = vec3( 0.0, 0.0, 0.0 );", - // "morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];", - // "morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];", - // "morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];", - // "morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];", - // "morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];", - // "morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];", - // "morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];", - // "morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];", - // "morphed += position;", - - // "gl_Position = projectionMatrix * modelViewMatrix * vec4( morphed, 1.0 );", - // "#endif", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float mNear;", - "uniform float mFar;", - "uniform float opacity;", - - "void main() {", - - "float depth = gl_FragCoord.z / gl_FragCoord.w;", - "float color = 1.0 - smoothstep( mNear, mFar, depth );", - "gl_FragColor = vec4( vec3( color ), opacity );", - - "}" - - ].join("\n") - - }, - - 'normal': { - - uniforms: { - - "opacity" : { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec3 vNormal;", - - "void main() {", - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - "vNormal = normalize( normalMatrix * normal );", - - "gl_Position = projectionMatrix * mvPosition;", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float opacity;", - "varying vec3 vNormal;", - - "void main() {", - - "gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );", - - "}" - - ].join("\n") - - }, - - 'basic': { - - uniforms: THREE.UniformsUtils.merge( [ - - THREE.UniformsLib[ "common" ], - THREE.UniformsLib[ "fog" ], - THREE.UniformsLib[ "shadowmap" ] - - ] ), - - vertexShader: [ - - THREE.ShaderChunk[ "map_pars_vertex" ], - THREE.ShaderChunk[ "lightmap_pars_vertex" ], - THREE.ShaderChunk[ "envmap_pars_vertex" ], - THREE.ShaderChunk[ "color_pars_vertex" ], - THREE.ShaderChunk[ "skinning_pars_vertex" ], - THREE.ShaderChunk[ "morphtarget_pars_vertex" ], - THREE.ShaderChunk[ "shadowmap_pars_vertex" ], - - "void main() {", - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - - THREE.ShaderChunk[ "map_vertex" ], - THREE.ShaderChunk[ "lightmap_vertex" ], - THREE.ShaderChunk[ "envmap_vertex" ], - THREE.ShaderChunk[ "color_vertex" ], - THREE.ShaderChunk[ "skinning_vertex" ], - THREE.ShaderChunk[ "morphtarget_vertex" ], - THREE.ShaderChunk[ "default_vertex" ], - THREE.ShaderChunk[ "shadowmap_vertex" ], - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform vec3 diffuse;", - "uniform float opacity;", - - THREE.ShaderChunk[ "color_pars_fragment" ], - THREE.ShaderChunk[ "map_pars_fragment" ], - THREE.ShaderChunk[ "lightmap_pars_fragment" ], - THREE.ShaderChunk[ "envmap_pars_fragment" ], - THREE.ShaderChunk[ "fog_pars_fragment" ], - THREE.ShaderChunk[ "shadowmap_pars_fragment" ], - - "void main() {", - - "gl_FragColor = vec4( diffuse, opacity );", - - THREE.ShaderChunk[ "map_fragment" ], - THREE.ShaderChunk[ "alphatest_fragment" ], - THREE.ShaderChunk[ "lightmap_fragment" ], - THREE.ShaderChunk[ "color_fragment" ], - THREE.ShaderChunk[ "envmap_fragment" ], - THREE.ShaderChunk[ "shadowmap_fragment" ], - - THREE.ShaderChunk[ "linear_to_gamma_fragment" ], - - THREE.ShaderChunk[ "fog_fragment" ], - - "}" - - ].join("\n") - - }, - - 'lambert': { - - uniforms: THREE.UniformsUtils.merge( [ - - THREE.UniformsLib[ "common" ], - THREE.UniformsLib[ "fog" ], - THREE.UniformsLib[ "lights" ], - THREE.UniformsLib[ "shadowmap" ], - - { - "ambient" : { type: "c", value: new THREE.Color( 0x050505 ) }, - "wrapRGB" : { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) } - } - - ] ), - - vertexShader: [ - - "varying vec3 vLightWeighting;", - - THREE.ShaderChunk[ "map_pars_vertex" ], - THREE.ShaderChunk[ "lightmap_pars_vertex" ], - THREE.ShaderChunk[ "envmap_pars_vertex" ], - THREE.ShaderChunk[ "lights_lambert_pars_vertex" ], - THREE.ShaderChunk[ "color_pars_vertex" ], - THREE.ShaderChunk[ "skinning_pars_vertex" ], - THREE.ShaderChunk[ "morphtarget_pars_vertex" ], - THREE.ShaderChunk[ "shadowmap_pars_vertex" ], - - "void main() {", - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - - THREE.ShaderChunk[ "map_vertex" ], - THREE.ShaderChunk[ "lightmap_vertex" ], - THREE.ShaderChunk[ "envmap_vertex" ], - THREE.ShaderChunk[ "color_vertex" ], - - "vec3 transformedNormal = normalize( normalMatrix * normal );", - - THREE.ShaderChunk[ "lights_lambert_vertex" ], - THREE.ShaderChunk[ "skinning_vertex" ], - THREE.ShaderChunk[ "morphtarget_vertex" ], - THREE.ShaderChunk[ "default_vertex" ], - THREE.ShaderChunk[ "shadowmap_vertex" ], - - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float opacity;", - - "varying vec3 vLightWeighting;", - - THREE.ShaderChunk[ "color_pars_fragment" ], - THREE.ShaderChunk[ "map_pars_fragment" ], - THREE.ShaderChunk[ "lightmap_pars_fragment" ], - THREE.ShaderChunk[ "envmap_pars_fragment" ], - THREE.ShaderChunk[ "fog_pars_fragment" ], - THREE.ShaderChunk[ "shadowmap_pars_fragment" ], - - "void main() {", - - "gl_FragColor = vec4( vec3 ( 1.0 ), opacity );", - - THREE.ShaderChunk[ "map_fragment" ], - THREE.ShaderChunk[ "alphatest_fragment" ], - - "gl_FragColor.xyz = gl_FragColor.xyz * vLightWeighting;", - - THREE.ShaderChunk[ "lightmap_fragment" ], - THREE.ShaderChunk[ "color_fragment" ], - THREE.ShaderChunk[ "envmap_fragment" ], - THREE.ShaderChunk[ "shadowmap_fragment" ], - - THREE.ShaderChunk[ "linear_to_gamma_fragment" ], - - THREE.ShaderChunk[ "fog_fragment" ], - - "}" - - ].join("\n") - - }, - - 'phong': { - - uniforms: THREE.UniformsUtils.merge( [ - - THREE.UniformsLib[ "common" ], - THREE.UniformsLib[ "fog" ], - THREE.UniformsLib[ "lights" ], - THREE.UniformsLib[ "shadowmap" ], - - { - "ambient" : { type: "c", value: new THREE.Color( 0x050505 ) }, - "specular" : { type: "c", value: new THREE.Color( 0x111111 ) }, - "shininess": { type: "f", value: 30 }, - "wrapRGB" : { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) } - } - - ] ), - - vertexShader: [ - - "varying vec3 vViewPosition;", - "varying vec3 vNormal;", - - THREE.ShaderChunk[ "map_pars_vertex" ], - THREE.ShaderChunk[ "lightmap_pars_vertex" ], - THREE.ShaderChunk[ "envmap_pars_vertex" ], - THREE.ShaderChunk[ "lights_phong_pars_vertex" ], - THREE.ShaderChunk[ "color_pars_vertex" ], - THREE.ShaderChunk[ "skinning_pars_vertex" ], - THREE.ShaderChunk[ "morphtarget_pars_vertex" ], - THREE.ShaderChunk[ "shadowmap_pars_vertex" ], - - "void main() {", - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - - THREE.ShaderChunk[ "map_vertex" ], - THREE.ShaderChunk[ "lightmap_vertex" ], - THREE.ShaderChunk[ "envmap_vertex" ], - THREE.ShaderChunk[ "color_vertex" ], - - "#ifndef USE_ENVMAP", - - "vec4 mPosition = objectMatrix * vec4( position, 1.0 );", - - "#endif", - - "vViewPosition = -mvPosition.xyz;", - - "vec3 transformedNormal = normalMatrix * normal;", - "vNormal = transformedNormal;", - - THREE.ShaderChunk[ "lights_phong_vertex" ], - THREE.ShaderChunk[ "skinning_vertex" ], - THREE.ShaderChunk[ "morphtarget_vertex" ], - THREE.ShaderChunk[ "default_vertex" ], - THREE.ShaderChunk[ "shadowmap_vertex" ], - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform vec3 diffuse;", - "uniform float opacity;", - - "uniform vec3 ambient;", - "uniform vec3 specular;", - "uniform float shininess;", - - THREE.ShaderChunk[ "color_pars_fragment" ], - THREE.ShaderChunk[ "map_pars_fragment" ], - THREE.ShaderChunk[ "lightmap_pars_fragment" ], - THREE.ShaderChunk[ "envmap_pars_fragment" ], - THREE.ShaderChunk[ "fog_pars_fragment" ], - THREE.ShaderChunk[ "lights_phong_pars_fragment" ], - THREE.ShaderChunk[ "shadowmap_pars_fragment" ], - - "void main() {", - - "gl_FragColor = vec4( vec3 ( 1.0 ), opacity );", - - THREE.ShaderChunk[ "map_fragment" ], - THREE.ShaderChunk[ "alphatest_fragment" ], - - THREE.ShaderChunk[ "lights_phong_fragment" ], - - THREE.ShaderChunk[ "lightmap_fragment" ], - THREE.ShaderChunk[ "color_fragment" ], - THREE.ShaderChunk[ "envmap_fragment" ], - THREE.ShaderChunk[ "shadowmap_fragment" ], - - THREE.ShaderChunk[ "linear_to_gamma_fragment" ], - - THREE.ShaderChunk[ "fog_fragment" ], - - "}" - - ].join("\n") - - }, - - 'particle_basic': { - - uniforms: THREE.UniformsUtils.merge( [ - - THREE.UniformsLib[ "particle" ], - THREE.UniformsLib[ "shadowmap" ] - - ] ), - - vertexShader: [ - - "uniform float size;", - "uniform float scale;", - - THREE.ShaderChunk[ "color_pars_vertex" ], - THREE.ShaderChunk[ "shadowmap_pars_vertex" ], - - "void main() {", - - THREE.ShaderChunk[ "color_vertex" ], - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - - "#ifdef USE_SIZEATTENUATION", - "gl_PointSize = size * ( scale / length( mvPosition.xyz ) );", - "#else", - "gl_PointSize = size;", - "#endif", - - "gl_Position = projectionMatrix * mvPosition;", - - THREE.ShaderChunk[ "shadowmap_vertex" ], - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform vec3 psColor;", - "uniform float opacity;", - - THREE.ShaderChunk[ "color_pars_fragment" ], - THREE.ShaderChunk[ "map_particle_pars_fragment" ], - THREE.ShaderChunk[ "fog_pars_fragment" ], - THREE.ShaderChunk[ "shadowmap_pars_fragment" ], - - "void main() {", - - "gl_FragColor = vec4( psColor, opacity );", - - THREE.ShaderChunk[ "map_particle_fragment" ], - THREE.ShaderChunk[ "alphatest_fragment" ], - THREE.ShaderChunk[ "color_fragment" ], - THREE.ShaderChunk[ "shadowmap_fragment" ], - THREE.ShaderChunk[ "fog_fragment" ], - - "}" - - ].join("\n") - - }, - - // Depth encoding into RGBA texture - // based on SpiderGL shadow map example - // http://spidergl.org/example.php?id=6 - // originally from - // http://www.gamedev.net/topic/442138-packing-a-float-into-a-a8r8g8b8-texture-shader/page__whichpage__1%25EF%25BF%25BD - // see also here: - // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ - - 'depthRGBA': { - - uniforms: {}, - - vertexShader: [ - - THREE.ShaderChunk[ "morphtarget_pars_vertex" ], - - "void main() {", - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - - THREE.ShaderChunk[ "morphtarget_vertex" ], - THREE.ShaderChunk[ "default_vertex" ], - - "}" - - ].join("\n"), - - fragmentShader: [ - - "vec4 pack_depth( const in float depth ) {", - - "const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );", - "const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );", - "vec4 res = fract( depth * bit_shift );", - "res -= res.xxyz * bit_mask;", - "return res;", - - "}", - - "void main() {", - - "gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );", - - //"gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z / gl_FragCoord.w );", - //"float z = ( ( gl_FragCoord.z / gl_FragCoord.w ) - 3.0 ) / ( 4000.0 - 3.0 );", - //"gl_FragData[ 0 ] = pack_depth( z );", - //"gl_FragData[ 0 ] = vec4( z, z, z, 1.0 );", - - "}" - - ].join("\n") - - } - -};/** - * @author supereggbert / http://www.paulbrunt.co.uk/ - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author szimek / https://github.com/szimek/ - */ - -THREE.WebGLRenderer = function ( parameters ) { - - // constructor parameters - - parameters = parameters || {}; - - var _canvas = parameters.canvas !== undefined ? parameters.canvas : document.createElement( 'canvas' ), - - _precision = parameters.precision !== undefined ? parameters.precision : 'mediump', - - _alpha = parameters.alpha !== undefined ? parameters.alpha : true, - _premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true, - _antialias = parameters.antialias !== undefined ? parameters.antialias : false, - _stencil = parameters.stencil !== undefined ? parameters.stencil : true, - _preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false, - - _clearColor = parameters.clearColor !== undefined ? new THREE.Color( parameters.clearColor ) : new THREE.Color( 0x000000 ), - _clearAlpha = parameters.clearAlpha !== undefined ? parameters.clearAlpha : 0, - - _maxLights = parameters.maxLights !== undefined ? parameters.maxLights : 4; - - // public properties - - this.domElement = _canvas; - this.context = null; - - // clearing - - this.autoClear = true; - this.autoClearColor = true; - this.autoClearDepth = true; - this.autoClearStencil = true; - - // scene graph - - this.sortObjects = true; - - this.autoUpdateObjects = true; - this.autoUpdateScene = true; - - // physically based shading - - this.gammaInput = false; - this.gammaOutput = false; - this.physicallyBasedShading = false; - - // shadow map - - this.shadowMapEnabled = false; - this.shadowMapAutoUpdate = true; - this.shadowMapSoft = true; - this.shadowMapCullFrontFaces = true; - - // morphs - - this.maxMorphTargets = 8; - - // flags - - this.autoScaleCubemaps = true; - - // custom render plugins - - this.renderPluginsPre = []; - this.renderPluginsPost = []; - - // info - - this.info = { - - memory: { - - programs: 0, - geometries: 0, - textures: 0 - - }, - - render: { - - calls: 0, - vertices: 0, - faces: 0, - points: 0 - - } - - }; - - // internal properties - - var _this = this, - - _gl, - - _programs = [], - - // internal state cache - - _currentProgram = null, - _currentFramebuffer = null, - _currentMaterialId = -1, - _currentGeometryGroupHash = null, - _currentCamera = null, - _geometryGroupCounter = 0, - - // GL state cache - - _oldDoubleSided = null, - _oldFlipSided = null, - _oldBlending = null, - _oldDepthTest = null, - _oldDepthWrite = null, - _oldPolygonOffset = null, - _oldPolygonOffsetFactor = null, - _oldPolygonOffsetUnits = null, - _oldLineWidth = null, - - _viewportX = 0, - _viewportY = 0, - _viewportWidth = 0, - _viewportHeight = 0, - _currentWidth = 0, - _currentHeight = 0, - - // frustum - - _frustum = new THREE.Frustum(), - - // camera matrices cache - - _projScreenMatrix = new THREE.Matrix4(), - - _vector3 = new THREE.Vector4(), - - // light arrays cache - - _direction = new THREE.Vector3(), - - _lights = { - - ambient: [ 0, 0, 0 ], - directional: { length: 0, colors: new Array(), positions: new Array() }, - point: { length: 0, colors: new Array(), positions: new Array(), distances: new Array() } - - }; - - // initialize - - _gl = initGL(); - - setDefaultGLState(); - - this.context = _gl; - - // GPU capabilities - - var _maxVertexTextures = _gl.getParameter( _gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ), - _maxTextureSize = _gl.getParameter( _gl.MAX_TEXTURE_SIZE ), - _maxCubemapSize = _gl.getParameter( _gl.MAX_CUBE_MAP_TEXTURE_SIZE ); - - // API - - this.getContext = function () { - - return _gl; - - }; - - this.supportsVertexTextures = function () { - - return _maxVertexTextures > 0; - - }; - - this.setSize = function ( width, height ) { - - _canvas.width = width; - _canvas.height = height; - - this.setViewport( 0, 0, _canvas.width, _canvas.height ); - - }; - - this.setViewport = function ( x, y, width, height ) { - - _viewportX = x; - _viewportY = y; - - _viewportWidth = width; - _viewportHeight = height; - - _gl.viewport( _viewportX, _viewportY, _viewportWidth, _viewportHeight ); - - }; - - this.setScissor = function ( x, y, width, height ) { - - _gl.scissor( x, y, width, height ); - - }; - - this.enableScissorTest = function ( enable ) { - - enable ? _gl.enable( _gl.SCISSOR_TEST ) : _gl.disable( _gl.SCISSOR_TEST ); - - }; - - // Clearing - - this.setClearColorHex = function ( hex, alpha ) { - - _clearColor.setHex( hex ); - _clearAlpha = alpha; - - _gl.clearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); - - }; - - this.setClearColor = function ( color, alpha ) { - - _clearColor.copy( color ); - _clearAlpha = alpha; - - _gl.clearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); - - }; - - this.getClearColor = function () { - - return _clearColor; - - }; - - this.getClearAlpha = function () { - - return _clearAlpha; - - }; - - this.clear = function ( color, depth, stencil ) { - - var bits = 0; - - if ( color === undefined || color ) bits |= _gl.COLOR_BUFFER_BIT; - if ( depth === undefined || depth ) bits |= _gl.DEPTH_BUFFER_BIT; - if ( stencil === undefined || stencil ) bits |= _gl.STENCIL_BUFFER_BIT; - - _gl.clear( bits ); - - }; - - this.clearTarget = function ( renderTarget, color, depth, stencil ) { - - this.setRenderTarget( renderTarget ); - this.clear( color, depth, stencil ); - - }; - - // Plugins - - this.addPostPlugin = function ( plugin ) { - - plugin.init( this ); - this.renderPluginsPost.push( plugin ); - - }; - - this.addPrePlugin = function ( plugin ) { - - plugin.init( this ); - this.renderPluginsPre.push( plugin ); - - }; - - // Deallocation - - this.deallocateObject = function ( object ) { - - if ( ! object.__webglInit ) return; - - object.__webglInit = false; - - delete object._modelViewMatrix; - - delete object._normalMatrixArray; - delete object._modelViewMatrixArray; - delete object._objectMatrixArray; - - if ( object instanceof THREE.Mesh ) { - - for ( var g in object.geometry.geometryGroups ) { - - deleteMeshBuffers( object.geometry.geometryGroups[ g ] ); - - } - - } else if ( object instanceof THREE.Ribbon ) { - - deleteRibbonBuffers( object.geometry ); - - } else if ( object instanceof THREE.Line ) { - - deleteLineBuffers( object.geometry ); - - } else if ( object instanceof THREE.ParticleSystem ) { - - deleteParticleBuffers( object.geometry ); - - } - - }; - - this.deallocateTexture = function ( texture ) { - - if ( ! texture.__webglInit ) return; - - texture.__webglInit = false; - _gl.deleteTexture( texture.__webglTexture ); - - _this.info.memory.textures --; - - }; - - // Rendering - - this.updateShadowMap = function ( scene, camera ) { - - _currentProgram = null; - _oldBlending = -1; - _oldDepthTest = -1; - _oldDepthWrite = -1; - _currentGeometryGroupHash = -1; - _currentMaterialId = -1; - - this.shadowMapPlugin.update( scene, camera ); - - }; - - // Internal functions - - // Buffer allocation - - function createParticleBuffers ( geometry ) { - - geometry.__webglVertexBuffer = _gl.createBuffer(); - geometry.__webglColorBuffer = _gl.createBuffer(); - - _this.info.geometries ++; - - }; - - function createLineBuffers ( geometry ) { - - geometry.__webglVertexBuffer = _gl.createBuffer(); - geometry.__webglColorBuffer = _gl.createBuffer(); - - _this.info.memory.geometries ++; - - }; - - function createRibbonBuffers ( geometry ) { - - geometry.__webglVertexBuffer = _gl.createBuffer(); - geometry.__webglColorBuffer = _gl.createBuffer(); - - _this.info.memory.geometries ++; - - }; - - function createMeshBuffers ( geometryGroup ) { - - geometryGroup.__webglVertexBuffer = _gl.createBuffer(); - geometryGroup.__webglNormalBuffer = _gl.createBuffer(); - geometryGroup.__webglTangentBuffer = _gl.createBuffer(); - geometryGroup.__webglColorBuffer = _gl.createBuffer(); - geometryGroup.__webglUVBuffer = _gl.createBuffer(); - geometryGroup.__webglUV2Buffer = _gl.createBuffer(); - - geometryGroup.__webglSkinVertexABuffer = _gl.createBuffer(); - geometryGroup.__webglSkinVertexBBuffer = _gl.createBuffer(); - geometryGroup.__webglSkinIndicesBuffer = _gl.createBuffer(); - geometryGroup.__webglSkinWeightsBuffer = _gl.createBuffer(); - - geometryGroup.__webglFaceBuffer = _gl.createBuffer(); - geometryGroup.__webglLineBuffer = _gl.createBuffer(); - - if ( geometryGroup.numMorphTargets ) { - - var m, ml; - - geometryGroup.__webglMorphTargetsBuffers = []; - - for ( m = 0, ml = geometryGroup.numMorphTargets; m < ml; m ++ ) { - - geometryGroup.__webglMorphTargetsBuffers.push( _gl.createBuffer() ); - - } - - } - - _this.info.memory.geometries ++; - - }; - - // Buffer deallocation - - function deleteParticleBuffers ( geometry ) { - - _gl.deleteBuffer( geometry.__webglVertexBuffer ); - _gl.deleteBuffer( geometry.__webglColorBuffer ); - - _this.info.memory.geometries --; - - }; - - function deleteLineBuffers ( geometry ) { - - _gl.deleteBuffer( geometry.__webglVertexBuffer ); - _gl.deleteBuffer( geometry.__webglColorBuffer ); - - _this.info.memory.geometries --; - - }; - - function deleteRibbonBuffers ( geometry ) { - - _gl.deleteBuffer( geometry.__webglVertexBuffer ); - _gl.deleteBuffer( geometry.__webglColorBuffer ); - - _this.info.memory.geometries --; - - }; - - function deleteMeshBuffers ( geometryGroup ) { - - _gl.deleteBuffer( geometryGroup.__webglVertexBuffer ); - _gl.deleteBuffer( geometryGroup.__webglNormalBuffer ); - _gl.deleteBuffer( geometryGroup.__webglTangentBuffer ); - _gl.deleteBuffer( geometryGroup.__webglColorBuffer ); - _gl.deleteBuffer( geometryGroup.__webglUVBuffer ); - _gl.deleteBuffer( geometryGroup.__webglUV2Buffer ); - - _gl.deleteBuffer( geometryGroup.__webglSkinVertexABuffer ); - _gl.deleteBuffer( geometryGroup.__webglSkinVertexBBuffer ); - _gl.deleteBuffer( geometryGroup.__webglSkinIndicesBuffer ); - _gl.deleteBuffer( geometryGroup.__webglSkinWeightsBuffer ); - - _gl.deleteBuffer( geometryGroup.__webglFaceBuffer ); - _gl.deleteBuffer( geometryGroup.__webglLineBuffer ); - - if ( geometryGroup.numMorphTargets ) { - - for ( var m = 0, ml = geometryGroup.numMorphTargets; m < ml; m ++ ) { - - _gl.deleteBuffer( geometryGroup.__webglMorphTargetsBuffers[ m ] ); - - } - - } - - - if ( geometryGroup.__webglCustomAttributesList ) { - - for ( var id in geometryGroup.__webglCustomAttributesList ) { - - _gl.deleteBuffer( geometryGroup.__webglCustomAttributesList[ id ].buffer ); - - } - - } - - _this.info.memory.geometries --; - - }; - - // Buffer initialization - - function initCustomAttributes ( geometry, object ) { - - var nvertices = geometry.vertices.length; - - var material = object.material; - - if ( material.attributes ) { - - if ( geometry.__webglCustomAttributesList === undefined ) { - - geometry.__webglCustomAttributesList = []; - - } - - for ( var a in material.attributes ) { - - var attribute = material.attributes[ a ]; - - if( !attribute.__webglInitialized || attribute.createUniqueBuffers ) { - - attribute.__webglInitialized = true; - - var size = 1; // "f" and "i" - - if ( attribute.type === "v2" ) size = 2; - else if ( attribute.type === "v3" ) size = 3; - else if ( attribute.type === "v4" ) size = 4; - else if ( attribute.type === "c" ) size = 3; - - attribute.size = size; - - attribute.array = new Float32Array( nvertices * size ); - - attribute.buffer = _gl.createBuffer(); - attribute.buffer.belongsToAttribute = a; - - attribute.needsUpdate = true; - - } - - geometry.__webglCustomAttributesList.push( attribute ); - - } - - } - - }; - - function initParticleBuffers ( geometry, object ) { - - var nvertices = geometry.vertices.length; - - geometry.__vertexArray = new Float32Array( nvertices * 3 ); - geometry.__colorArray = new Float32Array( nvertices * 3 ); - - geometry.__sortArray = []; - - geometry.__webglParticleCount = nvertices; - - initCustomAttributes ( geometry, object ); - - }; - - function initLineBuffers ( geometry, object ) { - - var nvertices = geometry.vertices.length; - - geometry.__vertexArray = new Float32Array( nvertices * 3 ); - geometry.__colorArray = new Float32Array( nvertices * 3 ); - - geometry.__webglLineCount = nvertices; - - initCustomAttributes ( geometry, object ); - - }; - - function initRibbonBuffers ( geometry ) { - - var nvertices = geometry.vertices.length; - - geometry.__vertexArray = new Float32Array( nvertices * 3 ); - geometry.__colorArray = new Float32Array( nvertices * 3 ); - - geometry.__webglVertexCount = nvertices; - - }; - - function initMeshBuffers ( geometryGroup, object ) { - - var geometry = object.geometry, - faces3 = geometryGroup.faces3, - faces4 = geometryGroup.faces4, - - nvertices = faces3.length * 3 + faces4.length * 4, - ntris = faces3.length * 1 + faces4.length * 2, - nlines = faces3.length * 3 + faces4.length * 4, - - material = getBufferMaterial( object, geometryGroup ), - - uvType = bufferGuessUVType( material ), - normalType = bufferGuessNormalType( material ), - vertexColorType = bufferGuessVertexColorType( material ); - - //console.log( "uvType", uvType, "normalType", normalType, "vertexColorType", vertexColorType, object, geometryGroup, material ); - - geometryGroup.__vertexArray = new Float32Array( nvertices * 3 ); - - if ( normalType ) { - - geometryGroup.__normalArray = new Float32Array( nvertices * 3 ); - - } - - if ( geometry.hasTangents ) { - - geometryGroup.__tangentArray = new Float32Array( nvertices * 4 ); - - } - - if ( vertexColorType ) { - - geometryGroup.__colorArray = new Float32Array( nvertices * 3 ); - - } - - if ( uvType ) { - - if ( geometry.faceUvs.length > 0 || geometry.faceVertexUvs.length > 0 ) { - - geometryGroup.__uvArray = new Float32Array( nvertices * 2 ); - - } - - if ( geometry.faceUvs.length > 1 || geometry.faceVertexUvs.length > 1 ) { - - geometryGroup.__uv2Array = new Float32Array( nvertices * 2 ); - - } - - } - - if ( object.geometry.skinWeights.length && object.geometry.skinIndices.length ) { - - geometryGroup.__skinVertexAArray = new Float32Array( nvertices * 4 ); - geometryGroup.__skinVertexBArray = new Float32Array( nvertices * 4 ); - geometryGroup.__skinIndexArray = new Float32Array( nvertices * 4 ); - geometryGroup.__skinWeightArray = new Float32Array( nvertices * 4 ); - - } - - geometryGroup.__faceArray = new Uint16Array( ntris * 3 ); - geometryGroup.__lineArray = new Uint16Array( nlines * 2 ); - - if ( geometryGroup.numMorphTargets ) { - - geometryGroup.__morphTargetsArrays = []; - - for ( var m = 0, ml = geometryGroup.numMorphTargets; m < ml; m ++ ) { - - geometryGroup.__morphTargetsArrays.push( new Float32Array( nvertices * 3 ) ); - - } - - } - - geometryGroup.__webglFaceCount = ntris * 3; - geometryGroup.__webglLineCount = nlines * 2; - - - // custom attributes - - if ( material.attributes ) { - - if ( geometryGroup.__webglCustomAttributesList === undefined ) { - - geometryGroup.__webglCustomAttributesList = []; - - } - - for ( var a in material.attributes ) { - - // Do a shallow copy of the attribute object so different geometryGroup chunks use different - // attribute buffers which are correctly indexed in the setMeshBuffers function - - var originalAttribute = material.attributes[ a ]; - - var attribute = {}; - - for ( var property in originalAttribute ) { - - attribute[ property ] = originalAttribute[ property ]; - - } - - if( !attribute.__webglInitialized || attribute.createUniqueBuffers ) { - - attribute.__webglInitialized = true; - - var size = 1; // "f" and "i" - - if( attribute.type === "v2" ) size = 2; - else if( attribute.type === "v3" ) size = 3; - else if( attribute.type === "v4" ) size = 4; - else if( attribute.type === "c" ) size = 3; - - attribute.size = size; - - attribute.array = new Float32Array( nvertices * size ); - - attribute.buffer = _gl.createBuffer(); - attribute.buffer.belongsToAttribute = a; - - originalAttribute.needsUpdate = true; - attribute.__original = originalAttribute; - - } - - geometryGroup.__webglCustomAttributesList.push( attribute ); - - } - - } - - geometryGroup.__inittedArrays = true; - - }; - - function getBufferMaterial( object, geometryGroup ) { - - if ( object.material && ! ( object.material instanceof THREE.MeshFaceMaterial ) ) { - - return object.material; - - } else if ( geometryGroup.materialIndex >= 0 ) { - - return object.geometry.materials[ geometryGroup.materialIndex ]; - - } - - }; - - function materialNeedsSmoothNormals ( material ) { - - return material && material.shading !== undefined && material.shading === THREE.SmoothShading; - - }; - - function bufferGuessNormalType ( material ) { - - // only MeshBasicMaterial and MeshDepthMaterial don't need normals - - if ( ( material instanceof THREE.MeshBasicMaterial && !material.envMap ) || material instanceof THREE.MeshDepthMaterial ) { - - return false; - - } - - if ( materialNeedsSmoothNormals( material ) ) { - - return THREE.SmoothShading; - - } else { - - return THREE.FlatShading; - - } - - }; - - function bufferGuessVertexColorType ( material ) { - - if ( material.vertexColors ) { - - return material.vertexColors; - - } - - return false; - - }; - - function bufferGuessUVType ( material ) { - - // material must use some texture to require uvs - - if ( material.map || material.lightMap || material instanceof THREE.ShaderMaterial ) { - - return true; - - } - - return false; - - }; - - // Buffer setting - - function setParticleBuffers ( geometry, hint, object ) { - - var v, c, vertex, offset, index, color, - - vertices = geometry.vertices, - vl = vertices.length, - - colors = geometry.colors, - cl = colors.length, - - vertexArray = geometry.__vertexArray, - colorArray = geometry.__colorArray, - - sortArray = geometry.__sortArray, - - dirtyVertices = geometry.__dirtyVertices, - dirtyElements = geometry.__dirtyElements, - dirtyColors = geometry.__dirtyColors, - - customAttributes = geometry.__webglCustomAttributesList, - i, il, - a, ca, cal, value, - customAttribute; - - if ( object.sortParticles ) { - - _projScreenMatrix.multiplySelf( object.matrixWorld ); - - for ( v = 0; v < vl; v ++ ) { - - vertex = vertices[ v ].position; - - _vector3.copy( vertex ); - _projScreenMatrix.multiplyVector3( _vector3 ); - - sortArray[ v ] = [ _vector3.z, v ]; - - } - - sortArray.sort( function( a, b ) { return b[ 0 ] - a[ 0 ]; } ); - - for ( v = 0; v < vl; v ++ ) { - - vertex = vertices[ sortArray[v][1] ].position; - - offset = v * 3; - - vertexArray[ offset ] = vertex.x; - vertexArray[ offset + 1 ] = vertex.y; - vertexArray[ offset + 2 ] = vertex.z; - - } - - for ( c = 0; c < cl; c ++ ) { - - offset = c * 3; - - color = colors[ sortArray[c][1] ]; - - colorArray[ offset ] = color.r; - colorArray[ offset + 1 ] = color.g; - colorArray[ offset + 2 ] = color.b; - - } - - if ( customAttributes ) { - - for ( i = 0, il = customAttributes.length; i < il; i ++ ) { - - customAttribute = customAttributes[ i ]; - - if ( ! ( customAttribute.boundTo === undefined || customAttribute.boundTo === "vertices" ) ) continue; - - offset = 0; - - cal = customAttribute.value.length; - - if ( customAttribute.size === 1 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - index = sortArray[ ca ][ 1 ]; - - customAttribute.array[ ca ] = customAttribute.value[ index ]; - - } - - } else if ( customAttribute.size === 2 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - index = sortArray[ ca ][ 1 ]; - - value = customAttribute.value[ index ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - - offset += 2; - - } - - } else if ( customAttribute.size === 3 ) { - - if ( customAttribute.type === "c" ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - index = sortArray[ ca ][ 1 ]; - - value = customAttribute.value[ index ]; - - customAttribute.array[ offset ] = value.r; - customAttribute.array[ offset + 1 ] = value.g; - customAttribute.array[ offset + 2 ] = value.b; - - offset += 3; - - } - - } else { - - for ( ca = 0; ca < cal; ca ++ ) { - - index = sortArray[ ca ][ 1 ]; - - value = customAttribute.value[ index ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - customAttribute.array[ offset + 2 ] = value.z; - - offset += 3; - - } - - } - - } else if ( customAttribute.size === 4 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - index = sortArray[ ca ][ 1 ]; - - value = customAttribute.value[ index ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - customAttribute.array[ offset + 2 ] = value.z; - customAttribute.array[ offset + 3 ] = value.w; - - offset += 4; - - } - - } - - } - - } - - } else { - - if ( dirtyVertices ) { - - for ( v = 0; v < vl; v ++ ) { - - vertex = vertices[ v ].position; - - offset = v * 3; - - vertexArray[ offset ] = vertex.x; - vertexArray[ offset + 1 ] = vertex.y; - vertexArray[ offset + 2 ] = vertex.z; - - } - - } - - if ( dirtyColors ) { - - for ( c = 0; c < cl; c ++ ) { - - color = colors[ c ]; - - offset = c * 3; - - colorArray[ offset ] = color.r; - colorArray[ offset + 1 ] = color.g; - colorArray[ offset + 2 ] = color.b; - - } - - } - - if ( customAttributes ) { - - for ( i = 0, il = customAttributes.length; i < il; i ++ ) { - - customAttribute = customAttributes[ i ]; - - if ( customAttribute.needsUpdate && - ( customAttribute.boundTo === undefined || - customAttribute.boundTo === "vertices") ) { - - cal = customAttribute.value.length; - - offset = 0; - - if ( customAttribute.size === 1 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - customAttribute.array[ ca ] = customAttribute.value[ ca ]; - - } - - } else if ( customAttribute.size === 2 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - - offset += 2; - - } - - } else if ( customAttribute.size === 3 ) { - - if ( customAttribute.type === "c" ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.r; - customAttribute.array[ offset + 1 ] = value.g; - customAttribute.array[ offset + 2 ] = value.b; - - offset += 3; - - } - - } else { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - customAttribute.array[ offset + 2 ] = value.z; - - offset += 3; - - } - - } - - } else if ( customAttribute.size === 4 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - customAttribute.array[ offset + 2 ] = value.z; - customAttribute.array[ offset + 3 ] = value.w; - - offset += 4; - - } - - } - - } - - } - - } - - } - - if ( dirtyVertices || object.sortParticles ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglVertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, vertexArray, hint ); - - } - - if ( dirtyColors || object.sortParticles ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglColorBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, colorArray, hint ); - - } - - if ( customAttributes ) { - - for ( i = 0, il = customAttributes.length; i < il; i ++ ) { - - customAttribute = customAttributes[ i ]; - - if ( customAttribute.needsUpdate || object.sortParticles ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, customAttribute.buffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, customAttribute.array, hint ); - - } - - } - - } - - - }; - - function setLineBuffers ( geometry, hint ) { - - var v, c, vertex, offset, color, - - vertices = geometry.vertices, - colors = geometry.colors, - vl = vertices.length, - cl = colors.length, - - vertexArray = geometry.__vertexArray, - colorArray = geometry.__colorArray, - - dirtyVertices = geometry.__dirtyVertices, - dirtyColors = geometry.__dirtyColors, - - customAttributes = geometry.__webglCustomAttributesList, - - i, il, - a, ca, cal, value, - customAttribute; - - if ( dirtyVertices ) { - - for ( v = 0; v < vl; v ++ ) { - - vertex = vertices[ v ].position; - - offset = v * 3; - - vertexArray[ offset ] = vertex.x; - vertexArray[ offset + 1 ] = vertex.y; - vertexArray[ offset + 2 ] = vertex.z; - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglVertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, vertexArray, hint ); - - } - - if ( dirtyColors ) { - - for ( c = 0; c < cl; c ++ ) { - - color = colors[ c ]; - - offset = c * 3; - - colorArray[ offset ] = color.r; - colorArray[ offset + 1 ] = color.g; - colorArray[ offset + 2 ] = color.b; - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglColorBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, colorArray, hint ); - - } - - if ( customAttributes ) { - - for ( i = 0, il = customAttributes.length; i < il; i ++ ) { - - customAttribute = customAttributes[ i ]; - - if ( customAttribute.needsUpdate && - ( customAttribute.boundTo === undefined || - customAttribute.boundTo === "vertices" ) ) { - - offset = 0; - - cal = customAttribute.value.length; - - if ( customAttribute.size === 1 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - customAttribute.array[ ca ] = customAttribute.value[ ca ]; - - } - - } else if ( customAttribute.size === 2 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - - offset += 2; - - } - - } else if ( customAttribute.size === 3 ) { - - if ( customAttribute.type === "c" ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.r; - customAttribute.array[ offset + 1 ] = value.g; - customAttribute.array[ offset + 2 ] = value.b; - - offset += 3; - - } - - } else { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - customAttribute.array[ offset + 2 ] = value.z; - - offset += 3; - - } - - } - - } else if ( customAttribute.size === 4 ) { - - for ( ca = 0; ca < cal; ca ++ ) { - - value = customAttribute.value[ ca ]; - - customAttribute.array[ offset ] = value.x; - customAttribute.array[ offset + 1 ] = value.y; - customAttribute.array[ offset + 2 ] = value.z; - customAttribute.array[ offset + 3 ] = value.w; - - offset += 4; - - } - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, customAttribute.buffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, customAttribute.array, hint ); - - } - - } - - } - - }; - - function setRibbonBuffers ( geometry, hint ) { - - var v, c, vertex, offset, color, - - vertices = geometry.vertices, - colors = geometry.colors, - vl = vertices.length, - cl = colors.length, - - vertexArray = geometry.__vertexArray, - colorArray = geometry.__colorArray, - - dirtyVertices = geometry.__dirtyVertices, - dirtyColors = geometry.__dirtyColors; - - if ( dirtyVertices ) { - - for ( v = 0; v < vl; v ++ ) { - - vertex = vertices[ v ].position; - - offset = v * 3; - - vertexArray[ offset ] = vertex.x; - vertexArray[ offset + 1 ] = vertex.y; - vertexArray[ offset + 2 ] = vertex.z; - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglVertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, vertexArray, hint ); - - } - - if ( dirtyColors ) { - - for ( c = 0; c < cl; c ++ ) { - - color = colors[ c ]; - - offset = c * 3; - - colorArray[ offset ] = color.r; - colorArray[ offset + 1 ] = color.g; - colorArray[ offset + 2 ] = color.b; - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometry.__webglColorBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, colorArray, hint ); - - } - - }; - - function setMeshBuffers( geometryGroup, object, hint, dispose, material ) { - - if ( ! geometryGroup.__inittedArrays ) { - - // console.log( object ); - return; - - } - - var normalType = bufferGuessNormalType( material ), - vertexColorType = bufferGuessVertexColorType( material ), - uvType = bufferGuessUVType( material ), - - needsSmoothNormals = ( normalType === THREE.SmoothShading ); - - var f, fl, fi, face, - vertexNormals, faceNormal, normal, - vertexColors, faceColor, - vertexTangents, - uv, uv2, v1, v2, v3, v4, t1, t2, t3, t4, - c1, c2, c3, c4, - sw1, sw2, sw3, sw4, - si1, si2, si3, si4, - sa1, sa2, sa3, sa4, - sb1, sb2, sb3, sb4, - m, ml, i, il, - vn, uvi, uv2i, - vk, vkl, vka, - a, - - vertexIndex = 0, - - offset = 0, - offset_uv = 0, - offset_uv2 = 0, - offset_face = 0, - offset_normal = 0, - offset_tangent = 0, - offset_line = 0, - offset_color = 0, - offset_skin = 0, - offset_morphTarget = 0, - offset_custom = 0, - offset_customSrc = 0, - - value, - - vertexArray = geometryGroup.__vertexArray, - uvArray = geometryGroup.__uvArray, - uv2Array = geometryGroup.__uv2Array, - normalArray = geometryGroup.__normalArray, - tangentArray = geometryGroup.__tangentArray, - colorArray = geometryGroup.__colorArray, - - skinVertexAArray = geometryGroup.__skinVertexAArray, - skinVertexBArray = geometryGroup.__skinVertexBArray, - skinIndexArray = geometryGroup.__skinIndexArray, - skinWeightArray = geometryGroup.__skinWeightArray, - - morphTargetsArrays = geometryGroup.__morphTargetsArrays, - - customAttributes = geometryGroup.__webglCustomAttributesList, - customAttribute, - - faceArray = geometryGroup.__faceArray, - lineArray = geometryGroup.__lineArray, - - geometry = object.geometry, // this is shared for all chunks - - dirtyVertices = geometry.__dirtyVertices, - dirtyElements = geometry.__dirtyElements, - dirtyUvs = geometry.__dirtyUvs, - dirtyNormals = geometry.__dirtyNormals, - dirtyTangents = geometry.__dirtyTangents, - dirtyColors = geometry.__dirtyColors, - dirtyMorphTargets = geometry.__dirtyMorphTargets, - - vertices = geometry.vertices, - chunk_faces3 = geometryGroup.faces3, - chunk_faces4 = geometryGroup.faces4, - obj_faces = geometry.faces, - - obj_uvs = geometry.faceVertexUvs[ 0 ], - obj_uvs2 = geometry.faceVertexUvs[ 1 ], - - obj_colors = geometry.colors, - - obj_skinVerticesA = geometry.skinVerticesA, - obj_skinVerticesB = geometry.skinVerticesB, - obj_skinIndices = geometry.skinIndices, - obj_skinWeights = geometry.skinWeights, - - morphTargets = geometry.morphTargets; - - if ( dirtyVertices ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - v1 = vertices[ face.a ].position; - v2 = vertices[ face.b ].position; - v3 = vertices[ face.c ].position; - - vertexArray[ offset ] = v1.x; - vertexArray[ offset + 1 ] = v1.y; - vertexArray[ offset + 2 ] = v1.z; - - vertexArray[ offset + 3 ] = v2.x; - vertexArray[ offset + 4 ] = v2.y; - vertexArray[ offset + 5 ] = v2.z; - - vertexArray[ offset + 6 ] = v3.x; - vertexArray[ offset + 7 ] = v3.y; - vertexArray[ offset + 8 ] = v3.z; - - offset += 9; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - v1 = vertices[ face.a ].position; - v2 = vertices[ face.b ].position; - v3 = vertices[ face.c ].position; - v4 = vertices[ face.d ].position; - - vertexArray[ offset ] = v1.x; - vertexArray[ offset + 1 ] = v1.y; - vertexArray[ offset + 2 ] = v1.z; - - vertexArray[ offset + 3 ] = v2.x; - vertexArray[ offset + 4 ] = v2.y; - vertexArray[ offset + 5 ] = v2.z; - - vertexArray[ offset + 6 ] = v3.x; - vertexArray[ offset + 7 ] = v3.y; - vertexArray[ offset + 8 ] = v3.z; - - vertexArray[ offset + 9 ] = v4.x; - vertexArray[ offset + 10 ] = v4.y; - vertexArray[ offset + 11 ] = v4.z; - - offset += 12; - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, vertexArray, hint ); - - } - - if ( dirtyMorphTargets ) { - - for ( vk = 0, vkl = morphTargets.length; vk < vkl; vk ++ ) { - - offset_morphTarget = 0; - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - v1 = morphTargets[ vk ].vertices[ face.a ].position; - v2 = morphTargets[ vk ].vertices[ face.b ].position; - v3 = morphTargets[ vk ].vertices[ face.c ].position; - - vka = morphTargetsArrays[ vk ]; - - vka[ offset_morphTarget ] = v1.x; - vka[ offset_morphTarget + 1 ] = v1.y; - vka[ offset_morphTarget + 2 ] = v1.z; - - vka[ offset_morphTarget + 3 ] = v2.x; - vka[ offset_morphTarget + 4 ] = v2.y; - vka[ offset_morphTarget + 5 ] = v2.z; - - vka[ offset_morphTarget + 6 ] = v3.x; - vka[ offset_morphTarget + 7 ] = v3.y; - vka[ offset_morphTarget + 8 ] = v3.z; - - offset_morphTarget += 9; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - v1 = morphTargets[ vk ].vertices[ face.a ].position; - v2 = morphTargets[ vk ].vertices[ face.b ].position; - v3 = morphTargets[ vk ].vertices[ face.c ].position; - v4 = morphTargets[ vk ].vertices[ face.d ].position; - - vka = morphTargetsArrays[ vk ]; - - vka[ offset_morphTarget ] = v1.x; - vka[ offset_morphTarget + 1 ] = v1.y; - vka[ offset_morphTarget + 2 ] = v1.z; - - vka[ offset_morphTarget + 3 ] = v2.x; - vka[ offset_morphTarget + 4 ] = v2.y; - vka[ offset_morphTarget + 5 ] = v2.z; - - vka[ offset_morphTarget + 6 ] = v3.x; - vka[ offset_morphTarget + 7 ] = v3.y; - vka[ offset_morphTarget + 8 ] = v3.z; - - vka[ offset_morphTarget + 9 ] = v4.x; - vka[ offset_morphTarget + 10 ] = v4.y; - vka[ offset_morphTarget + 11 ] = v4.z; - - offset_morphTarget += 12; - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ vk ] ); - _gl.bufferData( _gl.ARRAY_BUFFER, morphTargetsArrays[ vk ], hint ); - - } - - } - - if ( obj_skinWeights.length ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - // weights - - sw1 = obj_skinWeights[ face.a ]; - sw2 = obj_skinWeights[ face.b ]; - sw3 = obj_skinWeights[ face.c ]; - - skinWeightArray[ offset_skin ] = sw1.x; - skinWeightArray[ offset_skin + 1 ] = sw1.y; - skinWeightArray[ offset_skin + 2 ] = sw1.z; - skinWeightArray[ offset_skin + 3 ] = sw1.w; - - skinWeightArray[ offset_skin + 4 ] = sw2.x; - skinWeightArray[ offset_skin + 5 ] = sw2.y; - skinWeightArray[ offset_skin + 6 ] = sw2.z; - skinWeightArray[ offset_skin + 7 ] = sw2.w; - - skinWeightArray[ offset_skin + 8 ] = sw3.x; - skinWeightArray[ offset_skin + 9 ] = sw3.y; - skinWeightArray[ offset_skin + 10 ] = sw3.z; - skinWeightArray[ offset_skin + 11 ] = sw3.w; - - // indices - - si1 = obj_skinIndices[ face.a ]; - si2 = obj_skinIndices[ face.b ]; - si3 = obj_skinIndices[ face.c ]; - - skinIndexArray[ offset_skin ] = si1.x; - skinIndexArray[ offset_skin + 1 ] = si1.y; - skinIndexArray[ offset_skin + 2 ] = si1.z; - skinIndexArray[ offset_skin + 3 ] = si1.w; - - skinIndexArray[ offset_skin + 4 ] = si2.x; - skinIndexArray[ offset_skin + 5 ] = si2.y; - skinIndexArray[ offset_skin + 6 ] = si2.z; - skinIndexArray[ offset_skin + 7 ] = si2.w; - - skinIndexArray[ offset_skin + 8 ] = si3.x; - skinIndexArray[ offset_skin + 9 ] = si3.y; - skinIndexArray[ offset_skin + 10 ] = si3.z; - skinIndexArray[ offset_skin + 11 ] = si3.w; - - // vertices A - - sa1 = obj_skinVerticesA[ face.a ]; - sa2 = obj_skinVerticesA[ face.b ]; - sa3 = obj_skinVerticesA[ face.c ]; - - skinVertexAArray[ offset_skin ] = sa1.x; - skinVertexAArray[ offset_skin + 1 ] = sa1.y; - skinVertexAArray[ offset_skin + 2 ] = sa1.z; - skinVertexAArray[ offset_skin + 3 ] = 1; // pad for faster vertex shader - - skinVertexAArray[ offset_skin + 4 ] = sa2.x; - skinVertexAArray[ offset_skin + 5 ] = sa2.y; - skinVertexAArray[ offset_skin + 6 ] = sa2.z; - skinVertexAArray[ offset_skin + 7 ] = 1; - - skinVertexAArray[ offset_skin + 8 ] = sa3.x; - skinVertexAArray[ offset_skin + 9 ] = sa3.y; - skinVertexAArray[ offset_skin + 10 ] = sa3.z; - skinVertexAArray[ offset_skin + 11 ] = 1; - - // vertices B - - sb1 = obj_skinVerticesB[ face.a ]; - sb2 = obj_skinVerticesB[ face.b ]; - sb3 = obj_skinVerticesB[ face.c ]; - - skinVertexBArray[ offset_skin ] = sb1.x; - skinVertexBArray[ offset_skin + 1 ] = sb1.y; - skinVertexBArray[ offset_skin + 2 ] = sb1.z; - skinVertexBArray[ offset_skin + 3 ] = 1; // pad for faster vertex shader - - skinVertexBArray[ offset_skin + 4 ] = sb2.x; - skinVertexBArray[ offset_skin + 5 ] = sb2.y; - skinVertexBArray[ offset_skin + 6 ] = sb2.z; - skinVertexBArray[ offset_skin + 7 ] = 1; - - skinVertexBArray[ offset_skin + 8 ] = sb3.x; - skinVertexBArray[ offset_skin + 9 ] = sb3.y; - skinVertexBArray[ offset_skin + 10 ] = sb3.z; - skinVertexBArray[ offset_skin + 11 ] = 1; - - offset_skin += 12; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - // weights - - sw1 = obj_skinWeights[ face.a ]; - sw2 = obj_skinWeights[ face.b ]; - sw3 = obj_skinWeights[ face.c ]; - sw4 = obj_skinWeights[ face.d ]; - - skinWeightArray[ offset_skin ] = sw1.x; - skinWeightArray[ offset_skin + 1 ] = sw1.y; - skinWeightArray[ offset_skin + 2 ] = sw1.z; - skinWeightArray[ offset_skin + 3 ] = sw1.w; - - skinWeightArray[ offset_skin + 4 ] = sw2.x; - skinWeightArray[ offset_skin + 5 ] = sw2.y; - skinWeightArray[ offset_skin + 6 ] = sw2.z; - skinWeightArray[ offset_skin + 7 ] = sw2.w; - - skinWeightArray[ offset_skin + 8 ] = sw3.x; - skinWeightArray[ offset_skin + 9 ] = sw3.y; - skinWeightArray[ offset_skin + 10 ] = sw3.z; - skinWeightArray[ offset_skin + 11 ] = sw3.w; - - skinWeightArray[ offset_skin + 12 ] = sw4.x; - skinWeightArray[ offset_skin + 13 ] = sw4.y; - skinWeightArray[ offset_skin + 14 ] = sw4.z; - skinWeightArray[ offset_skin + 15 ] = sw4.w; - - // indices - - si1 = obj_skinIndices[ face.a ]; - si2 = obj_skinIndices[ face.b ]; - si3 = obj_skinIndices[ face.c ]; - si4 = obj_skinIndices[ face.d ]; - - skinIndexArray[ offset_skin ] = si1.x; - skinIndexArray[ offset_skin + 1 ] = si1.y; - skinIndexArray[ offset_skin + 2 ] = si1.z; - skinIndexArray[ offset_skin + 3 ] = si1.w; - - skinIndexArray[ offset_skin + 4 ] = si2.x; - skinIndexArray[ offset_skin + 5 ] = si2.y; - skinIndexArray[ offset_skin + 6 ] = si2.z; - skinIndexArray[ offset_skin + 7 ] = si2.w; - - skinIndexArray[ offset_skin + 8 ] = si3.x; - skinIndexArray[ offset_skin + 9 ] = si3.y; - skinIndexArray[ offset_skin + 10 ] = si3.z; - skinIndexArray[ offset_skin + 11 ] = si3.w; - - skinIndexArray[ offset_skin + 12 ] = si4.x; - skinIndexArray[ offset_skin + 13 ] = si4.y; - skinIndexArray[ offset_skin + 14 ] = si4.z; - skinIndexArray[ offset_skin + 15 ] = si4.w; - - // vertices A - - sa1 = obj_skinVerticesA[ face.a ]; - sa2 = obj_skinVerticesA[ face.b ]; - sa3 = obj_skinVerticesA[ face.c ]; - sa4 = obj_skinVerticesA[ face.d ]; - - skinVertexAArray[ offset_skin ] = sa1.x; - skinVertexAArray[ offset_skin + 1 ] = sa1.y; - skinVertexAArray[ offset_skin + 2 ] = sa1.z; - skinVertexAArray[ offset_skin + 3 ] = 1; // pad for faster vertex shader - - skinVertexAArray[ offset_skin + 4 ] = sa2.x; - skinVertexAArray[ offset_skin + 5 ] = sa2.y; - skinVertexAArray[ offset_skin + 6 ] = sa2.z; - skinVertexAArray[ offset_skin + 7 ] = 1; - - skinVertexAArray[ offset_skin + 8 ] = sa3.x; - skinVertexAArray[ offset_skin + 9 ] = sa3.y; - skinVertexAArray[ offset_skin + 10 ] = sa3.z; - skinVertexAArray[ offset_skin + 11 ] = 1; - - skinVertexAArray[ offset_skin + 12 ] = sa4.x; - skinVertexAArray[ offset_skin + 13 ] = sa4.y; - skinVertexAArray[ offset_skin + 14 ] = sa4.z; - skinVertexAArray[ offset_skin + 15 ] = 1; - - // vertices B - - sb1 = obj_skinVerticesB[ face.a ]; - sb2 = obj_skinVerticesB[ face.b ]; - sb3 = obj_skinVerticesB[ face.c ]; - sb4 = obj_skinVerticesB[ face.d ]; - - skinVertexBArray[ offset_skin ] = sb1.x; - skinVertexBArray[ offset_skin + 1 ] = sb1.y; - skinVertexBArray[ offset_skin + 2 ] = sb1.z; - skinVertexBArray[ offset_skin + 3 ] = 1; // pad for faster vertex shader - - skinVertexBArray[ offset_skin + 4 ] = sb2.x; - skinVertexBArray[ offset_skin + 5 ] = sb2.y; - skinVertexBArray[ offset_skin + 6 ] = sb2.z; - skinVertexBArray[ offset_skin + 7 ] = 1; - - skinVertexBArray[ offset_skin + 8 ] = sb3.x; - skinVertexBArray[ offset_skin + 9 ] = sb3.y; - skinVertexBArray[ offset_skin + 10 ] = sb3.z; - skinVertexBArray[ offset_skin + 11 ] = 1; - - skinVertexBArray[ offset_skin + 12 ] = sb4.x; - skinVertexBArray[ offset_skin + 13 ] = sb4.y; - skinVertexBArray[ offset_skin + 14 ] = sb4.z; - skinVertexBArray[ offset_skin + 15 ] = 1; - - offset_skin += 16; - - } - - if ( offset_skin > 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinVertexABuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, skinVertexAArray, hint ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinVertexBBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, skinVertexBArray, hint ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinIndicesBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, skinIndexArray, hint ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinWeightsBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, skinWeightArray, hint ); - - } - - } - - if ( dirtyColors && vertexColorType ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - vertexColors = face.vertexColors; - faceColor = face.color; - - if ( vertexColors.length === 3 && vertexColorType === THREE.VertexColors ) { - - c1 = vertexColors[ 0 ]; - c2 = vertexColors[ 1 ]; - c3 = vertexColors[ 2 ]; - - } else { - - c1 = faceColor; - c2 = faceColor; - c3 = faceColor; - - } - - colorArray[ offset_color ] = c1.r; - colorArray[ offset_color + 1 ] = c1.g; - colorArray[ offset_color + 2 ] = c1.b; - - colorArray[ offset_color + 3 ] = c2.r; - colorArray[ offset_color + 4 ] = c2.g; - colorArray[ offset_color + 5 ] = c2.b; - - colorArray[ offset_color + 6 ] = c3.r; - colorArray[ offset_color + 7 ] = c3.g; - colorArray[ offset_color + 8 ] = c3.b; - - offset_color += 9; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - vertexColors = face.vertexColors; - faceColor = face.color; - - if ( vertexColors.length === 4 && vertexColorType === THREE.VertexColors ) { - - c1 = vertexColors[ 0 ]; - c2 = vertexColors[ 1 ]; - c3 = vertexColors[ 2 ]; - c4 = vertexColors[ 3 ]; - - } else { - - c1 = faceColor; - c2 = faceColor; - c3 = faceColor; - c4 = faceColor; - - } - - colorArray[ offset_color ] = c1.r; - colorArray[ offset_color + 1 ] = c1.g; - colorArray[ offset_color + 2 ] = c1.b; - - colorArray[ offset_color + 3 ] = c2.r; - colorArray[ offset_color + 4 ] = c2.g; - colorArray[ offset_color + 5 ] = c2.b; - - colorArray[ offset_color + 6 ] = c3.r; - colorArray[ offset_color + 7 ] = c3.g; - colorArray[ offset_color + 8 ] = c3.b; - - colorArray[ offset_color + 9 ] = c4.r; - colorArray[ offset_color + 10 ] = c4.g; - colorArray[ offset_color + 11 ] = c4.b; - - offset_color += 12; - - } - - if ( offset_color > 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglColorBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, colorArray, hint ); - - } - - } - - if ( dirtyTangents && geometry.hasTangents ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - vertexTangents = face.vertexTangents; - - t1 = vertexTangents[ 0 ]; - t2 = vertexTangents[ 1 ]; - t3 = vertexTangents[ 2 ]; - - tangentArray[ offset_tangent ] = t1.x; - tangentArray[ offset_tangent + 1 ] = t1.y; - tangentArray[ offset_tangent + 2 ] = t1.z; - tangentArray[ offset_tangent + 3 ] = t1.w; - - tangentArray[ offset_tangent + 4 ] = t2.x; - tangentArray[ offset_tangent + 5 ] = t2.y; - tangentArray[ offset_tangent + 6 ] = t2.z; - tangentArray[ offset_tangent + 7 ] = t2.w; - - tangentArray[ offset_tangent + 8 ] = t3.x; - tangentArray[ offset_tangent + 9 ] = t3.y; - tangentArray[ offset_tangent + 10 ] = t3.z; - tangentArray[ offset_tangent + 11 ] = t3.w; - - offset_tangent += 12; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - vertexTangents = face.vertexTangents; - - t1 = vertexTangents[ 0 ]; - t2 = vertexTangents[ 1 ]; - t3 = vertexTangents[ 2 ]; - t4 = vertexTangents[ 3 ]; - - tangentArray[ offset_tangent ] = t1.x; - tangentArray[ offset_tangent + 1 ] = t1.y; - tangentArray[ offset_tangent + 2 ] = t1.z; - tangentArray[ offset_tangent + 3 ] = t1.w; - - tangentArray[ offset_tangent + 4 ] = t2.x; - tangentArray[ offset_tangent + 5 ] = t2.y; - tangentArray[ offset_tangent + 6 ] = t2.z; - tangentArray[ offset_tangent + 7 ] = t2.w; - - tangentArray[ offset_tangent + 8 ] = t3.x; - tangentArray[ offset_tangent + 9 ] = t3.y; - tangentArray[ offset_tangent + 10 ] = t3.z; - tangentArray[ offset_tangent + 11 ] = t3.w; - - tangentArray[ offset_tangent + 12 ] = t4.x; - tangentArray[ offset_tangent + 13 ] = t4.y; - tangentArray[ offset_tangent + 14 ] = t4.z; - tangentArray[ offset_tangent + 15 ] = t4.w; - - offset_tangent += 16; - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglTangentBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, tangentArray, hint ); - - } - - if ( dirtyNormals && normalType ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - vertexNormals = face.vertexNormals; - faceNormal = face.normal; - - if ( vertexNormals.length === 3 && needsSmoothNormals ) { - - for ( i = 0; i < 3; i ++ ) { - - vn = vertexNormals[ i ]; - - normalArray[ offset_normal ] = vn.x; - normalArray[ offset_normal + 1 ] = vn.y; - normalArray[ offset_normal + 2 ] = vn.z; - - offset_normal += 3; - - } - - } else { - - for ( i = 0; i < 3; i ++ ) { - - normalArray[ offset_normal ] = faceNormal.x; - normalArray[ offset_normal + 1 ] = faceNormal.y; - normalArray[ offset_normal + 2 ] = faceNormal.z; - - offset_normal += 3; - - } - - } - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - vertexNormals = face.vertexNormals; - faceNormal = face.normal; - - if ( vertexNormals.length === 4 && needsSmoothNormals ) { - - for ( i = 0; i < 4; i ++ ) { - - vn = vertexNormals[ i ]; - - normalArray[ offset_normal ] = vn.x; - normalArray[ offset_normal + 1 ] = vn.y; - normalArray[ offset_normal + 2 ] = vn.z; - - offset_normal += 3; - - } - - } else { - - for ( i = 0; i < 4; i ++ ) { - - normalArray[ offset_normal ] = faceNormal.x; - normalArray[ offset_normal + 1 ] = faceNormal.y; - normalArray[ offset_normal + 2 ] = faceNormal.z; - - offset_normal += 3; - - } - - } - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglNormalBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, normalArray, hint ); - - } - - if ( dirtyUvs && obj_uvs && uvType ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - fi = chunk_faces3[ f ]; - - face = obj_faces[ fi ]; - uv = obj_uvs[ fi ]; - - if ( uv === undefined ) continue; - - for ( i = 0; i < 3; i ++ ) { - - uvi = uv[ i ]; - - uvArray[ offset_uv ] = uvi.u; - uvArray[ offset_uv + 1 ] = uvi.v; - - offset_uv += 2; - - } - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - fi = chunk_faces4[ f ]; - - face = obj_faces[ fi ]; - uv = obj_uvs[ fi ]; - - if ( uv === undefined ) continue; - - for ( i = 0; i < 4; i ++ ) { - - uvi = uv[ i ]; - - uvArray[ offset_uv ] = uvi.u; - uvArray[ offset_uv + 1 ] = uvi.v; - - offset_uv += 2; - - } - - } - - if ( offset_uv > 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUVBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, uvArray, hint ); - - } - - } - - if ( dirtyUvs && obj_uvs2 && uvType ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - fi = chunk_faces3[ f ]; - - face = obj_faces[ fi ]; - uv2 = obj_uvs2[ fi ]; - - if ( uv2 === undefined ) continue; - - for ( i = 0; i < 3; i ++ ) { - - uv2i = uv2[ i ]; - - uv2Array[ offset_uv2 ] = uv2i.u; - uv2Array[ offset_uv2 + 1 ] = uv2i.v; - - offset_uv2 += 2; - - } - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - fi = chunk_faces4[ f ]; - - face = obj_faces[ fi ]; - uv2 = obj_uvs2[ fi ]; - - if ( uv2 === undefined ) continue; - - for ( i = 0; i < 4; i ++ ) { - - uv2i = uv2[ i ]; - - uv2Array[ offset_uv2 ] = uv2i.u; - uv2Array[ offset_uv2 + 1 ] = uv2i.v; - - offset_uv2 += 2; - - } - - } - - if ( offset_uv2 > 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUV2Buffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, uv2Array, hint ); - - } - - } - - if ( dirtyElements ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - faceArray[ offset_face ] = vertexIndex; - faceArray[ offset_face + 1 ] = vertexIndex + 1; - faceArray[ offset_face + 2 ] = vertexIndex + 2; - - offset_face += 3; - - lineArray[ offset_line ] = vertexIndex; - lineArray[ offset_line + 1 ] = vertexIndex + 1; - - lineArray[ offset_line + 2 ] = vertexIndex; - lineArray[ offset_line + 3 ] = vertexIndex + 2; - - lineArray[ offset_line + 4 ] = vertexIndex + 1; - lineArray[ offset_line + 5 ] = vertexIndex + 2; - - offset_line += 6; - - vertexIndex += 3; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - faceArray[ offset_face ] = vertexIndex; - faceArray[ offset_face + 1 ] = vertexIndex + 1; - faceArray[ offset_face + 2 ] = vertexIndex + 3; - - faceArray[ offset_face + 3 ] = vertexIndex + 1; - faceArray[ offset_face + 4 ] = vertexIndex + 2; - faceArray[ offset_face + 5 ] = vertexIndex + 3; - - offset_face += 6; - - lineArray[ offset_line ] = vertexIndex; - lineArray[ offset_line + 1 ] = vertexIndex + 1; - - lineArray[ offset_line + 2 ] = vertexIndex; - lineArray[ offset_line + 3 ] = vertexIndex + 3; - - lineArray[ offset_line + 4 ] = vertexIndex + 1; - lineArray[ offset_line + 5 ] = vertexIndex + 2; - - lineArray[ offset_line + 6 ] = vertexIndex + 2; - lineArray[ offset_line + 7 ] = vertexIndex + 3; - - offset_line += 8; - - vertexIndex += 4; - - } - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglFaceBuffer ); - _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, faceArray, hint ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglLineBuffer ); - _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, lineArray, hint ); - - } - - if ( customAttributes ) { - - for ( i = 0, il = customAttributes.length; i < il; i ++ ) { - - customAttribute = customAttributes[ i ]; - - if ( ! customAttribute.__original.needsUpdate ) continue; - - offset_custom = 0; - offset_customSrc = 0; - - if ( customAttribute.size === 1 ) { - - if ( customAttribute.boundTo === undefined || customAttribute.boundTo === "vertices" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - customAttribute.array[ offset_custom ] = customAttribute.value[ face.a ]; - customAttribute.array[ offset_custom + 1 ] = customAttribute.value[ face.b ]; - customAttribute.array[ offset_custom + 2 ] = customAttribute.value[ face.c ]; - - offset_custom += 3; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - customAttribute.array[ offset_custom ] = customAttribute.value[ face.a ]; - customAttribute.array[ offset_custom + 1 ] = customAttribute.value[ face.b ]; - customAttribute.array[ offset_custom + 2 ] = customAttribute.value[ face.c ]; - customAttribute.array[ offset_custom + 3 ] = customAttribute.value[ face.d ]; - - offset_custom += 4; - - } - - } else if ( customAttribute.boundTo === "faces" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces3[ f ] ]; - - customAttribute.array[ offset_custom ] = value; - customAttribute.array[ offset_custom + 1 ] = value; - customAttribute.array[ offset_custom + 2 ] = value; - - offset_custom += 3; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces4[ f ] ]; - - customAttribute.array[ offset_custom ] = value; - customAttribute.array[ offset_custom + 1 ] = value; - customAttribute.array[ offset_custom + 2 ] = value; - customAttribute.array[ offset_custom + 3 ] = value; - - offset_custom += 4; - - } - - } - - } else if ( customAttribute.size === 2 ) { - - if ( customAttribute.boundTo === undefined || customAttribute.boundTo === "vertices" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - v1 = customAttribute.value[ face.a ]; - v2 = customAttribute.value[ face.b ]; - v3 = customAttribute.value[ face.c ]; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - - customAttribute.array[ offset_custom + 2 ] = v2.x; - customAttribute.array[ offset_custom + 3 ] = v2.y; - - customAttribute.array[ offset_custom + 4 ] = v3.x; - customAttribute.array[ offset_custom + 5 ] = v3.y; - - offset_custom += 6; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - v1 = customAttribute.value[ face.a ]; - v2 = customAttribute.value[ face.b ]; - v3 = customAttribute.value[ face.c ]; - v4 = customAttribute.value[ face.d ]; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - - customAttribute.array[ offset_custom + 2 ] = v2.x; - customAttribute.array[ offset_custom + 3 ] = v2.y; - - customAttribute.array[ offset_custom + 4 ] = v3.x; - customAttribute.array[ offset_custom + 5 ] = v3.y; - - customAttribute.array[ offset_custom + 6 ] = v4.x; - customAttribute.array[ offset_custom + 7 ] = v4.y; - - offset_custom += 8; - - } - - } else if ( customAttribute.boundTo === "faces" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces3[ f ] ]; - - v1 = value; - v2 = value; - v3 = value; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - - customAttribute.array[ offset_custom + 2 ] = v2.x; - customAttribute.array[ offset_custom + 3 ] = v2.y; - - customAttribute.array[ offset_custom + 4 ] = v3.x; - customAttribute.array[ offset_custom + 5 ] = v3.y; - - offset_custom += 6; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces4[ f ] ]; - - v1 = value; - v2 = value; - v3 = value; - v4 = value; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - - customAttribute.array[ offset_custom + 2 ] = v2.x; - customAttribute.array[ offset_custom + 3 ] = v2.y; - - customAttribute.array[ offset_custom + 4 ] = v3.x; - customAttribute.array[ offset_custom + 5 ] = v3.y; - - customAttribute.array[ offset_custom + 6 ] = v4.x; - customAttribute.array[ offset_custom + 7 ] = v4.y; - - offset_custom += 8; - - } - - } - - } else if ( customAttribute.size === 3 ) { - - var pp; - - if ( customAttribute.type === "c" ) { - - pp = [ "r", "g", "b" ]; - - } else { - - pp = [ "x", "y", "z" ]; - - } - - if ( customAttribute.boundTo === undefined || customAttribute.boundTo === "vertices" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - v1 = customAttribute.value[ face.a ]; - v2 = customAttribute.value[ face.b ]; - v3 = customAttribute.value[ face.c ]; - - customAttribute.array[ offset_custom ] = v1[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 1 ] = v1[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 2 ] = v1[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 3 ] = v2[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 4 ] = v2[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 5 ] = v2[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 6 ] = v3[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 7 ] = v3[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 8 ] = v3[ pp[ 2 ] ]; - - offset_custom += 9; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - v1 = customAttribute.value[ face.a ]; - v2 = customAttribute.value[ face.b ]; - v3 = customAttribute.value[ face.c ]; - v4 = customAttribute.value[ face.d ]; - - customAttribute.array[ offset_custom ] = v1[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 1 ] = v1[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 2 ] = v1[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 3 ] = v2[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 4 ] = v2[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 5 ] = v2[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 6 ] = v3[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 7 ] = v3[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 8 ] = v3[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 9 ] = v4[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 10 ] = v4[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 11 ] = v4[ pp[ 2 ] ]; - - offset_custom += 12; - - } - - } else if ( customAttribute.boundTo === "faces" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces3[ f ] ]; - - v1 = value; - v2 = value; - v3 = value; - - customAttribute.array[ offset_custom ] = v1[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 1 ] = v1[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 2 ] = v1[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 3 ] = v2[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 4 ] = v2[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 5 ] = v2[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 6 ] = v3[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 7 ] = v3[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 8 ] = v3[ pp[ 2 ] ]; - - offset_custom += 9; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces4[ f ] ]; - - v1 = value; - v2 = value; - v3 = value; - v4 = value; - - customAttribute.array[ offset_custom ] = v1[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 1 ] = v1[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 2 ] = v1[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 3 ] = v2[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 4 ] = v2[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 5 ] = v2[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 6 ] = v3[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 7 ] = v3[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 8 ] = v3[ pp[ 2 ] ]; - - customAttribute.array[ offset_custom + 9 ] = v4[ pp[ 0 ] ]; - customAttribute.array[ offset_custom + 10 ] = v4[ pp[ 1 ] ]; - customAttribute.array[ offset_custom + 11 ] = v4[ pp[ 2 ] ]; - - offset_custom += 12; - - } - - } - - } else if ( customAttribute.size === 4 ) { - - if ( customAttribute.boundTo === undefined || customAttribute.boundTo === "vertices" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces3[ f ] ]; - - v1 = customAttribute.value[ face.a ]; - v2 = customAttribute.value[ face.b ]; - v3 = customAttribute.value[ face.c ]; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - customAttribute.array[ offset_custom + 2 ] = v1.z; - customAttribute.array[ offset_custom + 3 ] = v1.w; - - customAttribute.array[ offset_custom + 4 ] = v2.x; - customAttribute.array[ offset_custom + 5 ] = v2.y; - customAttribute.array[ offset_custom + 6 ] = v2.z; - customAttribute.array[ offset_custom + 7 ] = v2.w; - - customAttribute.array[ offset_custom + 8 ] = v3.x; - customAttribute.array[ offset_custom + 9 ] = v3.y; - customAttribute.array[ offset_custom + 10 ] = v3.z; - customAttribute.array[ offset_custom + 11 ] = v3.w; - - offset_custom += 12; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - face = obj_faces[ chunk_faces4[ f ] ]; - - v1 = customAttribute.value[ face.a ]; - v2 = customAttribute.value[ face.b ]; - v3 = customAttribute.value[ face.c ]; - v4 = customAttribute.value[ face.d ]; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - customAttribute.array[ offset_custom + 2 ] = v1.z; - customAttribute.array[ offset_custom + 3 ] = v1.w; - - customAttribute.array[ offset_custom + 4 ] = v2.x; - customAttribute.array[ offset_custom + 5 ] = v2.y; - customAttribute.array[ offset_custom + 6 ] = v2.z; - customAttribute.array[ offset_custom + 7 ] = v2.w; - - customAttribute.array[ offset_custom + 8 ] = v3.x; - customAttribute.array[ offset_custom + 9 ] = v3.y; - customAttribute.array[ offset_custom + 10 ] = v3.z; - customAttribute.array[ offset_custom + 11 ] = v3.w; - - customAttribute.array[ offset_custom + 12 ] = v4.x; - customAttribute.array[ offset_custom + 13 ] = v4.y; - customAttribute.array[ offset_custom + 14 ] = v4.z; - customAttribute.array[ offset_custom + 15 ] = v4.w; - - offset_custom += 16; - - } - - } else if ( customAttribute.boundTo === "faces" ) { - - for ( f = 0, fl = chunk_faces3.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces3[ f ] ]; - - v1 = value; - v2 = value; - v3 = value; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - customAttribute.array[ offset_custom + 2 ] = v1.z; - customAttribute.array[ offset_custom + 3 ] = v1.w; - - customAttribute.array[ offset_custom + 4 ] = v2.x; - customAttribute.array[ offset_custom + 5 ] = v2.y; - customAttribute.array[ offset_custom + 6 ] = v2.z; - customAttribute.array[ offset_custom + 7 ] = v2.w; - - customAttribute.array[ offset_custom + 8 ] = v3.x; - customAttribute.array[ offset_custom + 9 ] = v3.y; - customAttribute.array[ offset_custom + 10 ] = v3.z; - customAttribute.array[ offset_custom + 11 ] = v3.w; - - offset_custom += 12; - - } - - for ( f = 0, fl = chunk_faces4.length; f < fl; f ++ ) { - - value = customAttribute.value[ chunk_faces4[ f ] ]; - - v1 = value; - v2 = value; - v3 = value; - v4 = value; - - customAttribute.array[ offset_custom ] = v1.x; - customAttribute.array[ offset_custom + 1 ] = v1.y; - customAttribute.array[ offset_custom + 2 ] = v1.z; - customAttribute.array[ offset_custom + 3 ] = v1.w; - - customAttribute.array[ offset_custom + 4 ] = v2.x; - customAttribute.array[ offset_custom + 5 ] = v2.y; - customAttribute.array[ offset_custom + 6 ] = v2.z; - customAttribute.array[ offset_custom + 7 ] = v2.w; - - customAttribute.array[ offset_custom + 8 ] = v3.x; - customAttribute.array[ offset_custom + 9 ] = v3.y; - customAttribute.array[ offset_custom + 10 ] = v3.z; - customAttribute.array[ offset_custom + 11 ] = v3.w; - - customAttribute.array[ offset_custom + 12 ] = v4.x; - customAttribute.array[ offset_custom + 13 ] = v4.y; - customAttribute.array[ offset_custom + 14 ] = v4.z; - customAttribute.array[ offset_custom + 15 ] = v4.w; - - offset_custom += 16; - - } - - } - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, customAttribute.buffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, customAttribute.array, hint ); - - } - - } - - if ( dispose ) { - - delete geometryGroup.__inittedArrays; - delete geometryGroup.__colorArray; - delete geometryGroup.__normalArray; - delete geometryGroup.__tangentArray; - delete geometryGroup.__uvArray; - delete geometryGroup.__uv2Array; - delete geometryGroup.__faceArray; - delete geometryGroup.__vertexArray; - delete geometryGroup.__lineArray; - delete geometryGroup.__skinVertexAArray; - delete geometryGroup.__skinVertexBArray; - delete geometryGroup.__skinIndexArray; - delete geometryGroup.__skinWeightArray; - - } - - }; - - // Buffer rendering - - this.renderBufferImmediate = function ( object, program, shading ) { - - if ( ! object.__webglVertexBuffer ) object.__webglVertexBuffer = _gl.createBuffer(); - if ( ! object.__webglNormalBuffer ) object.__webglNormalBuffer = _gl.createBuffer(); - - if ( object.hasPos ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglVertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW ); - _gl.enableVertexAttribArray( program.attributes.position ); - _gl.vertexAttribPointer( program.attributes.position, 3, _gl.FLOAT, false, 0, 0 ); - - } - - if ( object.hasNormal ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, object.__webglNormalBuffer ); - - if ( shading === THREE.FlatShading ) { - - var nx, ny, nz, - nax, nbx, ncx, nay, nby, ncy, naz, nbz, ncz, - normalArray, - i, il = object.count * 3; - - for( i = 0; i < il; i += 9 ) { - - normalArray = object.normalArray; - - nax = normalArray[ i ]; - nay = normalArray[ i + 1 ]; - naz = normalArray[ i + 2 ]; - - nbx = normalArray[ i + 3 ]; - nby = normalArray[ i + 4 ]; - nbz = normalArray[ i + 5 ]; - - ncx = normalArray[ i + 6 ]; - ncy = normalArray[ i + 7 ]; - ncz = normalArray[ i + 8 ]; - - nx = ( nax + nbx + ncx ) / 3; - ny = ( nay + nby + ncy ) / 3; - nz = ( naz + nbz + ncz ) / 3; - - normalArray[ i ] = nx; - normalArray[ i + 1 ] = ny; - normalArray[ i + 2 ] = nz; - - normalArray[ i + 3 ] = nx; - normalArray[ i + 4 ] = ny; - normalArray[ i + 5 ] = nz; - - normalArray[ i + 6 ] = nx; - normalArray[ i + 7 ] = ny; - normalArray[ i + 8 ] = nz; - - } - - } - - _gl.bufferData( _gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW ); - _gl.enableVertexAttribArray( program.attributes.normal ); - _gl.vertexAttribPointer( program.attributes.normal, 3, _gl.FLOAT, false, 0, 0 ); - - } - - _gl.drawArrays( _gl.TRIANGLES, 0, object.count ); - - object.count = 0; - - }; - - this.renderBufferDirect = function ( camera, lights, fog, material, geometryGroup, object ) { - - if ( material.opacity === 0 ) return; - - var program, attributes, linewidth, primitives, a, attribute; - - program = setProgram( camera, lights, fog, material, object ); - - attributes = program.attributes; - - var updateBuffers = false, - wireframeBit = material.wireframe ? 1 : 0, - geometryGroupHash = ( geometryGroup.id * 0xffffff ) + ( program.id * 2 ) + wireframeBit; - - if ( geometryGroupHash !== _currentGeometryGroupHash ) { - - _currentGeometryGroupHash = geometryGroupHash; - updateBuffers = true; - - } - - // render mesh - - if ( object instanceof THREE.Mesh ) { - - var offsets = geometryGroup.offsets; - - for ( var i = 0, il = offsets.length; i < il; ++ i ) { - - if ( updateBuffers ) { - - // vertices - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.vertexPositionBuffer ); - _gl.vertexAttribPointer( attributes.position, geometryGroup.vertexPositionBuffer.itemSize, _gl.FLOAT, false, 0, offsets[ i ].index * 4 * 3 ); - - // normals - - if ( attributes.normal >= 0 && geometryGroup.vertexNormalBuffer ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.vertexNormalBuffer ); - _gl.vertexAttribPointer( attributes.normal, geometryGroup.vertexNormalBuffer.itemSize, _gl.FLOAT, false, 0, offsets[ i ].index * 4 * 3 ); - - } - - // uvs - - if ( attributes.uv >= 0 && geometryGroup.vertexUvBuffer ) { - - if ( geometryGroup.vertexUvBuffer ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.vertexUvBuffer ); - _gl.vertexAttribPointer( attributes.uv, geometryGroup.vertexUvBuffer.itemSize, _gl.FLOAT, false, 0, offsets[ i ].index * 4 * 2 ); - - _gl.enableVertexAttribArray( attributes.uv ); - - } else { - - _gl.disableVertexAttribArray( attributes.uv ); - - } - - } - - // colors - - if ( attributes.color >= 0 && geometryGroup.vertexColorBuffer ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.vertexColorBuffer ); - _gl.vertexAttribPointer( attributes.color, geometryGroup.vertexColorBuffer.itemSize, _gl.FLOAT, false, 0, offsets[ i ].index * 4 * 4 ); - - - } - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.vertexIndexBuffer ); - - } - - // render indexed triangles - - _gl.drawElements( _gl.TRIANGLES, offsets[ i ].count, _gl.UNSIGNED_SHORT, offsets[ i ].start * 2 ); // 2 = Uint16 - - _this.info.render.calls ++; - _this.info.render.vertices += offsets[ i ].count; // not really true, here vertices can be shared - _this.info.render.faces += offsets[ i ].count / 3; - - } - - } - - }; - - this.renderBuffer = function ( camera, lights, fog, material, geometryGroup, object ) { - - if ( material.opacity === 0 ) return; - - var program, attributes, linewidth, primitives, a, attribute, i, il; - - program = setProgram( camera, lights, fog, material, object ); - - attributes = program.attributes; - - var updateBuffers = false, - wireframeBit = material.wireframe ? 1 : 0, - geometryGroupHash = ( geometryGroup.id * 0xffffff ) + ( program.id * 2 ) + wireframeBit; - - if ( geometryGroupHash !== _currentGeometryGroupHash ) { - - _currentGeometryGroupHash = geometryGroupHash; - updateBuffers = true; - - } - - // vertices - - if ( !material.morphTargets && attributes.position >= 0 ) { - - if ( updateBuffers ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer ); - _gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 ); - - } - - } else { - - if ( object.morphTargetBase ) { - - setupMorphTargets( material, geometryGroup, object ); - - } - - } - - - if ( updateBuffers ) { - - // custom attributes - - // Use the per-geometryGroup custom attribute arrays which are setup in initMeshBuffers - - if ( geometryGroup.__webglCustomAttributesList ) { - - for ( i = 0, il = geometryGroup.__webglCustomAttributesList.length; i < il; i ++ ) { - - attribute = geometryGroup.__webglCustomAttributesList[ i ]; - - if( attributes[ attribute.buffer.belongsToAttribute ] >= 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, attribute.buffer ); - _gl.vertexAttribPointer( attributes[ attribute.buffer.belongsToAttribute ], attribute.size, _gl.FLOAT, false, 0, 0 ); - - } - - } - - } - - - // colors - - if ( attributes.color >= 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglColorBuffer ); - _gl.vertexAttribPointer( attributes.color, 3, _gl.FLOAT, false, 0, 0 ); - - } - - // normals - - if ( attributes.normal >= 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglNormalBuffer ); - _gl.vertexAttribPointer( attributes.normal, 3, _gl.FLOAT, false, 0, 0 ); - - } - - // tangents - - if ( attributes.tangent >= 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglTangentBuffer ); - _gl.vertexAttribPointer( attributes.tangent, 4, _gl.FLOAT, false, 0, 0 ); - - } - - // uvs - - if ( attributes.uv >= 0 ) { - - if ( geometryGroup.__webglUVBuffer ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUVBuffer ); - _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 0, 0 ); - - _gl.enableVertexAttribArray( attributes.uv ); - - } else { - - _gl.disableVertexAttribArray( attributes.uv ); - - } - - } - - if ( attributes.uv2 >= 0 ) { - - if ( geometryGroup.__webglUV2Buffer ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglUV2Buffer ); - _gl.vertexAttribPointer( attributes.uv2, 2, _gl.FLOAT, false, 0, 0 ); - - _gl.enableVertexAttribArray( attributes.uv2 ); - - } else { - - _gl.disableVertexAttribArray( attributes.uv2 ); - - } - - } - - if ( material.skinning && - attributes.skinVertexA >= 0 && attributes.skinVertexB >= 0 && - attributes.skinIndex >= 0 && attributes.skinWeight >= 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinVertexABuffer ); - _gl.vertexAttribPointer( attributes.skinVertexA, 4, _gl.FLOAT, false, 0, 0 ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinVertexBBuffer ); - _gl.vertexAttribPointer( attributes.skinVertexB, 4, _gl.FLOAT, false, 0, 0 ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinIndicesBuffer ); - _gl.vertexAttribPointer( attributes.skinIndex, 4, _gl.FLOAT, false, 0, 0 ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglSkinWeightsBuffer ); - _gl.vertexAttribPointer( attributes.skinWeight, 4, _gl.FLOAT, false, 0, 0 ); - - } - - } - - // render mesh - - if ( object instanceof THREE.Mesh ) { - - // wireframe - - if ( material.wireframe ) { - - setLineWidth( material.wireframeLinewidth ); - - if ( updateBuffers ) _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglLineBuffer ); - _gl.drawElements( _gl.LINES, geometryGroup.__webglLineCount, _gl.UNSIGNED_SHORT, 0 ); - - // triangles - - } else { - - if ( updateBuffers ) _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglFaceBuffer ); - _gl.drawElements( _gl.TRIANGLES, geometryGroup.__webglFaceCount, _gl.UNSIGNED_SHORT, 0 ); - - } - - _this.info.render.calls ++; - _this.info.render.vertices += geometryGroup.__webglFaceCount; - _this.info.render.faces += geometryGroup.__webglFaceCount / 3; - - // render lines - - } else if ( object instanceof THREE.Line ) { - - primitives = ( object.type === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; - - setLineWidth( material.linewidth ); - - _gl.drawArrays( primitives, 0, geometryGroup.__webglLineCount ); - - _this.info.render.calls ++; - - // render particles - - } else if ( object instanceof THREE.ParticleSystem ) { - - _gl.drawArrays( _gl.POINTS, 0, geometryGroup.__webglParticleCount ); - - _this.info.render.calls ++; - _this.info.render.points += geometryGroup.__webglParticleCount; - - // render ribbon - - } else if ( object instanceof THREE.Ribbon ) { - - _gl.drawArrays( _gl.TRIANGLE_STRIP, 0, geometryGroup.__webglVertexCount ); - - _this.info.render.calls ++; - - } - - }; - - function setupMorphTargets ( material, geometryGroup, object ) { - - // set base - - var attributes = material.program.attributes; - - if ( object.morphTargetBase !== - 1 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ object.morphTargetBase ] ); - _gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 ); - - } else if ( attributes.position >= 0 ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglVertexBuffer ); - _gl.vertexAttribPointer( attributes.position, 3, _gl.FLOAT, false, 0, 0 ); - - } - - if ( object.morphTargetForcedOrder.length ) { - - // set forced order - - var m = 0; - var order = object.morphTargetForcedOrder; - var influences = object.morphTargetInfluences; - - while ( m < material.numSupportedMorphTargets && m < order.length ) { - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ order[ m ] ] ); - _gl.vertexAttribPointer( attributes[ "morphTarget" + m ], 3, _gl.FLOAT, false, 0, 0 ); - - object.__webglMorphTargetInfluences[ m ] = influences[ order[ m ] ]; - - m ++; - } - - } else { - - // find most influencing - - var used = []; - var candidateInfluence = - 1; - var candidate = 0; - var influences = object.morphTargetInfluences; - var i, il = influences.length; - var m = 0; - - if ( object.morphTargetBase !== - 1 ) { - - used[ object.morphTargetBase ] = true; - - } - - while ( m < material.numSupportedMorphTargets ) { - - for ( i = 0; i < il; i ++ ) { - - if ( !used[ i ] && influences[ i ] > candidateInfluence ) { - - candidate = i; - candidateInfluence = influences[ candidate ]; - - } - - } - - _gl.bindBuffer( _gl.ARRAY_BUFFER, geometryGroup.__webglMorphTargetsBuffers[ candidate ] ); - _gl.vertexAttribPointer( attributes[ "morphTarget" + m ], 3, _gl.FLOAT, false, 0, 0 ); - - object.__webglMorphTargetInfluences[ m ] = candidateInfluence; - - used[ candidate ] = 1; - candidateInfluence = -1; - m ++; - - } - - } - - // load updated influences uniform - - if( material.program.uniforms.morphTargetInfluences !== null ) { - - _gl.uniform1fv( material.program.uniforms.morphTargetInfluences, object.__webglMorphTargetInfluences ); - - } - - }; - - - function painterSort ( a, b ) { - - return b.z - a.z; - - }; - - // Rendering - - this.render = function ( scene, camera, renderTarget, forceClear ) { - - var i, il, - - program, material, - webglObject, object, - renderList, - - lights = scene.lights, - fog = scene.fog; - - _currentMaterialId = -1; - - if ( this.autoUpdateObjects ) this.initWebGLObjects( scene ); - - if ( camera.parent === undefined ) { - - console.warn( 'DEPRECATED: Camera hasn\'t been added to a Scene. Adding it...' ); - scene.add( camera ); - - } - - if ( this.autoUpdateScene ) scene.updateMatrixWorld(); - - // custom render plugins (pre pass) - - renderPlugins( this.renderPluginsPre, scene, camera ); - - _this.info.render.calls = 0; - _this.info.render.vertices = 0; - _this.info.render.faces = 0; - _this.info.render.points = 0; - - camera.matrixWorldInverse.getInverse( camera.matrixWorld ); - - if ( ! camera._viewMatrixArray ) camera._viewMatrixArray = new Float32Array( 16 ); - camera.matrixWorldInverse.flattenToArray( camera._viewMatrixArray ); - - if ( ! camera._projectionMatrixArray ) camera._projectionMatrixArray = new Float32Array( 16 ); - camera.projectionMatrix.flattenToArray( camera._projectionMatrixArray ); - - _projScreenMatrix.multiply( camera.projectionMatrix, camera.matrixWorldInverse ); - _frustum.setFromMatrix( _projScreenMatrix ); - - this.setRenderTarget( renderTarget ); - - if ( this.autoClear || forceClear ) { - - this.clear( this.autoClearColor, this.autoClearDepth, this.autoClearStencil ); - - } - - // set matrices for regular objects (frustum culled) - - renderList = scene.__webglObjects; - - for ( i = 0, il = renderList.length; i < il; i ++ ) { - - webglObject = renderList[ i ]; - object = webglObject.object; - - webglObject.render = false; - - if ( object.visible ) { - - if ( ! ( object instanceof THREE.Mesh || object instanceof THREE.ParticleSystem ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) { - - object.matrixWorld.flattenToArray( object._objectMatrixArray ); - - setupMatrices( object, camera ); - - unrollBufferMaterial( webglObject ); - - webglObject.render = true; - - if ( this.sortObjects ) { - - if ( object.renderDepth ) { - - webglObject.z = object.renderDepth; - - } else { - - _vector3.copy( object.position ); - _projScreenMatrix.multiplyVector3( _vector3 ); - - webglObject.z = _vector3.z; - - } - - } - - } - - } - - } - - if ( this.sortObjects ) { - - renderList.sort( painterSort ); - - } - - // set matrices for immediate objects - - renderList = scene.__webglObjectsImmediate; - - for ( i = 0, il = renderList.length; i < il; i ++ ) { - - webglObject = renderList[ i ]; - object = webglObject.object; - - if ( object.visible ) { - - if( object.matrixAutoUpdate ) { - - object.matrixWorld.flattenToArray( object._objectMatrixArray ); - - } - - setupMatrices( object, camera ); - - unrollImmediateBufferMaterial( webglObject ); - - } - - } - - if ( scene.overrideMaterial ) { - - this.setBlending( scene.overrideMaterial.blending ); - this.setDepthTest( scene.overrideMaterial.depthTest ); - this.setDepthWrite( scene.overrideMaterial.depthWrite ); - setPolygonOffset( scene.overrideMaterial.polygonOffset, scene.overrideMaterial.polygonOffsetFactor, scene.overrideMaterial.polygonOffsetUnits ); - - renderObjects( scene.__webglObjects, false, "", camera, lights, fog, true, scene.overrideMaterial ); - renderObjectsImmediate( scene.__webglObjectsImmediate, "", camera, lights, fog, false, scene.overrideMaterial ); - - } else { - - // opaque pass (front-to-back order) - - this.setBlending( THREE.NormalBlending ); - - renderObjects( scene.__webglObjects, true, "opaque", camera, lights, fog, false ); - renderObjectsImmediate( scene.__webglObjectsImmediate, "opaque", camera, lights, fog, false ); - - // transparent pass (back-to-front order) - - renderObjects( scene.__webglObjects, false, "transparent", camera, lights, fog, true ); - renderObjectsImmediate( scene.__webglObjectsImmediate, "transparent", camera, lights, fog, true ); - - } - - // custom render plugins (post pass) - - renderPlugins( this.renderPluginsPost, scene, camera ); - - - // Generate mipmap if we're using any kind of mipmap filtering - - if ( renderTarget && renderTarget.generateMipmaps && renderTarget.minFilter !== THREE.NearestFilter && renderTarget.minFilter !== THREE.LinearFilter ) { - - updateRenderTargetMipmap( renderTarget ); - - } - - // Ensure depth buffer writing is enabled so it can be cleared on next render - - this.setDepthTest( true ); - this.setDepthWrite( true ); - - // _gl.finish(); - - }; - - function renderPlugins( plugins, scene, camera ) { - - if ( ! plugins.length ) return; - - for ( var i = 0, il = plugins.length; i < il; i ++ ) { - - _currentProgram = null; - _currentCamera = null; - _oldBlending = -1; - _oldDepthTest = -1; - _oldDepthWrite = -1; - _currentGeometryGroupHash = -1; - _currentMaterialId = -1; - - plugins[ i ].render( scene, camera, _currentWidth, _currentHeight ); - - _currentProgram = null; - _currentCamera = null; - _oldBlending = -1; - _oldDepthTest = -1; - _oldDepthWrite = -1; - _currentGeometryGroupHash = -1; - _currentMaterialId = -1; - - } - - }; - - function renderObjects ( renderList, reverse, materialType, camera, lights, fog, useBlending, overrideMaterial ) { - - var webglObject, object, buffer, material, start, end, delta; - - if ( reverse ) { - - start = renderList.length - 1; - end = -1; - delta = -1; - - } else { - - start = 0; - end = renderList.length; - delta = 1; - } - - for ( var i = start; i !== end; i += delta ) { - - webglObject = renderList[ i ]; - - if ( webglObject.render ) { - - object = webglObject.object; - buffer = webglObject.buffer; - - if ( overrideMaterial ) { - - material = overrideMaterial; - - } else { - - material = webglObject[ materialType ]; - - if ( ! material ) continue; - - if ( useBlending ) _this.setBlending( material.blending ); - - _this.setDepthTest( material.depthTest ); - _this.setDepthWrite( material.depthWrite ); - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - - } - - _this.setObjectFaces( object ); - - if ( buffer instanceof THREE.BufferGeometry ) { - - _this.renderBufferDirect( camera, lights, fog, material, buffer, object ); - - } else { - - _this.renderBuffer( camera, lights, fog, material, buffer, object ); - - } - - } - - } - - }; - - function renderObjectsImmediate ( renderList, materialType, camera, lights, fog, useBlending, overrideMaterial ) { - - var webglObject, object, material, program; - - for ( var i = 0, il = renderList.length; i < il; i ++ ) { - - webglObject = renderList[ i ]; - object = webglObject.object; - - if ( object.visible ) { - - if ( overrideMaterial ) { - - material = overrideMaterial; - - } else { - - material = webglObject[ materialType ]; - - if ( ! material ) continue; - - if ( useBlending ) _this.setBlending( material.blending ); - - _this.setDepthTest( material.depthTest ); - _this.setDepthWrite( material.depthWrite ); - setPolygonOffset( material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits ); - - } - - _this.renderImmediateObject( camera, lights, fog, material, object ); - - } - - } - - }; - - this.renderImmediateObject = function ( camera, lights, fog, material, object ) { - - var program = setProgram( camera, lights, fog, material, object ); - - _currentGeometryGroupHash = -1; - - _this.setObjectFaces( object ); - - if ( object.immediateRenderCallback ) { - - object.immediateRenderCallback( program, _gl, _frustum ); - - } else { - - object.render( function( object ) { _this.renderBufferImmediate( object, program, material.shading ); } ); - - } - - }; - - function unrollImmediateBufferMaterial ( globject ) { - - var object = globject.object, - material = object.material; - - if ( material.transparent ) { - - globject.transparent = material; - globject.opaque = null; - - } else { - - globject.opaque = material; - globject.transparent = null; - - } - - }; - - function unrollBufferMaterial ( globject ) { - - var object = globject.object, - buffer = globject.buffer, - material, materialIndex, meshMaterial; - - meshMaterial = object.material; - - if ( meshMaterial instanceof THREE.MeshFaceMaterial ) { - - materialIndex = buffer.materialIndex; - - if ( materialIndex >= 0 ) { - - material = object.geometry.materials[ materialIndex ]; - - if ( material.transparent ) { - - globject.transparent = material; - globject.opaque = null; - - } else { - - globject.opaque = material; - globject.transparent = null; - - } - - } - - } else { - - material = meshMaterial; - - if ( material ) { - - if ( material.transparent ) { - - globject.transparent = material; - globject.opaque = null; - - } else { - - globject.opaque = material; - globject.transparent = null; - - } - - } - - } - - }; - - // Geometry splitting - - function sortFacesByMaterial ( geometry ) { - - var f, fl, face, materialIndex, vertices, - materialHash, groupHash, - hash_map = {}; - - var numMorphTargets = geometry.morphTargets.length; - - geometry.geometryGroups = {}; - - for ( f = 0, fl = geometry.faces.length; f < fl; f ++ ) { - - face = geometry.faces[ f ]; - materialIndex = face.materialIndex; - - materialHash = ( materialIndex !== undefined ) ? materialIndex : -1; - - if ( hash_map[ materialHash ] === undefined ) { - - hash_map[ materialHash ] = { 'hash': materialHash, 'counter': 0 }; - - } - - groupHash = hash_map[ materialHash ].hash + '_' + hash_map[ materialHash ].counter; - - if ( geometry.geometryGroups[ groupHash ] === undefined ) { - - geometry.geometryGroups[ groupHash ] = { 'faces3': [], 'faces4': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; - - } - - vertices = face instanceof THREE.Face3 ? 3 : 4; - - if ( geometry.geometryGroups[ groupHash ].vertices + vertices > 65535 ) { - - hash_map[ materialHash ].counter += 1; - groupHash = hash_map[ materialHash ].hash + '_' + hash_map[ materialHash ].counter; - - if ( geometry.geometryGroups[ groupHash ] === undefined ) { - - geometry.geometryGroups[ groupHash ] = { 'faces3': [], 'faces4': [], 'materialIndex': materialIndex, 'vertices': 0, 'numMorphTargets': numMorphTargets }; - - } - - } - - if ( face instanceof THREE.Face3 ) { - - geometry.geometryGroups[ groupHash ].faces3.push( f ); - - } else { - - geometry.geometryGroups[ groupHash ].faces4.push( f ); - - } - - geometry.geometryGroups[ groupHash ].vertices += vertices; - - } - - geometry.geometryGroupsList = []; - - for ( var g in geometry.geometryGroups ) { - - geometry.geometryGroups[ g ].id = _geometryGroupCounter ++; - - geometry.geometryGroupsList.push( geometry.geometryGroups[ g ] ); - - } - - }; - - // Objects refresh - - this.initWebGLObjects = function ( scene ) { - - if ( !scene.__webglObjects ) { - - scene.__webglObjects = []; - scene.__webglObjectsImmediate = []; - scene.__webglSprites = []; - scene.__webglFlares = []; - - } - - while ( scene.__objectsAdded.length ) { - - addObject( scene.__objectsAdded[ 0 ], scene ); - scene.__objectsAdded.splice( 0, 1 ); - - } - - while ( scene.__objectsRemoved.length ) { - - removeObject( scene.__objectsRemoved[ 0 ], scene ); - scene.__objectsRemoved.splice( 0, 1 ); - - } - - // update must be called after objects adding / removal - - for ( var o = 0, ol = scene.__webglObjects.length; o < ol; o ++ ) { - - updateObject( scene.__webglObjects[ o ].object ); - - } - - }; - - // Objects adding - - function addObject ( object, scene ) { - - var g, geometry, geometryGroup; - - if ( ! object.__webglInit ) { - - object.__webglInit = true; - - object._modelViewMatrix = new THREE.Matrix4(); - - object._normalMatrixArray = new Float32Array( 9 ); - object._modelViewMatrixArray = new Float32Array( 16 ); - object._objectMatrixArray = new Float32Array( 16 ); - - object.matrixWorld.flattenToArray( object._objectMatrixArray ); - - if ( object instanceof THREE.Mesh ) { - - geometry = object.geometry; - - if ( geometry instanceof THREE.Geometry ) { - - if ( geometry.geometryGroups === undefined ) { - - sortFacesByMaterial( geometry ); - - } - - // create separate VBOs per geometry chunk - - for ( g in geometry.geometryGroups ) { - - geometryGroup = geometry.geometryGroups[ g ]; - - // initialise VBO on the first access - - if ( ! geometryGroup.__webglVertexBuffer ) { - - createMeshBuffers( geometryGroup ); - initMeshBuffers( geometryGroup, object ); - - geometry.__dirtyVertices = true; - geometry.__dirtyMorphTargets = true; - geometry.__dirtyElements = true; - geometry.__dirtyUvs = true; - geometry.__dirtyNormals = true; - geometry.__dirtyTangents = true; - geometry.__dirtyColors = true; - - } - - } - - } - - } else if ( object instanceof THREE.Ribbon ) { - - geometry = object.geometry; - - if( ! geometry.__webglVertexBuffer ) { - - createRibbonBuffers( geometry ); - initRibbonBuffers( geometry ); - - geometry.__dirtyVertices = true; - geometry.__dirtyColors = true; - - } - - } else if ( object instanceof THREE.Line ) { - - geometry = object.geometry; - - if( ! geometry.__webglVertexBuffer ) { - - createLineBuffers( geometry ); - initLineBuffers( geometry, object ); - - geometry.__dirtyVertices = true; - geometry.__dirtyColors = true; - - } - - } else if ( object instanceof THREE.ParticleSystem ) { - - geometry = object.geometry; - - if ( ! geometry.__webglVertexBuffer ) { - - createParticleBuffers( geometry ); - initParticleBuffers( geometry, object ); - - geometry.__dirtyVertices = true; - geometry.__dirtyColors = true; - - } - - } - - } - - if ( ! object.__webglActive ) { - - if ( object instanceof THREE.Mesh ) { - - geometry = object.geometry; - - if ( geometry instanceof THREE.BufferGeometry ) { - - addBuffer( scene.__webglObjects, geometry, object ); - - } else { - - for ( g in geometry.geometryGroups ) { - - geometryGroup = geometry.geometryGroups[ g ]; - - addBuffer( scene.__webglObjects, geometryGroup, object ); - - } - - } - - } else if ( object instanceof THREE.Ribbon || - object instanceof THREE.Line || - object instanceof THREE.ParticleSystem ) { - - geometry = object.geometry; - addBuffer( scene.__webglObjects, geometry, object ); - - } else if ( THREE.MarchingCubes !== undefined && object instanceof THREE.MarchingCubes || object.immediateRenderCallback ) { - - addBufferImmediate( scene.__webglObjectsImmediate, object ); - - } else if ( object instanceof THREE.Sprite ) { - - scene.__webglSprites.push( object ); - - } else if ( object instanceof THREE.LensFlare ) { - - scene.__webglFlares.push( object ); - - } - - object.__webglActive = true; - - } - - }; - - function addBuffer ( objlist, buffer, object ) { - - objlist.push( - { - buffer: buffer, - object: object, - opaque: null, - transparent: null - } - ); - - }; - - function addBufferImmediate ( objlist, object ) { - - objlist.push( - { - object: object, - opaque: null, - transparent: null - } - ); - - }; - - // Objects updates - - function updateObject ( object ) { - - var geometry = object.geometry, - geometryGroup, customAttributesDirty, material; - - if ( object instanceof THREE.Mesh ) { - - if ( geometry instanceof THREE.BufferGeometry ) { - - /* - if ( geometry.__dirtyVertices || geometry.__dirtyElements || - geometry.__dirtyUvs || geometry.__dirtyNormals || - geometry.__dirtyColors ) { - - // TODO - // set buffers from typed arrays - - } - */ - - geometry.__dirtyVertices = false; - geometry.__dirtyElements = false; - geometry.__dirtyUvs = false; - geometry.__dirtyNormals = false; - geometry.__dirtyColors = false; - - } else { - - // check all geometry groups - - for( var i = 0, il = geometry.geometryGroupsList.length; i < il; i ++ ) { - - geometryGroup = geometry.geometryGroupsList[ i ]; - - material = getBufferMaterial( object, geometryGroup ); - - customAttributesDirty = material.attributes && areCustomAttributesDirty( material ); - - if ( geometry.__dirtyVertices || geometry.__dirtyMorphTargets || geometry.__dirtyElements || - geometry.__dirtyUvs || geometry.__dirtyNormals || - geometry.__dirtyColors || geometry.__dirtyTangents || customAttributesDirty ) { - - setMeshBuffers( geometryGroup, object, _gl.DYNAMIC_DRAW, !geometry.dynamic, material ); - - } - - } - - geometry.__dirtyVertices = false; - geometry.__dirtyMorphTargets = false; - geometry.__dirtyElements = false; - geometry.__dirtyUvs = false; - geometry.__dirtyNormals = false; - geometry.__dirtyColors = false; - geometry.__dirtyTangents = false; - - material.attributes && clearCustomAttributes( material ); - - } - - } else if ( object instanceof THREE.Ribbon ) { - - if ( geometry.__dirtyVertices || geometry.__dirtyColors ) { - - setRibbonBuffers( geometry, _gl.DYNAMIC_DRAW ); - - } - - geometry.__dirtyVertices = false; - geometry.__dirtyColors = false; - - } else if ( object instanceof THREE.Line ) { - - material = getBufferMaterial( object, geometryGroup ); - - customAttributesDirty = material.attributes && areCustomAttributesDirty( material ); - - if ( geometry.__dirtyVertices || geometry.__dirtyColors || customAttributesDirty ) { - - setLineBuffers( geometry, _gl.DYNAMIC_DRAW ); - - } - - geometry.__dirtyVertices = false; - geometry.__dirtyColors = false; - - material.attributes && clearCustomAttributes( material ); - - } else if ( object instanceof THREE.ParticleSystem ) { - - material = getBufferMaterial( object, geometryGroup ); - - customAttributesDirty = material.attributes && areCustomAttributesDirty( material ); - - if ( geometry.__dirtyVertices || geometry.__dirtyColors || object.sortParticles || customAttributesDirty ) { - - setParticleBuffers( geometry, _gl.DYNAMIC_DRAW, object ); - - } - - geometry.__dirtyVertices = false; - geometry.__dirtyColors = false; - - material.attributes && clearCustomAttributes( material ); - - } - - }; - - // Objects updates - custom attributes check - - function areCustomAttributesDirty ( material ) { - - for ( var a in material.attributes ) { - - if ( material.attributes[ a ].needsUpdate ) return true; - - } - - return false; - - }; - - function clearCustomAttributes ( material ) { - - for ( var a in material.attributes ) { - - material.attributes[ a ].needsUpdate = false; - - } - - }; - - // Objects removal - - function removeObject ( object, scene ) { - - if ( object instanceof THREE.Mesh || - object instanceof THREE.ParticleSystem || - object instanceof THREE.Ribbon || - object instanceof THREE.Line ) { - - removeInstances( scene.__webglObjects, object ); - - } else if ( object instanceof THREE.Sprite ) { - - removeInstancesDirect( scene.__webglSprites, object ); - - } else if ( object instanceof THREE.LensFlare ) { - - removeInstancesDirect( scene.__webglFlares, object ); - - } else if ( object instanceof THREE.MarchingCubes || object.immediateRenderCallback ) { - - removeInstances( scene.__webglObjectsImmediate, object ); - - } - - object.__webglActive = false; - - }; - - function removeInstances ( objlist, object ) { - - for ( var o = objlist.length - 1; o >= 0; o -- ) { - - if ( objlist[ o ].object === object ) { - - objlist.splice( o, 1 ); - - } - - } - - }; - - function removeInstancesDirect ( objlist, object ) { - - for ( var o = objlist.length - 1; o >= 0; o -- ) { - - if ( objlist[ o ] === object ) { - - objlist.splice( o, 1 ); - - } - - } - - }; - - // Materials - - this.initMaterial = function ( material, lights, fog, object ) { - - var u, a, identifiers, i, parameters, maxLightCount, maxBones, maxShadows, shaderID; - - if ( material instanceof THREE.MeshDepthMaterial ) { - - shaderID = 'depth'; - - } else if ( material instanceof THREE.MeshNormalMaterial ) { - - shaderID = 'normal'; - - } else if ( material instanceof THREE.MeshBasicMaterial ) { - - shaderID = 'basic'; - - } else if ( material instanceof THREE.MeshLambertMaterial ) { - - shaderID = 'lambert'; - - } else if ( material instanceof THREE.MeshPhongMaterial ) { - - shaderID = 'phong'; - - } else if ( material instanceof THREE.LineBasicMaterial ) { - - shaderID = 'basic'; - - } else if ( material instanceof THREE.ParticleBasicMaterial ) { - - shaderID = 'particle_basic'; - - } - - if ( shaderID ) { - - setMaterialShaders( material, THREE.ShaderLib[ shaderID ] ); - - } - - // heuristics to create shader parameters according to lights in the scene - // (not to blow over maxLights budget) - - maxLightCount = allocateLights( lights ); - - maxShadows = allocateShadows( lights ); - - maxBones = allocateBones( object ); - - parameters = { - - map: !!material.map, envMap: !!material.envMap, lightMap: !!material.lightMap, - vertexColors: material.vertexColors, - fog: fog, useFog: material.fog, - sizeAttenuation: material.sizeAttenuation, - skinning: material.skinning, - morphTargets: material.morphTargets, - maxMorphTargets: this.maxMorphTargets, - maxDirLights: maxLightCount.directional, maxPointLights: maxLightCount.point, - maxBones: maxBones, - shadowMapEnabled: this.shadowMapEnabled && object.receiveShadow, - shadowMapSoft: this.shadowMapSoft, - maxShadows: maxShadows, - alphaTest: material.alphaTest, - metal: material.metal, - perPixel: material.perPixel, - wrapAround: material.wrapAround - - }; - - material.program = buildProgram( shaderID, material.fragmentShader, material.vertexShader, material.uniforms, material.attributes, parameters ); - - var attributes = material.program.attributes; - - if ( attributes.position >= 0 ) _gl.enableVertexAttribArray( attributes.position ); - if ( attributes.color >= 0 ) _gl.enableVertexAttribArray( attributes.color ); - if ( attributes.normal >= 0 ) _gl.enableVertexAttribArray( attributes.normal ); - if ( attributes.tangent >= 0 ) _gl.enableVertexAttribArray( attributes.tangent ); - - if ( material.skinning && - attributes.skinVertexA >=0 && attributes.skinVertexB >= 0 && - attributes.skinIndex >= 0 && attributes.skinWeight >= 0 ) { - - _gl.enableVertexAttribArray( attributes.skinVertexA ); - _gl.enableVertexAttribArray( attributes.skinVertexB ); - _gl.enableVertexAttribArray( attributes.skinIndex ); - _gl.enableVertexAttribArray( attributes.skinWeight ); - - } - - if ( material.attributes ) { - - for ( a in material.attributes ) { - - if( attributes[ a ] !== undefined && attributes[ a ] >= 0 ) _gl.enableVertexAttribArray( attributes[ a ] ); - - } - - } - - if ( material.morphTargets ) { - - material.numSupportedMorphTargets = 0; - - var id, base = "morphTarget"; - - for ( i = 0; i < this.maxMorphTargets; i ++ ) { - - id = base + i; - - if ( attributes[ id ] >= 0 ) { - - _gl.enableVertexAttribArray( attributes[ id ] ); - material.numSupportedMorphTargets ++; - - } - - } - - } - - material.uniformsList = []; - - for ( u in material.uniforms ) { - - material.uniformsList.push( [ material.uniforms[ u ], u ] ); - - } - - }; - - function setMaterialShaders ( material, shaders ) { - - material.uniforms = THREE.UniformsUtils.clone( shaders.uniforms ); - material.vertexShader = shaders.vertexShader; - material.fragmentShader = shaders.fragmentShader; - - }; - - function setProgram ( camera, lights, fog, material, object ) { - - if ( ! material.program ) { - - _this.initMaterial( material, lights, fog, object ); - - } - - if ( material.morphTargets ) { - - if ( ! object.__webglMorphTargetInfluences ) { - - object.__webglMorphTargetInfluences = new Float32Array( _this.maxMorphTargets ); - - for ( var i = 0, il = _this.maxMorphTargets; i < il; i ++ ) { - - object.__webglMorphTargetInfluences[ i ] = 0; - - } - - } - - } - - var refreshMaterial = false; - - var program = material.program, - p_uniforms = program.uniforms, - m_uniforms = material.uniforms; - - if ( program !== _currentProgram ) { - - _gl.useProgram( program ); - _currentProgram = program; - - refreshMaterial = true; - - } - - if ( material.id !== _currentMaterialId ) { - - _currentMaterialId = material.id; - refreshMaterial = true; - - } - - if ( refreshMaterial || camera !== _currentCamera ) { - - _gl.uniformMatrix4fv( p_uniforms.projectionMatrix, false, camera._projectionMatrixArray ); - - if ( camera !== _currentCamera ) _currentCamera = camera; - - } - - if ( refreshMaterial ) { - - // refresh uniforms common to several materials - - if ( fog && material.fog ) { - - refreshUniformsFog( m_uniforms, fog ); - - } - - if ( material instanceof THREE.MeshPhongMaterial || - material instanceof THREE.MeshLambertMaterial || - material.lights ) { - - setupLights( program, lights ); - refreshUniformsLights( m_uniforms, _lights ); - - } - - if ( material instanceof THREE.MeshBasicMaterial || - material instanceof THREE.MeshLambertMaterial || - material instanceof THREE.MeshPhongMaterial ) { - - refreshUniformsCommon( m_uniforms, material ); - - } - - // refresh single material specific uniforms - - if ( material instanceof THREE.LineBasicMaterial ) { - - refreshUniformsLine( m_uniforms, material ); - - } else if ( material instanceof THREE.ParticleBasicMaterial ) { - - refreshUniformsParticle( m_uniforms, material ); - - } else if ( material instanceof THREE.MeshPhongMaterial ) { - - refreshUniformsPhong( m_uniforms, material ); - - } else if ( material instanceof THREE.MeshLambertMaterial ) { - - refreshUniformsLambert( m_uniforms, material ); - - } else if ( material instanceof THREE.MeshDepthMaterial ) { - - m_uniforms.mNear.value = camera.near; - m_uniforms.mFar.value = camera.far; - m_uniforms.opacity.value = material.opacity; - - } else if ( material instanceof THREE.MeshNormalMaterial ) { - - m_uniforms.opacity.value = material.opacity; - - } - - if ( object.receiveShadow && ! material._shadowPass ) { - - refreshUniformsShadow( m_uniforms, lights ); - - } - - // load common uniforms - - loadUniformsGeneric( program, material.uniformsList ); - - // load material specific uniforms - // (shader material also gets them for the sake of genericity) - - if ( material instanceof THREE.ShaderMaterial || - material instanceof THREE.MeshPhongMaterial || - material.envMap ) { - - if ( p_uniforms.cameraPosition !== null ) { - - _gl.uniform3f( p_uniforms.cameraPosition, camera.position.x, camera.position.y, camera.position.z ); - - } - - } - - if ( material instanceof THREE.MeshPhongMaterial || - material instanceof THREE.MeshLambertMaterial || - material instanceof THREE.ShaderMaterial || - material.skinning ) { - - if ( p_uniforms.viewMatrix !== null ) { - - _gl.uniformMatrix4fv( p_uniforms.viewMatrix, false, camera._viewMatrixArray ); - - } - - } - - if ( material.skinning ) { - - loadUniformsSkinning( p_uniforms, object, camera ); - - } - - } - - loadUniformsMatrices( p_uniforms, object ); - - if ( material instanceof THREE.ShaderMaterial || - material.envMap || - material.skinning || - object.receiveShadow ) { - - if ( p_uniforms.objectMatrix !== null ) { - - _gl.uniformMatrix4fv( p_uniforms.objectMatrix, false, object._objectMatrixArray ); - - } - - } - - return program; - - }; - - // Uniforms (refresh uniforms objects) - - function refreshUniformsCommon ( uniforms, material ) { - - uniforms.opacity.value = material.opacity; - - if ( _this.gammaInput ) { - - uniforms.diffuse.value.copyGammaToLinear( material.color ); - - } else { - - uniforms.diffuse.value = material.color; - - } - - uniforms.map.texture = material.map; - - if ( material.map ) { - - uniforms.offsetRepeat.value.set( material.map.offset.x, material.map.offset.y, material.map.repeat.x, material.map.repeat.y ); - - } - - uniforms.lightMap.texture = material.lightMap; - - uniforms.envMap.texture = material.envMap; - uniforms.flipEnvMap.value = ( material.envMap instanceof THREE.WebGLRenderTargetCube ) ? 1 : -1; - - if ( _this.gammaInput ) { - - //uniforms.reflectivity.value = material.reflectivity * material.reflectivity; - uniforms.reflectivity.value = material.reflectivity; - - } else { - - uniforms.reflectivity.value = material.reflectivity; - - } - - uniforms.refractionRatio.value = material.refractionRatio; - uniforms.combine.value = material.combine; - uniforms.useRefract.value = material.envMap && material.envMap.mapping instanceof THREE.CubeRefractionMapping; - - }; - - function refreshUniformsLine ( uniforms, material ) { - - uniforms.diffuse.value = material.color; - uniforms.opacity.value = material.opacity; - - }; - - function refreshUniformsParticle ( uniforms, material ) { - - uniforms.psColor.value = material.color; - uniforms.opacity.value = material.opacity; - uniforms.size.value = material.size; - uniforms.scale.value = _canvas.height / 2.0; // TODO: Cache this. - - uniforms.map.texture = material.map; - - }; - - function refreshUniformsFog ( uniforms, fog ) { - - uniforms.fogColor.value = fog.color; - - if ( fog instanceof THREE.Fog ) { - - uniforms.fogNear.value = fog.near; - uniforms.fogFar.value = fog.far; - - } else if ( fog instanceof THREE.FogExp2 ) { - - uniforms.fogDensity.value = fog.density; - - } - - }; - - function refreshUniformsPhong ( uniforms, material ) { - - uniforms.shininess.value = material.shininess; - - if ( _this.gammaInput ) { - - uniforms.ambient.value.copyGammaToLinear( material.ambient ); - uniforms.specular.value.copyGammaToLinear( material.specular ); - - } else { - - uniforms.ambient.value = material.ambient; - uniforms.specular.value = material.specular; - - } - - if ( material.wrapAround ) { - - uniforms.wrapRGB.value.copy( material.wrapRGB ); - - } - - }; - - function refreshUniformsLambert ( uniforms, material ) { - - if ( _this.gammaInput ) { - - uniforms.ambient.value.copyGammaToLinear( material.ambient ); - - } else { - - uniforms.ambient.value = material.ambient; - - } - - if ( material.wrapAround ) { - - uniforms.wrapRGB.value.copy( material.wrapRGB ); - - } - - }; - - function refreshUniformsLights ( uniforms, lights ) { - - uniforms.ambientLightColor.value = lights.ambient; - - uniforms.directionalLightColor.value = lights.directional.colors; - uniforms.directionalLightDirection.value = lights.directional.positions; - - uniforms.pointLightColor.value = lights.point.colors; - uniforms.pointLightPosition.value = lights.point.positions; - uniforms.pointLightDistance.value = lights.point.distances; - - }; - - function refreshUniformsShadow ( uniforms, lights ) { - - if ( uniforms.shadowMatrix ) { - - var j = 0; - - for ( var i = 0, il = lights.length; i < il; i ++ ) { - - var light = lights[ i ]; - - if ( ! light.castShadow ) continue; - - if ( light instanceof THREE.SpotLight || light instanceof THREE.DirectionalLight ) { - - uniforms.shadowMap.texture[ j ] = light.shadowMap; - uniforms.shadowMapSize.value[ j ] = light.shadowMapSize; - - uniforms.shadowMatrix.value[ j ] = light.shadowMatrix; - - uniforms.shadowDarkness.value[ j ] = light.shadowDarkness; - uniforms.shadowBias.value[ j ] = light.shadowBias; - - j ++; - - } - - } - - } - - }; - - // Uniforms (load to GPU) - - function loadUniformsSkinning ( uniforms, object, camera ) { - - _gl.uniformMatrix4fv( uniforms.cameraInverseMatrix, false, camera._viewMatrixArray ); - _gl.uniformMatrix4fv( uniforms.boneGlobalMatrices, false, object.boneMatrices ); - - }; - - - function loadUniformsMatrices ( uniforms, object ) { - - _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrixArray ); - - if ( uniforms.normalMatrix ) { - - _gl.uniformMatrix3fv( uniforms.normalMatrix, false, object._normalMatrixArray ); - - } - - }; - - function loadUniformsGeneric ( program, uniforms ) { - - var uniform, value, type, location, texture, i, il, j, jl, offset; - - for( j = 0, jl = uniforms.length; j < jl; j ++ ) { - - location = program.uniforms[ uniforms[ j ][ 1 ] ]; - if ( !location ) continue; - - uniform = uniforms[ j ][ 0 ]; - - type = uniform.type; - value = uniform.value; - - // single integer - - if( type === "i" ) { - - _gl.uniform1i( location, value ); - - // single float - - } else if( type === "f" ) { - - _gl.uniform1f( location, value ); - - // single THREE.Vector2 - - } else if( type === "v2" ) { - - _gl.uniform2f( location, value.x, value.y ); - - // single THREE.Vector3 - - } else if( type === "v3" ) { - - _gl.uniform3f( location, value.x, value.y, value.z ); - - // single THREE.Vector4 - - } else if( type === "v4" ) { - - _gl.uniform4f( location, value.x, value.y, value.z, value.w ); - - // single THREE.Color - - } else if( type === "c" ) { - - _gl.uniform3f( location, value.r, value.g, value.b ); - - // flat array of floats (JS or typed array) - - } else if( type === "fv1" ) { - - _gl.uniform1fv( location, value ); - - // flat array of floats with 3 x N size (JS or typed array) - - } else if( type === "fv" ) { - - _gl.uniform3fv( location, value ); - - // array of THREE.Vector2 - - } else if( type === "v2v" ) { - - if ( ! uniform._array ) { - - uniform._array = new Float32Array( 2 * value.length ); - - } - - for ( i = 0, il = value.length; i < il; i ++ ) { - - offset = i * 2; - - uniform._array[ offset ] = value[ i ].x; - uniform._array[ offset + 1 ] = value[ i ].y; - - } - - _gl.uniform2fv( location, uniform._array ); - - // array of THREE.Vector3 - - } else if( type === "v3v" ) { - - if ( ! uniform._array ) { - - uniform._array = new Float32Array( 3 * value.length ); - - } - - for ( i = 0, il = value.length; i < il; i ++ ) { - - offset = i * 3; - - uniform._array[ offset ] = value[ i ].x; - uniform._array[ offset + 1 ] = value[ i ].y; - uniform._array[ offset + 2 ] = value[ i ].z; - - } - - _gl.uniform3fv( location, uniform._array ); - - // array of THREE.Vector4 - - } else if( type == "v4v" ) { - - if ( ! uniform._array ) { - - uniform._array = new Float32Array( 4 * value.length ); - - } - - for ( i = 0, il = value.length; i < il; i ++ ) { - - offset = i * 4; - - uniform._array[ offset ] = value[ i ].x; - uniform._array[ offset + 1 ] = value[ i ].y; - uniform._array[ offset + 2 ] = value[ i ].z; - uniform._array[ offset + 3 ] = value[ i ].w; - - } - - _gl.uniform4fv( location, uniform._array ); - - // single THREE.Matrix4 - - } else if( type === "m4" ) { - - if ( ! uniform._array ) { - - uniform._array = new Float32Array( 16 ); - - } - - value.flattenToArray( uniform._array ); - _gl.uniformMatrix4fv( location, false, uniform._array ); - - // array of THREE.Matrix4 - - } else if( type === "m4v" ) { - - if ( ! uniform._array ) { - - uniform._array = new Float32Array( 16 * value.length ); - - } - - for ( i = 0, il = value.length; i < il; i ++ ) { - - value[ i ].flattenToArrayOffset( uniform._array, i * 16 ); - - } - - _gl.uniformMatrix4fv( location, false, uniform._array ); - - - // single THREE.Texture (2d or cube) - - } else if( type === "t" ) { - - _gl.uniform1i( location, value ); - - texture = uniform.texture; - - if ( !texture ) continue; - - if ( texture.image instanceof Array && texture.image.length === 6 ) { - - setCubeTexture( texture, value ); - - } else if ( texture instanceof THREE.WebGLRenderTargetCube ) { - - setCubeTextureDynamic( texture, value ); - - } else { - - _this.setTexture( texture, value ); - - } - - // array of THREE.Texture (2d) - - } else if( type === "tv" ) { - - if ( ! uniform._array ) { - - uniform._array = []; - - for( i = 0, il = uniform.texture.length; i < il; i ++ ) { - - uniform._array[ i ] = value + i; - - } - - } - - _gl.uniform1iv( location, uniform._array ); - - for( i = 0, il = uniform.texture.length; i < il; i ++ ) { - - texture = uniform.texture[ i ]; - - if ( !texture ) continue; - - _this.setTexture( texture, uniform._array[ i ] ); - - } - - } - - } - - }; - - function setupMatrices ( object, camera ) { - - object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray ); - - var inverseMatrix = THREE.Matrix4.makeInvert3x3( object._modelViewMatrix ); - - if ( inverseMatrix ) { - - inverseMatrix.transposeIntoArray( object._normalMatrixArray ); - - } - - }; - - function setupLights ( program, lights ) { - - var l, ll, light, n, - r = 0, g = 0, b = 0, - color, position, intensity, distance, - - zlights = _lights, - - dcolors = zlights.directional.colors, - dpositions = zlights.directional.positions, - - pcolors = zlights.point.colors, - ppositions = zlights.point.positions, - pdistances = zlights.point.distances, - - dlength = 0, - plength = 0, - - doffset = 0, - poffset = 0; - - for ( l = 0, ll = lights.length; l < ll; l ++ ) { - - light = lights[ l ]; - - if ( light.onlyShadow ) continue; - - color = light.color; - intensity = light.intensity; - distance = light.distance; - - if ( light instanceof THREE.AmbientLight ) { - - if ( _this.gammaInput ) { - - r += color.r * color.r; - g += color.g * color.g; - b += color.b * color.b; - - } else { - - r += color.r; - g += color.g; - b += color.b; - - } - - } else if ( light instanceof THREE.DirectionalLight ) { - - doffset = dlength * 3; - - if ( _this.gammaInput ) { - - dcolors[ doffset ] = color.r * color.r * intensity * intensity; - dcolors[ doffset + 1 ] = color.g * color.g * intensity * intensity; - dcolors[ doffset + 2 ] = color.b * color.b * intensity * intensity; - - } else { - - dcolors[ doffset ] = color.r * intensity; - dcolors[ doffset + 1 ] = color.g * intensity; - dcolors[ doffset + 2 ] = color.b * intensity; - - } - - _direction.copy( light.matrixWorld.getPosition() ); - _direction.subSelf( light.target.matrixWorld.getPosition() ); - _direction.normalize(); - - dpositions[ doffset ] = _direction.x; - dpositions[ doffset + 1 ] = _direction.y; - dpositions[ doffset + 2 ] = _direction.z; - - dlength += 1; - - } else if( light instanceof THREE.PointLight || light instanceof THREE.SpotLight ) { - - poffset = plength * 3; - - if ( _this.gammaInput ) { - - pcolors[ poffset ] = color.r * color.r * intensity * intensity; - pcolors[ poffset + 1 ] = color.g * color.g * intensity * intensity; - pcolors[ poffset + 2 ] = color.b * color.b * intensity * intensity; - - } else { - - pcolors[ poffset ] = color.r * intensity; - pcolors[ poffset + 1 ] = color.g * intensity; - pcolors[ poffset + 2 ] = color.b * intensity; - - } - - position = light.matrixWorld.getPosition(); - - ppositions[ poffset ] = position.x; - ppositions[ poffset + 1 ] = position.y; - ppositions[ poffset + 2 ] = position.z; - - pdistances[ plength ] = distance; - - plength += 1; - - } - - } - - // null eventual remains from removed lights - // (this is to avoid if in shader) - - for ( l = dlength * 3, ll = dcolors.length; l < ll; l ++ ) dcolors[ l ] = 0.0; - for ( l = plength * 3, ll = pcolors.length; l < ll; l ++ ) pcolors[ l ] = 0.0; - - zlights.point.length = plength; - zlights.directional.length = dlength; - - zlights.ambient[ 0 ] = r; - zlights.ambient[ 1 ] = g; - zlights.ambient[ 2 ] = b; - - }; - - // GL state setting - - this.setFaceCulling = function ( cullFace, frontFace ) { - - if ( cullFace ) { - - if ( !frontFace || frontFace === "ccw" ) { - - _gl.frontFace( _gl.CCW ); - - } else { - - _gl.frontFace( _gl.CW ); - - } - - if( cullFace === "back" ) { - - _gl.cullFace( _gl.BACK ); - - } else if( cullFace === "front" ) { - - _gl.cullFace( _gl.FRONT ); - - } else { - - _gl.cullFace( _gl.FRONT_AND_BACK ); - - } - - _gl.enable( _gl.CULL_FACE ); - - } else { - - _gl.disable( _gl.CULL_FACE ); - - } - - }; - - this.setObjectFaces = function ( object ) { - - if ( _oldDoubleSided !== object.doubleSided ) { - - if( object.doubleSided ) { - - _gl.disable( _gl.CULL_FACE ); - - } else { - - _gl.enable( _gl.CULL_FACE ); - - } - - _oldDoubleSided = object.doubleSided; - - } - - if ( _oldFlipSided !== object.flipSided ) { - - if( object.flipSided ) { - - _gl.frontFace( _gl.CW ); - - } else { - - _gl.frontFace( _gl.CCW ); - - } - - _oldFlipSided = object.flipSided; - - } - - }; - - this.setDepthTest = function ( depthTest ) { - - if ( _oldDepthTest !== depthTest ) { - - if ( depthTest ) { - - _gl.enable( _gl.DEPTH_TEST ); - - } else { - - _gl.disable( _gl.DEPTH_TEST ); - - } - - _oldDepthTest = depthTest; - - } - - }; - - this.setDepthWrite = function ( depthWrite ) { - - if ( _oldDepthWrite !== depthWrite ) { - - _gl.depthMask( depthWrite ); - _oldDepthWrite = depthWrite; - - } - - }; - - function setLineWidth ( width ) { - - if ( width !== _oldLineWidth ) { - - _gl.lineWidth( width ); - - _oldLineWidth = width; - - } - - }; - - function setPolygonOffset ( polygonoffset, factor, units ) { - - if ( _oldPolygonOffset !== polygonoffset ) { - - if ( polygonoffset ) { - - _gl.enable( _gl.POLYGON_OFFSET_FILL ); - - } else { - - _gl.disable( _gl.POLYGON_OFFSET_FILL ); - - } - - _oldPolygonOffset = polygonoffset; - - } - - if ( polygonoffset && ( _oldPolygonOffsetFactor !== factor || _oldPolygonOffsetUnits !== units ) ) { - - _gl.polygonOffset( factor, units ); - - _oldPolygonOffsetFactor = factor; - _oldPolygonOffsetUnits = units; - - } - - }; - - this.setBlending = function ( blending ) { - - if ( blending !== _oldBlending ) { - - switch ( blending ) { - - case THREE.AdditiveBlending: - - _gl.blendEquation( _gl.FUNC_ADD ); - _gl.blendFunc( _gl.SRC_ALPHA, _gl.ONE ); - - break; - - case THREE.SubtractiveBlending: - - // TODO: Find blendFuncSeparate() combination - - _gl.blendEquation( _gl.FUNC_ADD ); - _gl.blendFunc( _gl.ZERO, _gl.ONE_MINUS_SRC_COLOR ); - - break; - - case THREE.MultiplyBlending: - - // TODO: Find blendFuncSeparate() combination - - _gl.blendEquation( _gl.FUNC_ADD ); - _gl.blendFunc( _gl.ZERO, _gl.SRC_COLOR ); - - break; - - default: - - _gl.blendEquationSeparate( _gl.FUNC_ADD, _gl.FUNC_ADD ); - _gl.blendFuncSeparate( _gl.SRC_ALPHA, _gl.ONE_MINUS_SRC_ALPHA, _gl.ONE, _gl.ONE_MINUS_SRC_ALPHA ); - - break; - - } - - _oldBlending = blending; - - } - - }; - - // Shaders - - function buildProgram ( shaderID, fragmentShader, vertexShader, uniforms, attributes, parameters ) { - - var p, pl, program, code; - var chunks = []; - - // Generate code - - if ( shaderID ) { - - chunks.push( shaderID ); - - } else { - - chunks.push( fragmentShader ); - chunks.push( vertexShader ); - - } - - for ( p in parameters ) { - - chunks.push( p ); - chunks.push( parameters[ p ] ); - - } - - code = chunks.join(); - - // Check if code has been already compiled - - for ( p = 0, pl = _programs.length; p < pl; p ++ ) { - - if ( _programs[ p ].code === code ) { - - // console.log( "Code already compiled." /*: \n\n" + code*/ ); - - return _programs[ p ].program; - - } - - } - - //console.log( "building new program " ); - - // - - program = _gl.createProgram(); - - var prefix_vertex = [ - - ( _maxVertexTextures > 0 ) ? "#define VERTEX_TEXTURES" : "", - - _this.gammaInput ? "#define GAMMA_INPUT" : "", - _this.gammaOutput ? "#define GAMMA_OUTPUT" : "", - _this.physicallyBasedShading ? "#define PHYSICALLY_BASED_SHADING" : "", - - "#define MAX_DIR_LIGHTS " + parameters.maxDirLights, - "#define MAX_POINT_LIGHTS " + parameters.maxPointLights, - - "#define MAX_SHADOWS " + parameters.maxShadows, - - "#define MAX_BONES " + parameters.maxBones, - - parameters.map ? "#define USE_MAP" : "", - parameters.envMap ? "#define USE_ENVMAP" : "", - parameters.lightMap ? "#define USE_LIGHTMAP" : "", - parameters.vertexColors ? "#define USE_COLOR" : "", - parameters.skinning ? "#define USE_SKINNING" : "", - parameters.morphTargets ? "#define USE_MORPHTARGETS" : "", - parameters.perPixel ? "#define PHONG_PER_PIXEL" : "", - parameters.wrapAround ? "#define WRAP_AROUND" : "", - - parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", - parameters.shadowMapSoft ? "#define SHADOWMAP_SOFT" : "", - - parameters.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", - - "uniform mat4 objectMatrix;", - "uniform mat4 modelViewMatrix;", - "uniform mat4 projectionMatrix;", - "uniform mat4 viewMatrix;", - "uniform mat3 normalMatrix;", - "uniform vec3 cameraPosition;", - - "uniform mat4 cameraInverseMatrix;", - - "attribute vec3 position;", - "attribute vec3 normal;", - "attribute vec2 uv;", - "attribute vec2 uv2;", - - "#ifdef USE_COLOR", - - "attribute vec3 color;", - - "#endif", - - "#ifdef USE_MORPHTARGETS", - - "attribute vec3 morphTarget0;", - "attribute vec3 morphTarget1;", - "attribute vec3 morphTarget2;", - "attribute vec3 morphTarget3;", - "attribute vec3 morphTarget4;", - "attribute vec3 morphTarget5;", - "attribute vec3 morphTarget6;", - "attribute vec3 morphTarget7;", - - "#endif", - - "#ifdef USE_SKINNING", - - "attribute vec4 skinVertexA;", - "attribute vec4 skinVertexB;", - "attribute vec4 skinIndex;", - "attribute vec4 skinWeight;", - - "#endif", - - "" - - ].join("\n"); - - var prefix_fragment = [ - - "precision " + _precision + " float;", - - "#define MAX_DIR_LIGHTS " + parameters.maxDirLights, - "#define MAX_POINT_LIGHTS " + parameters.maxPointLights, - - "#define MAX_SHADOWS " + parameters.maxShadows, - - parameters.alphaTest ? "#define ALPHATEST " + parameters.alphaTest: "", - - _this.gammaInput ? "#define GAMMA_INPUT" : "", - _this.gammaOutput ? "#define GAMMA_OUTPUT" : "", - _this.physicallyBasedShading ? "#define PHYSICALLY_BASED_SHADING" : "", - - ( parameters.useFog && parameters.fog ) ? "#define USE_FOG" : "", - ( parameters.useFog && parameters.fog instanceof THREE.FogExp2 ) ? "#define FOG_EXP2" : "", - - parameters.map ? "#define USE_MAP" : "", - parameters.envMap ? "#define USE_ENVMAP" : "", - parameters.lightMap ? "#define USE_LIGHTMAP" : "", - parameters.vertexColors ? "#define USE_COLOR" : "", - - parameters.metal ? "#define METAL" : "", - parameters.perPixel ? "#define PHONG_PER_PIXEL" : "", - parameters.wrapAround ? "#define WRAP_AROUND" : "", - - parameters.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", - parameters.shadowMapSoft ? "#define SHADOWMAP_SOFT" : "", - - "uniform mat4 viewMatrix;", - "uniform vec3 cameraPosition;", - "" - - ].join("\n"); - - _gl.attachShader( program, getShader( "fragment", prefix_fragment + fragmentShader ) ); - _gl.attachShader( program, getShader( "vertex", prefix_vertex + vertexShader ) ); - - _gl.linkProgram( program ); - - if ( !_gl.getProgramParameter( program, _gl.LINK_STATUS ) ) { - - console.error( "Could not initialise shader\n" + "VALIDATE_STATUS: " + _gl.getProgramParameter( program, _gl.VALIDATE_STATUS ) + ", gl error [" + _gl.getError() + "]" ); - - } - - //console.log( prefix_fragment + fragmentShader ); - //console.log( prefix_vertex + vertexShader ); - - program.uniforms = {}; - program.attributes = {}; - - var identifiers, u, a, i; - - // cache uniform locations - - identifiers = [ - - 'viewMatrix', 'modelViewMatrix', 'projectionMatrix', 'normalMatrix', 'objectMatrix', 'cameraPosition', - 'cameraInverseMatrix', 'boneGlobalMatrices', 'morphTargetInfluences' - - ]; - - for ( u in uniforms ) { - - identifiers.push( u ); - - } - - cacheUniformLocations( program, identifiers ); - - // cache attributes locations - - identifiers = [ - - "position", "normal", "uv", "uv2", "tangent", "color", - "skinVertexA", "skinVertexB", "skinIndex", "skinWeight" - - ]; - - for ( i = 0; i < parameters.maxMorphTargets; i ++ ) { - - identifiers.push( "morphTarget" + i ); - - } - - for ( a in attributes ) { - - identifiers.push( a ); - - } - - cacheAttributeLocations( program, identifiers ); - - program.id = _programs.length; - - _programs.push( { program: program, code: code } ); - - _this.info.memory.programs = _programs.length; - - return program; - - }; - - // Shader parameters cache - - function cacheUniformLocations ( program, identifiers ) { - - var i, l, id; - - for( i = 0, l = identifiers.length; i < l; i ++ ) { - - id = identifiers[ i ]; - program.uniforms[ id ] = _gl.getUniformLocation( program, id ); - - } - - }; - - function cacheAttributeLocations ( program, identifiers ) { - - var i, l, id; - - for( i = 0, l = identifiers.length; i < l; i ++ ) { - - id = identifiers[ i ]; - program.attributes[ id ] = _gl.getAttribLocation( program, id ); - - } - - }; - - function getShader ( type, string ) { - - var shader; - - if ( type === "fragment" ) { - - shader = _gl.createShader( _gl.FRAGMENT_SHADER ); - - } else if ( type === "vertex" ) { - - shader = _gl.createShader( _gl.VERTEX_SHADER ); - - } - - _gl.shaderSource( shader, string ); - _gl.compileShader( shader ); - - if ( !_gl.getShaderParameter( shader, _gl.COMPILE_STATUS ) ) { - - console.error( _gl.getShaderInfoLog( shader ) ); - console.error( string ); - return null; - - } - - return shader; - - }; - - // Textures - - - function isPowerOfTwo ( value ) { - - return ( value & ( value - 1 ) ) === 0; - - }; - - function setTextureParameters ( textureType, texture, isImagePowerOfTwo ) { - - if ( isImagePowerOfTwo ) { - - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, paramThreeToGL( texture.wrapS ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, paramThreeToGL( texture.wrapT ) ); - - _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, paramThreeToGL( texture.magFilter ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, paramThreeToGL( texture.minFilter ) ); - - } else { - - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); - - _gl.texParameteri( textureType, _gl.TEXTURE_MAG_FILTER, filterFallback( texture.magFilter ) ); - _gl.texParameteri( textureType, _gl.TEXTURE_MIN_FILTER, filterFallback( texture.minFilter ) ); - - } - - }; - - this.setTexture = function ( texture, slot ) { - - if ( texture.needsUpdate ) { - - if ( ! texture.__webglInit ) { - - texture.__webglInit = true; - texture.__webglTexture = _gl.createTexture(); - - _this.info.memory.textures ++; - - } - - _gl.activeTexture( _gl.TEXTURE0 + slot ); - _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture ); - - var image = texture.image, - isImagePowerOfTwo = isPowerOfTwo( image.width ) && isPowerOfTwo( image.height ), - glFormat = paramThreeToGL( texture.format ), - glType = paramThreeToGL( texture.type ); - - setTextureParameters( _gl.TEXTURE_2D, texture, isImagePowerOfTwo ); - - if ( texture instanceof THREE.DataTexture ) { - - _gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data ); - - } else { - - _gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, texture.image ); - - } - - if ( texture.generateMipmaps && isImagePowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D ); - - texture.needsUpdate = false; - - if ( texture.onUpdated ) texture.onUpdated(); - - } else { - - _gl.activeTexture( _gl.TEXTURE0 + slot ); - _gl.bindTexture( _gl.TEXTURE_2D, texture.__webglTexture ); - - } - - }; - - function clampToMaxSize ( image, maxSize ) { - - if ( image.width <= maxSize && image.height <= maxSize ) { - - return image; - - } - - // Warning: Scaling through the canvas will only work with images that use - // premultiplied alpha. - - var maxDimension = Math.max( image.width, image.height ); - var newWidth = Math.floor( image.width * maxSize / maxDimension ); - var newHeight = Math.floor( image.height * maxSize / maxDimension ); - - var canvas = document.createElement( 'canvas' ); - canvas.width = newWidth; - canvas.height = newHeight; - - var ctx = canvas.getContext( "2d" ); - ctx.drawImage( image, 0, 0, image.width, image.height, 0, 0, newWidth, newHeight ); - - return canvas; - - } - - function setCubeTexture ( texture, slot ) { - - if ( texture.image.length === 6 ) { - - if ( texture.needsUpdate ) { - - if ( ! texture.image.__webglTextureCube ) { - - texture.image.__webglTextureCube = _gl.createTexture(); - - } - - _gl.activeTexture( _gl.TEXTURE0 + slot ); - _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.image.__webglTextureCube ); - - var cubeImage = []; - - for ( var i = 0; i < 6; i ++ ) { - - if ( _this.autoScaleCubemaps ) { - - cubeImage[ i ] = clampToMaxSize( texture.image[ i ], _maxCubemapSize ); - - } else { - - cubeImage[ i ] = texture.image[ i ]; - - } - - } - - var image = cubeImage[ 0 ], - isImagePowerOfTwo = isPowerOfTwo( image.width ) && isPowerOfTwo( image.height ), - glFormat = paramThreeToGL( texture.format ), - glType = paramThreeToGL( texture.type ); - - setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, isImagePowerOfTwo ); - - for ( var i = 0; i < 6; i ++ ) { - - _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] ); - - } - - if ( texture.generateMipmaps && isImagePowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); - - texture.needsUpdate = false; - - if ( texture.onUpdated ) texture.onUpdated(); - - } else { - - _gl.activeTexture( _gl.TEXTURE0 + slot ); - _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.image.__webglTextureCube ); - - } - - } - - }; - - function setCubeTextureDynamic ( texture, slot ) { - - _gl.activeTexture( _gl.TEXTURE0 + slot ); - _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, texture.__webglTexture ); - - }; - - // Render targets - - function setupFrameBuffer ( framebuffer, renderTarget, textureTarget ) { - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - _gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureTarget, renderTarget.__webglTexture, 0 ); - - }; - - function setupRenderBuffer ( renderbuffer, renderTarget ) { - - _gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer ); - - if ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) { - - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height ); - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); - - /* For some reason this is not working. Defaulting to RGBA4. - } else if( ! renderTarget.depthBuffer && renderTarget.stencilBuffer ) { - - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.STENCIL_INDEX8, renderTarget.width, renderTarget.height ); - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); - */ - } else if( renderTarget.depthBuffer && renderTarget.stencilBuffer ) { - - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height ); - _gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer ); - - } else { - - _gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height ); - - } - - }; - - this.setRenderTarget = function ( renderTarget ) { - - var isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube ); - - if ( renderTarget && ! renderTarget.__webglFramebuffer ) { - - if( renderTarget.depthBuffer === undefined ) renderTarget.depthBuffer = true; - if( renderTarget.stencilBuffer === undefined ) renderTarget.stencilBuffer = true; - - renderTarget.__webglTexture = _gl.createTexture(); - - // Setup texture, create render and frame buffers - - var isTargetPowerOfTwo = isPowerOfTwo( renderTarget.width ) && isPowerOfTwo( renderTarget.height ), - glFormat = paramThreeToGL( renderTarget.format ), - glType = paramThreeToGL( renderTarget.type ); - - if ( isCube ) { - - renderTarget.__webglFramebuffer = []; - renderTarget.__webglRenderbuffer = []; - - _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTarget.__webglTexture ); - setTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget, isTargetPowerOfTwo ); - - for ( var i = 0; i < 6; i ++ ) { - - renderTarget.__webglFramebuffer[ i ] = _gl.createFramebuffer(); - renderTarget.__webglRenderbuffer[ i ] = _gl.createRenderbuffer(); - - _gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); - - setupFrameBuffer( renderTarget.__webglFramebuffer[ i ], renderTarget, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i ); - setupRenderBuffer( renderTarget.__webglRenderbuffer[ i ], renderTarget ); - - } - - } else { - - renderTarget.__webglFramebuffer = _gl.createFramebuffer(); - renderTarget.__webglRenderbuffer = _gl.createRenderbuffer(); - - _gl.bindTexture( _gl.TEXTURE_2D, renderTarget.__webglTexture ); - setTextureParameters( _gl.TEXTURE_2D, renderTarget, isTargetPowerOfTwo ); - - _gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null ); - - setupFrameBuffer( renderTarget.__webglFramebuffer, renderTarget, _gl.TEXTURE_2D ); - setupRenderBuffer( renderTarget.__webglRenderbuffer, renderTarget ); - - } - - // Release everything - - if ( isCube ) { - - _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, null ); - - } else { - - _gl.bindTexture( _gl.TEXTURE_2D, null ); - - } - - _gl.bindRenderbuffer( _gl.RENDERBUFFER, null ); - _gl.bindFramebuffer( _gl.FRAMEBUFFER, null); - - } - - var framebuffer, width, height, vx, vy; - - if ( renderTarget ) { - - if ( isCube ) { - - framebuffer = renderTarget.__webglFramebuffer[ renderTarget.activeCubeFace ]; - - } else { - - framebuffer = renderTarget.__webglFramebuffer; - - } - - width = renderTarget.width; - height = renderTarget.height; - - vx = 0; - vy = 0; - - } else { - - framebuffer = null; - - width = _viewportWidth; - height = _viewportHeight; - - vx = _viewportX; - vy = _viewportY; - - } - - if ( framebuffer !== _currentFramebuffer ) { - - _gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer ); - _gl.viewport( vx, vy, width, height ); - - _currentFramebuffer = framebuffer; - - } - - _currentWidth = width; - _currentHeight = height; - - }; - - function updateRenderTargetMipmap ( renderTarget ) { - - if ( renderTarget instanceof THREE.WebGLRenderTargetCube ) { - - _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, renderTarget.__webglTexture ); - _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP ); - _gl.bindTexture( _gl.TEXTURE_CUBE_MAP, null ); - - } else { - - _gl.bindTexture( _gl.TEXTURE_2D, renderTarget.__webglTexture ); - _gl.generateMipmap( _gl.TEXTURE_2D ); - _gl.bindTexture( _gl.TEXTURE_2D, null ); - - } - - }; - - // Fallback filters for non-power-of-2 textures - - function filterFallback ( f ) { - - switch ( f ) { - - case THREE.NearestFilter: - case THREE.NearestMipMapNearestFilter: - case THREE.NearestMipMapLinearFilter: return _gl.NEAREST; break; - - case THREE.LinearFilter: - case THREE.LinearMipMapNearestFilter: - case THREE.LinearMipMapLinearFilter: - default: - - return _gl.LINEAR; break; - - } - - }; - - // Map three.js constants to WebGL constants - - function paramThreeToGL ( p ) { - - switch ( p ) { - - case THREE.RepeatWrapping: return _gl.REPEAT; break; - case THREE.ClampToEdgeWrapping: return _gl.CLAMP_TO_EDGE; break; - case THREE.MirroredRepeatWrapping: return _gl.MIRRORED_REPEAT; break; - - case THREE.NearestFilter: return _gl.NEAREST; break; - case THREE.NearestMipMapNearestFilter: return _gl.NEAREST_MIPMAP_NEAREST; break; - case THREE.NearestMipMapLinearFilter: return _gl.NEAREST_MIPMAP_LINEAR; break; - - case THREE.LinearFilter: return _gl.LINEAR; break; - case THREE.LinearMipMapNearestFilter: return _gl.LINEAR_MIPMAP_NEAREST; break; - case THREE.LinearMipMapLinearFilter: return _gl.LINEAR_MIPMAP_LINEAR; break; - - case THREE.ByteType: return _gl.BYTE; break; - case THREE.UnsignedByteType: return _gl.UNSIGNED_BYTE; break; - case THREE.ShortType: return _gl.SHORT; break; - case THREE.UnsignedShortType: return _gl.UNSIGNED_SHORT; break; - case THREE.IntType: return _gl.INT; break; - case THREE.UnsignedShortType: return _gl.UNSIGNED_INT; break; - case THREE.FloatType: return _gl.FLOAT; break; - - case THREE.AlphaFormat: return _gl.ALPHA; break; - case THREE.RGBFormat: return _gl.RGB; break; - case THREE.RGBAFormat: return _gl.RGBA; break; - case THREE.LuminanceFormat: return _gl.LUMINANCE; break; - case THREE.LuminanceAlphaFormat: return _gl.LUMINANCE_ALPHA; break; - - } - - return 0; - - }; - - // Allocations - - function allocateBones ( object ) { - - // default for when object is not specified - // ( for example when prebuilding shader - // to be used with multiple objects ) - // - // - leave some extra space for other uniforms - // - limit here is ANGLE's 254 max uniform vectors - // (up to 54 should be safe) - - var maxBones = 50; - - if ( object !== undefined && object instanceof THREE.SkinnedMesh ) { - - maxBones = object.bones.length; - - } - - return maxBones; - - }; - - function allocateLights ( lights ) { - - var l, ll, light, dirLights, pointLights, maxDirLights, maxPointLights; - dirLights = pointLights = maxDirLights = maxPointLights = 0; - - for ( l = 0, ll = lights.length; l < ll; l++ ) { - - light = lights[ l ]; - - if ( light.onlyShadow ) continue; - - if ( light instanceof THREE.DirectionalLight ) dirLights ++; - if ( light instanceof THREE.PointLight ) pointLights ++; - if ( light instanceof THREE.SpotLight ) pointLights ++; - - } - - if ( ( pointLights + dirLights ) <= _maxLights ) { - - maxDirLights = dirLights; - maxPointLights = pointLights; - - } else { - - maxDirLights = Math.ceil( _maxLights * dirLights / ( pointLights + dirLights ) ); - maxPointLights = _maxLights - maxDirLights; - - } - - return { 'directional' : maxDirLights, 'point' : maxPointLights }; - - }; - - function allocateShadows ( lights ) { - - var l, ll, light, maxShadows = 0; - - for ( l = 0, ll = lights.length; l < ll; l++ ) { - - light = lights[ l ]; - - if ( ! light.castShadow ) continue; - - if ( light instanceof THREE.SpotLight || light instanceof THREE.DirectionalLight ) maxShadows ++; - - } - - return maxShadows; - - }; - - // Initialization - - function initGL () { - - var gl; - - try { - - if ( ! ( gl = _canvas.getContext( 'experimental-webgl', { alpha: _alpha, premultipliedAlpha: _premultipliedAlpha, antialias: _antialias, stencil: _stencil, preserveDrawingBuffer: _preserveDrawingBuffer } ) ) ) { - - throw 'Error creating WebGL context.'; - - } - - console.log( - navigator.userAgent + " | " + - gl.getParameter( gl.VERSION ) + " | " + - gl.getParameter( gl.VENDOR ) + " | " + - gl.getParameter( gl.RENDERER ) + " | " + - gl.getParameter( gl.SHADING_LANGUAGE_VERSION ) - ); - - } catch ( error ) { - - console.error( error ); - - } - - return gl; - - }; - - function setDefaultGLState () { - - _gl.clearColor( 0, 0, 0, 1 ); - _gl.clearDepth( 1 ); - _gl.clearStencil( 0 ); - - _gl.enable( _gl.DEPTH_TEST ); - _gl.depthFunc( _gl.LEQUAL ); - - _gl.frontFace( _gl.CCW ); - _gl.cullFace( _gl.BACK ); - _gl.enable( _gl.CULL_FACE ); - - _gl.enable( _gl.BLEND ); - _gl.blendEquation( _gl.FUNC_ADD ); - _gl.blendFunc( _gl.SRC_ALPHA, _gl.ONE_MINUS_SRC_ALPHA ); - - _gl.clearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha ); - - }; - - // default plugins (order is important) - - this.shadowMapPlugin = new THREE.ShadowMapPlugin(); - this.addPrePlugin( this.shadowMapPlugin ); - - this.addPostPlugin( new THREE.SpritePlugin() ); - this.addPostPlugin( new THREE.LensFlarePlugin() ); - -}; -/** - * @author szimek / https://github.com/szimek/ - */ - -THREE.WebGLRenderTarget = function ( width, height, options ) { - - this.width = width; - this.height = height; - - options = options || {}; - - this.wrapS = options.wrapS !== undefined ? options.wrapS : THREE.ClampToEdgeWrapping; - this.wrapT = options.wrapT !== undefined ? options.wrapT : THREE.ClampToEdgeWrapping; - - this.magFilter = options.magFilter !== undefined ? options.magFilter : THREE.LinearFilter; - this.minFilter = options.minFilter !== undefined ? options.minFilter : THREE.LinearMipMapLinearFilter; - - this.offset = new THREE.Vector2( 0, 0 ); - this.repeat = new THREE.Vector2( 1, 1 ); - - this.format = options.format !== undefined ? options.format : THREE.RGBAFormat; - this.type = options.type !== undefined ? options.type : THREE.UnsignedByteType; - - this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true; - this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true; - - this.generateMipmaps = true; - -}; - -THREE.WebGLRenderTarget.prototype.clone = function() { - - var tmp = new THREE.WebGLRenderTarget( this.width, this.height ); - - tmp.wrapS = this.wrapS; - tmp.wrapT = this.wrapT; - - tmp.magFilter = this.magFilter; - tmp.minFilter = this.minFilter; - - tmp.offset.copy( this.offset ); - tmp.repeat.copy( this.repeat ); - - tmp.format = this.format; - tmp.type = this.type; - - tmp.depthBuffer = this.depthBuffer; - tmp.stencilBuffer = this.stencilBuffer; - - return tmp; - -}; -/** - * @author alteredq / http://alteredqualia.com - */ - -THREE.WebGLRenderTargetCube = function ( width, height, options ) { - - THREE.WebGLRenderTarget.call( this, width, height, options ); - - this.activeCubeFace = 0; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5 - -}; - -THREE.WebGLRenderTargetCube.prototype = new THREE.WebGLRenderTarget(); -THREE.WebGLRenderTargetCube.prototype.constructor = THREE.WebGLRenderTargetCube; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.RenderableVertex = function () { - - this.positionWorld = new THREE.Vector3(); - this.positionScreen = new THREE.Vector4(); - - this.visible = true; - -}; - -THREE.RenderableVertex.prototype.copy = function ( vertex ) { - - this.positionWorld.copy( vertex.positionWorld ); - this.positionScreen.copy( vertex.positionScreen ); - -} -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.RenderableFace3 = function () { - - this.v1 = new THREE.RenderableVertex(); - this.v2 = new THREE.RenderableVertex(); - this.v3 = new THREE.RenderableVertex(); - - this.centroidWorld = new THREE.Vector3(); - this.centroidScreen = new THREE.Vector3(); - - this.normalWorld = new THREE.Vector3(); - this.vertexNormalsWorld = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ]; - - this.material = null; - this.faceMaterial = null; - this.uvs = [[]]; - - this.z = null; - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.RenderableFace4 = function () { - - this.v1 = new THREE.RenderableVertex(); - this.v2 = new THREE.RenderableVertex(); - this.v3 = new THREE.RenderableVertex(); - this.v4 = new THREE.RenderableVertex(); - - this.centroidWorld = new THREE.Vector3(); - this.centroidScreen = new THREE.Vector3(); - - this.normalWorld = new THREE.Vector3(); - this.vertexNormalsWorld = [ new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3(), new THREE.Vector3() ]; - - this.material = null; - this.faceMaterial = null; - this.uvs = [[]]; - - this.z = null; - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.RenderableObject = function () { - - this.object = null; - this.z = null; - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.RenderableParticle = function () { - - this.x = null; - this.y = null; - this.z = null; - - this.rotation = null; - this.scale = new THREE.Vector2(); - - this.material = null; - -}; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.RenderableLine = function () { - - this.z = null; - - this.v1 = new THREE.RenderableVertex(); - this.v2 = new THREE.RenderableVertex(); - - this.material = null; - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.ColorUtils = { - - adjustHSV : function ( color, h, s, v ) { - - var hsv = THREE.ColorUtils.__hsv; - - THREE.ColorUtils.rgbToHsv( color, hsv ); - - hsv.h = THREE.Math.clamp( hsv.h + h, 0, 1 ); - hsv.s = THREE.Math.clamp( hsv.s + s, 0, 1 ); - hsv.v = THREE.Math.clamp( hsv.v + v, 0, 1 ); - - color.setHSV( hsv.h, hsv.s, hsv.v ); - - }, - - // based on MochiKit implementation by Bob Ippolito - - rgbToHsv : function ( color, hsv ) { - - var r = color.r; - var g = color.g; - var b = color.b; - - var max = Math.max( Math.max( r, g ), b ); - var min = Math.min( Math.min( r, g ), b ); - - var hue; - var saturation; - var value = max; - - if ( min === max ) { - - hue = 0; - saturation = 0; - - } else { - - var delta = ( max - min ); - saturation = delta / max; - - if ( r === max ) { - - hue = ( g - b ) / delta; - - } else if ( g === max ) { - - hue = 2 + ( ( b - r ) / delta ); - - } else { - - hue = 4 + ( ( r - g ) / delta ); - } - - hue /= 6; - - if ( hue < 0 ) { - - hue += 1; - - } - - if ( hue > 1 ) { - - hue -= 1; - - } - - } - - if ( hsv === undefined ) { - - hsv = { h: 0, s: 0, v: 0 }; - - } - - hsv.h = hue; - hsv.s = saturation; - hsv.v = value; - - return hsv; - - } - -}; - -THREE.ColorUtils.__hsv = { h: 0, s: 0, v: 0 };/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.GeometryUtils = { - - // Merge two geometries or geometry and geometry from object (using object's transform) - - merge: function ( geometry1, object2 /* mesh | geometry */ ) { - - var matrix, matrixRotation, - vertexOffset = geometry1.vertices.length, - uvPosition = geometry1.faceVertexUvs[ 0 ].length, - geometry2 = object2 instanceof THREE.Mesh ? object2.geometry : object2, - vertices1 = geometry1.vertices, - vertices2 = geometry2.vertices, - faces1 = geometry1.faces, - faces2 = geometry2.faces, - uvs1 = geometry1.faceVertexUvs[ 0 ], - uvs2 = geometry2.faceVertexUvs[ 0 ]; - - var geo1MaterialsMap = {}; - - for ( var i = 0; i < geometry1.materials.length; i ++ ) { - - var id = geometry1.materials[ i ].id; - - geo1MaterialsMap[ id ] = i; - - } - - - if ( object2 instanceof THREE.Mesh ) { - - object2.matrixAutoUpdate && object2.updateMatrix(); - - matrix = object2.matrix; - matrixRotation = new THREE.Matrix4(); - matrixRotation.extractRotation( matrix, object2.scale ); - - } - - // vertices - - for ( var i = 0, il = vertices2.length; i < il; i ++ ) { - - var vertex = vertices2[ i ]; - - var vertexCopy = new THREE.Vertex( vertex.position.clone() ); - - if ( matrix ) matrix.multiplyVector3( vertexCopy.position ); - - vertices1.push( vertexCopy ); - - } - - // faces - - for ( i = 0, il = faces2.length; i < il; i ++ ) { - - var face = faces2[ i ], faceCopy, normal, color, - faceVertexNormals = face.vertexNormals, - faceVertexColors = face.vertexColors; - - if ( face instanceof THREE.Face3 ) { - - faceCopy = new THREE.Face3( face.a + vertexOffset, face.b + vertexOffset, face.c + vertexOffset ); - - } else if ( face instanceof THREE.Face4 ) { - - faceCopy = new THREE.Face4( face.a + vertexOffset, face.b + vertexOffset, face.c + vertexOffset, face.d + vertexOffset ); - - } - - faceCopy.normal.copy( face.normal ); - - if ( matrixRotation ) matrixRotation.multiplyVector3( faceCopy.normal ); - - for ( var j = 0, jl = faceVertexNormals.length; j < jl; j ++ ) { - - normal = faceVertexNormals[ j ].clone(); - - if ( matrixRotation ) matrixRotation.multiplyVector3( normal ); - - faceCopy.vertexNormals.push( normal ); - - } - - faceCopy.color.copy( face.color ); - - for ( var j = 0, jl = faceVertexColors.length; j < jl; j ++ ) { - - color = faceVertexColors[ j ]; - faceCopy.vertexColors.push( color.clone() ); - - } - - if ( face.materialIndex !== undefined ) { - - var material2 = geometry2.materials[ face.materialIndex ]; - var materialId2 = material2.id; - - var materialIndex = geo1MaterialsMap[ materialId2 ]; - - if ( materialIndex === undefined ) { - - materialIndex = geometry1.materials.length; - geo1MaterialsMap[ materialId2 ] = materialIndex; - - geometry1.materials.push( material2 ); - - } - - faceCopy.materialIndex = materialIndex; - - } - - faceCopy.centroid.copy( face.centroid ); - if ( matrix ) matrix.multiplyVector3( faceCopy.centroid ); - - faces1.push( faceCopy ); - - } - - // uvs - - for ( i = 0, il = uvs2.length; i < il; i ++ ) { - - var uv = uvs2[ i ], uvCopy = []; - - for ( var j = 0, jl = uv.length; j < jl; j ++ ) { - - uvCopy.push( new THREE.UV( uv[ j ].u, uv[ j ].v ) ); - - } - - uvs1.push( uvCopy ); - - } - - }, - - clone: function ( geometry ) { - - var cloneGeo = new THREE.Geometry(); - - var i, il; - - var vertices = geometry.vertices, - faces = geometry.faces, - uvs = geometry.faceVertexUvs[ 0 ]; - - // materials - - if ( geometry.materials ) { - - cloneGeo.materials = geometry.materials.slice(); - - } - - // vertices - - for ( i = 0, il = vertices.length; i < il; i ++ ) { - - var vertex = vertices[ i ]; - var vertexCopy = new THREE.Vertex( vertex.position.clone() ); - - cloneGeo.vertices.push( vertexCopy ); - - } - - // faces - - for ( i = 0, il = faces.length; i < il; i ++ ) { - - var face = faces[ i ], faceCopy, normal, color, - faceVertexNormals = face.vertexNormals, - faceVertexColors = face.vertexColors; - - if ( face instanceof THREE.Face3 ) { - - faceCopy = new THREE.Face3( face.a, face.b, face.c ); - - } else if ( face instanceof THREE.Face4 ) { - - faceCopy = new THREE.Face4( face.a, face.b, face.c, face.d ); - - } - - faceCopy.normal.copy( face.normal ); - - for ( var j = 0, jl = faceVertexNormals.length; j < jl; j ++ ) { - - normal = faceVertexNormals[ j ]; - faceCopy.vertexNormals.push( normal.clone() ); - - } - - faceCopy.color.copy( face.color ); - - for ( var j = 0, jl = faceVertexColors.length; j < jl; j ++ ) { - - color = faceVertexColors[ j ]; - faceCopy.vertexColors.push( color.clone() ); - - } - - faceCopy.materialIndex = face.materialIndex; - - faceCopy.centroid.copy( face.centroid ); - - cloneGeo.faces.push( faceCopy ); - - } - - // uvs - - for ( i = 0, il = uvs.length; i < il; i ++ ) { - - var uv = uvs[ i ], uvCopy = []; - - for ( var j = 0, jl = uv.length; j < jl; j ++ ) { - - uvCopy.push( new THREE.UV( uv[ j ].u, uv[ j ].v ) ); - - } - - cloneGeo.faceVertexUvs[ 0 ].push( uvCopy ); - - } - - return cloneGeo; - - }, - - // Get random point in triangle (via barycentric coordinates) - // (uniform distribution) - // http://www.cgafaq.info/wiki/Random_Point_In_Triangle - - randomPointInTriangle: function ( vectorA, vectorB, vectorC ) { - - var a, b, c, - point = new THREE.Vector3(), - tmp = THREE.GeometryUtils.__v1; - - a = THREE.GeometryUtils.random(); - b = THREE.GeometryUtils.random(); - - if ( ( a + b ) > 1 ) { - - a = 1 - a; - b = 1 - b; - - } - - c = 1 - a - b; - - point.copy( vectorA ); - point.multiplyScalar( a ); - - tmp.copy( vectorB ); - tmp.multiplyScalar( b ); - - point.addSelf( tmp ); - - tmp.copy( vectorC ); - tmp.multiplyScalar( c ); - - point.addSelf( tmp ); - - return point; - - }, - - // Get random point in face (triangle / quad) - // (uniform distribution) - - randomPointInFace: function ( face, geometry, useCachedAreas ) { - - var vA, vB, vC, vD; - - if ( face instanceof THREE.Face3 ) { - - vA = geometry.vertices[ face.a ].position; - vB = geometry.vertices[ face.b ].position; - vC = geometry.vertices[ face.c ].position; - - return THREE.GeometryUtils.randomPointInTriangle( vA, vB, vC ); - - } else if ( face instanceof THREE.Face4 ) { - - vA = geometry.vertices[ face.a ].position; - vB = geometry.vertices[ face.b ].position; - vC = geometry.vertices[ face.c ].position; - vD = geometry.vertices[ face.d ].position; - - var area1, area2; - - if ( useCachedAreas ) { - - if ( face._area1 && face._area2 ) { - - area1 = face._area1; - area2 = face._area2; - - } else { - - area1 = THREE.GeometryUtils.triangleArea( vA, vB, vD ); - area2 = THREE.GeometryUtils.triangleArea( vB, vC, vD ); - - face._area1 = area1; - face._area2 = area2; - - } - - } else { - - area1 = THREE.GeometryUtils.triangleArea( vA, vB, vD ), - area2 = THREE.GeometryUtils.triangleArea( vB, vC, vD ); - - } - - var r = THREE.GeometryUtils.random() * ( area1 + area2 ); - - if ( r < area1 ) { - - return THREE.GeometryUtils.randomPointInTriangle( vA, vB, vD ); - - } else { - - return THREE.GeometryUtils.randomPointInTriangle( vB, vC, vD ); - - } - - } - - }, - - // Get uniformly distributed random points in mesh - // - create array with cumulative sums of face areas - // - pick random number from 0 to total area - // - find corresponding place in area array by binary search - // - get random point in face - - randomPointsInGeometry: function ( geometry, n ) { - - var face, i, - faces = geometry.faces, - vertices = geometry.vertices, - il = faces.length, - totalArea = 0, - cumulativeAreas = [], - vA, vB, vC, vD; - - // precompute face areas - - for ( i = 0; i < il; i ++ ) { - - face = faces[ i ]; - - if ( face instanceof THREE.Face3 ) { - - vA = vertices[ face.a ].position; - vB = vertices[ face.b ].position; - vC = vertices[ face.c ].position; - - face._area = THREE.GeometryUtils.triangleArea( vA, vB, vC ); - - } else if ( face instanceof THREE.Face4 ) { - - vA = vertices[ face.a ].position; - vB = vertices[ face.b ].position; - vC = vertices[ face.c ].position; - vD = vertices[ face.d ].position; - - face._area1 = THREE.GeometryUtils.triangleArea( vA, vB, vD ); - face._area2 = THREE.GeometryUtils.triangleArea( vB, vC, vD ); - - face._area = face._area1 + face._area2; - - } - - totalArea += face._area; - - cumulativeAreas[ i ] = totalArea; - - } - - // binary search cumulative areas array - - function binarySearchIndices( value ) { - - function binarySearch( start, end ) { - - // return closest larger index - // if exact number is not found - - if ( end < start ) - return start; - - var mid = start + Math.floor( ( end - start ) / 2 ); - - if ( cumulativeAreas[ mid ] > value ) { - - return binarySearch( start, mid - 1 ); - - } else if ( cumulativeAreas[ mid ] < value ) { - - return binarySearch( mid + 1, end ); - - } else { - - return mid; - - } - - } - - var result = binarySearch( 0, cumulativeAreas.length - 1 ) - return result; - - } - - // pick random face weighted by face area - - var r, index, - result = []; - - var stats = {}; - - for ( i = 0; i < n; i ++ ) { - - r = THREE.GeometryUtils.random() * totalArea; - - index = binarySearchIndices( r ); - - result[ i ] = THREE.GeometryUtils.randomPointInFace( faces[ index ], geometry, true ); - - if ( ! stats[ index ] ) { - - stats[ index ] = 1; - - } else { - - stats[ index ] += 1; - - } - - } - - return result; - - }, - - // Get triangle area (by Heron's formula) - // http://en.wikipedia.org/wiki/Heron%27s_formula - - triangleArea: function ( vectorA, vectorB, vectorC ) { - - var s, a, b, c, - tmp = THREE.GeometryUtils.__v1; - - tmp.sub( vectorA, vectorB ); - a = tmp.length(); - - tmp.sub( vectorA, vectorC ); - b = tmp.length(); - - tmp.sub( vectorB, vectorC ); - c = tmp.length(); - - s = 0.5 * ( a + b + c ); - - return Math.sqrt( s * ( s - a ) * ( s - b ) * ( s - c ) ); - - }, - - // Center geometry so that 0,0,0 is in center of bounding box - - center: function ( geometry ) { - - geometry.computeBoundingBox(); - - var bb = geometry.boundingBox; - - var offset = new THREE.Vector3(); - - offset.add( bb.min, bb.max ); - offset.multiplyScalar( -0.5 ); - - geometry.applyMatrix( new THREE.Matrix4().setTranslation( offset.x, offset.y, offset.z ) ); - geometry.computeBoundingBox(); - - return offset; - - }, - - // Normalize UVs to be from <0,1> - // (for now just the first set of UVs) - - normalizeUVs: function ( geometry ) { - - var uvSet = geometry.faceVertexUvs[ 0 ]; - - for ( var i = 0, il = uvSet.length; i < il; i ++ ) { - - var uvs = uvSet[ i ]; - - for ( var j = 0, jl = uvs.length; j < jl; j ++ ) { - - // texture repeat - - if( uvs[ j ].u !== 1.0 ) uvs[ j ].u = uvs[ j ].u - Math.floor( uvs[ j ].u ); - if( uvs[ j ].v !== 1.0 ) uvs[ j ].v = uvs[ j ].v - Math.floor( uvs[ j ].v ); - - } - - } - - } - -}; - -THREE.GeometryUtils.random = THREE.Math.random16; - -THREE.GeometryUtils.__v1 = new THREE.Vector3(); -/** - * @author alteredq / http://alteredqualia.com/ - * @author mrdoob / http://mrdoob.com/ - */ - -THREE.ImageUtils = { - - crossOrigin: '', - - loadTexture: function ( path, mapping, callback ) { - - var image = new Image(), texture = new THREE.Texture( image, mapping ); - - image.onload = function () { texture.needsUpdate = true; if ( callback ) callback( this ); }; - image.crossOrigin = this.crossOrigin; - image.src = path; - - return texture; - - }, - - loadTextureCube: function ( array, mapping, callback ) { - - var i, l, images = [], texture = new THREE.Texture( images, mapping ); - - images.loadCount = 0; - - for ( i = 0, l = array.length; i < l; ++ i ) { - - images[ i ] = new Image(); - images[ i ].onload = function () { - - images.loadCount += 1; - if ( images.loadCount === 6 ) texture.needsUpdate = true; - if ( callback ) callback( this ); - - }; - - images[ i ].crossOrigin = ''; - images[ i ].src = array[ i ]; - - } - - return texture; - - }, - - getNormalMap: function ( image, depth ) { - - // Adapted from http://www.paulbrunt.co.uk/lab/heightnormal/ - - var cross = function ( a, b ) { - - return [ a[ 1 ] * b[ 2 ] - a[ 2 ] * b[ 1 ], a[ 2 ] * b[ 0 ] - a[ 0 ] * b[ 2 ], a[ 0 ] * b[ 1 ] - a[ 1 ] * b[ 0 ] ]; - - } - - var subtract = function ( a, b ) { - - return [ a[ 0 ] - b[ 0 ], a[ 1 ] - b[ 1 ], a[ 2 ] - b[ 2 ] ]; - - } - - var normalize = function ( a ) { - - var l = Math.sqrt( a[ 0 ] * a[ 0 ] + a[ 1 ] * a[ 1 ] + a[ 2 ] * a[ 2 ] ); - return [ a[ 0 ] / l, a[ 1 ] / l, a[ 2 ] / l ]; - - } - - depth = depth | 1; - - var width = image.width; - var height = image.height; - - var canvas = document.createElement( 'canvas' ); - canvas.width = width; - canvas.height = height; - - var context = canvas.getContext( '2d' ); - context.drawImage( image, 0, 0 ); - - var data = context.getImageData( 0, 0, width, height ).data; - var imageData = context.createImageData( width, height ); - var output = imageData.data; - - for ( var x = 0; x < width; x ++ ) { - - for ( var y = 1; y < height; y ++ ) { - - var ly = y - 1 < 0 ? height - 1 : y - 1; - var uy = ( y + 1 ) % height; - var lx = x - 1 < 0 ? width - 1 : x - 1; - var ux = ( x + 1 ) % width; - - var points = []; - var origin = [ 0, 0, data[ ( y * width + x ) * 4 ] / 255 * depth ]; - points.push( [ - 1, 0, data[ ( y * width + lx ) * 4 ] / 255 * depth ] ); - points.push( [ - 1, - 1, data[ ( ly * width + lx ) * 4 ] / 255 * depth ] ); - points.push( [ 0, - 1, data[ ( ly * width + x ) * 4 ] / 255 * depth ] ); - points.push( [ 1, - 1, data[ ( ly * width + ux ) * 4 ] / 255 * depth ] ); - points.push( [ 1, 0, data[ ( y * width + ux ) * 4 ] / 255 * depth ] ); - points.push( [ 1, 1, data[ ( uy * width + ux ) * 4 ] / 255 * depth ] ); - points.push( [ 0, 1, data[ ( uy * width + x ) * 4 ] / 255 * depth ] ); - points.push( [ - 1, 1, data[ ( uy * width + lx ) * 4 ] / 255 * depth ] ); - - var normals = []; - var num_points = points.length; - - for ( var i = 0; i < num_points; i ++ ) { - - var v1 = points[ i ]; - var v2 = points[ ( i + 1 ) % num_points ]; - v1 = subtract( v1, origin ); - v2 = subtract( v2, origin ); - normals.push( normalize( cross( v1, v2 ) ) ); - - } - - var normal = [ 0, 0, 0 ]; - - for ( var i = 0; i < normals.length; i ++ ) { - - normal[ 0 ] += normals[ i ][ 0 ]; - normal[ 1 ] += normals[ i ][ 1 ]; - normal[ 2 ] += normals[ i ][ 2 ]; - - } - - normal[ 0 ] /= normals.length; - normal[ 1 ] /= normals.length; - normal[ 2 ] /= normals.length; - - var idx = ( y * width + x ) * 4; - - output[ idx ] = ( ( normal[ 0 ] + 1.0 ) / 2.0 * 255 ) | 0; - output[ idx + 1 ] = ( ( normal[ 1 ] + 1.0 / 2.0 ) * 255 ) | 0; - output[ idx + 2 ] = ( normal[ 2 ] * 255 ) | 0; - output[ idx + 3 ] = 255; - - } - - } - - context.putImageData( imageData, 0, 0 ); - - return canvas; - - } - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.SceneUtils = { - - showHierarchy : function ( root, visible ) { - - THREE.SceneUtils.traverseHierarchy( root, function( node ) { node.visible = visible; } ); - - }, - - traverseHierarchy : function ( root, callback ) { - - var n, i, l = root.children.length; - - for ( i = 0; i < l; i ++ ) { - - n = root.children[ i ]; - - callback( n ); - - THREE.SceneUtils.traverseHierarchy( n, callback ); - - } - - }, - - createMultiMaterialObject : function ( geometry, materials ) { - - var i, il = materials.length, - group = new THREE.Object3D(); - - for ( i = 0; i < il; i ++ ) { - - var object = new THREE.Mesh( geometry, materials[ i ] ); - group.add( object ); - - } - - return group; - - }, - - cloneObject: function ( source ) { - - var object; - - // subclass specific properties - // (must process in order from more specific subclasses to more abstract classes) - - if ( source instanceof THREE.MorphAnimMesh ) { - - object = new THREE.MorphAnimMesh( source.geometry, source.material ); - - object.duration = source.duration; - object.mirroredLoop = source.mirroredLoop; - object.time = source.time; - - object.lastKeyframe = source.lastKeyframe; - object.currentKeyframe = source.currentKeyframe; - - object.direction = source.direction; - object.directionBackwards = source.directionBackwards; - - } else if ( source instanceof THREE.SkinnedMesh ) { - - object = new THREE.SkinnedMesh( source.geometry, source.material ); - - } else if ( source instanceof THREE.Mesh ) { - - object = new THREE.Mesh( source.geometry, source.material ); - - } else if ( source instanceof THREE.Line ) { - - object = new THREE.Line( source.geometry, source.material, source.type ); - - } else if ( source instanceof THREE.Ribbon ) { - - object = new THREE.Ribbon( source.geometry, source.material ); - - } else if ( source instanceof THREE.ParticleSystem ) { - - object = new THREE.ParticleSystem( source.geometry, source.material ); - object.sortParticles = source.sortParticles; - - } else if ( source instanceof THREE.Particle ) { - - object = new THREE.Particle( source.material ); - - } else if ( source instanceof THREE.Sprite ) { - - object = new THREE.Sprite( {} ); - - object.color.copy( source.color ); - object.map = source.map; - object.blending = source.blending; - - object.useScreenCoordinates = source.useScreenCoordinates; - object.mergeWith3D = source.mergeWith3D; - object.affectedByDistance = source.affectedByDistance; - object.scaleByViewport = source.scaleByViewport; - object.alignment = source.alignment; - - object.rotation3d.copy( source.rotation3d ); - object.rotation = source.rotation; - object.opacity = source.opacity; - - object.uvOffset.copy( source.uvOffset ); - object.uvScale.copy( source.uvScale); - - } else if ( source instanceof THREE.LOD ) { - - object = new THREE.LOD(); - - } else if ( source instanceof THREE.MarchingCubes ) { - - object = new THREE.MarchingCubes( source.resolution, source.material ); - object.field.set( source.field ); - object.isolation = source.isolation; - - } else if ( source instanceof THREE.Object3D ) { - - object = new THREE.Object3D(); - - } - - // base class properties - - object.name = source.name; - - object.parent = source.parent; - - object.up.copy( source.up ); - - object.position.copy( source.position ); - - // because of Sprite madness - - if ( object.rotation instanceof THREE.Vector3 ) - object.rotation.copy( source.rotation ); - - object.eulerOrder = source.eulerOrder; - - object.scale.copy( source.scale ); - - object.dynamic = source.dynamic; - - object.doubleSided = source.doubleSided; - object.flipSided = source.flipSided; - - object.renderDepth = source.renderDepth; - - object.rotationAutoUpdate = source.rotationAutoUpdate; - - object.matrix.copy( source.matrix ); - object.matrixWorld.copy( source.matrixWorld ); - object.matrixRotationWorld.copy( source.matrixRotationWorld ); - - object.matrixAutoUpdate = source.matrixAutoUpdate; - object.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate; - - object.quaternion.copy( source.quaternion ); - object.useQuaternion = source.useQuaternion; - - object.boundRadius = source.boundRadius; - object.boundRadiusScale = source.boundRadiusScale; - - object.visible = source.visible; - - object.castShadow = source.castShadow; - object.receiveShadow = source.receiveShadow; - - object.frustumCulled = source.frustumCulled; - - // children - - for ( var i = 0; i < source.children.length; i ++ ) { - - var child = THREE.SceneUtils.cloneObject( source.children[ i ] ); - object.children[ i ] = child; - - child.parent = object; - - } - - // LODs need to be patched separately to use cloned children - - if ( source instanceof THREE.LOD ) { - - for ( var i = 0; i < source.LODs.length; i ++ ) { - - var lod = source.LODs[ i ]; - object.LODs[ i ] = { visibleAtDistance: lod.visibleAtDistance, object3D: object.children[ i ] }; - - } - - } - - return object; - - } - -}; -/** - * @author alteredq / http://alteredqualia.com/ - * @author mr.doob / http://mrdoob.com/ - * - * ShaderUtils currently contains: - * - * fresnel - * normal - * cube - * - */ - -if ( THREE.WebGLRenderer ) { - -THREE.ShaderUtils = { - - lib: { - - /* ------------------------------------------------------------------------- - // Fresnel shader - // - based on Nvidia Cg tutorial - ------------------------------------------------------------------------- */ - - 'fresnel': { - - uniforms: { - - "mRefractionRatio": { type: "f", value: 1.02 }, - "mFresnelBias": { type: "f", value: 0.1 }, - "mFresnelPower": { type: "f", value: 2.0 }, - "mFresnelScale": { type: "f", value: 1.0 }, - "tCube": { type: "t", value: 1, texture: null } - - }, - - fragmentShader: [ - - "uniform samplerCube tCube;", - - "varying vec3 vReflect;", - "varying vec3 vRefract[3];", - "varying float vReflectionFactor;", - - "void main() {", - - "vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );", - "vec4 refractedColor = vec4( 1.0, 1.0, 1.0, 1.0 );", - - "refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;", - "refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;", - "refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;", - "refractedColor.a = 1.0;", - - "gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );", - - "}" - - ].join("\n"), - - vertexShader: [ - - "uniform float mRefractionRatio;", - "uniform float mFresnelBias;", - "uniform float mFresnelScale;", - "uniform float mFresnelPower;", - - "varying vec3 vReflect;", - "varying vec3 vRefract[3];", - "varying float vReflectionFactor;", - - "void main() {", - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - "vec4 mPosition = objectMatrix * vec4( position, 1.0 );", - - "vec3 nWorld = normalize ( mat3( objectMatrix[0].xyz, objectMatrix[1].xyz, objectMatrix[2].xyz ) * normal );", - - "vec3 I = mPosition.xyz - cameraPosition;", - - "vReflect = reflect( I, nWorld );", - "vRefract[0] = refract( normalize( I ), nWorld, mRefractionRatio );", - "vRefract[1] = refract( normalize( I ), nWorld, mRefractionRatio * 0.99 );", - "vRefract[2] = refract( normalize( I ), nWorld, mRefractionRatio * 0.98 );", - "vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), nWorld ), mFresnelPower );", - - "gl_Position = projectionMatrix * mvPosition;", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Normal map shader - // - Blinn-Phong - // - normal + diffuse + specular + AO + displacement + reflection + shadow maps - // - point and directional lights (use with "lights: true" material option) - ------------------------------------------------------------------------- */ - - 'normal' : { - - uniforms: THREE.UniformsUtils.merge( [ - - THREE.UniformsLib[ "fog" ], - THREE.UniformsLib[ "lights" ], - THREE.UniformsLib[ "shadowmap" ], - - { - - "enableAO" : { type: "i", value: 0 }, - "enableDiffuse" : { type: "i", value: 0 }, - "enableSpecular" : { type: "i", value: 0 }, - "enableReflection": { type: "i", value: 0 }, - - "tDiffuse" : { type: "t", value: 0, texture: null }, - "tCube" : { type: "t", value: 1, texture: null }, - "tNormal" : { type: "t", value: 2, texture: null }, - "tSpecular" : { type: "t", value: 3, texture: null }, - "tAO" : { type: "t", value: 4, texture: null }, - "tDisplacement": { type: "t", value: 5, texture: null }, - - "uNormalScale": { type: "f", value: 1.0 }, - - "uDisplacementBias": { type: "f", value: 0.0 }, - "uDisplacementScale": { type: "f", value: 1.0 }, - - "uDiffuseColor": { type: "c", value: new THREE.Color( 0xeeeeee ) }, - "uSpecularColor": { type: "c", value: new THREE.Color( 0x111111 ) }, - "uAmbientColor": { type: "c", value: new THREE.Color( 0x050505 ) }, - "uShininess": { type: "f", value: 30 }, - "uOpacity": { type: "f", value: 1 }, - - "uReflectivity": { type: "f", value: 0.5 }, - - "uOffset" : { type: "v2", value: new THREE.Vector2( 0, 0 ) }, - "uRepeat" : { type: "v2", value: new THREE.Vector2( 1, 1 ) }, - - "wrapRGB" : { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) } - - } - - ] ), - - fragmentShader: [ - - "uniform vec3 uAmbientColor;", - "uniform vec3 uDiffuseColor;", - "uniform vec3 uSpecularColor;", - "uniform float uShininess;", - "uniform float uOpacity;", - - "uniform bool enableDiffuse;", - "uniform bool enableSpecular;", - "uniform bool enableAO;", - "uniform bool enableReflection;", - - "uniform sampler2D tDiffuse;", - "uniform sampler2D tNormal;", - "uniform sampler2D tSpecular;", - "uniform sampler2D tAO;", - - "uniform samplerCube tCube;", - - "uniform float uNormalScale;", - "uniform float uReflectivity;", - - "varying vec3 vTangent;", - "varying vec3 vBinormal;", - "varying vec3 vNormal;", - "varying vec2 vUv;", - - "uniform vec3 ambientLightColor;", - - "#if MAX_DIR_LIGHTS > 0", - "uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];", - "uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];", - "#endif", - - "#if MAX_POINT_LIGHTS > 0", - "uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];", - "varying vec4 vPointLight[ MAX_POINT_LIGHTS ];", - "#endif", - - "#ifdef WRAP_AROUND", - "uniform vec3 wrapRGB;", - "#endif", - - "varying vec3 vViewPosition;", - - THREE.ShaderChunk[ "shadowmap_pars_fragment" ], - THREE.ShaderChunk[ "fog_pars_fragment" ], - - "void main() {", - - "gl_FragColor = vec4( vec3( 1.0 ), uOpacity );", - - "vec3 specularTex = vec3( 1.0 );", - - "vec3 normalTex = texture2D( tNormal, vUv ).xyz * 2.0 - 1.0;", - "normalTex.xy *= uNormalScale;", - "normalTex = normalize( normalTex );", - - "if( enableDiffuse ) {", - - "#ifdef GAMMA_INPUT", - - "vec4 texelColor = texture2D( tDiffuse, vUv );", - "texelColor.xyz *= texelColor.xyz;", - - "gl_FragColor = gl_FragColor * texelColor;", - - "#else", - - "gl_FragColor = gl_FragColor * texture2D( tDiffuse, vUv );", - - "#endif", - - "}", - - "if( enableAO ) {", - - "#ifdef GAMMA_INPUT", - - "vec4 aoColor = texture2D( tAO, vUv );", - "aoColor.xyz *= aoColor.xyz;", - - "gl_FragColor.xyz = gl_FragColor.xyz * aoColor.xyz;", - - "#else", - - "gl_FragColor.xyz = gl_FragColor.xyz * texture2D( tAO, vUv ).xyz;", - - "#endif", - - "}", - - "if( enableSpecular )", - "specularTex = texture2D( tSpecular, vUv ).xyz;", - - "mat3 tsb = mat3( normalize( vTangent ), normalize( vBinormal ), normalize( vNormal ) );", - "vec3 finalNormal = tsb * normalTex;", - - "vec3 normal = normalize( finalNormal );", - "vec3 viewPosition = normalize( vViewPosition );", - - // point lights - - "#if MAX_POINT_LIGHTS > 0", - - "vec3 pointDiffuse = vec3( 0.0 );", - "vec3 pointSpecular = vec3( 0.0 );", - - "for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {", - - "vec3 pointVector = normalize( vPointLight[ i ].xyz );", - "float pointDistance = vPointLight[ i ].w;", - - // diffuse - - "#ifdef WRAP_AROUND", - - "float pointDiffuseWeightFull = max( dot( normal, pointVector ), 0.0 );", - "float pointDiffuseWeightHalf = max( 0.5 * dot( normal, pointVector ) + 0.5, 0.0 );", - - "vec3 pointDiffuseWeight = mix( vec3 ( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );", - - "#else", - - "float pointDiffuseWeight = max( dot( normal, pointVector ), 0.0 );", - - "#endif", - - "pointDiffuse += pointDistance * pointLightColor[ i ] * uDiffuseColor * pointDiffuseWeight;", - - // specular - - "vec3 pointHalfVector = normalize( pointVector + viewPosition );", - "float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );", - "float pointSpecularWeight = specularTex.r * max( pow( pointDotNormalHalf, uShininess ), 0.0 );", - - "pointSpecular += pointDistance * pointLightColor[ i ] * uSpecularColor * pointSpecularWeight * pointDiffuseWeight;", - - "}", - - "#endif", - - // directional lights - - "#if MAX_DIR_LIGHTS > 0", - - "vec3 dirDiffuse = vec3( 0.0 );", - "vec3 dirSpecular = vec3( 0.0 );", - - "for( int i = 0; i < MAX_DIR_LIGHTS; i++ ) {", - - "vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );", - "vec3 dirVector = normalize( lDirection.xyz );", - - // diffuse - - "#ifdef WRAP_AROUND", - - "float directionalLightWeightingFull = max( dot( normal, dirVector ), 0.0 );", - "float directionalLightWeightingHalf = max( 0.5 * dot( normal, dirVector ) + 0.5, 0.0 );", - - "vec3 dirDiffuseWeight = mix( vec3( directionalLightWeightingFull ), vec3( directionalLightWeightingHalf ), wrapRGB );", - - "#else", - - "float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );", - - "#endif", - - "dirDiffuse += directionalLightColor[ i ] * uDiffuseColor * dirDiffuseWeight;", - - // specular - - "vec3 dirHalfVector = normalize( dirVector + viewPosition );", - "float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );", - "float dirSpecularWeight = specularTex.r * max( pow( dirDotNormalHalf, uShininess ), 0.0 );", - - "dirSpecular += directionalLightColor[ i ] * uSpecularColor * dirSpecularWeight * dirDiffuseWeight;", - - "}", - - "#endif", - - // all lights contribution summation - - "vec3 totalDiffuse = vec3( 0.0 );", - "vec3 totalSpecular = vec3( 0.0 );", - - "#if MAX_DIR_LIGHTS > 0", - - "totalDiffuse += dirDiffuse;", - "totalSpecular += dirSpecular;", - - "#endif", - - "#if MAX_POINT_LIGHTS > 0", - - "totalDiffuse += pointDiffuse;", - "totalSpecular += pointSpecular;", - - "#endif", - - "gl_FragColor.xyz = gl_FragColor.xyz * ( totalDiffuse + ambientLightColor * uAmbientColor) + totalSpecular;", - - "if ( enableReflection ) {", - - "vec3 wPos = cameraPosition - vViewPosition;", - "vec3 vReflect = reflect( normalize( wPos ), normal );", - - "vec4 cubeColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );", - - "#ifdef GAMMA_INPUT", - - "cubeColor.xyz *= cubeColor.xyz;", - - "#endif", - - "gl_FragColor.xyz = mix( gl_FragColor.xyz, cubeColor.xyz, specularTex.r * uReflectivity );", - - "}", - - THREE.ShaderChunk[ "shadowmap_fragment" ], - THREE.ShaderChunk[ "linear_to_gamma_fragment" ], - THREE.ShaderChunk[ "fog_fragment" ], - - "}" - - ].join("\n"), - - vertexShader: [ - - "attribute vec4 tangent;", - - "uniform vec2 uOffset;", - "uniform vec2 uRepeat;", - - "#ifdef VERTEX_TEXTURES", - - "uniform sampler2D tDisplacement;", - "uniform float uDisplacementScale;", - "uniform float uDisplacementBias;", - - "#endif", - - "varying vec3 vTangent;", - "varying vec3 vBinormal;", - "varying vec3 vNormal;", - "varying vec2 vUv;", - - "#if MAX_POINT_LIGHTS > 0", - - "uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];", - "uniform float pointLightDistance[ MAX_POINT_LIGHTS ];", - - "varying vec4 vPointLight[ MAX_POINT_LIGHTS ];", - - "#endif", - - "varying vec3 vViewPosition;", - - THREE.ShaderChunk[ "shadowmap_pars_vertex" ], - - "void main() {", - - "vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );", - - "vViewPosition = -mvPosition.xyz;", - - // normal, tangent and binormal vectors - - "vNormal = normalMatrix * normal;", - "vTangent = normalMatrix * tangent.xyz;", - "vBinormal = cross( vNormal, vTangent ) * tangent.w;", - - "vUv = uv * uRepeat + uOffset;", - - // point lights - - "#if MAX_POINT_LIGHTS > 0", - - "for( int i = 0; i < MAX_POINT_LIGHTS; i++ ) {", - - "vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );", - "vec3 lVector = lPosition.xyz - mvPosition.xyz;", - - "float lDistance = 1.0;", - "if ( pointLightDistance[ i ] > 0.0 )", - "lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );", - - "lVector = normalize( lVector );", - - "vPointLight[ i ] = vec4( lVector, lDistance );", - - "}", - - "#endif", - - // displacement mapping - - "#ifdef VERTEX_TEXTURES", - - "vec3 dv = texture2D( tDisplacement, uv ).xyz;", - "float df = uDisplacementScale * dv.x + uDisplacementBias;", - "vec4 displacedPosition = vec4( normalize( vNormal.xyz ) * df, 0.0 ) + mvPosition;", - "gl_Position = projectionMatrix * displacedPosition;", - - "#else", - - "gl_Position = projectionMatrix * mvPosition;", - - "#endif", - - THREE.ShaderChunk[ "shadowmap_vertex" ], - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Cube map shader - ------------------------------------------------------------------------- */ - - 'cube': { - - uniforms: { "tCube": { type: "t", value: 1, texture: null }, - "tFlip": { type: "f", value: -1 } }, - - vertexShader: [ - - "varying vec3 vViewPosition;", - - "void main() {", - - "vec4 mPosition = objectMatrix * vec4( position, 1.0 );", - "vViewPosition = cameraPosition - mPosition.xyz;", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform samplerCube tCube;", - "uniform float tFlip;", - - "varying vec3 vViewPosition;", - - "void main() {", - - "vec3 wPos = cameraPosition - vViewPosition;", - "gl_FragColor = textureCube( tCube, vec3( tFlip * wPos.x, wPos.yz ) );", - - "}" - - ].join("\n") - - } - - } - -}; - -};/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.BufferGeometry = function () { - - this.id = THREE.GeometryCount ++; - - // GL buffers - - this.vertexIndexBuffer = null; - this.vertexPositionBuffer = null; - this.vertexNormalBuffer = null; - this.vertexUvBuffer = null; - this.vertexColorBuffer = null; - - // typed arrays (kept only if dynamic flag is set) - - this.vertexIndexArray = null; - this.vertexPositionArray = null; - this.vertexNormalArray = null; - this.vertexUvArray = null; - this.vertexColorArray = null; - - this.dynamic = false; - - // boundings - - this.boundingBox = null; - this.boundingSphere = null; - - // for compatibility - - this.morphTargets = []; - -}; - -THREE.BufferGeometry.prototype = { - - constructor : THREE.BufferGeometry, - - // for compatibility - - computeBoundingBox: function () { - - }, - - // for compatibility - - computeBoundingSphere: function () { - - } - - -}; - -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Extensible curve object - * - * Some common of Curve methods - * .getPoint(t), getTangent(t) - * .getPointAt(u), getTagentAt(u) - * .getPoints(), .getSpacedPoints() - * .getLength() - * - * This file contains following classes: - * - * -- 2d classes -- - * THREE.Curve - * THREE.LineCurve - * THREE.QuadraticBezierCurve - * THREE.CubicBezierCurve - * THREE.SplineCurve - * THREE.ArcCurve - * - * -- 3d classes -- - * THREE.LineCurve3 - * THREE.QuadraticBezierCurve3 - * THREE.CubicBezierCurve3 - * THREE.SplineCurve3 - * - **/ - -/************************************************************** - * Abstract Curve base class - **************************************************************/ - -THREE.Curve = function () { - -}; - -// Virtual base class method to overwrite and implement in subclasses -// - t [0 .. 1] - -THREE.Curve.prototype.getPoint = function ( t ) { - - console.log( "Warning, getPoint() not implemented!" ); - return null; - -}; - -// Get point at relative position in curve according to arc length -// - u [0 .. 1] - -THREE.Curve.prototype.getPointAt = function ( u ) { - - var t = this.getUtoTmapping( u ); - return this.getPoint( t ); - -}; - -// Get sequence of points using getPoint( t ) - -THREE.Curve.prototype.getPoints = function ( divisions ) { - - if ( !divisions ) divisions = 5; - - var d, pts = []; - - for ( d = 0; d <= divisions; d ++ ) { - - pts.push( this.getPoint( d / divisions ) ); - - }; - - return pts; - -}; - -// Get sequence of points using getPointAt( u ) - -THREE.Curve.prototype.getSpacedPoints = function ( divisions ) { - - if ( !divisions ) divisions = 5; - - var d, pts = []; - - for ( d = 0; d <= divisions; d ++ ) { - - pts.push( this.getPointAt( d / divisions ) ); - - }; - - return pts; - -}; - -// Get total curve length - -THREE.Curve.prototype.getLength = function () { - - var lengths = this.getLengths(); - return lengths[ lengths.length - 1 ]; - -}; - -// Get list of cumulative segment lengths - -THREE.Curve.prototype.getLengths = function ( divisions ) { - - if ( !divisions ) divisions = 200; - - if ( this.cacheArcLengths && ( this.cacheArcLengths.length == divisions + 1 ) ) { - - //console.log( "cached", this.cacheArcLengths ); - return this.cacheArcLengths; - - } - - var cache = []; - var current, last = this.getPoint( 0 ); - var p, sum = 0; - - cache.push( 0 ); - - for ( p = 1; p <= divisions; p ++ ) { - - current = this.getPoint ( p / divisions ); - sum += current.distanceTo( last ); - cache.push( sum ); - last = current; - - } - - this.cacheArcLengths = cache; - - return cache; // { sums: cache, sum:sum }; Sum is in the last element. - -}; - -// Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equi distance - -THREE.Curve.prototype.getUtoTmapping = function ( u, distance ) { - - var arcLengths = this.getLengths(); - - var i = 0, il = arcLengths.length; - - var targetArcLength; // The targeted u distance value to get - - if ( distance ) { - - targetArcLength = distance; - - } else { - - targetArcLength = u * arcLengths[ il - 1 ]; - - } - - //var time = Date.now(); - - // binary search for the index with largest value smaller than target u distance - - var low = 0, high = il - 1, comparison; - - while ( low <= high ) { - - i = Math.floor( low + ( high - low ) / 2 ); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats - - comparison = arcLengths[ i ] - targetArcLength; - - if ( comparison < 0 ) { - - low = i + 1; - continue; - - } else if ( comparison > 0 ) { - - high = i - 1; - continue; - - } else { - - high = i; - break; - - // DONE - - } - - } - - i = high; - - //console.log('b' , i, low, high, Date.now()- time); - - if ( arcLengths[ i ] == targetArcLength ) { - - var t = i / ( il - 1 ); - return t; - - } - - // we could get finer grain at lengths, or use simple interpolatation between two points - - var lengthBefore = arcLengths[ i ]; - var lengthAfter = arcLengths[ i + 1 ]; - - var segmentLength = lengthAfter - lengthBefore; - - // determine where we are between the 'before' and 'after' points - - var segmentFraction = ( targetArcLength - lengthBefore ) / segmentLength; - - // add that fractional amount to t - - t = ( i + segmentFraction ) / ( il -1 ); - - return t; - -}; - -// In case any sub curve does not implement its tangent / normal finding, -// we get 2 points with a small delta and find a gradient of the 2 points -// which seems to make a reasonable approximation - -THREE.Curve.prototype.getNormalVector = function( t ) { - - var vec = this.getTangent( t ); - - return new THREE.Vector2( -vec.y , vec.x ); - -}; - -// Returns a unit vector tangent at t - -THREE.Curve.prototype.getTangent = function( t ) { - - var delta = 0.0001; - var t1 = t - delta; - var t2 = t + delta; - - // Capping in case of danger - - if ( t1 < 0 ) t1 = 0; - if ( t2 > 1 ) t2 = 1; - - var pt1 = this.getPoint( t1 ); - var pt2 = this.getPoint( t2 ); - - var vec = pt1.clone().subSelf(pt2); - return vec.normalize(); - -}; - - -THREE.Curve.prototype.getTangentAt = function ( u ) { - - var t = this.getUtoTmapping( u ); - return this.getTangent( t ); - -}; - -/************************************************************** - * Line - **************************************************************/ - -THREE.LineCurve = function ( v1, v2 ) { - - if ( ! ( v1 instanceof THREE.Vector2 ) ) { - - // Fall back for old constuctor signature - should be removed over time - - THREE.LineCurve.oldConstructor.apply( this, arguments ); - return; - - } - - this.v1 = v1; - this.v2 = v2; - -}; - -THREE.LineCurve.oldConstructor = function ( x1, y1, x2, y2 ) { - - this.constructor( new THREE.Vector2( x1, y1 ), new THREE.Vector2( x2, y2 ) ); - -}; - -THREE.LineCurve.prototype = new THREE.Curve(); -THREE.LineCurve.prototype.constructor = THREE.LineCurve; - -THREE.LineCurve.prototype.getPoint = function ( t ) { - - var point = new THREE.Vector2(); - - point.sub( this.v2, this.v1 ); - point.multiplyScalar( t ).addSelf( this.v1 ); - - return point; - -}; - -// Line curve is linear, so we can overwrite default getPointAt - -THREE.LineCurve.prototype.getPointAt = function ( u ) { - - return this.getPoint( u ); - -}; - -THREE.LineCurve.prototype.getTangent = function( t ) { - - var tangent = new THREE.Vector2(); - - tangent.sub( this.v2, this.v1 ); - tangent.normalize(); - - return tangent; - -}; - -/************************************************************** - * Quadratic Bezier curve - **************************************************************/ - - -THREE.QuadraticBezierCurve = function ( v0, v1, v2 ) { - - if ( !( v1 instanceof THREE.Vector2 ) ) { - - var args = Array.prototype.slice.call( arguments ); - - v0 = new THREE.Vector2( args[ 0 ], args[ 1 ] ); - v1 = new THREE.Vector2( args[ 2 ], args[ 3 ] ); - v2 = new THREE.Vector2( args[ 4 ], args[ 5 ] ); - - } - - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - -}; - -THREE.QuadraticBezierCurve.prototype = new THREE.Curve(); -THREE.QuadraticBezierCurve.prototype.constructor = THREE.QuadraticBezierCurve; - - -THREE.QuadraticBezierCurve.prototype.getPoint = function ( t ) { - - var tx, ty; - - tx = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x ); - ty = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y ); - - return new THREE.Vector2( tx, ty ); - -}; - - -THREE.QuadraticBezierCurve.prototype.getTangent = function( t ) { - - // iterate sub segments - // get lengths for sub segments - // if segment is bezier - // perform subdivisions - - var tx, ty; - - tx = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.x, this.v1.x, this.v2.x ); - ty = THREE.Curve.Utils.tangentQuadraticBezier( t, this.v0.y, this.v1.y, this.v2.y ); - - // returns unit vector - - var tangent = new THREE.Vector2( tx, ty ); - tangent.normalize(); - - return tangent; - -}; - - -/************************************************************** - * Cubic Bezier curve - **************************************************************/ - -THREE.CubicBezierCurve = function ( v0, v1, v2, v3 ) { - - if ( ! ( v1 instanceof THREE.Vector2 ) ) { - - var args = Array.prototype.slice.call( arguments ); - - v0 = new THREE.Vector2( args[ 0 ], args[ 1 ] ); - v1 = new THREE.Vector2( args[ 2 ], args[ 3 ] ); - v2 = new THREE.Vector2( args[ 4 ], args[ 5 ] ); - v3 = new THREE.Vector2( args[ 6 ], args[ 7 ] ); - - } - - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - -}; - -THREE.CubicBezierCurve.prototype = new THREE.Curve(); -THREE.CubicBezierCurve.prototype.constructor = THREE.CubicBezierCurve; - -THREE.CubicBezierCurve.prototype.getPoint = function ( t ) { - - var tx, ty; - - tx = THREE.Shape.Utils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ); - ty = THREE.Shape.Utils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ); - - return new THREE.Vector2( tx, ty ); - -}; - -THREE.CubicBezierCurve.prototype.getTangent = function( t ) { - - var tx, ty; - - tx = THREE.Curve.Utils.tangentCubicBezier( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ); - ty = THREE.Curve.Utils.tangentCubicBezier( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ); - - // return normal unit vector - - var tangent = new THREE.Vector2( tx, ty ); - tangent.normalize(); - - return tangent; - -}; - - -/************************************************************** - * Spline curve - **************************************************************/ - -THREE.SplineCurve = function ( points /* array of Vector2 */ ) { - - this.points = (points == undefined) ? [] : points; - -}; - -THREE.SplineCurve.prototype = new THREE.Curve(); -THREE.SplineCurve.prototype.constructor = THREE.SplineCurve; - -THREE.SplineCurve.prototype.getPoint = function ( t ) { - - var v = new THREE.Vector2(); - var c = []; - var points = this.points, point, intPoint, weight; - point = ( points.length - 1 ) * t; - - intPoint = Math.floor( point ); - weight = point - intPoint; - - c[ 0 ] = intPoint == 0 ? intPoint : intPoint - 1; - c[ 1 ] = intPoint; - c[ 2 ] = intPoint > points.length - 2 ? intPoint : intPoint + 1; - c[ 3 ] = intPoint > points.length - 3 ? intPoint : intPoint + 2; - - v.x = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].x, points[ c[ 1 ] ].x, points[ c[ 2 ] ].x, points[ c[ 3 ] ].x, weight ); - v.y = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].y, points[ c[ 1 ] ].y, points[ c[ 2 ] ].y, points[ c[ 3 ] ].y, weight ); - - return v; - -}; - -/************************************************************** - * Arc curve - **************************************************************/ - -THREE.ArcCurve = function ( aX, aY, aRadius, - aStartAngle, aEndAngle, - aClockwise ) { - - this.aX = aX; - this.aY = aY; - - this.aRadius = aRadius; - - this.aStartAngle = aStartAngle; - this.aEndAngle = aEndAngle; - - this.aClockwise = aClockwise; - -}; - -THREE.ArcCurve.prototype = new THREE.Curve(); -THREE.ArcCurve.prototype.constructor = THREE.ArcCurve; - -THREE.ArcCurve.prototype.getPoint = function ( t ) { - - var deltaAngle = this.aEndAngle - this.aStartAngle; - - if ( !this.aClockwise ) { - - t = 1 - t; - - } - - var angle = this.aStartAngle + t * deltaAngle; - - var tx = this.aX + this.aRadius * Math.cos( angle ); - var ty = this.aY + this.aRadius * Math.sin( angle ); - - return new THREE.Vector2( tx, ty ); - -}; - -/************************************************************** - * Utils - **************************************************************/ - -THREE.Curve.Utils = { - - tangentQuadraticBezier: function ( t, p0, p1, p2 ) { - - return 2 * ( 1 - t ) * ( p1 - p0 ) + 2 * t * ( p2 - p1 ); - - }, - - // Puay Bing, thanks for helping with this derivative! - - tangentCubicBezier: function (t, p0, p1, p2, p3 ) { - - return -3 * p0 * (1 - t) * (1 - t) + - 3 * p1 * (1 - t) * (1-t) - 6 *t *p1 * (1-t) + - 6 * t * p2 * (1-t) - 3 * t * t * p2 + - 3 * t * t * p3; - }, - - - tangentSpline: function ( t, p0, p1, p2, p3 ) { - - // To check if my formulas are correct - - var h00 = 6 * t * t - 6 * t; // derived from 2t^3 − 3t^2 + 1 - var h10 = 3 * t * t - 4 * t + 1; // t^3 − 2t^2 + t - var h01 = -6 * t * t + 6 * t; // − 2t3 + 3t2 - var h11 = 3 * t * t - 2 * t; // t3 − t2 - - return h00 + h10 + h01 + h11; - - }, - - // Catmull-Rom - - interpolate: function( p0, p1, p2, p3, t ) { - - var v0 = ( p2 - p0 ) * 0.5; - var v1 = ( p3 - p1 ) * 0.5; - var t2 = t * t; - var t3 = t * t2; - return ( 2 * p1 - 2 * p2 + v0 + v1 ) * t3 + ( - 3 * p1 + 3 * p2 - 2 * v0 - v1 ) * t2 + v0 * t + p1; - - } - -}; - - -/* -getPoint DONE -getLength DONE -getLengths DONE - -curve.getPoints(); DONE -curve.getPointAtArcLength(t); DONE -curve.transform(params); -curve.getTangentAt(t); DONE -*/ - -/************************************************************** - * 3D Curves - **************************************************************/ - -// A Factory method for creating new curve subclasses - -THREE.Curve.create = function( constructor, getPointFunc ) { - - var subClass = constructor; - - subClass.prototype = new THREE.Curve(); - - subClass.prototype.constructor = constructor; - subClass.prototype.getPoint = getPointFunc; - - return subClass; - -}; - - -/************************************************************** - * Line3D - **************************************************************/ - -THREE.LineCurve3 = THREE.Curve.create( - - function ( v1, v2 ) { - - this.v1 = v1; - this.v2 = v2; - - }, - - function ( t ) { - - var r = new THREE.Vector3(); - - - r.sub( this.v2, this.v1 ); // diff - r.multiplyScalar( t ); - r.addSelf( this.v1 ); - - return r; - - } - -); - - -/************************************************************** - * Quadratic Bezier 3D curve - **************************************************************/ - -THREE.QuadraticBezierCurve3 = THREE.Curve.create( - - function ( v0, v1, v2 ) { - - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - - }, - - function ( t ) { - - var tx, ty, tz; - - tx = THREE.Shape.Utils.b2( t, this.v0.x, this.v1.x, this.v2.x ); - ty = THREE.Shape.Utils.b2( t, this.v0.y, this.v1.y, this.v2.y ); - tz = THREE.Shape.Utils.b2( t, this.v0.z, this.v1.z, this.v2.z ); - - return new THREE.Vector3( tx, ty, tz ); - - } - -); - - - -/************************************************************** - * Cubic Bezier 3D curve - **************************************************************/ - -THREE.CubicBezierCurve3 = THREE.Curve.create( - - function ( v0, v1, v2, v3 ) { - - this.v0 = v0; - this.v1 = v1; - this.v2 = v2; - this.v3 = v3; - - }, - - function ( t ) { - - var tx, ty, tz; - - tx = THREE.Shape.Utils.b3( t, this.v0.x, this.v1.x, this.v2.x, this.v3.x ); - ty = THREE.Shape.Utils.b3( t, this.v0.y, this.v1.y, this.v2.y, this.v3.y ); - tz = THREE.Shape.Utils.b3( t, this.v0.z, this.v1.z, this.v2.z, this.v3.z ); - - return new THREE.Vector3( tx, ty, tz ); - - } - -); - - - -/************************************************************** - * Spline 3D curve - **************************************************************/ - - -THREE.SplineCurve3 = THREE.Curve.create( - - function ( points /* array of Vector3 */) { - - this.points = (points == undefined) ? [] : points; - - }, - - function ( t ) { - - var v = new THREE.Vector3(); - var c = []; - var points = this.points, point, intPoint, weight; - point = ( points.length - 1 ) * t; - - intPoint = Math.floor( point ); - weight = point - intPoint; - - c[ 0 ] = intPoint == 0 ? intPoint : intPoint - 1; - c[ 1 ] = intPoint; - c[ 2 ] = intPoint > points.length - 2 ? intPoint : intPoint + 1; - c[ 3 ] = intPoint > points.length - 3 ? intPoint : intPoint + 2; - - v.x = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].x, points[ c[ 1 ] ].x, points[ c[ 2 ] ].x, points[ c[ 3 ] ].x, weight ); - v.y = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].y, points[ c[ 1 ] ].y, points[ c[ 2 ] ].y, points[ c[ 3 ] ].y, weight ); - v.z = THREE.Curve.Utils.interpolate( points[ c[ 0 ] ].z, points[ c[ 1 ] ].z, points[ c[ 2 ] ].z, points[ c[ 3 ] ].z, weight ); - - return v; - - } - -); -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - **/ - -/************************************************************** - * Curved Path - a curve path is simply a array of connected - * curves, but retains the api of a curve - **************************************************************/ - -THREE.CurvePath = function () { - - this.curves = []; - this.bends = []; - - this.autoClose = false; // Automatically closes the path -}; - -THREE.CurvePath.prototype = new THREE.Curve(); -THREE.CurvePath.prototype.constructor = THREE.CurvePath; - -THREE.CurvePath.prototype.add = function ( curve ) { - - this.curves.push( curve ); - -}; - -THREE.CurvePath.prototype.checkConnection = function() { - // TODO - // If the ending of curve is not connected to the starting - // or the next curve, then, this is not a real path -}; - -THREE.CurvePath.prototype.closePath = function() { - // TODO Test - // and verify for vector3 (needs to implement equals) - // Add a line curve if start and end of lines are not connected - var startPoint = this.curves[0].getPoint(0); - var endPoint = this.curves[this.curves.length-1].getPoint(1); - - if (!startPoint.equals(endPoint)) { - this.curves.push( new THREE.LineCurve(endPoint, startPoint) ); - } - -}; - -// To get accurate point with reference to -// entire path distance at time t, -// following has to be done: - -// 1. Length of each sub path have to be known -// 2. Locate and identify type of curve -// 3. Get t for the curve -// 4. Return curve.getPointAt(t') - -THREE.CurvePath.prototype.getPoint = function( t ) { - - var d = t * this.getLength(); - var curveLengths = this.getCurveLengths(); - var i = 0, diff, curve; - - // To think about boundaries points. - - while ( i < curveLengths.length ) { - - if ( curveLengths[ i ] >= d ) { - - diff = curveLengths[ i ] - d; - curve = this.curves[ i ]; - - var u = 1 - diff / curve.getLength(); - - return curve.getPointAt( u ); - - break; - } - - i ++; - - } - - return null; - - // loop where sum != 0, sum > d , sum+1 maxX ) maxX = p.x; - else if ( p.x < minX ) minX = p.x; - - if ( p.y > maxY ) maxY = p.y; - else if ( p.y < maxY ) minY = p.y; - - sum.addSelf( p.x, p.y ); - - } - - return { - - minX: minX, - minY: minY, - maxX: maxX, - maxY: maxY, - centroid: sum.divideScalar( il ) - - }; - -}; - -/************************************************************** - * Create Geometries Helpers - **************************************************************/ - -/// Generate geometry from path points (for Line or ParticleSystem objects) - -THREE.CurvePath.prototype.createPointsGeometry = function( divisions ) { - - var pts = this.getPoints( divisions, true ); - return this.createGeometry( pts ); - -}; - -// Generate geometry from equidistance sampling along the path - -THREE.CurvePath.prototype.createSpacedPointsGeometry = function( divisions ) { - - var pts = this.getSpacedPoints( divisions, true ); - return this.createGeometry( pts ); - -}; - -THREE.CurvePath.prototype.createGeometry = function( points ) { - - var geometry = new THREE.Geometry(); - - for( var i = 0; i < points.length; i ++ ) { - - geometry.vertices.push( new THREE.Vertex( new THREE.Vector3( points[ i ].x, points[ i ].y, 0 ) ) ); - - } - - return geometry; - -}; - - -/************************************************************** - * Bend / Wrap Helper Methods - **************************************************************/ - -// Wrap path / Bend modifiers? - -THREE.CurvePath.prototype.addWrapPath = function ( bendpath ) { - - this.bends.push( bendpath ); - -}; - -THREE.CurvePath.prototype.getTransformedPoints = function( segments, bends ) { - - var oldPts = this.getPoints( segments ); // getPoints getSpacedPoints - var i, il; - - if ( !bends ) { - - bends = this.bends; - - } - - for ( i = 0, il = bends.length; i < il; i ++ ) { - - oldPts = this.getWrapPoints( oldPts, bends[ i ] ); - - } - - return oldPts; - -}; - -THREE.CurvePath.prototype.getTransformedSpacedPoints = function( segments, bends ) { - - var oldPts = this.getSpacedPoints( segments ); - - var i, il; - - if ( !bends ) { - - bends = this.bends; - - } - - for ( i = 0, il = bends.length; i < il; i ++ ) { - - oldPts = this.getWrapPoints( oldPts, bends[ i ] ); - - } - - return oldPts; - -}; - -// This returns getPoints() bend/wrapped around the contour of a path. -// Read http://www.planetclegg.com/projects/WarpingTextToSplines.html - -THREE.CurvePath.prototype.getWrapPoints = function ( oldPts, path ) { - - var bounds = this.getBoundingBox(); - - var i, il, p, oldX, oldY, xNorm; - - for ( i = 0, il = oldPts.length; i < il; i ++ ) { - - p = oldPts[ i ]; - - oldX = p.x; - oldY = p.y; - - xNorm = oldX / bounds.maxX; - - // If using actual distance, for length > path, requires line extrusions - //xNorm = path.getUtoTmapping(xNorm, oldX); // 3 styles. 1) wrap stretched. 2) wrap stretch by arc length 3) warp by actual distance - - xNorm = path.getUtoTmapping( xNorm, oldX ); - - // check for out of bounds? - - var pathPt = path.getPoint( xNorm ); - var normal = path.getNormalVector( xNorm ).multiplyScalar( oldY ); - - p.x = pathPt.x + normal.x; - p.y = pathPt.y + normal.y; - - } - - return oldPts; - -}; - -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.Gyroscope = function () { - - THREE.Object3D.call( this ); - -}; - - -THREE.Gyroscope.prototype = new THREE.Object3D(); -THREE.Gyroscope.prototype.constructor = THREE.Gyroscope; - -THREE.Gyroscope.prototype.updateMatrixWorld = function ( force ) { - - this.matrixAutoUpdate && this.updateMatrix(); - - // update matrixWorld - - if ( this.matrixWorldNeedsUpdate || force ) { - - if ( this.parent ) { - - this.matrixWorld.multiply( this.parent.matrixWorld, this.matrix ); - - this.matrixWorld.decompose( this.translationWorld, this.rotationWorld, this.scaleWorld ); - this.matrix.decompose( this.translationObject, this.rotationObject, this.scaleObject ); - - this.matrixWorld.compose( this.translationWorld, this.rotationObject, this.scaleWorld ); - - - } else { - - this.matrixWorld.copy( this.matrix ); - - } - - - this.matrixWorldNeedsUpdate = false; - - force = true; - - } - - // update children - - for ( var i = 0, l = this.children.length; i < l; i ++ ) { - - this.children[ i ].updateMatrixWorld( force ); - - } - -}; - -THREE.Gyroscope.prototype.translationWorld = new THREE.Vector3(); -THREE.Gyroscope.prototype.translationObject = new THREE.Vector3(); -THREE.Gyroscope.prototype.rotationWorld = new THREE.Quaternion(); -THREE.Gyroscope.prototype.rotationObject = new THREE.Quaternion(); -THREE.Gyroscope.prototype.scaleWorld = new THREE.Vector3(); -THREE.Gyroscope.prototype.scaleObject = new THREE.Vector3(); - -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Creates free form 2d path using series of points, lines or curves. - * - **/ - -THREE.Path = function ( points ) { - - THREE.CurvePath.call(this); - - this.actions = []; - - if ( points ) { - - this.fromPoints( points ); - - } - -}; - -THREE.Path.prototype = new THREE.CurvePath(); -THREE.Path.prototype.constructor = THREE.Path; - - -THREE.PathActions = { - - MOVE_TO: 'moveTo', - LINE_TO: 'lineTo', - QUADRATIC_CURVE_TO: 'quadraticCurveTo', // Bezier quadratic curve - BEZIER_CURVE_TO: 'bezierCurveTo', // Bezier cubic curve - CSPLINE_THRU: 'splineThru', // Catmull-rom spline - ARC: 'arc' // Circle - -}; - -// TODO Clean up PATH API - -// Create path using straight lines to connect all points -// - vectors: array of Vector2 - -THREE.Path.prototype.fromPoints = function ( vectors ) { - - this.moveTo( vectors[ 0 ].x, vectors[ 0 ].y ); - - for ( var v = 1, vlen = vectors.length; v < vlen; v ++ ) { - - this.lineTo( vectors[ v ].x, vectors[ v ].y ); - - }; - -}; - -// startPath() endPath()? - -THREE.Path.prototype.moveTo = function ( x, y ) { - - var args = Array.prototype.slice.call( arguments ); - this.actions.push( { action: THREE.PathActions.MOVE_TO, args: args } ); - -}; - -THREE.Path.prototype.lineTo = function ( x, y ) { - - var args = Array.prototype.slice.call( arguments ); - - var lastargs = this.actions[ this.actions.length - 1 ].args; - - var x0 = lastargs[ lastargs.length - 2 ]; - var y0 = lastargs[ lastargs.length - 1 ]; - - var curve = new THREE.LineCurve( new THREE.Vector2( x0, y0 ), new THREE.Vector2( x, y ) ); - this.curves.push( curve ); - - this.actions.push( { action: THREE.PathActions.LINE_TO, args: args } ); - -}; - -THREE.Path.prototype.quadraticCurveTo = function( aCPx, aCPy, aX, aY ) { - - var args = Array.prototype.slice.call( arguments ); - - var lastargs = this.actions[ this.actions.length - 1 ].args; - - var x0 = lastargs[ lastargs.length - 2 ]; - var y0 = lastargs[ lastargs.length - 1 ]; - - var curve = new THREE.QuadraticBezierCurve( new THREE.Vector2( x0, y0 ), - new THREE.Vector2( aCPx, aCPy ), - new THREE.Vector2( aX, aY ) ); - this.curves.push( curve ); - - this.actions.push( { action: THREE.PathActions.QUADRATIC_CURVE_TO, args: args } ); - -}; - -THREE.Path.prototype.bezierCurveTo = function( aCP1x, aCP1y, - aCP2x, aCP2y, - aX, aY ) { - - var args = Array.prototype.slice.call( arguments ); - - var lastargs = this.actions[ this.actions.length - 1 ].args; - - var x0 = lastargs[ lastargs.length - 2 ]; - var y0 = lastargs[ lastargs.length - 1 ]; - - var curve = new THREE.CubicBezierCurve( new THREE.Vector2( x0, y0 ), - new THREE.Vector2( aCP1x, aCP1y ), - new THREE.Vector2( aCP2x, aCP2y ), - new THREE.Vector2( aX, aY ) ); - this.curves.push( curve ); - - this.actions.push( { action: THREE.PathActions.BEZIER_CURVE_TO, args: args } ); - -}; - -THREE.Path.prototype.splineThru = function( pts /*Array of Vector*/ ) { - - var args = Array.prototype.slice.call( arguments ); - var lastargs = this.actions[ this.actions.length - 1 ].args; - - var x0 = lastargs[ lastargs.length - 2 ]; - var y0 = lastargs[ lastargs.length - 1 ]; -//--- - var npts = [ new THREE.Vector2( x0, y0 ) ]; - Array.prototype.push.apply( npts, pts ); - - var curve = new THREE.SplineCurve( npts ); - this.curves.push( curve ); - - this.actions.push( { action: THREE.PathActions.CSPLINE_THRU, args: args } ); - -}; - -// FUTURE: Change the API or follow canvas API? -// TODO ARC ( x, y, x - radius, y - radius, startAngle, endAngle ) - -THREE.Path.prototype.arc = function ( aX, aY, aRadius, - aStartAngle, aEndAngle, aClockwise ) { - - var args = Array.prototype.slice.call( arguments ); - - var curve = new THREE.ArcCurve( aX, aY, aRadius, - aStartAngle, aEndAngle, aClockwise ); - this.curves.push( curve ); - - // console.log( 'arc', args ); - - this.actions.push( { action: THREE.PathActions.ARC, args: args } ); - - }; - - -THREE.Path.prototype.getSpacedPoints = function ( divisions, closedPath ) { - - if ( ! divisions ) divisions = 40; - - var points = []; - - for ( var i = 0; i < divisions; i ++ ) { - - points.push( this.getPoint( i / divisions ) ); - - //if( !this.getPoint( i / divisions ) ) throw "DIE"; - - } - - // if ( closedPath ) { - // - // points.push( points[ 0 ] ); - // - // } - - return points; - -}; - -/* Return an array of vectors based on contour of the path */ - -THREE.Path.prototype.getPoints = function( divisions, closedPath ) { - - divisions = divisions || 12; - - var points = []; - - var i, il, item, action, args; - var cpx, cpy, cpx2, cpy2, cpx1, cpy1, cpx0, cpy0, - laste, j, - t, tx, ty; - - for ( i = 0, il = this.actions.length; i < il; i ++ ) { - - item = this.actions[ i ]; - - action = item.action; - args = item.args; - - switch( action ) { - - case THREE.PathActions.MOVE_TO: - - // points.push( new THREE.Vector2( args[ 0 ], args[ 1 ] ) ); - - break; - - case THREE.PathActions.LINE_TO: - - points.push( new THREE.Vector2( args[ 0 ], args[ 1 ] ) ); - - break; - - case THREE.PathActions.QUADRATIC_CURVE_TO: - - cpx = args[ 2 ]; - cpy = args[ 3 ]; - - cpx1 = args[ 0 ]; - cpy1 = args[ 1 ]; - - if ( points.length > 0 ) { - - laste = points[ points.length - 1 ]; - - cpx0 = laste.x; - cpy0 = laste.y; - - } else { - - laste = this.actions[ i - 1 ].args; - - cpx0 = laste[ laste.length - 2 ]; - cpy0 = laste[ laste.length - 1 ]; - - } - - for ( j = 1; j <= divisions; j ++ ) { - - t = j / divisions; - - tx = THREE.Shape.Utils.b2( t, cpx0, cpx1, cpx ); - ty = THREE.Shape.Utils.b2( t, cpy0, cpy1, cpy ); - - points.push( new THREE.Vector2( tx, ty ) ); - - } - - break; - - case THREE.PathActions.BEZIER_CURVE_TO: - - cpx = args[ 4 ]; - cpy = args[ 5 ]; - - cpx1 = args[ 0 ]; - cpy1 = args[ 1 ]; - - cpx2 = args[ 2 ]; - cpy2 = args[ 3 ]; - - if ( points.length > 0 ) { - - laste = points[ points.length - 1 ]; - - cpx0 = laste.x; - cpy0 = laste.y; - - } else { - - laste = this.actions[ i - 1 ].args; - - cpx0 = laste[ laste.length - 2 ]; - cpy0 = laste[ laste.length - 1 ]; - - } - - - for ( j = 1; j <= divisions; j ++ ) { - - t = j / divisions; - - tx = THREE.Shape.Utils.b3( t, cpx0, cpx1, cpx2, cpx ); - ty = THREE.Shape.Utils.b3( t, cpy0, cpy1, cpy2, cpy ); - - points.push( new THREE.Vector2( tx, ty ) ); - - } - - break; - - case THREE.PathActions.CSPLINE_THRU: - - laste = this.actions[ i - 1 ].args; - - var last = new THREE.Vector2( laste[ laste.length - 2 ], laste[ laste.length - 1 ] ); - var spts = [ last ]; - - var n = divisions * args[ 0 ].length; - - spts = spts.concat( args[ 0 ] ); - - var spline = new THREE.SplineCurve( spts ); - - for ( j = 1; j <= n; j ++ ) { - - points.push( spline.getPointAt( j / n ) ) ; - - } - - break; - - case THREE.PathActions.ARC: - - laste = this.actions[ i - 1 ].args; - - var aX = args[ 0 ], aY = args[ 1 ], - aRadius = args[ 2 ], - aStartAngle = args[ 3 ], aEndAngle = args[ 4 ], - aClockwise = !!args[ 5 ]; - - var lastx = laste[ laste.length - 2 ], - lasty = laste[ laste.length - 1 ]; - - if ( laste.length == 0 ) { - - lastx = lasty = 0; - - } - - - var deltaAngle = aEndAngle - aStartAngle; - var angle; - var tdivisions = divisions * 2; - - for ( j = 1; j <= tdivisions; j ++ ) { - - t = j / tdivisions; - - if ( ! aClockwise ) { - - t = 1 - t; - - } - - angle = aStartAngle + t * deltaAngle; - - tx = lastx + aX + aRadius * Math.cos( angle ); - ty = lasty + aY + aRadius * Math.sin( angle ); - - //console.log('t', t, 'angle', angle, 'tx', tx, 'ty', ty); - - points.push( new THREE.Vector2( tx, ty ) ); - - } - - //console.log(points); - - break; - - } // end switch - - } - - if ( closedPath ) { - - points.push( points[ 0 ] ); - - } - - return points; - -}; - - - -// This was used for testing purposes. Should be removed soon. - -THREE.Path.prototype.transform = function( path, segments ) { - - var bounds = this.getBoundingBox(); - var oldPts = this.getPoints( segments ); // getPoints getSpacedPoints - - //console.log( path.cacheArcLengths() ); - //path.getLengths(400); - //segments = 40; - - return this.getWrapPoints( oldPts, path ); - -}; - -// Read http://www.tinaja.com/glib/nonlingr.pdf -// nonlinear transforms - -THREE.Path.prototype.nltransform = function( a, b, c, d, e, f ) { - - // a - horizontal size - // b - lean - // c - x offset - // d - vertical size - // e - climb - // f - y offset - - var oldPts = this.getPoints(); - - var i, il, p, oldX, oldY; - - for ( i = 0, il = oldPts.length; i < il; i ++ ) { - - p = oldPts[i]; - - oldX = p.x; - oldY = p.y; - - p.x = a * oldX + b * oldY + c; - p.y = d * oldY + e * oldX + f; - - } - - return oldPts; - -}; - - -// FUTURE Export JSON Format - -/* Draws this path onto a 2d canvas easily */ - -THREE.Path.prototype.debug = function( canvas ) { - - var bounds = this.getBoundingBox(); - - if ( !canvas ) { - - canvas = document.createElement( "canvas" ); - - canvas.setAttribute( 'width', bounds.maxX + 100 ); - canvas.setAttribute( 'height', bounds.maxY + 100 ); - - document.body.appendChild( canvas ); - - } - - var ctx = canvas.getContext( "2d" ); - ctx.fillStyle = "white"; - ctx.fillRect( 0, 0, canvas.width, canvas.height ); - - ctx.strokeStyle = "black"; - ctx.beginPath(); - - var i, il, item, action, args; - - // Debug Path - - for ( i = 0, il = this.actions.length; i < il; i ++ ) { - - item = this.actions[ i ]; - - args = item.args; - action = item.action; - - // Short hand for now - - if ( action != THREE.PathActions.CSPLINE_THRU ) { - - ctx[ action ].apply( ctx, args ); - - } - - /* - switch ( action ) { - - case THREE.PathActions.MOVE_TO: - - ctx[ action ]( args[ 0 ], args[ 1 ] ); - break; - - case THREE.PathActions.LINE_TO: - - ctx[ action ]( args[ 0 ], args[ 1 ] ); - break; - - case THREE.PathActions.QUADRATIC_CURVE_TO: - - ctx[ action ]( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ] ); - break; - - case THREE.PathActions.CUBIC_CURVE_TO: - - ctx[ action ]( args[ 0 ], args[ 1 ], args[ 2 ], args[ 3 ], args[ 4 ], args[ 5 ] ); - break; - - } - */ - - } - - ctx.stroke(); - ctx.closePath(); - - // Debug Points - - ctx.strokeStyle = "red"; - - /* TO CLEAN UP */ - - var p, points = this.getPoints(); - - for ( i = 0, il = points.length; i < il; i ++ ) { - - p = points[ i ]; - - ctx.beginPath(); - ctx.arc( p.x, p.y, 1.5, 0, Math.PI * 2, false ); - ctx.stroke(); - ctx.closePath(); - - } - -}; - -// Breaks path into shapes - -THREE.Path.prototype.toShapes = function() { - - var i, il, item, action, args; - - var subPaths = [], lastPath = new THREE.Path(); - - for ( i = 0, il = this.actions.length; i < il; i ++ ) { - - item = this.actions[ i ]; - - args = item.args; - action = item.action; - - if ( action == THREE.PathActions.MOVE_TO ) { - - if ( lastPath.actions.length != 0 ) { - - subPaths.push( lastPath ); - lastPath = new THREE.Path(); - - } - - } - - lastPath[ action ].apply( lastPath, args ); - - } - - if ( lastPath.actions.length != 0 ) { - - subPaths.push( lastPath ); - - } - - // console.log(subPaths); - - if ( subPaths.length == 0 ) return []; - - var tmpPath, tmpShape, shapes = []; - - var holesFirst = !THREE.Shape.Utils.isClockWise( subPaths[ 0 ].getPoints() ); - // console.log("Holes first", holesFirst); - - if ( subPaths.length == 1) { - tmpPath = subPaths[0]; - tmpShape = new THREE.Shape(); - tmpShape.actions = tmpPath.actions; - tmpShape.curves = tmpPath.curves; - shapes.push( tmpShape ); - return shapes; - }; - - if ( holesFirst ) { - - tmpShape = new THREE.Shape(); - - for ( i = 0, il = subPaths.length; i < il; i ++ ) { - - tmpPath = subPaths[ i ]; - - if ( THREE.Shape.Utils.isClockWise( tmpPath.getPoints() ) ) { - - tmpShape.actions = tmpPath.actions; - tmpShape.curves = tmpPath.curves; - - shapes.push( tmpShape ); - tmpShape = new THREE.Shape(); - - //console.log('cw', i); - - } else { - - tmpShape.holes.push( tmpPath ); - - //console.log('ccw', i); - - } - - } - - } else { - - // Shapes first - - for ( i = 0, il = subPaths.length; i < il; i ++ ) { - - tmpPath = subPaths[ i ]; - - if ( THREE.Shape.Utils.isClockWise( tmpPath.getPoints() ) ) { - - - if ( tmpShape ) shapes.push( tmpShape ); - - tmpShape = new THREE.Shape(); - tmpShape.actions = tmpPath.actions; - tmpShape.curves = tmpPath.curves; - - } else { - - tmpShape.holes.push( tmpPath ); - - } - - } - - shapes.push( tmpShape ); - - } - - //console.log("shape", shapes); - - return shapes; - -}; -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * Defines a 2d shape plane using paths. - **/ - -// STEP 1 Create a path. -// STEP 2 Turn path into shape. -// STEP 3 ExtrudeGeometry takes in Shape/Shapes -// STEP 3a - Extract points from each shape, turn to vertices -// STEP 3b - Triangulate each shape, add faces. - -THREE.Shape = function ( ) { - - THREE.Path.apply( this, arguments ); - this.holes = []; - -}; - -THREE.Shape.prototype = new THREE.Path(); -THREE.Shape.prototype.constructor = THREE.Path; - -// Convenience method to return ExtrudeGeometry - -THREE.Shape.prototype.extrude = function ( options ) { - - var extruded = new THREE.ExtrudeGeometry( this, options ); - return extruded; - -}; - -// Get points of holes - -THREE.Shape.prototype.getPointsHoles = function ( divisions ) { - - var i, il = this.holes.length, holesPts = []; - - for ( i = 0; i < il; i ++ ) { - - holesPts[ i ] = this.holes[ i ].getTransformedPoints( divisions, this.bends ); - - } - - return holesPts; - -}; - -// Get points of holes (spaced by regular distance) - -THREE.Shape.prototype.getSpacedPointsHoles = function ( divisions ) { - - var i, il = this.holes.length, holesPts = []; - - for ( i = 0; i < il; i ++ ) { - - holesPts[ i ] = this.holes[ i ].getTransformedSpacedPoints( divisions, this.bends ); - - } - - return holesPts; - -}; - - -// Get points of shape and holes (keypoints based on segments parameter) - -THREE.Shape.prototype.extractAllPoints = function ( divisions ) { - - return { - - shape: this.getTransformedPoints( divisions ), - holes: this.getPointsHoles( divisions ) - - }; - -}; - -// -// THREE.Shape.prototype.extractAllPointsWithBend = function ( divisions, bend ) { -// -// return { -// -// shape: this.transform( bend, divisions ), -// holes: this.getPointsHoles( divisions, bend ) -// -// }; -// -// }; - -// Get points of shape and holes (spaced by regular distance) - -THREE.Shape.prototype.extractAllSpacedPoints = function ( divisions ) { - - return { - - shape: this.getTransformedSpacedPoints( divisions ), - holes: this.getSpacedPointsHoles( divisions ) - - }; - -}; - -/************************************************************** - * Utils - **************************************************************/ - -THREE.Shape.Utils = { - - /* - contour - array of vector2 for contour - holes - array of array of vector2 - */ - - removeHoles: function ( contour, holes ) { - - var shape = contour.concat(); // work on this shape - var allpoints = shape.concat(); - - /* For each isolated shape, find the closest points and break to the hole to allow triangulation */ - - - var prevShapeVert, nextShapeVert, - prevHoleVert, nextHoleVert, - holeIndex, shapeIndex, - shapeId, shapeGroup, - h, h2, - hole, shortest, d, - p, pts1, pts2, - tmpShape1, tmpShape2, - tmpHole1, tmpHole2, - verts = []; - - for ( h = 0; h < holes.length; h ++ ) { - - hole = holes[ h ]; - - /* - shapeholes[ h ].concat(); // preserves original - holes.push( hole ); - */ - - Array.prototype.push.apply( allpoints, hole ); - - shortest = Number.POSITIVE_INFINITY; - - - // Find the shortest pair of pts between shape and hole - - // Note: Actually, I'm not sure now if we could optimize this to be faster than O(m*n) - // Using distanceToSquared() intead of distanceTo() should speed a little - // since running square roots operations are reduced. - - for ( h2 = 0; h2 < hole.length; h2 ++ ) { - - pts1 = hole[ h2 ]; - var dist = []; - - for ( p = 0; p < shape.length; p++ ) { - - pts2 = shape[ p ]; - d = pts1.distanceToSquared( pts2 ); - dist.push( d ); - - if ( d < shortest ) { - - shortest = d; - holeIndex = h2; - shapeIndex = p; - - } - - } - - } - - //console.log("shortest", shortest, dist); - - prevShapeVert = ( shapeIndex - 1 ) >= 0 ? shapeIndex - 1 : shape.length - 1; - prevHoleVert = ( holeIndex - 1 ) >= 0 ? holeIndex - 1 : hole.length - 1; - - var areaapts = [ - - hole[ holeIndex ], - shape[ shapeIndex ], - shape[ prevShapeVert ] - - ]; - - var areaa = THREE.FontUtils.Triangulate.area( areaapts ); - - var areabpts = [ - - hole[ holeIndex ], - hole[ prevHoleVert ], - shape[ shapeIndex ] - - ]; - - var areab = THREE.FontUtils.Triangulate.area( areabpts ); - - var shapeOffset = 1; - var holeOffset = -1; - - var oldShapeIndex = shapeIndex, oldHoleIndex = holeIndex; - shapeIndex += shapeOffset; - holeIndex += holeOffset; - - if ( shapeIndex < 0 ) { shapeIndex += shape.length; } - shapeIndex %= shape.length; - - if ( holeIndex < 0 ) { holeIndex += hole.length; } - holeIndex %= hole.length; - - prevShapeVert = ( shapeIndex - 1 ) >= 0 ? shapeIndex - 1 : shape.length - 1; - prevHoleVert = ( holeIndex - 1 ) >= 0 ? holeIndex - 1 : hole.length - 1; - - areaapts = [ - - hole[ holeIndex ], - shape[ shapeIndex ], - shape[ prevShapeVert ] - - ]; - - var areaa2 = THREE.FontUtils.Triangulate.area( areaapts ); - - areabpts = [ - - hole[ holeIndex ], - hole[ prevHoleVert ], - shape[ shapeIndex ] - - ]; - - var areab2 = THREE.FontUtils.Triangulate.area( areabpts ); - //console.log(areaa,areab ,areaa2,areab2, ( areaa + areab ), ( areaa2 + areab2 )); - - if ( ( areaa + areab ) > ( areaa2 + areab2 ) ) { - - // In case areas are not correct. - //console.log("USE THIS"); - - shapeIndex = oldShapeIndex; - holeIndex = oldHoleIndex ; - - if ( shapeIndex < 0 ) { shapeIndex += shape.length; } - shapeIndex %= shape.length; - - if ( holeIndex < 0 ) { holeIndex += hole.length; } - holeIndex %= hole.length; - - prevShapeVert = ( shapeIndex - 1 ) >= 0 ? shapeIndex - 1 : shape.length - 1; - prevHoleVert = ( holeIndex - 1 ) >= 0 ? holeIndex - 1 : hole.length - 1; - - } else { - - //console.log("USE THAT ") - - } - - tmpShape1 = shape.slice( 0, shapeIndex ); - tmpShape2 = shape.slice( shapeIndex ); - tmpHole1 = hole.slice( holeIndex ); - tmpHole2 = hole.slice( 0, holeIndex ); - - // Should check orders here again? - - var trianglea = [ - - hole[ holeIndex ], - shape[ shapeIndex ], - shape[ prevShapeVert ] - - ]; - - var triangleb = [ - - hole[ holeIndex ] , - hole[ prevHoleVert ], - shape[ shapeIndex ] - - ]; - - verts.push( trianglea ); - verts.push( triangleb ); - - shape = tmpShape1.concat( tmpHole1 ).concat( tmpHole2 ).concat( tmpShape2 ); - - } - - return { - - shape:shape, /* shape with no holes */ - isolatedPts: verts, /* isolated faces */ - allpoints: allpoints - - } - - - }, - - triangulateShape: function ( contour, holes ) { - - var shapeWithoutHoles = THREE.Shape.Utils.removeHoles( contour, holes ); - - var shape = shapeWithoutHoles.shape, - allpoints = shapeWithoutHoles.allpoints, - isolatedPts = shapeWithoutHoles.isolatedPts; - - var triangles = THREE.FontUtils.Triangulate( shape, false ); // True returns indices for points of spooled shape - - // To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first. - - //console.log( "triangles",triangles, triangles.length ); - //console.log( "allpoints",allpoints, allpoints.length ); - - var i, il, f, face, - key, index, - allPointsMap = {}, - isolatedPointsMap = {}; - - // prepare all points map - - for ( i = 0, il = allpoints.length; i < il; i ++ ) { - - key = allpoints[ i ].x + ":" + allpoints[ i ].y; - - if ( allPointsMap[ key ] !== undefined ) { - - console.log( "Duplicate point", key ); - - } - - allPointsMap[ key ] = i; - - } - - // check all face vertices against all points map - - for ( i = 0, il = triangles.length; i < il; i ++ ) { - - face = triangles[ i ]; - - for ( f = 0; f < 3; f ++ ) { - - key = face[ f ].x + ":" + face[ f ].y; - - index = allPointsMap[ key ]; - - if ( index !== undefined ) { - - face[ f ] = index; - - } - - } - - } - - // check isolated points vertices against all points map - - for ( i = 0, il = isolatedPts.length; i < il; i ++ ) { - - face = isolatedPts[ i ]; - - for ( f = 0; f < 3; f ++ ) { - - key = face[ f ].x + ":" + face[ f ].y; - - index = allPointsMap[ key ]; - - if ( index !== undefined ) { - - face[ f ] = index; - - } - - } - - } - - return triangles.concat( isolatedPts ); - - }, // end triangulate shapes - - /* - triangulate2 : function( pts, holes ) { - - // For use with Poly2Tri.js - - var allpts = pts.concat(); - var shape = []; - for (var p in pts) { - shape.push(new js.poly2tri.Point(pts[p].x, pts[p].y)); - } - - var swctx = new js.poly2tri.SweepContext(shape); - - for (var h in holes) { - var aHole = holes[h]; - var newHole = [] - for (i in aHole) { - newHole.push(new js.poly2tri.Point(aHole[i].x, aHole[i].y)); - allpts.push(aHole[i]); - } - swctx.AddHole(newHole); - } - - var find; - var findIndexForPt = function (pt) { - find = new THREE.Vector2(pt.x, pt.y); - var p; - for (p=0, pl = allpts.length; p 1 ) { - - console.log( "THREE.Animation.update: Warning! Scale out of bounds:" + scale + " on bone " + h ); - scale = scale < 0 ? 0 : 1; - - } - - // interpolate - - if ( type === "pos" ) { - - vector = object.position; - - if( this.interpolationType === THREE.AnimationHandler.LINEAR ) { - - vector.x = prevXYZ[ 0 ] + ( nextXYZ[ 0 ] - prevXYZ[ 0 ] ) * scale; - vector.y = prevXYZ[ 1 ] + ( nextXYZ[ 1 ] - prevXYZ[ 1 ] ) * scale; - vector.z = prevXYZ[ 2 ] + ( nextXYZ[ 2 ] - prevXYZ[ 2 ] ) * scale; - - } else if ( this.interpolationType === THREE.AnimationHandler.CATMULLROM || - this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - - this.points[ 0 ] = this.getPrevKeyWith( "pos", h, prevKey.index - 1 )[ "pos" ]; - this.points[ 1 ] = prevXYZ; - this.points[ 2 ] = nextXYZ; - this.points[ 3 ] = this.getNextKeyWith( "pos", h, nextKey.index + 1 )[ "pos" ]; - - scale = scale * 0.33 + 0.33; - - currentPoint = this.interpolateCatmullRom( this.points, scale ); - - vector.x = currentPoint[ 0 ]; - vector.y = currentPoint[ 1 ]; - vector.z = currentPoint[ 2 ]; - - if( this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - - forwardPoint = this.interpolateCatmullRom( this.points, scale * 1.01 ); - - this.target.set( forwardPoint[ 0 ], forwardPoint[ 1 ], forwardPoint[ 2 ] ); - this.target.subSelf( vector ); - this.target.y = 0; - this.target.normalize(); - - angle = Math.atan2( this.target.x, this.target.z ); - object.rotation.set( 0, angle, 0 ); - - } - - } - - } else if ( type === "rot" ) { - - THREE.Quaternion.slerp( prevXYZ, nextXYZ, object.quaternion, scale ); - - } else if( type === "scl" ) { - - vector = object.scale; - - vector.x = prevXYZ[ 0 ] + ( nextXYZ[ 0 ] - prevXYZ[ 0 ] ) * scale; - vector.y = prevXYZ[ 1 ] + ( nextXYZ[ 1 ] - prevXYZ[ 1 ] ) * scale; - vector.z = prevXYZ[ 2 ] + ( nextXYZ[ 2 ] - prevXYZ[ 2 ] ) * scale; - - } - - } - - } - - } - - // update JIT? - - if ( this.JITCompile ) { - - if ( JIThierarchy[ 0 ][ frame ] === undefined ) { - - this.hierarchy[ 0 ].updateMatrixWorld( true ); - - for ( var h = 0; h < this.hierarchy.length; h++ ) { - - if( this.hierarchy[ h ] instanceof THREE.Bone ) { - - JIThierarchy[ h ][ frame ] = this.hierarchy[ h ].skinMatrix.clone(); - - } else { - - JIThierarchy[ h ][ frame ] = this.hierarchy[ h ].matrix.clone(); - - } - - } - - } - - } - -}; - -// Catmull-Rom spline - -THREE.Animation.prototype.interpolateCatmullRom = function ( points, scale ) { - - var c = [], v3 = [], - point, intPoint, weight, w2, w3, - pa, pb, pc, pd; - - point = ( points.length - 1 ) * scale; - intPoint = Math.floor( point ); - weight = point - intPoint; - - c[ 0 ] = intPoint === 0 ? intPoint : intPoint - 1; - c[ 1 ] = intPoint; - c[ 2 ] = intPoint > points.length - 2 ? intPoint : intPoint + 1; - c[ 3 ] = intPoint > points.length - 3 ? intPoint : intPoint + 2; - - pa = points[ c[ 0 ] ]; - pb = points[ c[ 1 ] ]; - pc = points[ c[ 2 ] ]; - pd = points[ c[ 3 ] ]; - - w2 = weight * weight; - w3 = weight * w2; - - v3[ 0 ] = this.interpolate( pa[ 0 ], pb[ 0 ], pc[ 0 ], pd[ 0 ], weight, w2, w3 ); - v3[ 1 ] = this.interpolate( pa[ 1 ], pb[ 1 ], pc[ 1 ], pd[ 1 ], weight, w2, w3 ); - v3[ 2 ] = this.interpolate( pa[ 2 ], pb[ 2 ], pc[ 2 ], pd[ 2 ], weight, w2, w3 ); - - return v3; - -}; - -THREE.Animation.prototype.interpolate = function( p0, p1, p2, p3, t, t2, t3 ) { - - var v0 = ( p2 - p0 ) * 0.5, - v1 = ( p3 - p1 ) * 0.5; - - return ( 2 * ( p1 - p2 ) + v0 + v1 ) * t3 + ( - 3 * ( p1 - p2 ) - 2 * v0 - v1 ) * t2 + v0 * t + p1; - -}; - - - -// Get next key with - -THREE.Animation.prototype.getNextKeyWith = function( type, h, key ) { - - var keys = this.data.hierarchy[ h ].keys; - - if ( this.interpolationType === THREE.AnimationHandler.CATMULLROM || - this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - - key = key < keys.length - 1 ? key : keys.length - 1; - - } else { - - key = key % keys.length; - - } - - for ( ; key < keys.length; key++ ) { - - if ( keys[ key ][ type ] !== undefined ) { - - return keys[ key ]; - - } - - } - - return this.data.hierarchy[ h ].keys[ 0 ]; - -}; - -// Get previous key with - -THREE.Animation.prototype.getPrevKeyWith = function( type, h, key ) { - - var keys = this.data.hierarchy[ h ].keys; - - if ( this.interpolationType === THREE.AnimationHandler.CATMULLROM || - this.interpolationType === THREE.AnimationHandler.CATMULLROM_FORWARD ) { - - key = key > 0 ? key : 0; - - } else { - - key = key >= 0 ? key : key + keys.length; - - } - - - for ( ; key >= 0; key-- ) { - - if ( keys[ key ][ type ] !== undefined ) { - - return keys[ key ]; - - } - - } - - return this.data.hierarchy[ h ].keys[ keys.length - 1 ]; - -};/** - * @author mikael emtinger / http://gomo.se/ - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author khang duong - * @author erik kitson - */ - -THREE.KeyFrameAnimation = function( root, data, JITCompile ) { - - this.root = root; - this.data = THREE.AnimationHandler.get( data ); - this.hierarchy = THREE.AnimationHandler.parse( root ); - this.currentTime = 0; - this.timeScale = 0.001; - this.isPlaying = false; - this.isPaused = true; - this.loop = true; - this.JITCompile = JITCompile !== undefined ? JITCompile : true; - - // initialize to first keyframes - - for ( var h = 0, hl = this.hierarchy.length; h < hl; h++ ) { - - var keys = this.data.hierarchy[h].keys, - sids = this.data.hierarchy[h].sids, - obj = this.hierarchy[h]; - - if ( keys.length && sids ) { - - for ( var s = 0; s < sids.length; s++ ) { - - var sid = sids[ s ], - next = this.getNextKeyWith( sid, h, 0 ); - - if ( next ) { - - next.apply( sid ); - - } - - } - - obj.matrixAutoUpdate = false; - this.data.hierarchy[h].node.updateMatrix(); - obj.matrixWorldNeedsUpdate = true; - - } - - } - -}; - -// Play - -THREE.KeyFrameAnimation.prototype.play = function( loop, startTimeMS ) { - - if( !this.isPlaying ) { - - this.isPlaying = true; - this.loop = loop !== undefined ? loop : true; - this.currentTime = startTimeMS !== undefined ? startTimeMS : 0; - this.startTimeMs = startTimeMS; - this.startTime = 10000000; - this.endTime = -this.startTime; - - - // reset key cache - - var h, hl = this.hierarchy.length, - object, - node; - - for ( h = 0; h < hl; h++ ) { - - object = this.hierarchy[ h ]; - node = this.data.hierarchy[ h ]; - object.useQuaternion = true; - - if ( node.animationCache === undefined ) { - - node.animationCache = {}; - node.animationCache.prevKey = null; - node.animationCache.nextKey = null; - node.animationCache.originalMatrix = object instanceof THREE.Bone ? object.skinMatrix : object.matrix; - - } - - var keys = this.data.hierarchy[h].keys; - - if (keys.length) { - - node.animationCache.prevKey = keys[ 0 ]; - node.animationCache.nextKey = keys[ 1 ]; - - this.startTime = Math.min( keys[0].time, this.startTime ); - this.endTime = Math.max( keys[keys.length - 1].time, this.endTime ); - - } - - } - - this.update( 0 ); - - } - - this.isPaused = false; - - THREE.AnimationHandler.addToUpdate( this ); - -}; - - - -// Pause - -THREE.KeyFrameAnimation.prototype.pause = function() { - - if( this.isPaused ) { - - THREE.AnimationHandler.addToUpdate( this ); - - } else { - - THREE.AnimationHandler.removeFromUpdate( this ); - - } - - this.isPaused = !this.isPaused; - -}; - - -// Stop - -THREE.KeyFrameAnimation.prototype.stop = function() { - - this.isPlaying = false; - this.isPaused = false; - THREE.AnimationHandler.removeFromUpdate( this ); - - - // reset JIT matrix and remove cache - - for ( var h = 0; h < this.hierarchy.length; h++ ) { - - var obj = this.hierarchy[ h ]; - - if ( obj.animationCache !== undefined ) { - - var original = obj.animationCache.originalMatrix; - - if( obj instanceof THREE.Bone ) { - - original.copy( obj.skinMatrix ); - obj.skinMatrix = original; - - } else { - - original.copy( obj.matrix ); - obj.matrix = original; - - } - - delete obj.animationCache; - - } - - } - -}; - - -// Update - -THREE.KeyFrameAnimation.prototype.update = function( deltaTimeMS ) { - - // early out - - if( !this.isPlaying ) return; - - - // vars - - var prevKey, nextKey; - var object; - var node; - var frame; - var JIThierarchy = this.data.JIT.hierarchy; - var currentTime, unloopedCurrentTime; - var looped; - - - // update - - this.currentTime += deltaTimeMS * this.timeScale; - - unloopedCurrentTime = this.currentTime; - currentTime = this.currentTime = this.currentTime % this.data.length; - - // if looped around, the current time should be based on the startTime - if ( currentTime < this.startTimeMs ) { - - currentTime = this.currentTime = this.startTimeMs + currentTime; - - } - - frame = parseInt( Math.min( currentTime * this.data.fps, this.data.length * this.data.fps ), 10 ); - looped = currentTime < unloopedCurrentTime; - - if ( looped && !this.loop ) { - - // Set the animation to the last keyframes and stop - for ( var h = 0, hl = this.hierarchy.length; h < hl; h++ ) { - - var keys = this.data.hierarchy[h].keys, - sids = this.data.hierarchy[h].sids, - end = keys.length-1, - obj = this.hierarchy[h]; - - if ( keys.length ) { - - for ( var s = 0; s < sids.length; s++ ) { - - var sid = sids[ s ], - prev = this.getPrevKeyWith( sid, h, end ); - - if ( prev ) { - - prev.apply( sid ); - - } - - } - - this.data.hierarchy[h].node.updateMatrix(); - obj.matrixWorldNeedsUpdate = true; - - } - - } - - this.stop(); - return; - - } - - // check pre-infinity - if ( currentTime < this.startTime ) { - - return; - - } - - // update - - for ( var h = 0, hl = this.hierarchy.length; h < hl; h++ ) { - - object = this.hierarchy[ h ]; - node = this.data.hierarchy[ h ]; - - var keys = node.keys, - animationCache = node.animationCache; - - // use JIT? - - if ( this.JITCompile && JIThierarchy[ h ][ frame ] !== undefined ) { - - if( object instanceof THREE.Bone ) { - - object.skinMatrix = JIThierarchy[ h ][ frame ]; - object.matrixWorldNeedsUpdate = false; - - } else { - - object.matrix = JIThierarchy[ h ][ frame ]; - object.matrixWorldNeedsUpdate = true; - - } - - // use interpolation - - } else if ( keys.length ) { - - // make sure so original matrix and not JIT matrix is set - - if ( this.JITCompile && animationCache ) { - - if( object instanceof THREE.Bone ) { - - object.skinMatrix = animationCache.originalMatrix; - - } else { - - object.matrix = animationCache.originalMatrix; - - } - - } - - prevKey = animationCache.prevKey; - nextKey = animationCache.nextKey; - - if ( prevKey && nextKey ) { - - // switch keys? - - if ( nextKey.time <= unloopedCurrentTime ) { - - // did we loop? - - if ( looped && this.loop ) { - - prevKey = keys[ 0 ]; - nextKey = keys[ 1 ]; - - while ( nextKey.time < currentTime ) { - - prevKey = nextKey; - nextKey = keys[ prevKey.index + 1 ]; - - } - - } else if ( !looped ) { - - var lastIndex = keys.length - 1; - - while ( nextKey.time < currentTime && nextKey.index !== lastIndex ) { - - prevKey = nextKey; - nextKey = keys[ prevKey.index + 1 ]; - - } - - } - - animationCache.prevKey = prevKey; - animationCache.nextKey = nextKey; - - } - - prevKey.interpolate( nextKey, currentTime ); - - } - - this.data.hierarchy[h].node.updateMatrix(); - object.matrixWorldNeedsUpdate = true; - - } - - } - - // update JIT? - - if ( this.JITCompile ) { - - if ( JIThierarchy[ 0 ][ frame ] === undefined ) { - - this.hierarchy[ 0 ].updateMatrixWorld( true ); - - for ( var h = 0; h < this.hierarchy.length; h++ ) { - - if( this.hierarchy[ h ] instanceof THREE.Bone ) { - - JIThierarchy[ h ][ frame ] = this.hierarchy[ h ].skinMatrix.clone(); - - } else { - - JIThierarchy[ h ][ frame ] = this.hierarchy[ h ].matrix.clone(); - - } - - } - - } - - } - -}; - -// Get next key with - -THREE.KeyFrameAnimation.prototype.getNextKeyWith = function( sid, h, key ) { - - var keys = this.data.hierarchy[ h ].keys; - key = key % keys.length; - - for ( ; key < keys.length; key++ ) { - - if ( keys[ key ].hasTarget( sid ) ) { - - return keys[ key ]; - - } - - } - - return keys[ 0 ]; - -}; - -// Get previous key with - -THREE.KeyFrameAnimation.prototype.getPrevKeyWith = function( sid, h, key ) { - - var keys = this.data.hierarchy[ h ].keys; - key = key >= 0 ? key : key + keys.length; - - for ( ; key >= 0; key-- ) { - - if ( keys[ key ].hasTarget( sid ) ) { - - return keys[ key ]; - - } - - } - - return keys[ keys.length - 1 ]; - -}; -/** - * Camera for rendering cube maps - * - renders scene into axis-aligned cube - * - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.CubeCamera = function ( near, far, heightOffset, cubeResolution ) { - - this.heightOffset = heightOffset; - this.position = new THREE.Vector3( 0, heightOffset, 0 ); - - // cameras - - var fov = 90, aspect = 1; - - this.cameraPX = new THREE.PerspectiveCamera( fov, aspect, near, far ); - this.cameraNX = new THREE.PerspectiveCamera( fov, aspect, near, far ); - - this.cameraPY = new THREE.PerspectiveCamera( fov, aspect, near, far ); - this.cameraNY = new THREE.PerspectiveCamera( fov, aspect, near, far ); - - this.cameraPZ = new THREE.PerspectiveCamera( fov, aspect, near, far ); - this.cameraNZ = new THREE.PerspectiveCamera( fov, aspect, near, far ); - - this.cameraPX.position = this.position; - this.cameraNX.position = this.position; - - this.cameraPY.position = this.position; - this.cameraNY.position = this.position; - - this.cameraPZ.position = this.position; - this.cameraNZ.position = this.position; - - this.cameraPX.up.set( 0, -1, 0 ); - this.cameraNX.up.set( 0, -1, 0 ); - - this.cameraPY.up.set( 0, 0, 1 ); - this.cameraNY.up.set( 0, 0, -1 ); - - this.cameraPZ.up.set( 0, -1, 0 ); - this.cameraNZ.up.set( 0, -1, 0 ); - - // targets - - this.targetPX = new THREE.Vector3( 0, 0, 0 ); - this.targetNX = new THREE.Vector3( 0, 0, 0 ); - - this.targetPY = new THREE.Vector3( 0, 0, 0 ); - this.targetNY = new THREE.Vector3( 0, 0, 0 ); - - this.targetPZ = new THREE.Vector3( 0, 0, 0 ); - this.targetNZ = new THREE.Vector3( 0, 0, 0 ); - - // cube render target - - this.renderTarget = new THREE.WebGLRenderTargetCube( cubeResolution, cubeResolution, { format: THREE.RGBFormat, magFilter: THREE.LinearFilter, minFilter: THREE.LinearFilter } ); - - this.updatePosition = function ( position ) { - - this.position.copy( position ); - - this.position.y += this.heightOffset; - - this.targetPX.copy( this.position ); - this.targetNX.copy( this.position ); - - this.targetPY.copy( this.position ); - this.targetNY.copy( this.position ); - - this.targetPZ.copy( this.position ); - this.targetNZ.copy( this.position ); - - this.targetPX.x += 1; - this.targetNX.x -= 1; - - this.targetPY.y += 1; - this.targetNY.y -= 1; - - this.targetPZ.z += 1; - this.targetNZ.z -= 1; - - this.cameraPX.lookAt( this.targetPX ); - this.cameraNX.lookAt( this.targetNX ); - - this.cameraPY.lookAt( this.targetPY ); - this.cameraNY.lookAt( this.targetNY ); - - this.cameraPZ.lookAt( this.targetPZ ); - this.cameraNZ.lookAt( this.targetNZ ); - - }; - - this.updateCubeMap = function ( renderer, scene ) { - - var cubeTarget = this.renderTarget; - - cubeTarget.activeCubeFace = 0; - renderer.render( scene, this.cameraPX, cubeTarget ); - - cubeTarget.activeCubeFace = 1; - renderer.render( scene, this.cameraNX, cubeTarget ); - - cubeTarget.activeCubeFace = 2; - renderer.render( scene, this.cameraPY, cubeTarget ); - - cubeTarget.activeCubeFace = 3; - renderer.render( scene, this.cameraNY, cubeTarget ); - - cubeTarget.activeCubeFace = 4; - renderer.render( scene, this.cameraPZ, cubeTarget ); - - cubeTarget.activeCubeFace = 5; - renderer.render( scene, this.cameraNZ, cubeTarget ); - - }; - -};THREE.FirstPersonCamera = function () { - - console.warn( 'DEPRECATED: FirstPersonCamera() is FirstPersonControls().' ); - -}; -THREE.PathCamera = function () { - - console.warn( 'DEPRECATED: PathCamera() is PathControls().' ); - -}; -THREE.FlyCamera = function () { - - console.warn( 'DEPRECATED: FlyCamera() is FlyControls().' ); - -}; -THREE.RollCamera = function () { - - console.warn( 'DEPRECATED: RollCamera() is RollControls().' ); - -}; -THREE.TrackballCamera = function () { - - console.warn( 'DEPRECATED: TrackballCamera() is TrackballControls().' ); - -}; -/* - * @author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog - * - * A handy general perpose camera, for setting FOV, Lens Focal Length, - * and switching between perspective and orthographic views easily. - * - */ - - -THREE.CombinedCamera = function ( width, height, fov, near, far, orthonear, orthofar ) { - - THREE.Camera.call( this ); - - this.fov = fov; - - this.left = -width / 2; - this.right = width / 2 - this.top = height / 2; - this.bottom = -height / 2; - - // We could also handle the projectionMatrix internally, but just wanted to test nested camera objects - this.cameraO = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, orthonear, orthofar ); - this.cameraP = new THREE.PerspectiveCamera( fov, width/height, near, far ); - - this.zoom = 1; - - this.toPerspective(); - - - var aspect = width/height; - - - - -}; - -THREE.CombinedCamera.prototype = new THREE.Camera(); -THREE.CombinedCamera.prototype.constructor = THREE.CoolCamera; - -THREE.CombinedCamera.prototype.toPerspective = function () { - - this.near = this.cameraP.near; - this.far = this.cameraP.far; - this.cameraP.fov = this.fov / this.zoom ; - this.cameraP.updateProjectionMatrix(); - this.projectionMatrix = this.cameraP.projectionMatrix; - - this.inPersepectiveMode = true; - this.inOrthographicMode = false; - -}; - -THREE.CombinedCamera.prototype.toOrthographic = function () { - - // Orthographic from Perspective - var fov = this.fov; - var aspect = this.cameraP.aspect; - var near = this.cameraP.near; - var far = this.cameraP.far; - - - // Just pretend we want the mid plane of the viewing frustum - var hyperfocus = ( near + far ) / 2; - - var halfHeight = Math.tan( fov / 2 ) * hyperfocus; - var planeHeight = 2 * halfHeight; - var planeWidth = planeHeight * aspect; - var halfWidth = planeWidth / 2; - - halfHeight /= this.zoom; - halfWidth /= this.zoom; - - this.cameraO.left = -halfWidth; - this.cameraO.right = halfWidth; - this.cameraO.top = halfHeight; - this.cameraO.bottom = -halfHeight; - - // this.cameraO.left = -farHalfWidth; - // this.cameraO.right = farHalfWidth; - // this.cameraO.top = farHalfHeight; - // this.cameraO.bottom = -farHalfHeight; - - // this.cameraO.left = this.left / this.zoom; - // this.cameraO.right = this.right / this.zoom; - // this.cameraO.top = this.top / this.zoom; - // this.cameraO.bottom = this.bottom / this.zoom; - - this.cameraO.updateProjectionMatrix(); - - this.near = this.cameraO.near; - this.far = this.cameraO.far; - this.projectionMatrix = this.cameraO.projectionMatrix; - - this.inPersepectiveMode = false; - this.inOrthographicMode = true; - -}; - -THREE.CombinedCamera.prototype.setFov = function(fov) { - this.fov = fov; - - if (this.inPersepectiveMode) { - this.toPerspective(); - } else { - this.toOrthographic(); - } - -}; - -/* -* Uses Focal Length (in mm) to estimate and set FOV -* 35mm (fullframe) camera is used if frame size is not specified; -* Formula based on http://www.bobatkins.com/photography/technical/field_of_view.html -*/ -THREE.CombinedCamera.prototype.setLens = function(focalLength, framesize) { - - if (!framesize) framesize = 43.25; // 36x24mm - - var fov = 2 * Math.atan( framesize / (focalLength * 2)); - fov = 180 / Math.PI * fov; - this.setFov(fov); - - return fov; -}; - - -THREE.CombinedCamera.prototype.setZoom = function(zoom) { - - this.zoom = zoom; - - if (this.inPersepectiveMode) { - this.toPerspective(); - } else { - this.toOrthographic(); - } - - -}; - -THREE.CombinedCamera.prototype.toFrontView = function() { - this.rotation.x = 0; - this.rotation.y = 0; - this.rotation.z = 0; - - //TODO: Better way to disable camera.lookAt()? - this.rotationAutoUpdate = false; -}; - -THREE.CombinedCamera.prototype.toBackView = function() { - this.rotation.x = 0; - this.rotation.y = Math.PI; - this.rotation.z = 0; - this.rotationAutoUpdate = false; -}; - -THREE.CombinedCamera.prototype.toLeftView = function() { - this.rotation.x = 0; - this.rotation.y = - Math.PI / 2; - this.rotation.z = 0; - this.rotationAutoUpdate = false; -}; - -THREE.CombinedCamera.prototype.toRightView = function() { - this.rotation.x = 0; - this.rotation.y = Math.PI / 2; - this.rotation.z = 0; - this.rotationAutoUpdate = false; -}; - -THREE.CombinedCamera.prototype.toTopView = function() { - this.rotation.x = - Math.PI / 2; - this.rotation.y = 0; - this.rotation.z = 0; - this.rotationAutoUpdate = false; -}; - -THREE.CombinedCamera.prototype.toBottomView = function() { - this.rotation.x = Math.PI / 2; - this.rotation.y = 0; - this.rotation.z = 0; - this.rotationAutoUpdate = false; -}; - -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - * @author paulirish / http://paulirish.com/ - */ - -THREE.FirstPersonControls = function ( object, domElement ) { - - this.object = object; - this.target = new THREE.Vector3( 0, 0, 0 ); - - this.domElement = ( domElement !== undefined ) ? domElement : document; - - this.movementSpeed = 1.0; - this.lookSpeed = 0.005; - - this.noFly = false; - this.lookVertical = true; - this.autoForward = false; - - this.activeLook = true; - - this.heightSpeed = false; - this.heightCoef = 1.0; - this.heightMin = 0.0; - - this.constrainVertical = false; - this.verticalMin = 0; - this.verticalMax = Math.PI; - - this.autoSpeedFactor = 0.0; - - this.mouseX = 0; - this.mouseY = 0; - - this.lat = 0; - this.lon = 0; - this.phi = 0; - this.theta = 0; - - this.moveForward = false; - this.moveBackward = false; - this.moveLeft = false; - this.moveRight = false; - this.freeze = false; - - this.mouseDragOn = false; - - if ( this.domElement === document ) { - - this.viewHalfX = window.innerWidth / 2; - this.viewHalfY = window.innerHeight / 2; - - } else { - - this.viewHalfX = this.domElement.offsetWidth / 2; - this.viewHalfY = this.domElement.offsetHeight / 2; - this.domElement.setAttribute( 'tabindex', -1 ); - - } - - this.onMouseDown = function ( event ) { - - if ( this.domElement !== document ) { - - this.domElement.focus(); - - } - - event.preventDefault(); - event.stopPropagation(); - - if ( this.activeLook ) { - - switch ( event.button ) { - - case 0: this.moveForward = true; break; - case 2: this.moveBackward = true; break; - - } - - } - - this.mouseDragOn = true; - - }; - - this.onMouseUp = function ( event ) { - - event.preventDefault(); - event.stopPropagation(); - - if ( this.activeLook ) { - - switch ( event.button ) { - - case 0: this.moveForward = false; break; - case 2: this.moveBackward = false; break; - - } - - } - - this.mouseDragOn = false; - - }; - - this.onMouseMove = function ( event ) { - - if ( this.domElement === document ) { - - this.mouseX = event.pageX - this.viewHalfX; - this.mouseY = event.pageY - this.viewHalfY; - - } else { - - this.mouseX = event.pageX - this.domElement.offsetLeft - this.viewHalfX; - this.mouseY = event.pageY - this.domElement.offsetTop - this.viewHalfY; - - } - - }; - - this.onKeyDown = function ( event ) { - - switch( event.keyCode ) { - - case 38: /*up*/ - case 87: /*W*/ this.moveForward = true; break; - - case 37: /*left*/ - case 65: /*A*/ this.moveLeft = true; break; - - case 40: /*down*/ - case 83: /*S*/ this.moveBackward = true; break; - - case 39: /*right*/ - case 68: /*D*/ this.moveRight = true; break; - - case 82: /*R*/ this.moveUp = true; break; - case 70: /*F*/ this.moveDown = true; break; - - case 81: /*Q*/ this.freeze = !this.freeze; break; - - } - - }; - - this.onKeyUp = function ( event ) { - - switch( event.keyCode ) { - - case 38: /*up*/ - case 87: /*W*/ this.moveForward = false; break; - - case 37: /*left*/ - case 65: /*A*/ this.moveLeft = false; break; - - case 40: /*down*/ - case 83: /*S*/ this.moveBackward = false; break; - - case 39: /*right*/ - case 68: /*D*/ this.moveRight = false; break; - - case 82: /*R*/ this.moveUp = false; break; - case 70: /*F*/ this.moveDown = false; break; - - } - - }; - - this.update = function( delta ) { - var actualMoveSpeed = 0; - - if ( this.freeze ) { - - return; - - } else { - - if ( this.heightSpeed ) { - - var y = THREE.Math.clamp( this.object.position.y, this.heightMin, this.heightMax ); - var heightDelta = y - this.heightMin; - - this.autoSpeedFactor = delta * ( heightDelta * this.heightCoef ); - - } else { - - this.autoSpeedFactor = 0.0; - - } - - actualMoveSpeed = delta * this.movementSpeed; - - if ( this.moveForward || ( this.autoForward && !this.moveBackward ) ) this.object.translateZ( - ( actualMoveSpeed + this.autoSpeedFactor ) ); - if ( this.moveBackward ) this.object.translateZ( actualMoveSpeed ); - - if ( this.moveLeft ) this.object.translateX( - actualMoveSpeed ); - if ( this.moveRight ) this.object.translateX( actualMoveSpeed ); - - if ( this.moveUp ) this.object.translateY( actualMoveSpeed ); - if ( this.moveDown ) this.object.translateY( - actualMoveSpeed ); - - var actualLookSpeed = delta * this.lookSpeed; - - if ( !this.activeLook ) { - - actualLookSpeed = 0; - - } - - this.lon += this.mouseX * actualLookSpeed; - if( this.lookVertical ) this.lat -= this.mouseY * actualLookSpeed; - - this.lat = Math.max( - 85, Math.min( 85, this.lat ) ); - this.phi = ( 90 - this.lat ) * Math.PI / 180; - this.theta = this.lon * Math.PI / 180; - - var targetPosition = this.target, - position = this.object.position; - - targetPosition.x = position.x + 100 * Math.sin( this.phi ) * Math.cos( this.theta ); - targetPosition.y = position.y + 100 * Math.cos( this.phi ); - targetPosition.z = position.z + 100 * Math.sin( this.phi ) * Math.sin( this.theta ); - - } - - var verticalLookRatio = 1; - - if ( this.constrainVertical ) { - - verticalLookRatio = Math.PI / ( this.verticalMax - this.verticalMin ); - - } - - this.lon += this.mouseX * actualLookSpeed; - if( this.lookVertical ) this.lat -= this.mouseY * actualLookSpeed * verticalLookRatio; - - this.lat = Math.max( - 85, Math.min( 85, this.lat ) ); - this.phi = ( 90 - this.lat ) * Math.PI / 180; - - this.theta = this.lon * Math.PI / 180; - - if ( this.constrainVertical ) { - - this.phi = THREE.Math.mapLinear( this.phi, 0, Math.PI, this.verticalMin, this.verticalMax ); - - } - - var targetPosition = this.target, - position = this.object.position; - - targetPosition.x = position.x + 100 * Math.sin( this.phi ) * Math.cos( this.theta ); - targetPosition.y = position.y + 100 * Math.cos( this.phi ); - targetPosition.z = position.z + 100 * Math.sin( this.phi ) * Math.sin( this.theta ); - - this.object.lookAt( targetPosition ); - - }; - - - this.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false ); - - this.domElement.addEventListener( 'mousemove', bind( this, this.onMouseMove ), false ); - this.domElement.addEventListener( 'mousedown', bind( this, this.onMouseDown ), false ); - this.domElement.addEventListener( 'mouseup', bind( this, this.onMouseUp ), false ); - this.domElement.addEventListener( 'keydown', bind( this, this.onKeyDown ), false ); - this.domElement.addEventListener( 'keyup', bind( this, this.onKeyUp ), false ); - - function bind( scope, fn ) { - - return function () { - - fn.apply( scope, arguments ); - - }; - - }; - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.PathControls = function ( object, domElement ) { - - this.object = object; - this.domElement = ( domElement !== undefined ) ? domElement : document; - - this.id = "PathControls" + THREE.PathControlsIdCounter ++; - - // API - - this.duration = 10 * 1000; // milliseconds - this.waypoints = []; - - this.useConstantSpeed = true; - this.resamplingCoef = 50; - - this.debugPath = new THREE.Object3D(); - this.debugDummy = new THREE.Object3D(); - - this.animationParent = new THREE.Object3D(); - - this.lookSpeed = 0.005; - this.lookVertical = true; - this.lookHorizontal = true; - this.verticalAngleMap = { srcRange: [ 0, 2 * Math.PI ], dstRange: [ 0, 2 * Math.PI ] }; - this.horizontalAngleMap = { srcRange: [ 0, 2 * Math.PI ], dstRange: [ 0, 2 * Math.PI ] }; - - // internals - - this.target = new THREE.Object3D(); - - this.mouseX = 0; - this.mouseY = 0; - - this.lat = 0; - this.lon = 0; - - this.phi = 0; - this.theta = 0; - - if ( this.domElement === document ) { - - this.viewHalfX = window.innerWidth / 2; - this.viewHalfY = window.innerHeight / 2; - - } else { - - this.viewHalfX = this.domElement.offsetWidth / 2; - this.viewHalfY = this.domElement.offsetHeight / 2; - this.domElement.setAttribute( 'tabindex', -1 ); - - } - - var PI2 = Math.PI * 2, - PI180 = Math.PI / 180; - - // methods - - this.update = function ( delta ) { - - var srcRange, dstRange; - - if( this.lookHorizontal ) this.lon += this.mouseX * this.lookSpeed * delta; - if( this.lookVertical ) this.lat -= this.mouseY * this.lookSpeed * delta; - - this.lon = Math.max( 0, Math.min( 360, this.lon ) ); - this.lat = Math.max( - 85, Math.min( 85, this.lat ) ); - - this.phi = ( 90 - this.lat ) * PI180; - this.theta = this.lon * PI180; - - this.phi = normalize_angle_rad( this.phi ); - - // constrain vertical look angle - - srcRange = this.verticalAngleMap.srcRange; - dstRange = this.verticalAngleMap.dstRange; - - var tmpPhi = THREE.Math.mapLinear( this.phi, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); - var tmpPhiFullRange = dstRange[ 1 ] - dstRange[ 0 ]; - var tmpPhiNormalized = ( tmpPhi - dstRange[ 0 ] ) / tmpPhiFullRange; - - this.phi = QuadraticEaseInOut( tmpPhiNormalized ) * tmpPhiFullRange + dstRange[ 0 ]; - - // constrain horizontal look angle - - srcRange = this.horizontalAngleMap.srcRange; - dstRange = this.horizontalAngleMap.dstRange; - - var tmpTheta = THREE.Math.mapLinear( this.theta, srcRange[ 0 ], srcRange[ 1 ], dstRange[ 0 ], dstRange[ 1 ] ); - var tmpThetaFullRange = dstRange[ 1 ] - dstRange[ 0 ]; - var tmpThetaNormalized = ( tmpTheta - dstRange[ 0 ] ) / tmpThetaFullRange; - - this.theta = QuadraticEaseInOut( tmpThetaNormalized ) * tmpThetaFullRange + dstRange[ 0 ]; - - var targetPosition = this.target.position, - position = this.object.position; - - targetPosition.x = 100 * Math.sin( this.phi ) * Math.cos( this.theta ); - targetPosition.y = 100 * Math.cos( this.phi ); - targetPosition.z = 100 * Math.sin( this.phi ) * Math.sin( this.theta ); - - this.object.lookAt( this.target.position ); - - }; - - this.onMouseMove = function ( event ) { - - if ( this.domElement === document ) { - - this.mouseX = event.pageX - this.viewHalfX; - this.mouseY = event.pageY - this.viewHalfY; - - } else { - - this.mouseX = event.pageX - this.domElement.offsetLeft - this.viewHalfX; - this.mouseY = event.pageY - this.domElement.offsetTop - this.viewHalfY; - - } - - }; - - // utils - - function normalize_angle_rad( a ) { - - var b = a % PI2; - return b >= 0 ? b : b + PI2; - - }; - - function distance( a, b ) { - - var dx = a[ 0 ] - b[ 0 ], - dy = a[ 1 ] - b[ 1 ], - dz = a[ 2 ] - b[ 2 ]; - - return Math.sqrt( dx * dx + dy * dy + dz * dz ); - - }; - - function QuadraticEaseInOut ( k ) { - - if ( ( k *= 2 ) < 1 ) return 0.5 * k * k; - return - 0.5 * ( --k * ( k - 2 ) - 1 ); - - }; - - function bind( scope, fn ) { - - return function () { - - fn.apply( scope, arguments ); - - }; - - }; - - function initAnimationPath( parent, spline, name, duration ) { - - var animationData = { - - name: name, - fps: 0.6, - length: duration, - - hierarchy: [] - - }; - - var i, - parentAnimation, childAnimation, - path = spline.getControlPointsArray(), - sl = spline.getLength(), - pl = path.length, - t = 0, - first = 0, - last = pl - 1; - - parentAnimation = { parent: -1, keys: [] }; - parentAnimation.keys[ first ] = { time: 0, pos: path[ first ], rot: [ 0, 0, 0, 1 ], scl: [ 1, 1, 1 ] }; - parentAnimation.keys[ last ] = { time: duration, pos: path[ last ], rot: [ 0, 0, 0, 1 ], scl: [ 1, 1, 1 ] }; - - for ( i = 1; i < pl - 1; i++ ) { - - // real distance (approximation via linear segments) - - t = duration * sl.chunks[ i ] / sl.total; - - // equal distance - - //t = duration * ( i / pl ); - - // linear distance - - //t += duration * distance( path[ i ], path[ i - 1 ] ) / sl.total; - - parentAnimation.keys[ i ] = { time: t, pos: path[ i ] }; - - } - - animationData.hierarchy[ 0 ] = parentAnimation; - - THREE.AnimationHandler.add( animationData ); - - return new THREE.Animation( parent, name, THREE.AnimationHandler.CATMULLROM_FORWARD, false ); - - }; - - - function createSplineGeometry( spline, n_sub ) { - - var i, index, position, - geometry = new THREE.Geometry(); - - for ( i = 0; i < spline.points.length * n_sub; i ++ ) { - - index = i / ( spline.points.length * n_sub ); - position = spline.getPoint( index ); - - geometry.vertices[ i ] = new THREE.Vertex( new THREE.Vector3( position.x, position.y, position.z ) ); - - } - - return geometry; - - }; - - function createPath( parent, spline ) { - - var lineGeo = createSplineGeometry( spline, 10 ), - particleGeo = createSplineGeometry( spline, 10 ), - lineMat = new THREE.LineBasicMaterial( { color: 0xff0000, linewidth: 3 } ), - lineObj = new THREE.Line( lineGeo, lineMat ), - particleObj = new THREE.ParticleSystem( particleGeo, new THREE.ParticleBasicMaterial( { color: 0xffaa00, size: 3 } ) ); - - lineObj.scale.set( 1, 1, 1 ); - parent.add( lineObj ); - - particleObj.scale.set( 1, 1, 1 ); - parent.add( particleObj ); - - var waypoint, - geo = new THREE.SphereGeometry( 1, 16, 8 ), - mat = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); - - for ( var i = 0; i < spline.points.length; i ++ ) { - - waypoint = new THREE.Mesh( geo, mat ); - waypoint.position.copy( spline.points[ i ] ); - parent.add( waypoint ); - - } - - }; - - this.init = function ( ) { - - // constructor - - this.spline = new THREE.Spline(); - this.spline.initFromArray( this.waypoints ); - - if ( this.useConstantSpeed ) { - - this.spline.reparametrizeByArcLength( this.resamplingCoef ); - - } - - if ( this.createDebugDummy ) { - - var dummyParentMaterial = new THREE.MeshLambertMaterial( { color: 0x0077ff } ), - dummyChildMaterial = new THREE.MeshLambertMaterial( { color: 0x00ff00 } ), - dummyParentGeo = new THREE.CubeGeometry( 10, 10, 20 ), - dummyChildGeo = new THREE.CubeGeometry( 2, 2, 10 ); - - this.animationParent = new THREE.Mesh( dummyParentGeo, dummyParentMaterial ); - - var dummyChild = new THREE.Mesh( dummyChildGeo, dummyChildMaterial ); - dummyChild.position.set( 0, 10, 0 ); - - this.animation = initAnimationPath( this.animationParent, this.spline, this.id, this.duration ); - - this.animationParent.add( this.object ); - this.animationParent.add( this.target ); - this.animationParent.add( dummyChild ); - - } else { - - this.animation = initAnimationPath( this.animationParent, this.spline, this.id, this.duration ); - this.animationParent.add( this.target ); - this.animationParent.add( this.object ); - - } - - if ( this.createDebugPath ) { - - createPath( this.debugPath, this.spline ); - - } - - this.domElement.addEventListener( 'mousemove', bind( this, this.onMouseMove ), false ); - - }; - -}; - -THREE.PathControlsIdCounter = 0; -/** - * @author James Baicoianu / http://www.baicoianu.com/ - */ - -THREE.FlyControls = function ( object, domElement ) { - - this.object = object; - - this.domElement = ( domElement !== undefined ) ? domElement : document; - if ( domElement ) this.domElement.setAttribute( 'tabindex', -1 ); - - // API - - this.movementSpeed = 1.0; - this.rollSpeed = 0.005; - - this.dragToLook = false; - this.autoForward = false; - - // disable default target object behavior - - this.object.useQuaternion = true; - - // internals - - this.tmpQuaternion = new THREE.Quaternion(); - - this.mouseStatus = 0; - - this.moveState = { up: 0, down: 0, left: 0, right: 0, forward: 0, back: 0, pitchUp: 0, pitchDown: 0, yawLeft: 0, yawRight: 0, rollLeft: 0, rollRight: 0 }; - this.moveVector = new THREE.Vector3( 0, 0, 0 ); - this.rotationVector = new THREE.Vector3( 0, 0, 0 ); - - this.handleEvent = function ( event ) { - - if ( typeof this[ event.type ] == 'function' ) { - - this[ event.type ]( event ); - - } - - }; - - this.keydown = function( event ) { - - if ( event.altKey ) { - - return; - - } - - switch( event.keyCode ) { - - case 16: /* shift */ this.movementSpeedMultiplier = .1; break; - - case 87: /*W*/ this.moveState.forward = 1; break; - case 83: /*S*/ this.moveState.back = 1; break; - - case 65: /*A*/ this.moveState.left = 1; break; - case 68: /*D*/ this.moveState.right = 1; break; - - case 82: /*R*/ this.moveState.up = 1; break; - case 70: /*F*/ this.moveState.down = 1; break; - - case 38: /*up*/ this.moveState.pitchUp = 1; break; - case 40: /*down*/ this.moveState.pitchDown = 1; break; - - case 37: /*left*/ this.moveState.yawLeft = 1; break; - case 39: /*right*/ this.moveState.yawRight = 1; break; - - case 81: /*Q*/ this.moveState.rollLeft = 1; break; - case 69: /*E*/ this.moveState.rollRight = 1; break; - - } - - this.updateMovementVector(); - this.updateRotationVector(); - - }; - - this.keyup = function( event ) { - - switch( event.keyCode ) { - - case 16: /* shift */ this.movementSpeedMultiplier = 1; break; - - case 87: /*W*/ this.moveState.forward = 0; break; - case 83: /*S*/ this.moveState.back = 0; break; - - case 65: /*A*/ this.moveState.left = 0; break; - case 68: /*D*/ this.moveState.right = 0; break; - - case 82: /*R*/ this.moveState.up = 0; break; - case 70: /*F*/ this.moveState.down = 0; break; - - case 38: /*up*/ this.moveState.pitchUp = 0; break; - case 40: /*down*/ this.moveState.pitchDown = 0; break; - - case 37: /*left*/ this.moveState.yawLeft = 0; break; - case 39: /*right*/ this.moveState.yawRight = 0; break; - - case 81: /*Q*/ this.moveState.rollLeft = 0; break; - case 69: /*E*/ this.moveState.rollRight = 0; break; - - } - - this.updateMovementVector(); - this.updateRotationVector(); - - }; - - this.mousedown = function( event ) { - - if ( this.domElement !== document ) { - - this.domElement.focus(); - - } - - event.preventDefault(); - event.stopPropagation(); - - if ( this.dragToLook ) { - - this.mouseStatus ++; - - } else { - - switch ( event.button ) { - - case 0: this.object.moveForward = true; break; - case 2: this.object.moveBackward = true; break; - - } - - } - - }; - - this.mousemove = function( event ) { - - if ( !this.dragToLook || this.mouseStatus > 0 ) { - - var container = this.getContainerDimensions(); - var halfWidth = container.size[ 0 ] / 2; - var halfHeight = container.size[ 1 ] / 2; - - this.moveState.yawLeft = - ( ( event.pageX - container.offset[ 0 ] ) - halfWidth ) / halfWidth; - this.moveState.pitchDown = ( ( event.pageY - container.offset[ 1 ] ) - halfHeight ) / halfHeight; - - this.updateRotationVector(); - - } - - }; - - this.mouseup = function( event ) { - - event.preventDefault(); - event.stopPropagation(); - - if ( this.dragToLook ) { - - this.mouseStatus --; - - this.moveState.yawLeft = this.moveState.pitchDown = 0; - - } else { - - switch ( event.button ) { - - case 0: this.moveForward = false; break; - case 2: this.moveBackward = false; break; - - } - - } - - this.updateRotationVector(); - - }; - - this.update = function( delta ) { - - var moveMult = delta * this.movementSpeed; - var rotMult = delta * this.rollSpeed; - - this.object.translateX( this.moveVector.x * moveMult ); - this.object.translateY( this.moveVector.y * moveMult ); - this.object.translateZ( this.moveVector.z * moveMult ); - - this.tmpQuaternion.set( this.rotationVector.x * rotMult, this.rotationVector.y * rotMult, this.rotationVector.z * rotMult, 1 ).normalize(); - this.object.quaternion.multiplySelf( this.tmpQuaternion ); - - this.object.matrix.setPosition( this.object.position ); - this.object.matrix.setRotationFromQuaternion( this.object.quaternion ); - this.object.matrixWorldNeedsUpdate = true; - - - }; - - this.updateMovementVector = function() { - - var forward = ( this.moveState.forward || ( this.autoForward && !this.moveState.back ) ) ? 1 : 0; - - this.moveVector.x = ( -this.moveState.left + this.moveState.right ); - this.moveVector.y = ( -this.moveState.down + this.moveState.up ); - this.moveVector.z = ( -forward + this.moveState.back ); - - //console.log( 'move:', [ this.moveVector.x, this.moveVector.y, this.moveVector.z ] ); - - }; - - this.updateRotationVector = function() { - - this.rotationVector.x = ( -this.moveState.pitchDown + this.moveState.pitchUp ); - this.rotationVector.y = ( -this.moveState.yawRight + this.moveState.yawLeft ); - this.rotationVector.z = ( -this.moveState.rollRight + this.moveState.rollLeft ); - - //console.log( 'rotate:', [ this.rotationVector.x, this.rotationVector.y, this.rotationVector.z ] ); - - }; - - this.getContainerDimensions = function() { - - if ( this.domElement != document ) { - - return { - size : [ this.domElement.offsetWidth, this.domElement.offsetHeight ], - offset : [ this.domElement.offsetLeft, this.domElement.offsetTop ] - }; - - } else { - - return { - size : [ window.innerWidth, window.innerHeight ], - offset : [ 0, 0 ] - }; - - } - - }; - - function bind( scope, fn ) { - - return function () { - - fn.apply( scope, arguments ); - - }; - - }; - - this.domElement.addEventListener( 'mousemove', bind( this, this.mousemove ), false ); - this.domElement.addEventListener( 'mousedown', bind( this, this.mousedown ), false ); - this.domElement.addEventListener( 'mouseup', bind( this, this.mouseup ), false ); - - this.domElement.addEventListener( 'keydown', bind( this, this.keydown ), false ); - this.domElement.addEventListener( 'keyup', bind( this, this.keyup ), false ); - - this.updateMovementVector(); - this.updateRotationVector(); - -}; -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.RollControls = function ( object, domElement ) { - - this.object = object; - this.domElement = ( domElement !== undefined ) ? domElement : document; - - // API - - this.mouseLook = true; - this.autoForward = false; - - this.lookSpeed = 1; - this.movementSpeed = 1; - this.rollSpeed = 1; - - this.constrainVertical = [ -0.9, 0.9 ]; - - // disable default target object behavior - - this.object.matrixAutoUpdate = false; - - // internals - - this.forward = new THREE.Vector3( 0, 0, 1 ); - this.roll = 0; - - var xTemp = new THREE.Vector3(); - var yTemp = new THREE.Vector3(); - var zTemp = new THREE.Vector3(); - var rollMatrix = new THREE.Matrix4(); - - var doRoll = false, rollDirection = 1, forwardSpeed = 0, sideSpeed = 0, upSpeed = 0; - - var mouseX = 0, mouseY = 0; - - var windowHalfX = window.innerWidth / 2; - var windowHalfY = window.innerHeight / 2; - - // custom update - - this.update = function ( delta ) { - - if ( this.mouseLook ) { - - var actualLookSpeed = delta * this.lookSpeed; - - this.rotateHorizontally( actualLookSpeed * mouseX ); - this.rotateVertically( actualLookSpeed * mouseY ); - - } - - var actualSpeed = delta * this.movementSpeed; - var forwardOrAuto = ( forwardSpeed > 0 || ( this.autoForward && ! ( forwardSpeed < 0 ) ) ) ? 1 : forwardSpeed; - - this.object.translateZ( -actualSpeed * forwardOrAuto ); - this.object.translateX( actualSpeed * sideSpeed ); - this.object.translateY( actualSpeed * upSpeed ); - - if( doRoll ) { - - this.roll += this.rollSpeed * delta * rollDirection; - - } - - // cap forward up / down - - if( this.forward.y > this.constrainVertical[ 1 ] ) { - - this.forward.y = this.constrainVertical[ 1 ]; - this.forward.normalize(); - - } else if( this.forward.y < this.constrainVertical[ 0 ] ) { - - this.forward.y = this.constrainVertical[ 0 ]; - this.forward.normalize(); - - } - - - // construct unrolled camera matrix - - zTemp.copy( this.forward ); - yTemp.set( 0, 1, 0 ); - - xTemp.cross( yTemp, zTemp ).normalize(); - yTemp.cross( zTemp, xTemp ).normalize(); - - this.object.matrix.n11 = xTemp.x; this.object.matrix.n12 = yTemp.x; this.object.matrix.n13 = zTemp.x; - this.object.matrix.n21 = xTemp.y; this.object.matrix.n22 = yTemp.y; this.object.matrix.n23 = zTemp.y; - this.object.matrix.n31 = xTemp.z; this.object.matrix.n32 = yTemp.z; this.object.matrix.n33 = zTemp.z; - - // calculate roll matrix - - rollMatrix.identity(); - rollMatrix.n11 = Math.cos( this.roll ); rollMatrix.n12 = -Math.sin( this.roll ); - rollMatrix.n21 = Math.sin( this.roll ); rollMatrix.n22 = Math.cos( this.roll ); - - // multiply camera with roll - - this.object.matrix.multiplySelf( rollMatrix ); - this.object.matrixWorldNeedsUpdate = true; - - // set position - - this.object.matrix.n14 = this.object.position.x; - this.object.matrix.n24 = this.object.position.y; - this.object.matrix.n34 = this.object.position.z; - - - }; - - this.translateX = function ( distance ) { - - this.object.position.x += this.object.matrix.n11 * distance; - this.object.position.y += this.object.matrix.n21 * distance; - this.object.position.z += this.object.matrix.n31 * distance; - - }; - - this.translateY = function ( distance ) { - - this.object.position.x += this.object.matrix.n12 * distance; - this.object.position.y += this.object.matrix.n22 * distance; - this.object.position.z += this.object.matrix.n32 * distance; - - }; - - this.translateZ = function ( distance ) { - - this.object.position.x -= this.object.matrix.n13 * distance; - this.object.position.y -= this.object.matrix.n23 * distance; - this.object.position.z -= this.object.matrix.n33 * distance; - - }; - - - this.rotateHorizontally = function ( amount ) { - - // please note that the amount is NOT degrees, but a scale value - - xTemp.set( this.object.matrix.n11, this.object.matrix.n21, this.object.matrix.n31 ); - xTemp.multiplyScalar( amount ); - - this.forward.subSelf( xTemp ); - this.forward.normalize(); - - }; - - this.rotateVertically = function ( amount ) { - - // please note that the amount is NOT degrees, but a scale value - - yTemp.set( this.object.matrix.n12, this.object.matrix.n22, this.object.matrix.n32 ); - yTemp.multiplyScalar( amount ); - - this.forward.addSelf( yTemp ); - this.forward.normalize(); - - }; - - function onKeyDown( event ) { - - switch( event.keyCode ) { - - case 38: /*up*/ - case 87: /*W*/ forwardSpeed = 1; break; - - case 37: /*left*/ - case 65: /*A*/ sideSpeed = -1; break; - - case 40: /*down*/ - case 83: /*S*/ forwardSpeed = -1; break; - - case 39: /*right*/ - case 68: /*D*/ sideSpeed = 1; break; - - case 81: /*Q*/ doRoll = true; rollDirection = 1; break; - case 69: /*E*/ doRoll = true; rollDirection = -1; break; - - case 82: /*R*/ upSpeed = 1; break; - case 70: /*F*/ upSpeed = -1; break; - - } - - }; - - function onKeyUp( event ) { - - switch( event.keyCode ) { - - case 38: /*up*/ - case 87: /*W*/ forwardSpeed = 0; break; - - case 37: /*left*/ - case 65: /*A*/ sideSpeed = 0; break; - - case 40: /*down*/ - case 83: /*S*/ forwardSpeed = 0; break; - - case 39: /*right*/ - case 68: /*D*/ sideSpeed = 0; break; - - case 81: /*Q*/ doRoll = false; break; - case 69: /*E*/ doRoll = false; break; - - case 82: /*R*/ upSpeed = 0; break; - case 70: /*F*/ upSpeed = 0; break; - - } - - }; - - function onMouseMove( event ) { - - mouseX = ( event.clientX - windowHalfX ) / window.innerWidth; - mouseY = ( event.clientY - windowHalfY ) / window.innerHeight; - - }; - - function onMouseDown ( event ) { - - event.preventDefault(); - event.stopPropagation(); - - switch ( event.button ) { - - case 0: forwardSpeed = 1; break; - case 2: forwardSpeed = -1; break; - - } - - }; - - function onMouseUp ( event ) { - - event.preventDefault(); - event.stopPropagation(); - - switch ( event.button ) { - - case 0: forwardSpeed = 0; break; - case 2: forwardSpeed = 0; break; - - } - - }; - - this.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false ); - - this.domElement.addEventListener( 'mousemove', onMouseMove, false ); - this.domElement.addEventListener( 'mousedown', onMouseDown, false ); - this.domElement.addEventListener( 'mouseup', onMouseUp, false ); - this.domElement.addEventListener( 'keydown', onKeyDown, false ); - this.domElement.addEventListener( 'keyup', onKeyUp, false ); - -}; -/** - * @author Eberhard Graether / http://egraether.com/ - */ - -THREE.TrackballControls = function ( object, domElement ) { - - var _this = this, - STATE = { NONE : -1, ROTATE : 0, ZOOM : 1, PAN : 2 }; - - this.object = object; - this.domElement = ( domElement !== undefined ) ? domElement : document; - - // API - - this.enabled = true; - - this.screen = { width: window.innerWidth, height: window.innerHeight, offsetLeft: 0, offsetTop: 0 }; - this.radius = ( this.screen.width + this.screen.height ) / 4; - - this.rotateSpeed = 1.0; - this.zoomSpeed = 1.2; - this.panSpeed = 0.3; - - this.noRotate = false; - this.noZoom = false; - this.noPan = false; - - this.staticMoving = false; - this.dynamicDampingFactor = 0.2; - - this.minDistance = 0; - this.maxDistance = Infinity; - - this.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ]; - - // internals - - this.target = new THREE.Vector3( 0, 0, 0 ); - - var _keyPressed = false, - _state = STATE.NONE, - - _eye = new THREE.Vector3(), - - _rotateStart = new THREE.Vector3(), - _rotateEnd = new THREE.Vector3(), - - _zoomStart = new THREE.Vector2(), - _zoomEnd = new THREE.Vector2(), - - _panStart = new THREE.Vector2(), - _panEnd = new THREE.Vector2(); - - - // methods - - this.handleEvent = function ( event ) { - - if ( typeof this[ event.type ] == 'function' ) { - - this[ event.type ]( event ); - - } - - }; - - this.getMouseOnScreen = function( clientX, clientY ) { - - return new THREE.Vector2( - ( clientX - _this.screen.offsetLeft ) / _this.radius * 0.5, - ( clientY - _this.screen.offsetTop ) / _this.radius * 0.5 - ); - - }; - - this.getMouseProjectionOnBall = function( clientX, clientY ) { - - var mouseOnBall = new THREE.Vector3( - ( clientX - _this.screen.width * 0.5 - _this.screen.offsetLeft ) / _this.radius, - ( _this.screen.height * 0.5 + _this.screen.offsetTop - clientY ) / _this.radius, - 0.0 - ); - - var length = mouseOnBall.length(); - - if ( length > 1.0 ) { - - mouseOnBall.normalize(); - - } else { - - mouseOnBall.z = Math.sqrt( 1.0 - length * length ); - - } - - _eye.copy( _this.object.position ).subSelf( _this.target ); - - var projection = _this.object.up.clone().setLength( mouseOnBall.y ); - projection.addSelf( _this.object.up.clone().crossSelf( _eye ).setLength( mouseOnBall.x ) ); - projection.addSelf( _eye.setLength( mouseOnBall.z ) ); - - return projection; - - }; - - this.rotateCamera = function() { - - var angle = Math.acos( _rotateStart.dot( _rotateEnd ) / _rotateStart.length() / _rotateEnd.length() ); - - if ( angle ) { - - var axis = ( new THREE.Vector3() ).cross( _rotateStart, _rotateEnd ).normalize(), - quaternion = new THREE.Quaternion(); - - angle *= _this.rotateSpeed; - - quaternion.setFromAxisAngle( axis, -angle ); - - quaternion.multiplyVector3( _eye ); - quaternion.multiplyVector3( _this.object.up ); - - quaternion.multiplyVector3( _rotateEnd ); - - if ( _this.staticMoving ) { - - _rotateStart = _rotateEnd; - - } else { - - quaternion.setFromAxisAngle( axis, angle * ( _this.dynamicDampingFactor - 1.0 ) ); - quaternion.multiplyVector3( _rotateStart ); - - } - - } - - }; - - this.zoomCamera = function() { - - var factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed; - - if ( factor !== 1.0 && factor > 0.0 ) { - - _eye.multiplyScalar( factor ); - - if ( _this.staticMoving ) { - - _zoomStart = _zoomEnd; - - } else { - - _zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor; - - } - - } - - }; - - this.panCamera = function() { - - var mouseChange = _panEnd.clone().subSelf( _panStart ); - - if ( mouseChange.lengthSq() ) { - - mouseChange.multiplyScalar( _eye.length() * _this.panSpeed ); - - var pan = _eye.clone().crossSelf( _this.object.up ).setLength( mouseChange.x ); - pan.addSelf( _this.object.up.clone().setLength( mouseChange.y ) ); - - _this.object.position.addSelf( pan ); - _this.target.addSelf( pan ); - - if ( _this.staticMoving ) { - - _panStart = _panEnd; - - } else { - - _panStart.addSelf( mouseChange.sub( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) ); - - } - - } - - }; - - this.checkDistances = function() { - - if ( !_this.noZoom || !_this.noPan ) { - - if ( _this.object.position.lengthSq() > _this.maxDistance * _this.maxDistance ) { - - _this.object.position.setLength( _this.maxDistance ); - - } - - if ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) { - - _this.object.position.add( _this.target, _eye.setLength( _this.minDistance ) ); - - } - - } - - }; - - this.update = function() { - - _eye.copy( _this.object.position ).subSelf( this.target ); - - if ( !_this.noRotate ) { - - _this.rotateCamera(); - - } - - if ( !_this.noZoom ) { - - _this.zoomCamera(); - - } - - if ( !_this.noPan ) { - - _this.panCamera(); - - } - - _this.object.position.add( _this.target, _eye ); - - _this.checkDistances(); - - _this.object.lookAt( _this.target ); - - }; - - - // listeners - - function keydown( event ) { - - if ( ! _this.enabled ) return; - - if ( _state !== STATE.NONE ) { - - return; - - } else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && !_this.noRotate ) { - - _state = STATE.ROTATE; - - } else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && !_this.noZoom ) { - - _state = STATE.ZOOM; - - } else if ( event.keyCode === _this.keys[ STATE.PAN ] && !_this.noPan ) { - - _state = STATE.PAN; - - } - - if ( _state !== STATE.NONE ) { - - _keyPressed = true; - - } - - }; - - function keyup( event ) { - - if ( ! _this.enabled ) return; - - if ( _state !== STATE.NONE ) { - - _state = STATE.NONE; - - } - - }; - - function mousedown( event ) { - - if ( ! _this.enabled ) return; - - event.preventDefault(); - event.stopPropagation(); - - if ( _state === STATE.NONE ) { - - _state = event.button; - - if ( _state === STATE.ROTATE && !_this.noRotate ) { - - _rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.clientX, event.clientY ); - - } else if ( _state === STATE.ZOOM && !_this.noZoom ) { - - _zoomStart = _zoomEnd = _this.getMouseOnScreen( event.clientX, event.clientY ); - - } else if ( !this.noPan ) { - - _panStart = _panEnd = _this.getMouseOnScreen( event.clientX, event.clientY ); - - } - - } - - }; - - function mousemove( event ) { - - if ( ! _this.enabled ) return; - - if ( _keyPressed ) { - - _rotateStart = _rotateEnd = _this.getMouseProjectionOnBall( event.clientX, event.clientY ); - _zoomStart = _zoomEnd = _this.getMouseOnScreen( event.clientX, event.clientY ); - _panStart = _panEnd = _this.getMouseOnScreen( event.clientX, event.clientY ); - - _keyPressed = false; - - } - - if ( _state === STATE.NONE ) { - - return; - - } else if ( _state === STATE.ROTATE && !_this.noRotate ) { - - _rotateEnd = _this.getMouseProjectionOnBall( event.clientX, event.clientY ); - - } else if ( _state === STATE.ZOOM && !_this.noZoom ) { - - _zoomEnd = _this.getMouseOnScreen( event.clientX, event.clientY ); - - } else if ( _state === STATE.PAN && !_this.noPan ) { - - _panEnd = _this.getMouseOnScreen( event.clientX, event.clientY ); - - } - - }; - - function mouseup( event ) { - - if ( ! _this.enabled ) return; - - event.preventDefault(); - event.stopPropagation(); - - _state = STATE.NONE; - - }; - - this.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false ); - - this.domElement.addEventListener( 'mousemove', mousemove, false ); - this.domElement.addEventListener( 'mousedown', mousedown, false ); - this.domElement.addEventListener( 'mouseup', mouseup, false ); - - window.addEventListener( 'keydown', keydown, false ); - window.addEventListener( 'keyup', keyup, false ); - -}; -/** - * @author mr.doob / http://mrdoob.com/ - * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Cube.as - */ - -THREE.CubeGeometry = function ( width, height, depth, segmentsWidth, segmentsHeight, segmentsDepth, materials, sides ) { - - THREE.Geometry.call( this ); - - var scope = this, - width_half = width / 2, - height_half = height / 2, - depth_half = depth / 2; - - var mpx, mpy, mpz, mnx, mny, mnz; - - if ( materials !== undefined ) { - - if ( materials instanceof Array ) { - - this.materials = materials; - - } else { - - this.materials = []; - - for ( var i = 0; i < 6; i ++ ) { - - this.materials.push( materials ); - - } - - } - - mpx = 0; mnx = 1; mpy = 2; mny = 3; mpz = 4; mnz = 5; - - } else { - - this.materials = []; - - } - - this.sides = { px: true, nx: true, py: true, ny: true, pz: true, nz: true }; - - if ( sides != undefined ) { - - for ( var s in sides ) { - - if ( this.sides[ s ] !== undefined ) { - - this.sides[ s ] = sides[ s ]; - - } - - } - - } - - this.sides.px && buildPlane( 'z', 'y', - 1, - 1, depth, height, width_half, mpx ); // px - this.sides.nx && buildPlane( 'z', 'y', 1, - 1, depth, height, - width_half, mnx ); // nx - this.sides.py && buildPlane( 'x', 'z', 1, 1, width, depth, height_half, mpy ); // py - this.sides.ny && buildPlane( 'x', 'z', 1, - 1, width, depth, - height_half, mny ); // ny - this.sides.pz && buildPlane( 'x', 'y', 1, - 1, width, height, depth_half, mpz ); // pz - this.sides.nz && buildPlane( 'x', 'y', - 1, - 1, width, height, - depth_half, mnz ); // nz - - function buildPlane( u, v, udir, vdir, width, height, depth, material ) { - - var w, ix, iy, - gridX = segmentsWidth || 1, - gridY = segmentsHeight || 1, - width_half = width / 2, - height_half = height / 2, - offset = scope.vertices.length; - - if ( ( u === 'x' && v === 'y' ) || ( u === 'y' && v === 'x' ) ) { - - w = 'z'; - - } else if ( ( u === 'x' && v === 'z' ) || ( u === 'z' && v === 'x' ) ) { - - w = 'y'; - gridY = segmentsDepth || 1; - - } else if ( ( u === 'z' && v === 'y' ) || ( u === 'y' && v === 'z' ) ) { - - w = 'x'; - gridX = segmentsDepth || 1; - - } - - var gridX1 = gridX + 1, - gridY1 = gridY + 1, - segment_width = width / gridX, - segment_height = height / gridY, - normal = new THREE.Vector3(); - - normal[ w ] = depth > 0 ? 1 : - 1; - - for ( iy = 0; iy < gridY1; iy ++ ) { - - for ( ix = 0; ix < gridX1; ix ++ ) { - - var vector = new THREE.Vector3(); - vector[ u ] = ( ix * segment_width - width_half ) * udir; - vector[ v ] = ( iy * segment_height - height_half ) * vdir; - vector[ w ] = depth; - - scope.vertices.push( new THREE.Vertex( vector ) ); - - } - - } - - for ( iy = 0; iy < gridY; iy++ ) { - - for ( ix = 0; ix < gridX; ix++ ) { - - var a = ix + gridX1 * iy; - var b = ix + gridX1 * ( iy + 1 ); - var c = ( ix + 1 ) + gridX1 * ( iy + 1 ); - var d = ( ix + 1 ) + gridX1 * iy; - - var face = new THREE.Face4( a + offset, b + offset, c + offset, d + offset ); - face.normal.copy( normal ); - face.vertexNormals.push( normal.clone(), normal.clone(), normal.clone(), normal.clone() ); - face.materialIndex = material; - - scope.faces.push( face ); - scope.faceVertexUvs[ 0 ].push( [ - new THREE.UV( ix / gridX, iy / gridY ), - new THREE.UV( ix / gridX, ( iy + 1 ) / gridY ), - new THREE.UV( ( ix + 1 ) / gridX, ( iy + 1 ) / gridY ), - new THREE.UV( ( ix + 1 ) / gridX, iy / gridY ) - ] ); - - } - - } - - } - - this.computeCentroids(); - this.mergeVertices(); - -}; - -THREE.CubeGeometry.prototype = new THREE.Geometry(); -THREE.CubeGeometry.prototype.constructor = THREE.CubeGeometry; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, segmentsRadius, segmentsHeight, openEnded ) { - - THREE.Geometry.call( this ); - - radiusTop = radiusTop !== undefined ? radiusTop : 20; - radiusBottom = radiusBottom !== undefined ? radiusBottom : 20; - height = height !== undefined ? height : 100; - - var heightHalf = height / 2; - var segmentsX = segmentsRadius || 8; - var segmentsY = segmentsHeight || 1; - - var x, y, vertices = [], uvs = []; - - for ( y = 0; y <= segmentsY; y ++ ) { - - var verticesRow = []; - var uvsRow = []; - - var v = y / segmentsY; - var radius = v * ( radiusBottom - radiusTop ) + radiusTop; - - for ( x = 0; x <= segmentsX; x ++ ) { - - var u = x / segmentsX; - - var xpos = radius * Math.sin( u * Math.PI * 2 ); - var ypos = - v * height + heightHalf; - var zpos = radius * Math.cos( u * Math.PI * 2 ); - - this.vertices.push( new THREE.Vertex( new THREE.Vector3( xpos, ypos, zpos ) ) ); - - verticesRow.push( this.vertices.length - 1 ); - uvsRow.push( new THREE.UV( u, v ) ); - - } - - vertices.push( verticesRow ); - uvs.push( uvsRow ); - - } - - for ( y = 0; y < segmentsY; y ++ ) { - - for ( x = 0; x < segmentsX; x ++ ) { - - var v1 = vertices[ y ][ x ]; - var v2 = vertices[ y + 1 ][ x ]; - var v3 = vertices[ y + 1 ][ x + 1 ]; - var v4 = vertices[ y ][ x + 1 ]; - - // FIXME: These normals aren't right for cones. - - var n1 = this.vertices[ v1 ].position.clone().setY( 0 ).normalize(); - var n2 = this.vertices[ v2 ].position.clone().setY( 0 ).normalize(); - var n3 = this.vertices[ v3 ].position.clone().setY( 0 ).normalize(); - var n4 = this.vertices[ v4 ].position.clone().setY( 0 ).normalize(); - - var uv1 = uvs[ y ][ x ].clone(); - var uv2 = uvs[ y + 1 ][ x ].clone(); - var uv3 = uvs[ y + 1 ][ x + 1 ].clone(); - var uv4 = uvs[ y ][ x + 1 ].clone(); - - this.faces.push( new THREE.Face4( v1, v2, v3, v4, [ n1, n2, n3, n4 ] ) ); - this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3, uv4 ] ); - - } - - } - - // top cap - - if ( !openEnded && radiusTop > 0 ) { - - this.vertices.push( new THREE.Vertex( new THREE.Vector3( 0, heightHalf, 0 ) ) ); - - for ( x = 0; x < segmentsX; x ++ ) { - - var v1 = vertices[ 0 ][ x ]; - var v2 = vertices[ 0 ][ x + 1 ]; - var v3 = this.vertices.length - 1; - - var n1 = new THREE.Vector3( 0, 1, 0 ); - var n2 = new THREE.Vector3( 0, 1, 0 ); - var n3 = new THREE.Vector3( 0, 1, 0 ); - - var uv1 = uvs[ 0 ][ x ].clone(); - var uv2 = uvs[ 0 ][ x + 1 ].clone(); - var uv3 = new THREE.UV( uv2.u, 0 ); - - this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ] ) ); - this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] ); - - } - - } - - // bottom cap - - if ( !openEnded && radiusBottom > 0 ) { - - this.vertices.push( new THREE.Vertex( new THREE.Vector3( 0, - heightHalf, 0 ) ) ); - - for ( x = 0; x < segmentsX; x ++ ) { - - var v1 = vertices[ y ][ x + 1 ]; - var v2 = vertices[ y ][ x ]; - var v3 = this.vertices.length - 1; - - var n1 = new THREE.Vector3( 0, - 1, 0 ); - var n2 = new THREE.Vector3( 0, - 1, 0 ); - var n3 = new THREE.Vector3( 0, - 1, 0 ); - - var uv1 = uvs[ y ][ x + 1 ].clone(); - var uv2 = uvs[ y ][ x ].clone(); - var uv3 = new THREE.UV( uv2.u, 1 ); - - this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ] ) ); - this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] ); - - } - - } - - this.computeCentroids(); - this.computeFaceNormals(); - -} -THREE.CylinderGeometry.prototype = new THREE.Geometry(); -THREE.CylinderGeometry.prototype.constructor = THREE.CylinderGeometry; -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * - * Creates extruded geometry from a path shape. - * - * parameters = { - * - * size: , // size of the text - * height: , // thickness to extrude text - * curveSegments: , // number of points on the curves - * steps: , // number of points for z-side extrusions - * - * font: , // font name - * weight: , // font weight (normal, bold) - * style: , // font style (normal, italics) - * - * bevelEnabled: , // turn on bevel - * bevelThickness: , // how deep into text bevel goes - * bevelSize: , // how far from text outline is bevel - * bevelSegments: , // number of bevel layers - * - * extrudePath: // path to extrude shape along - * bendPath: // path to bend the geometry around - * - * material: // material index for front and back faces - * extrudeMaterial: // material index for extrusion and beveled faces - * - * } - **/ - -THREE.ExtrudeGeometry = function( shapes, options ) { - - if ( typeof( shapes ) === "undefined" ) { - - shapes = []; - return; - - } - - THREE.Geometry.call( this ); - - shapes = shapes instanceof Array ? shapes : [ shapes ]; - - var shape, s, sl = shapes.length; - - this.shapebb = shapes[ sl - 1 ].getBoundingBox(); - - for ( s = 0; s < sl; s ++ ) { - - shape = shapes[ s ]; - - this.addShape( shape, options ); - - } - - - this.computeCentroids(); - this.computeFaceNormals(); - - // can't really use automatic vertex normals - // as then front and back sides get smoothed too - // should do separate smoothing just for sides - - //this.computeVertexNormals(); - - //console.log( "took", ( Date.now() - startTime ) ); - -}; - -THREE.ExtrudeGeometry.prototype = new THREE.Geometry(); -THREE.ExtrudeGeometry.prototype.constructor = THREE.ExtrudeGeometry; - - -THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) { - - var amount = options.amount !== undefined ? options.amount : 100; - - var bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 6; // 10 - var bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 2; // 8 - var bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3; - - var bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true; // false - - var curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12; - - var steps = options.steps !== undefined ? options.steps : 1; - - var bendPath = options.bendPath; - - var extrudePath = options.extrudePath; - var extrudePts, extrudeByPath = false; - - var useSpacedPoints = options.useSpacedPoints !== undefined ? options.useSpacedPoints : false; - - var material = options.material; - var extrudeMaterial = options.extrudeMaterial; - - var shapebb = this.shapebb; - //shapebb = shape.getBoundingBox(); - - - if ( extrudePath ) { - - extrudePts = extrudePath.getPoints( curveSegments ); - steps = extrudePts.length; - extrudeByPath = true; - bevelEnabled = false; // bevels not supported for path extrusion - - } - - // Safeguards if bevels are not enabled - - if ( ! bevelEnabled ) { - - bevelSegments = 0; - bevelThickness = 0; - bevelSize = 0; - - } - - - // TODO, extrude by path's tangents? also via 3d path? - - // Variables initalization - - var ahole, h, hl; // looping of holes - var scope = this; - var bevelPoints = []; - - var shapesOffset = this.vertices.length; - - if ( bendPath ) { - - shape.addWrapPath( bendPath ); - - } - - var shapePoints; - - if ( ! useSpacedPoints ) { - - shapePoints = shape.extractAllPoints( curveSegments ); // - - } else { - - // QN - Would it be better to pass useSpacePoints parameter to shape, just like bendpath ? - - shapePoints = shape.extractAllSpacedPoints( curveSegments ) // for points with equal divisions - - } - - var vertices = shapePoints.shape; - var holes = shapePoints.holes; - - var reverse = !THREE.Shape.Utils.isClockWise( vertices ) ; - - if ( reverse ) { - - vertices = vertices.reverse(); - - // Maybe we should also check if holes are in the opposite direction, just to be safe ... - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - - if ( THREE.Shape.Utils.isClockWise( ahole ) ) { - - holes[ h ] = ahole.reverse(); - - } - - } - - reverse = false; // If vertices are in order now, we shouldn't need to worry about them again (hopefully)! - - } - - - var faces = THREE.Shape.Utils.triangulateShape ( vertices, holes ); - //var faces = THREE.Shape.Utils.triangulate2( vertices, holes ); - - // Would it be better to move points after triangulation? - // shapePoints = shape.extractAllPointsWithBend( curveSegments, bendPath ); - // vertices = shapePoints.shape; - // holes = shapePoints.holes; - - //console.log(faces); - - //// - /// Handle Vertices - //// - - var contour = vertices; // vertices has all points but contour has only points of circumference - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - - vertices = vertices.concat( ahole ); - - } - - - function scalePt2 ( pt, vec, size ) { - - if ( !vec ) console.log( "die" ); - - return vec.clone().multiplyScalar( size ).addSelf( pt ); - - } - - var b, bs, t, z, - vert, vlen = vertices.length, - face, flen = faces.length, - cont, clen = contour.length; - - - //------ - // Find directions for point movement - // - - var RAD_TO_DEGREES = 180 / Math.PI; - - - function getBevelVec( pt_i, pt_j, pt_k ) { - - // Algorithm 2 - - return getBevelVec2( pt_i, pt_j, pt_k ); - - } - - function getBevelVec1( pt_i, pt_j, pt_k ) { - - var anglea = Math.atan2( pt_j.y - pt_i.y, pt_j.x - pt_i.x ); - var angleb = Math.atan2( pt_k.y - pt_i.y, pt_k.x - pt_i.x ); - - if ( anglea > angleb ) { - - angleb += Math.PI * 2; - - } - - var anglec = ( anglea + angleb ) / 2; - - - //console.log('angle1', anglea * RAD_TO_DEGREES,'angle2', angleb * RAD_TO_DEGREES, 'anglec', anglec *RAD_TO_DEGREES); - - var x = - Math.cos( anglec ); - var y = - Math.sin( anglec ); - - var vec = new THREE.Vector2( x, y ); //.normalize(); - - return vec; - - } - - function getBevelVec2( pt_i, pt_j, pt_k ) { - - var a = THREE.ExtrudeGeometry.__v1, - b = THREE.ExtrudeGeometry.__v2, - v_hat = THREE.ExtrudeGeometry.__v3, - w_hat = THREE.ExtrudeGeometry.__v4, - p = THREE.ExtrudeGeometry.__v5, - q = THREE.ExtrudeGeometry.__v6, - v, w, - v_dot_w_hat, q_sub_p_dot_w_hat, - s, intersection; - - // good reading for line-line intersection - // http://sputsoft.com/blog/2010/03/line-line-intersection.html - - // define a as vector j->i - // define b as vectot k->i - - a.set( pt_i.x - pt_j.x, pt_i.y - pt_j.y ); - b.set( pt_i.x - pt_k.x, pt_i.y - pt_k.y ); - - // get unit vectors - - v = a.normalize(); - w = b.normalize(); - - // normals from pt i - - v_hat.set( -v.y, v.x ); - w_hat.set( w.y, -w.x ); - - // pts from i - - p.copy( pt_i ).addSelf( v_hat ); - q.copy( pt_i ).addSelf( w_hat ); - - if ( p.equals( q ) ) { - - //console.log("Warning: lines are straight"); - return w_hat.clone(); - - } - - // Points from j, k. helps prevents points cross overover most of the time - - p.copy( pt_j ).addSelf( v_hat ); - q.copy( pt_k ).addSelf( w_hat ); - - v_dot_w_hat = v.dot( w_hat ); - q_sub_p_dot_w_hat = q.subSelf( p ).dot( w_hat ); - - // We should not reach these conditions - - if ( v_dot_w_hat === 0 ) { - - console.log( "Either infinite or no solutions!" ); - - if ( q_sub_p_dot_w_hat === 0 ) { - - console.log( "Its finite solutions." ); - - } else { - - console.log( "Too bad, no solutions." ); - - } - - } - - s = q_sub_p_dot_w_hat / v_dot_w_hat; - - if ( s < 0 ) { - - // in case of emergecy, revert to algorithm 1. - - return getBevelVec1( pt_i, pt_j, pt_k ); - - } - - intersection = v.multiplyScalar( s ).addSelf( p ); - - return intersection.subSelf( pt_i ).clone(); // Don't normalize!, otherwise sharp corners become ugly - - } - - var contourMovements = []; - - for ( var i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - - if ( j === il ) j = 0; - if ( k === il ) k = 0; - - // (j)---(i)---(k) - // console.log('i,j,k', i, j , k) - - var pt_i = contour[ i ]; - var pt_j = contour[ j ]; - var pt_k = contour[ k ]; - - contourMovements[ i ]= getBevelVec( contour[ i ], contour[ j ], contour[ k ] ); - - } - - var holesMovements = [], oneHoleMovements, verticesMovements = contourMovements.concat(); - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - - oneHoleMovements = []; - - for ( i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i ++, j ++, k ++ ) { - - if ( j === il ) j = 0; - if ( k === il ) k = 0; - - // (j)---(i)---(k) - oneHoleMovements[ i ]= getBevelVec( ahole[ i ], ahole[ j ], ahole[ k ] ); - - } - - holesMovements.push( oneHoleMovements ); - verticesMovements = verticesMovements.concat( oneHoleMovements ); - - } - - - // Loop bevelSegments, 1 for the front, 1 for the back - - for ( b = 0; b < bevelSegments; b ++ ) { - //for ( b = bevelSegments; b > 0; b -- ) { - - t = b / bevelSegments; - z = bevelThickness * ( 1 - t ); - - //z = bevelThickness * t; - bs = bevelSize * ( Math.sin ( t * Math.PI/2 ) ) ; // curved - //bs = bevelSize * t ; // linear - - // contract shape - - for ( i = 0, il = contour.length; i < il; i ++ ) { - - vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - //vert = scalePt( contour[ i ], contourCentroid, bs, false ); - v( vert.x, vert.y, - z ); - - } - - // expand holes - - for ( h = 0, hl = holes.length; h < hl; h++ ) { - - ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; - - for ( i = 0, il = ahole.length; i < il; i++ ) { - - vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - //vert = scalePt( ahole[ i ], holesCentroids[ h ], bs, true ); - - v( vert.x, vert.y, -z ); - - } - - } - - } - - bs = bevelSize; - - // Back facing vertices - - for ( i = 0; i < vlen; i ++ ) { - - vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - - if ( !extrudeByPath ) { - - v( vert.x, vert.y, 0 ); - - } else { - - v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x ); - - } - - } - - // Add stepped vertices... - // Including front facing vertices - - var s; - - for ( s = 1; s <= steps; s ++ ) { - - for ( i = 0; i < vlen; i ++ ) { - - vert = bevelEnabled ? scalePt2( vertices[ i ], verticesMovements[ i ], bs ) : vertices[ i ]; - - if ( !extrudeByPath ) { - - v( vert.x, vert.y, amount / steps * s ); - - } else { - - v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x ); - - } - - } - - } - - - // Add bevel segments planes - - //for ( b = 1; b <= bevelSegments; b ++ ) { - for ( b = bevelSegments - 1; b >= 0; b -- ) { - - t = b / bevelSegments; - z = bevelThickness * ( 1 - t ); - //bs = bevelSize * ( 1-Math.sin ( ( 1 - t ) * Math.PI/2 ) ); - bs = bevelSize * Math.sin ( t * Math.PI/2 ) ; - - // contract shape - - for ( i = 0, il = contour.length; i < il; i ++ ) { - - vert = scalePt2( contour[ i ], contourMovements[ i ], bs ); - v( vert.x, vert.y, amount + z ); - - } - - // expand holes - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - oneHoleMovements = holesMovements[ h ]; - - for ( i = 0, il = ahole.length; i < il; i++ ) { - - vert = scalePt2( ahole[ i ], oneHoleMovements[ i ], bs ); - - if ( !extrudeByPath ) { - - v( vert.x, vert.y, amount + z ); - - } else { - - v( vert.x, vert.y + extrudePts[ steps - 1 ].y, extrudePts[ steps - 1 ].x + z ); - - } - - } - - } - - } - - - //// - /// Handle Faces - //// - - // Bottom faces - - if ( bevelEnabled ) { - - var layer = 0 ; // steps + 1 - var offset = vlen * layer; - - for ( i = 0; i < flen; i ++ ) { - - face = faces[ i ]; - f3( face[ 2 ]+ offset, face[ 1 ]+ offset, face[ 0 ] + offset ); - - } - - layer = steps + bevelSegments * 2; - offset = vlen * layer; - - // Top faces - - for ( i = 0; i < flen; i ++ ) { - - face = faces[ i ]; - f3( face[ 0 ] + offset, face[ 1 ] + offset, face[ 2 ] + offset ); - - } - - } else { - - for ( i = 0; i < flen; i++ ) { - - face = faces[ i ]; - f3( face[ 2 ], face[ 1 ], face[ 0 ] ); - - } - - // Top faces - - for ( i = 0; i < flen; i ++ ) { - - face = faces[ i ]; - f3( face[ 0 ] + vlen * steps, face[ 1 ] + vlen * steps, face[ 2 ] + vlen * steps ); - - } - - } - - var tmpPt; - var j, k, l, m; - - var layeroffset = 0; - - // Sides faces - - sidewalls( contour ); - layeroffset += contour.length; - - for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - sidewalls( ahole ); - - //, true - layeroffset += ahole.length; - - } - - // Create faces for the z-sides of the shape - - function sidewalls( contour ) { - - i = contour.length; - - while ( --i >= 0 ) { - - tmpPt = contour[ i ]; - - j = i; - k = i - 1; - - if ( k < 0 ) k = contour.length - 1; - - //console.log('b', i,j, i-1, k,vertices.length); - - var s = 0, sl = steps + bevelSegments * 2; - - for ( s = 0; s < sl; s ++ ) { - - var slen1 = vlen * s; - var slen2 = vlen * ( s + 1 ); - var a = layeroffset + j + slen1, - b = layeroffset + k + slen1, - c = layeroffset + k + slen2, - d = layeroffset + j + slen2; - - f4( a, b, c, d ); - - if ( extrudeMaterial !== undefined ) { - - var v1 = s / sl; - var v2 = ( s + 1 ) / sl; - - var ztol = ( amount + bevelThickness * 2 ); - - var u1 = ( scope.vertices[ a ].position.z + bevelThickness ) / ztol; - var u2 = ( scope.vertices[ d ].position.z + bevelThickness ) / ztol; - - //console.log(vy1, vy2); - - scope.faceVertexUvs[ 0 ].push( [ - new THREE.UV( u1, v1 ), - new THREE.UV( u2, v1 ), - new THREE.UV( u2, v2 ), - new THREE.UV( u1, v2 ) - ] ); - } - - - } - - } - - } - - - function v( x, y, z ) { - - scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ); - - } - - function f3( a, b, c ) { - - a += shapesOffset; - b += shapesOffset; - c += shapesOffset; - - scope.faces.push( new THREE.Face3( a, b, c, null, null, material ) ); - //normal, color, materials - - if ( material !== undefined ) { - - var mx = shapebb.minX, my = shapebb.minY; - - var uy = shapebb.maxY; // - shapebb.minY; - var ux = shapebb.maxX; // - shapebb.minX; - - var ax = scope.vertices[ a ].position.x - mx, - ay = scope.vertices[ a ].position.y - my, - - bx = scope.vertices[ b ].position.x - mx, - by = scope.vertices[ b ].position.y - my, - - cx = scope.vertices[ c ].position.x - mx, - cy = scope.vertices[ c ].position.y - my; - - scope.faceVertexUvs[ 0 ].push( [ - - new THREE.UV( ax / ux, ay / uy ), - new THREE.UV( bx / ux, by / uy ), - new THREE.UV( cx / ux, cy / uy ) - - ] ); - } - - } - - function f4( a, b, c, d ) { - - a += shapesOffset; - b += shapesOffset; - c += shapesOffset; - d += shapesOffset; - - scope.faces.push( new THREE.Face4( a, b, c, d, null, null, extrudeMaterial ) ); - - } - -}; - - -THREE.ExtrudeGeometry.__v1 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v2 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v3 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v4 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v5 = new THREE.Vector2(); -THREE.ExtrudeGeometry.__v6 = new THREE.Vector2(); -/** - * @author oosmoxiecode - * - * uvs are messed up in this one, and commented away for now. There is an ugly "seam" by the shared vertices - * when it "wraps" around, that needs to be fixed. It's because they share the first and the last vertices - * so it draws the entire texture on the seam-faces, I think... - */ - -THREE.IcosahedronGeometry = function ( subdivisions ) { - - var scope = this; - var tempScope = new THREE.Geometry(); - var tempFaces; - this.subdivisions = subdivisions || 0; - - THREE.Geometry.call( this ); - - // create 12 vertices of a Icosahedron - - var t = ( 1 + Math.sqrt( 5 ) ) / 2; - - v(-1, t, 0); - v( 1, t, 0); - v(-1, -t, 0); - v( 1, -t, 0); - - v( 0, -1, t); - v( 0, 1, t); - v( 0, -1, -t); - v( 0, 1, -t); - - v( t, 0, -1); - v( t, 0, 1); - v(-t, 0, -1); - v(-t, 0, 1); - - // 5 faces around point 0 - - f3(0, 11, 5, tempScope); - f3(0, 5, 1, tempScope); - f3(0, 1, 7, tempScope); - f3(0, 7, 10, tempScope); - f3(0, 10, 11, tempScope); - - // 5 adjacent faces - - f3(1, 5, 9, tempScope); - f3(5, 11, 4, tempScope); - f3(11, 10, 2, tempScope); - f3(10, 7, 6, tempScope); - f3(7, 1, 8, tempScope); - - // 5 faces around point 3 - - f3(3, 9, 4, tempScope); - f3(3, 4, 2, tempScope); - f3(3, 2, 6, tempScope); - f3(3, 6, 8, tempScope); - f3(3, 8, 9, tempScope); - - // 5 adjacent faces - - f3(4, 9, 5, tempScope); - f3(2, 4, 11, tempScope); - f3(6, 2, 10, tempScope); - f3(8, 6, 7, tempScope); - f3(9, 8, 1, tempScope); - - // subdivide faces to refine the triangles - - for ( var i = 0; i < this.subdivisions; i ++ ) { - - tempFaces = new THREE.Geometry(); - - for ( var i = 0, l = tempScope.faces.length; i < l; i ++ ) { - - // replace each triangle by 4 triangles - - var face = tempScope.faces[ i ]; - - var a = getMiddlePoint( face.a, face.b ); - var b = getMiddlePoint( face.b, face.c ); - var c = getMiddlePoint( face.c, face.a ); - - f3( face.a, a, c, tempFaces ); - f3( face.b, b, a, tempFaces ); - f3( face.c, c, b, tempFaces ); - f3( a, b, c, tempFaces ); - - } - - tempScope.faces = tempFaces.faces; - tempScope.faceVertexUvs[ 0 ] = tempFaces.faceVertexUvs[ 0 ]; - - } - - scope.faces = tempScope.faces; - scope.faceVertexUvs[ 0 ] = tempScope.faceVertexUvs[ 0 ]; - - this.mergeVertices(); - this.computeCentroids(); - this.computeFaceNormals(); - - function v( x, y, z ) { - - var length = Math.sqrt( x * x + y * y + z * z ); - var i = scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x/length, y/length, z/length ) ) ); - - return i-1; - } - - function f3( a, b, c, inscope ) { - - var v1 = scope.vertices[ a ].position; - var v2 = scope.vertices[ b ].position; - var v3 = scope.vertices[ c ].position; - - var face = new THREE.Face3( a, b, c ); - face.vertexNormals.push( v1.clone().normalize(), v2.clone().normalize(), v3.clone().normalize() ); - - inscope.faces.push( face ); - - inscope.faceVertexUvs[ 0 ].push( [ - new THREE.UV( 1 - ( ( ( Math.atan2( v1.z, v1.x ) + Math.PI ) % Math.PI ) / Math.PI * 0.5 ), 0.5 - v1.y / 2 ), - new THREE.UV( 1 - ( ( ( Math.atan2( v2.z, v2.x ) + Math.PI ) % Math.PI ) / Math.PI * 0.5 ), 0.5 - v2.y / 2 ), - new THREE.UV( 1 - ( ( ( Math.atan2( v3.z, v3.x ) + Math.PI ) % Math.PI ) / Math.PI * 0.5 ), 0.5 - v3.y / 2 ) - ] ); - - } - - function getMiddlePoint( p1, p2 ) { - - var pos1 = scope.vertices[ p1 ].position; - var pos2 = scope.vertices[ p2 ].position; - - var x = ( pos1.x + pos2.x ) / 2; - var y = ( pos1.y + pos2.y ) / 2; - var z = ( pos1.z + pos2.z ) / 2; - - var i = v(x, y, z); - return i; - - } - -} - -THREE.IcosahedronGeometry.prototype = new THREE.Geometry(); -THREE.IcosahedronGeometry.prototype.constructor = THREE.IcosahedronGeometry; -/** - * @author astrodud / http://astrodud.isgreat.org/ - */ - -THREE.LatheGeometry = function ( points, steps, angle ) { - - THREE.Geometry.call( this ); - - this.steps = steps || 12; - this.angle = angle || 2 * Math.PI; - - var stepSize = this.angle / this.steps, - newV = [], oldInds = [], newInds = [], startInds = [], - matrix = new THREE.Matrix4().setRotationZ( stepSize ); - - for ( var j = 0; j < points.length; j ++ ) { - - this.vertices.push( new THREE.Vertex( points[ j ] ) ); - - newV[ j ] = points[ j ].clone(); - oldInds[ j ] = this.vertices.length - 1; - - } - - for ( var r = 0; r <= this.angle + 0.001; r += stepSize ) { // need the +0.001 for it go up to angle - - for ( var j = 0; j < newV.length; j ++ ) { - - if ( r < this.angle ) { - - newV[ j ] = matrix.multiplyVector3( newV[ j ].clone() ); - this.vertices.push( new THREE.Vertex( newV[ j ] ) ); - newInds[ j ] = this.vertices.length - 1; - - } else { - - newInds = startInds; // wrap it up! - - } - - } - - if ( r == 0 ) startInds = oldInds; - - for ( var j = 0; j < oldInds.length - 1; j ++ ) { - - this.faces.push( new THREE.Face4( newInds[ j ], newInds[ j + 1 ], oldInds[ j + 1 ], oldInds[ j ] ) ); - this.faceVertexUvs[ 0 ].push( [ - - new THREE.UV( 1 - r / this.angle, j / points.length ), - new THREE.UV( 1 - r / this.angle, ( j + 1 ) / points.length ), - new THREE.UV( 1 - ( r - stepSize ) / this.angle, ( j + 1 ) / points.length ), - new THREE.UV( 1 - ( r - stepSize ) / this.angle, j / points.length ) - - ] ); - - } - - oldInds = newInds; - newInds = []; - - } - - this.computeCentroids(); - this.computeFaceNormals(); - this.computeVertexNormals(); - -}; - -THREE.LatheGeometry.prototype = new THREE.Geometry(); -THREE.LatheGeometry.prototype.constructor = THREE.LatheGeometry; -/** - * Octahedrons have 8 sides. This octahedron supports subdivision. - * - * Vertices have 'smooth' normals, - * to make a sharp edge choose a material that uses face normals instead. - * - * @author daniel.deady@knectar.com - * @param radius - * @param detail Final number of triangles = 4^detail * 8 - */ - -THREE.OctahedronGeometry = function ( radius, detail ) { - - THREE.Geometry.call( this ); - - detail = detail || 0; - - var that = this; // ugly scope hack - - prepare( new THREE.Vector3( +1, 0, 0 ) ); // right - prepare( new THREE.Vector3( -1, 0, 0 ) ); // left - prepare( new THREE.Vector3( 0, +1, 0 ) ); // up - prepare( new THREE.Vector3( 0, -1, 0 ) ); // down - prepare( new THREE.Vector3( 0, 0, +1 ) ); // front - prepare( new THREE.Vector3( 0, 0, -1 ) ); // back - var midpoints = [], p = this.vertices; - - // careful to output faces counter-clockwise, that is required for meshes - make( p[0], p[2], p[4], detail ); - make( p[0], p[4], p[3], detail ); - make( p[0], p[3], p[5], detail ); - make( p[0], p[5], p[2], detail ); - make( p[1], p[2], p[5], detail ); - make( p[1], p[5], p[3], detail ); - make( p[1], p[3], p[4], detail ); - make( p[1], p[4], p[2], detail ); - - /** - * Project vector onto sphere's surface - */ - function prepare( vector ) { - - var normal = vector.clone().normalize(); - var vertex = new THREE.Vertex( normal.clone().multiplyScalar( radius ) ); - vertex.index = that.vertices.push( vertex ) - 1; - - // Texture coords are equivalent to map coords, calculate angle and convert to fraction of a circle. - var u = azimuth( vector ) / 2 / Math.PI + 0.5; - var v = inclination( vector ) / Math.PI + 0.5; - vertex.uv = new THREE.UV( u, v ); - - return vertex; - - } - - /** - * Approximate a curved face with recursively sub-divided triangles. - */ - function make( v1, v2, v3, detail ) { - - if ( detail < 1 ) { - - var face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.position, v2.position, v3.position ] ); - face.centroid.addSelf( v1.position ).addSelf( v2.position ).addSelf( v3.position ).divideScalar( 3 ); - face.normal = face.centroid.clone().normalize(); - that.faces.push( face ); - - var azi = azimuth( face.centroid ); - that.faceVertexUvs[ 0 ].push( [ - correctUV( v1.uv, v1.position, azi ), - correctUV( v2.uv, v2.position, azi ), - correctUV( v3.uv, v3.position, azi ) - ] ); - - } - else { - - detail -= 1; - // split triangle into 4 smaller triangles - make( v1, midpoint( v1, v2 ), midpoint( v1, v3 ), detail ); // top quadrant - make( midpoint( v1, v2 ), v2, midpoint( v2, v3 ), detail ); // left quadrant - make( midpoint( v1, v3 ), midpoint( v2, v3 ), v3, detail ); // right quadrant - make( midpoint( v1, v2 ), midpoint( v2, v3 ), midpoint( v1, v3 ), detail ); // center quadrant - - } - - } - - function midpoint( v1, v2 ) { - - if ( !midpoints[ v1.index ] ) midpoints[ v1.index ] = []; - if ( !midpoints[ v2.index ] ) midpoints[ v2.index ] = []; - var mid = midpoints[ v1.index ][ v2.index ]; - if ( mid === undefined ) { - // generate mean point and project to surface with prepare() - midpoints[ v1.index ][ v2.index ] = midpoints[ v2.index ][ v1.index ] = mid = prepare( - new THREE.Vector3().add( v1.position, v2.position ).divideScalar( 2 ) - ); - } - return mid; - - } - - /** - * Angle around the Y axis, counter-clockwise when looking from above. - */ - function azimuth( vector ) { - - return Math.atan2( vector.z, -vector.x ); - - } - - /** - * Angle above the XZ plane. - */ - function inclination( vector ) { - - return Math.atan2( -vector.y, Math.sqrt( ( vector.x * vector.x ) + ( vector.z * vector.z ) ) ); - - } - - /** - * Texture fixing helper. Spheres have some odd behaviours. - */ - function correctUV( uv, vector, azimuth ) { - - if ( (azimuth < 0) && (uv.u === 1) ) uv = new THREE.UV( uv.u - 1, uv.v ); - if ( (vector.x === 0) && (vector.z === 0) ) uv = new THREE.UV( azimuth / 2 / Math.PI + 0.5, uv.v ); - return uv; - - } - - this.boundingSphere = { radius: radius }; - -}; - -THREE.OctahedronGeometry.prototype = new THREE.Geometry(); -THREE.OctahedronGeometry.prototype.constructor = THREE.OctahedronGeometry; -/** - * @author mr.doob / http://mrdoob.com/ - * based on http://papervision3d.googlecode.com/svn/trunk/as3/trunk/src/org/papervision3d/objects/primitives/Plane.as - */ - -THREE.PlaneGeometry = function ( width, height, segmentsWidth, segmentsHeight ) { - - THREE.Geometry.call( this ); - - var ix, iy, - width_half = width / 2, - height_half = height / 2, - gridX = segmentsWidth || 1, - gridY = segmentsHeight || 1, - gridX1 = gridX + 1, - gridY1 = gridY + 1, - segment_width = width / gridX, - segment_height = height / gridY, - normal = new THREE.Vector3( 0, 0, 1 ); - - for ( iy = 0; iy < gridY1; iy++ ) { - - for ( ix = 0; ix < gridX1; ix++ ) { - - var x = ix * segment_width - width_half; - var y = iy * segment_height - height_half; - - this.vertices.push( new THREE.Vertex( new THREE.Vector3( x, - y, 0 ) ) ); - - } - - } - - for ( iy = 0; iy < gridY; iy++ ) { - - for ( ix = 0; ix < gridX; ix++ ) { - - var a = ix + gridX1 * iy; - var b = ix + gridX1 * ( iy + 1 ); - var c = ( ix + 1 ) + gridX1 * ( iy + 1 ); - var d = ( ix + 1 ) + gridX1 * iy; - - var face = new THREE.Face4( a, b, c, d ); - face.normal.copy( normal ); - face.vertexNormals.push( normal.clone(), normal.clone(), normal.clone(), normal.clone() ); - - this.faces.push( face ); - this.faceVertexUvs[ 0 ].push( [ - new THREE.UV( ix / gridX, iy / gridY ), - new THREE.UV( ix / gridX, ( iy + 1 ) / gridY ), - new THREE.UV( ( ix + 1 ) / gridX, ( iy + 1 ) / gridY ), - new THREE.UV( ( ix + 1 ) / gridX, iy / gridY ) - ] ); - - } - - } - - this.computeCentroids(); - -}; - -THREE.PlaneGeometry.prototype = new THREE.Geometry(); -THREE.PlaneGeometry.prototype.constructor = THREE.PlaneGeometry; -/** - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.SphereGeometry = function ( radius, segmentsWidth, segmentsHeight, phiStart, phiLength, thetaStart, thetaLength ) { - - THREE.Geometry.call( this ); - - radius = radius || 50; - - phiStart = phiStart !== undefined ? phiStart : 0; - phiLength = phiLength !== undefined ? phiLength : Math.PI * 2; - - thetaStart = thetaStart !== undefined ? thetaStart : 0; - thetaLength = thetaLength !== undefined ? thetaLength : Math.PI; - - var segmentsX = Math.max( 3, Math.floor( segmentsWidth ) || 8 ); - var segmentsY = Math.max( 2, Math.floor( segmentsHeight ) || 6 ); - - var x, y, vertices = [], uvs = []; - - for ( y = 0; y <= segmentsY; y ++ ) { - - var verticesRow = []; - var uvsRow = []; - - for ( x = 0; x <= segmentsX; x ++ ) { - - var u = x / segmentsX; - var v = y / segmentsY; - - var xpos = - radius * Math.cos( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - var ypos = radius * Math.cos( thetaStart + v * thetaLength ); - var zpos = radius * Math.sin( phiStart + u * phiLength ) * Math.sin( thetaStart + v * thetaLength ); - - this.vertices.push( new THREE.Vertex( new THREE.Vector3( xpos, ypos, zpos ) ) ); - - verticesRow.push( this.vertices.length - 1 ); - uvsRow.push( new THREE.UV( u, v ) ); - - } - - vertices.push( verticesRow ); - uvs.push( uvsRow ); - - } - - for ( y = 0; y < segmentsY; y ++ ) { - - for ( x = 0; x < segmentsX; x ++ ) { - - var v1 = vertices[ y ][ x + 1 ]; - var v2 = vertices[ y ][ x ]; - var v3 = vertices[ y + 1 ][ x ]; - var v4 = vertices[ y + 1 ][ x + 1 ]; - - var n1 = this.vertices[ v1 ].position.clone().normalize(); - var n2 = this.vertices[ v2 ].position.clone().normalize(); - var n3 = this.vertices[ v3 ].position.clone().normalize(); - var n4 = this.vertices[ v4 ].position.clone().normalize(); - - var uv1 = uvs[ y ][ x + 1 ].clone(); - var uv2 = uvs[ y ][ x ].clone(); - var uv3 = uvs[ y + 1 ][ x ].clone(); - var uv4 = uvs[ y + 1 ][ x + 1 ].clone(); - - if ( Math.abs( this.vertices[ v1 ].position.y ) == radius ) { - - this.faces.push( new THREE.Face3( v1, v3, v4, [ n1, n3, n4 ] ) ); - this.faceVertexUvs[ 0 ].push( [ uv1, uv3, uv4 ] ); - - } else if ( Math.abs( this.vertices[ v3 ].position.y ) == radius ) { - - this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ] ) ); - this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] ); - - } else { - - this.faces.push( new THREE.Face4( v1, v2, v3, v4, [ n1, n2, n3, n4 ] ) ); - this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3, uv4 ] ); - - } - - } - - } - - this.computeCentroids(); - this.computeFaceNormals(); - - this.boundingSphere = { radius: radius }; - -}; - -THREE.SphereGeometry.prototype = new THREE.Geometry(); -THREE.SphereGeometry.prototype.constructor = THREE.SphereGeometry; -/** - * @author zz85 / http://www.lab4games.net/zz85/blog - * @author alteredq / http://alteredqualia.com/ - * - * For creating 3D text geometry in three.js - * - * Text = 3D Text - * - * parameters = { - * size: , // size of the text - * height: , // thickness to extrude text - * curveSegments: , // number of points on the curves - * - * font: , // font name - * weight: , // font weight (normal, bold) - * style: , // font style (normal, italics) - * - * bevelEnabled: , // turn on bevel - * bevelThickness: , // how deep into text bevel goes - * bevelSize: , // how far from text outline is bevel - * - * bend: // bend according to hardcoded curve (generates bendPath) - * bendPath: // wraps text according to bend Path - * } - * - * It uses techniques used in: - * - * typeface.js and canvastext - * For converting fonts and rendering with javascript - * http://typeface.neocracy.org - * - * Triangulation ported from AS3 - * Simple Polygon Triangulation - * http://actionsnippet.com/?p=1462 - * - * A Method to triangulate shapes with holes - * http://www.sakri.net/blog/2009/06/12/an-approach-to-triangulating-polygons-with-holes/ - * - */ -/* Usage Examples - - // TextGeometry wrapper - - var text3d = new TextGeometry( text, options ); - - // Complete manner - - var textPath = new THREE.TextPath( text, options ); - var textShapes = textPath.toShapes(); - var text3d = new ExtrudeGeometry( textShapes, options ); - -*/ - - -THREE.TextGeometry = function ( text, parameters ) { - - var textPath = new THREE.TextPath( text, parameters ); - var textShapes = textPath.toShapes(); - - // translate parameters to ExtrudeGeometry API - - parameters.amount = parameters.height !== undefined ? parameters.height : 50; - - // defaults - - if ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10; - if ( parameters.bevelSize === undefined ) parameters.bevelSize = 8; - if ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false; - - if ( parameters.bend ) { - - var b = textShapes[ textShapes.length - 1 ].getBoundingBox(); - var max = b.maxX; - - parameters.bendPath = new THREE.QuadraticBezierCurve( new THREE.Vector2( 0, 0 ), - new THREE.Vector2( max / 2, 120 ), - new THREE.Vector2( max, 0 ) ); - - } - - THREE.ExtrudeGeometry.call( this, textShapes, parameters ); - -}; - -THREE.TextGeometry.prototype = new THREE.ExtrudeGeometry(); -THREE.TextGeometry.prototype.constructor = THREE.TextGeometry; - - -THREE.FontUtils = { - - faces : {}, - - // Just for now. face[weight][style] - - face : "helvetiker", - weight: "normal", - style : "normal", - size : 150, - divisions : 10, - - getFace : function() { - - return this.faces[ this.face ][ this.weight ][ this.style ]; - - }, - - loadFace : function( data ) { - - var family = data.familyName.toLowerCase(); - - var ThreeFont = this; - - ThreeFont.faces[ family ] = ThreeFont.faces[ family ] || {}; - - ThreeFont.faces[ family ][ data.cssFontWeight ] = ThreeFont.faces[ family ][ data.cssFontWeight ] || {}; - ThreeFont.faces[ family ][ data.cssFontWeight ][ data.cssFontStyle ] = data; - - var face = ThreeFont.faces[ family ][ data.cssFontWeight ][ data.cssFontStyle ] = data; - - return data; - - }, - - drawText : function( text ) { - - var characterPts = [], allPts = []; - - // RenderText - - var i, p, - face = this.getFace(), - scale = this.size / face.resolution, - offset = 0, - chars = String( text ).split( '' ), - length = chars.length; - - var fontPaths = []; - - for ( i = 0; i < length; i ++ ) { - - var path = new THREE.Path(); - - var ret = this.extractGlyphPoints( chars[ i ], face, scale, offset, path ); - offset += ret.offset; - //characterPts.push( ret.points ); - //allPts = allPts.concat( ret.points ); - fontPaths.push( ret.path ); - - } - - // get the width - - var width = offset / 2; - // - // for ( p = 0; p < allPts.length; p++ ) { - // - // allPts[ p ].x -= width; - // - // } - - //var extract = this.extractPoints( allPts, characterPts ); - //extract.contour = allPts; - - //extract.paths = fontPaths; - //extract.offset = width; - - return { paths : fontPaths, offset : width }; - - }, - - - - - extractGlyphPoints : function( c, face, scale, offset, path ) { - - var pts = []; - - var i, i2, divisions, - outline, action, length, - scaleX, scaleY, - x, y, cpx, cpy, cpx0, cpy0, cpx1, cpy1, cpx2, cpy2, - laste, - glyph = face.glyphs[ c ] || face.glyphs[ '?' ]; - - if ( !glyph ) return; - - if ( glyph.o ) { - - outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) ); - length = outline.length; - - scaleX = scale; - scaleY = scale; - - for ( i = 0; i < length; ) { - - action = outline[ i ++ ]; - - //console.log( action ); - - switch( action ) { - - case 'm': - - // Move To - - x = outline[ i++ ] * scaleX + offset; - y = outline[ i++ ] * scaleY; - - pts.push( new THREE.Vector2( x, y ) ); - - path.moveTo( x, y ); - break; - - case 'l': - - // Line To - - x = outline[ i++ ] * scaleX + offset; - y = outline[ i++ ] * scaleY; - pts.push( new THREE.Vector2( x, y ) ); - path.lineTo(x,y); - break; - - case 'q': - - // QuadraticCurveTo - - cpx = outline[ i++ ] * scaleX + offset; - cpy = outline[ i++ ] * scaleY; - cpx1 = outline[ i++ ] * scaleX + offset; - cpy1 = outline[ i++ ] * scaleY; - - path.quadraticCurveTo(cpx1, cpy1, cpx, cpy); - - laste = pts[ pts.length - 1 ]; - - if ( laste ) { - - cpx0 = laste.x; - cpy0 = laste.y; - - for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2 ++ ) { - - var t = i2 / divisions; - var tx = THREE.Shape.Utils.b2( t, cpx0, cpx1, cpx ); - var ty = THREE.Shape.Utils.b2( t, cpy0, cpy1, cpy ); - pts.push( new THREE.Vector2( tx, ty ) ); - - } - - } - - break; - - case 'b': - - // Cubic Bezier Curve - - cpx = outline[ i++ ] * scaleX + offset; - cpy = outline[ i++ ] * scaleY; - cpx1 = outline[ i++ ] * scaleX + offset; - cpy1 = outline[ i++ ] * -scaleY; - cpx2 = outline[ i++ ] * scaleX + offset; - cpy2 = outline[ i++ ] * -scaleY; - - path.bezierCurveTo( cpx, cpy, cpx1, cpy1, cpx2, cpy2 ); - - laste = pts[ pts.length - 1 ]; - - if ( laste ) { - - cpx0 = laste.x; - cpy0 = laste.y; - - for ( i2 = 1, divisions = this.divisions; i2 <= divisions; i2 ++ ) { - - var t = i2 / divisions; - var tx = THREE.Shape.Utils.b3( t, cpx0, cpx1, cpx2, cpx ); - var ty = THREE.Shape.Utils.b3( t, cpy0, cpy1, cpy2, cpy ); - pts.push( new THREE.Vector2( tx, ty ) ); - - } - - } - - break; - - } - - } - } - - - - return { offset: glyph.ha*scale, points:pts, path:path}; - } - -}; - - - -/** - * This code is a quick port of code written in C++ which was submitted to - * flipcode.com by John W. Ratcliff // July 22, 2000 - * See original code and more information here: - * http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml - * - * ported to actionscript by Zevan Rosser - * www.actionsnippet.com - * - * ported to javascript by Joshua Koo - * http://www.lab4games.net/zz85/blog - * - */ - - -( function( namespace ) { - - var EPSILON = 0.0000000001; - - // takes in an contour array and returns - - var process = function( contour, indices ) { - - var n = contour.length; - - if ( n < 3 ) return null; - - var result = [], - verts = [], - vertIndices = []; - - /* we want a counter-clockwise polygon in verts */ - - var u, v, w; - - if ( area( contour ) > 0.0 ) { - - for ( v = 0; v < n; v++ ) verts[ v ] = v; - - } else { - - for ( v = 0; v < n; v++ ) verts[ v ] = ( n - 1 ) - v; - - } - - var nv = n; - - /* remove nv - 2 vertices, creating 1 triangle every time */ - - var count = 2 * nv; /* error detection */ - - for( v = nv - 1; nv > 2; ) { - - /* if we loop, it is probably a non-simple polygon */ - - if ( ( count-- ) <= 0 ) { - - //** Triangulate: ERROR - probable bad polygon! - - //throw ( "Warning, unable to triangulate polygon!" ); - //return null; - // Sometimes warning is fine, especially polygons are triangulated in reverse. - console.log( "Warning, unable to triangulate polygon!" ); - - if ( indices ) return vertIndices; - return result; - - } - - /* three consecutive vertices in current polygon, */ - - u = v; if ( nv <= u ) u = 0; /* previous */ - v = u + 1; if ( nv <= v ) v = 0; /* new v */ - w = v + 1; if ( nv <= w ) w = 0; /* next */ - - if ( snip( contour, u, v, w, nv, verts ) ) { - - var a, b, c, s, t; - - /* true names of the vertices */ - - a = verts[ u ]; - b = verts[ v ]; - c = verts[ w ]; - - /* output Triangle */ - - /* - result.push( contour[ a ] ); - result.push( contour[ b ] ); - result.push( contour[ c ] ); - */ - result.push( [ contour[ a ], - contour[ b ], - contour[ c ] ] ); - - - vertIndices.push( [ verts[ u ], verts[ v ], verts[ w ] ] ); - - /* remove v from the remaining polygon */ - - for( s = v, t = v + 1; t < nv; s++, t++ ) { - - verts[ s ] = verts[ t ]; - - } - - nv--; - - /* reset error detection counter */ - - count = 2 * nv; - - } - - } - - if ( indices ) return vertIndices; - return result; - - }; - - // calculate area of the contour polygon - - var area = function ( contour ) { - - var n = contour.length; - var a = 0.0; - - for( var p = n - 1, q = 0; q < n; p = q++ ) { - - a += contour[ p ].x * contour[ q ].y - contour[ q ].x * contour[ p ].y; - - } - - return a * 0.5; - - }; - - // see if p is inside triangle abc - - var insideTriangle = function( ax, ay, - bx, by, - cx, cy, - px, py ) { - - var aX, aY, bX, bY; - var cX, cY, apx, apy; - var bpx, bpy, cpx, cpy; - var cCROSSap, bCROSScp, aCROSSbp; - - aX = cx - bx; aY = cy - by; - bX = ax - cx; bY = ay - cy; - cX = bx - ax; cY = by - ay; - apx= px -ax; apy= py - ay; - bpx= px - bx; bpy= py - by; - cpx= px - cx; cpy= py - cy; - - aCROSSbp = aX*bpy - aY*bpx; - cCROSSap = cX*apy - cY*apx; - bCROSScp = bX*cpy - bY*cpx; - - return ( (aCROSSbp >= 0.0) && (bCROSScp >= 0.0) && (cCROSSap >= 0.0) ); - - }; - - - var snip = function ( contour, u, v, w, n, verts ) { - - var p; - var ax, ay, bx, by; - var cx, cy, px, py; - - ax = contour[ verts[ u ] ].x; - ay = contour[ verts[ u ] ].y; - - bx = contour[ verts[ v ] ].x; - by = contour[ verts[ v ] ].y; - - cx = contour[ verts[ w ] ].x; - cy = contour[ verts[ w ] ].y; - - if ( EPSILON > (((bx-ax)*(cy-ay)) - ((by-ay)*(cx-ax))) ) return false; - - for ( p = 0; p < n; p++ ) { - - if( (p == u) || (p == v) || (p == w) ) continue; - - px = contour[ verts[ p ] ].x - py = contour[ verts[ p ] ].y - - if ( insideTriangle( ax, ay, bx, by, cx, cy, px, py ) ) return false; - - } - - return true; - - }; - - - namespace.Triangulate = process; - namespace.Triangulate.area = area; - - return namespace; - -})(THREE.FontUtils); - -// To use the typeface.js face files, hook up the API -self._typeface_js = { faces: THREE.FontUtils.faces, loadFace: THREE.FontUtils.loadFace }; -/** - * @author oosmoxiecode - * @author mr.doob / http://mrdoob.com/ - * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888 - */ - -THREE.TorusGeometry = function ( radius, tube, segmentsR, segmentsT, arc ) { - - THREE.Geometry.call( this ); - - var scope = this; - - this.radius = radius || 100; - this.tube = tube || 40; - this.segmentsR = segmentsR || 8; - this.segmentsT = segmentsT || 6; - this.arc = arc || Math.PI * 2; - - var center = new THREE.Vector3(), uvs = [], normals = []; - - for ( var j = 0; j <= this.segmentsR; j ++ ) { - - for ( var i = 0; i <= this.segmentsT; i ++ ) { - - var u = i / this.segmentsT * this.arc; - var v = j / this.segmentsR * Math.PI * 2; - - center.x = this.radius * Math.cos( u ); - center.y = this.radius * Math.sin( u ); - - var vector = new THREE.Vector3(); - vector.x = ( this.radius + this.tube * Math.cos( v ) ) * Math.cos( u ); - vector.y = ( this.radius + this.tube * Math.cos( v ) ) * Math.sin( u ); - vector.z = this.tube * Math.sin( v ); - - this.vertices.push( new THREE.Vertex( vector ) ); - - uvs.push( new THREE.UV( i / this.segmentsT, 1 - j / this.segmentsR ) ); - normals.push( vector.clone().subSelf( center ).normalize() ); - - } - } - - - for ( var j = 1; j <= this.segmentsR; j ++ ) { - - for ( var i = 1; i <= this.segmentsT; i ++ ) { - - var a = ( this.segmentsT + 1 ) * j + i - 1; - var b = ( this.segmentsT + 1 ) * ( j - 1 ) + i - 1; - var c = ( this.segmentsT + 1 ) * ( j - 1 ) + i; - var d = ( this.segmentsT + 1 ) * j + i; - - var face = new THREE.Face4( a, b, c, d, [ normals[ a ], normals[ b ], normals[ c ], normals[ d ] ] ); - face.normal.addSelf( normals[ a ] ); - face.normal.addSelf( normals[ b ] ); - face.normal.addSelf( normals[ c ] ); - face.normal.addSelf( normals[ d ] ); - face.normal.normalize(); - - this.faces.push( face ); - - this.faceVertexUvs[ 0 ].push( [ uvs[ a ].clone(), uvs[ b ].clone(), uvs[ c ].clone(), uvs[ d ].clone() ] ); - } - - } - - this.computeCentroids(); - -}; - -THREE.TorusGeometry.prototype = new THREE.Geometry(); -THREE.TorusGeometry.prototype.constructor = THREE.TorusGeometry; -/** - * @author oosmoxiecode - * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3D/src/away3d/primitives/TorusKnot.as?spec=svn2473&r=2473 - */ - -THREE.TorusKnotGeometry = function ( radius, tube, segmentsR, segmentsT, p, q, heightScale ) { - - THREE.Geometry.call( this ); - - var scope = this; - - this.radius = radius || 200; - this.tube = tube || 40; - this.segmentsR = segmentsR || 64; - this.segmentsT = segmentsT || 8; - this.p = p || 2; - this.q = q || 3; - this.heightScale = heightScale || 1; - this.grid = new Array(this.segmentsR); - - var tang = new THREE.Vector3(); - var n = new THREE.Vector3(); - var bitan = new THREE.Vector3(); - - for ( var i = 0; i < this.segmentsR; ++ i ) { - - this.grid[ i ] = new Array( this.segmentsT ); - - for ( var j = 0; j < this.segmentsT; ++ j ) { - - var u = i / this.segmentsR * 2 * this.p * Math.PI; - var v = j / this.segmentsT * 2 * Math.PI; - var p1 = getPos( u, v, this.q, this.p, this.radius, this.heightScale ); - var p2 = getPos( u + 0.01, v, this.q, this.p, this.radius, this.heightScale ); - var cx, cy; - - tang.sub( p2, p1 ); - n.add( p2, p1 ); - - bitan.cross( tang, n ); - n.cross( bitan, tang ); - bitan.normalize(); - n.normalize(); - - cx = - this.tube * Math.cos( v ); // TODO: Hack: Negating it so it faces outside. - cy = this.tube * Math.sin( v ); - - p1.x += cx * n.x + cy * bitan.x; - p1.y += cx * n.y + cy * bitan.y; - p1.z += cx * n.z + cy * bitan.z; - - this.grid[ i ][ j ] = vert( p1.x, p1.y, p1.z ); - - } - - } - - for ( var i = 0; i < this.segmentsR; ++ i ) { - - for ( var j = 0; j < this.segmentsT; ++ j ) { - - var ip = ( i + 1 ) % this.segmentsR; - var jp = ( j + 1 ) % this.segmentsT; - - var a = this.grid[ i ][ j ]; - var b = this.grid[ ip ][ j ]; - var c = this.grid[ ip ][ jp ]; - var d = this.grid[ i ][ jp ]; - - var uva = new THREE.UV( i / this.segmentsR, j / this.segmentsT ); - var uvb = new THREE.UV( ( i + 1 ) / this.segmentsR, j / this.segmentsT ); - var uvc = new THREE.UV( ( i + 1 ) / this.segmentsR, ( j + 1 ) / this.segmentsT ); - var uvd = new THREE.UV( i / this.segmentsR, ( j + 1 ) / this.segmentsT ); - - this.faces.push( new THREE.Face4( a, b, c, d ) ); - this.faceVertexUvs[ 0 ].push( [ uva,uvb,uvc, uvd ] ); - - } - } - - this.computeCentroids(); - this.computeFaceNormals(); - this.computeVertexNormals(); - - function vert( x, y, z ) { - - return scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ) - 1; - - } - - function getPos( u, v, in_q, in_p, radius, heightScale ) { - - var cu = Math.cos( u ); - var cv = Math.cos( v ); - var su = Math.sin( u ); - var quOverP = in_q / in_p * u; - var cs = Math.cos( quOverP ); - - var tx = radius * ( 2 + cs ) * 0.5 * cu; - var ty = radius * ( 2 + cs ) * su * 0.5; - var tz = heightScale * radius * Math.sin( quOverP ) * 0.5; - - return new THREE.Vector3( tx, ty, tz ); - - } - -}; - -THREE.TorusKnotGeometry.prototype = new THREE.Geometry(); -THREE.TorusKnotGeometry.prototype.constructor = THREE.TorusKnotGeometry; -/** - * @author sroucheray / http://sroucheray.org/ - * @author mr.doob / http://mrdoob.com/ - */ - -THREE.AxisHelper = function () { - - THREE.Object3D.call( this ); - - var lineGeometry = new THREE.Geometry(); - lineGeometry.vertices.push( new THREE.Vertex() ); - lineGeometry.vertices.push( new THREE.Vertex( new THREE.Vector3( 0, 100, 0 ) ) ); - - var coneGeometry = new THREE.CylinderGeometry( 0, 5, 25, 5, 1 ); - - var line, cone; - - // x - - line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color : 0xff0000 } ) ); - line.rotation.z = - Math.PI / 2; - this.add( line ); - - cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color : 0xff0000 } ) ); - cone.position.x = 100; - cone.rotation.z = - Math.PI / 2; - this.add( cone ); - - // y - - line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color : 0x00ff00 } ) ); - this.add( line ); - - cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color : 0x00ff00 } ) ); - cone.position.y = 100; - this.add( cone ); - - // z - - line = new THREE.Line( lineGeometry, new THREE.LineBasicMaterial( { color : 0x0000ff } ) ); - line.rotation.x = Math.PI / 2; - this.add( line ); - - cone = new THREE.Mesh( coneGeometry, new THREE.MeshBasicMaterial( { color : 0x0000ff } ) ); - cone.position.z = 100; - cone.rotation.x = Math.PI / 2; - this.add( cone ); - -}; - -THREE.AxisHelper.prototype = new THREE.Object3D(); -THREE.AxisHelper.prototype.constructor = THREE.AxisHelper; -/** - * @author alteredq / http://alteredqualia.com/ - * - * - shows frustum, line of sight and up of the camera - * - suitable for fast updates - * - based on frustum visualization in lightgl.js shadowmap example - * http://evanw.github.com/lightgl.js/tests/shadowmap.html - */ - -THREE.CameraHelper = function ( camera ) { - - THREE.Object3D.call( this ); - - var _this = this; - - this.lineGeometry = new THREE.Geometry(); - this.lineMaterial = new THREE.LineBasicMaterial( { color: 0xffffff, vertexColors: THREE.FaceColors } ); - - this.pointMap = {}; - - // colors - - var hexFrustum = 0xffaa00, - hexCone = 0xff0000, - hexUp = 0x00aaff, - hexTarget = 0xffffff, - hexCross = 0x333333; - - // near - - addLine( "n1", "n2", hexFrustum ); - addLine( "n2", "n4", hexFrustum ); - addLine( "n4", "n3", hexFrustum ); - addLine( "n3", "n1", hexFrustum ); - - // far - - addLine( "f1", "f2", hexFrustum ); - addLine( "f2", "f4", hexFrustum ); - addLine( "f4", "f3", hexFrustum ); - addLine( "f3", "f1", hexFrustum ); - - // sides - - addLine( "n1", "f1", hexFrustum ); - addLine( "n2", "f2", hexFrustum ); - addLine( "n3", "f3", hexFrustum ); - addLine( "n4", "f4", hexFrustum ); - - // cone - - addLine( "p", "n1", hexCone ); - addLine( "p", "n2", hexCone ); - addLine( "p", "n3", hexCone ); - addLine( "p", "n4", hexCone ); - - // up - - addLine( "u1", "u2", hexUp ); - addLine( "u2", "u3", hexUp ); - addLine( "u3", "u1", hexUp ); - - // target - - addLine( "c", "t", hexTarget ); - addLine( "p", "c", hexCross ); - - // cross - - addLine( "cn1", "cn2", hexCross ); - addLine( "cn3", "cn4", hexCross ); - - addLine( "cf1", "cf2", hexCross ); - addLine( "cf3", "cf4", hexCross ); - - function addLine( a, b, hex ) { - - addPoint( a, hex ); - addPoint( b, hex ); - - } - - function addPoint( id, hex ) { - - _this.lineGeometry.vertices.push( new THREE.Vertex( new THREE.Vector3() ) ); - _this.lineGeometry.colors.push( new THREE.Color( hex ) ); - - if ( _this.pointMap[ id ] === undefined ) _this.pointMap[ id ] = []; - _this.pointMap[ id ].push( _this.lineGeometry.vertices.length - 1 ); - - } - - this.update( camera ); - - this.lines = new THREE.Line( this.lineGeometry, this.lineMaterial, THREE.LinePieces ); - this.add( this.lines ); - -}; - -THREE.CameraHelper.prototype = new THREE.Object3D(); -THREE.CameraHelper.prototype.constructor = THREE.CameraHelper; - -THREE.CameraHelper.prototype.update = function ( camera ) { - - var w = 1; - var h = 1; - - var _this = this; - - // we need just camera projection matrix - // world matrix must be identity - - THREE.CameraHelper.__c.projectionMatrix.copy( camera.projectionMatrix ); - - // center / target - - setPoint( "c", 0, 0, -1 ); - setPoint( "t", 0, 0, 1 ); - - // near - - setPoint( "n1", -w, -h, -1 ); - setPoint( "n2", w, -h, -1 ); - setPoint( "n3", -w, h, -1 ); - setPoint( "n4", w, h, -1 ); - - // far - - setPoint( "f1", -w, -h, 1 ); - setPoint( "f2", w, -h, 1 ); - setPoint( "f3", -w, h, 1 ); - setPoint( "f4", w, h, 1 ); - - // up - - setPoint( "u1", w * 0.7, h * 1.1, -1 ); - setPoint( "u2", -w * 0.7, h * 1.1, -1 ); - setPoint( "u3", 0, h * 2, -1 ); - - // cross - - setPoint( "cf1", -w, 0, 1 ); - setPoint( "cf2", w, 0, 1 ); - setPoint( "cf3", 0, -h, 1 ); - setPoint( "cf4", 0, h, 1 ); - - setPoint( "cn1", -w, 0, -1 ); - setPoint( "cn2", w, 0, -1 ); - setPoint( "cn3", 0, -h, -1 ); - setPoint( "cn4", 0, h, -1 ); - - function setPoint( point, x, y, z ) { - - THREE.CameraHelper.__v.set( x, y, z ); - THREE.CameraHelper.__projector.unprojectVector( THREE.CameraHelper.__v, THREE.CameraHelper.__c ); - - var points = _this.pointMap[ point ]; - - if ( points !== undefined ) { - - for ( var i = 0, il = points.length; i < il; i ++ ) { - - var j = points[ i ]; - _this.lineGeometry.vertices[ j ].position.copy( THREE.CameraHelper.__v ); - - } - - } - - } - - this.lineGeometry.__dirtyVertices = true; - -}; - -THREE.CameraHelper.__projector = new THREE.Projector(); -THREE.CameraHelper.__v = new THREE.Vector3(); -THREE.CameraHelper.__c = new THREE.Camera(); - -/* - * @author zz85 / http://twitter.com/blurspline / http://www.lab4games.net/zz85/blog - * - * Subdivision Geometry Modifier - * using Catmull-Clark Subdivision Surfaces - * for creating smooth geometry meshes - * - * Note: a modifier modifies vertices and faces of geometry, - * so use THREE.GeometryUtils.clone() if orignal geoemtry needs to be retained - * - * Readings: - * http://en.wikipedia.org/wiki/Catmull%E2%80%93Clark_subdivision_surface - * http://www.rorydriscoll.com/2008/08/01/catmull-clark-subdivision-the-basics/ - * http://xrt.wikidot.com/blog:31 - * "Subdivision Surfaces in Character Animation" - * - * Supports: - * Closed and Open geometries. - * - * TODO: - * crease vertex and "semi-sharp" features - * selective subdivision - */ - -THREE.SubdivisionModifier = function( subdivisions ) { - - this.subdivisions = (subdivisions === undefined ) ? 1 : subdivisions; - - // Settings - this.useOldVertexColors = false; - this.supportUVs = true; - -}; - -//THREE.SubdivisionModifier.prototype = new THREE.Modifier(); - -THREE.SubdivisionModifier.prototype.constructor = THREE.SubdivisionModifier; - -// Applies the "modify" pattern -THREE.SubdivisionModifier.prototype.modify = function ( geometry ) { - - var repeats = this.subdivisions; - - while ( repeats-- > 0 ) { - this.smooth( geometry ); - } - -}; - -// Performs an iteration of Catmull-Clark Subdivision -THREE.SubdivisionModifier.prototype.smooth = function ( oldGeometry ) { - - //console.log( 'running smooth' ); - - // New set of vertices, faces and uvs - var newVertices = [], newFaces = [], newUVs = []; - - function v( x, y, z ) { - newVertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ); - } - - var scope = this; - - function f4( a, b, c, d, oldFace, orders ) { - - // TODO move vertex selection over here! - - var newFace = new THREE.Face4( a, b, c, d, null, oldFace.color, oldFace.material ); - - if (scope.useOldVertexColors) { - - newFace.vertexColors = []; - - var color, tmpColor, order; - for (var i=0;i<4;i++) { - order = orders[i]; - - color = new THREE.Color(), - color.setRGB(0,0,0); - - for (var j=0, jl=0; j face map - - for( i = 0, il = geometry.faces.length; i < il; i ++ ) { - - face = geometry.faces[ i ]; - - if ( face instanceof THREE.Face3 ) { - - hash = edge_hash( face.a, face.b ); - addToMap( vfMap, hash, i ); - - hash = edge_hash( face.b, face.c ); - addToMap( vfMap, hash, i ); - - hash = edge_hash( face.c, face.a ); - addToMap( vfMap, hash, i ); - - } else if ( face instanceof THREE.Face4 ) { - - hash = edge_hash( face.a, face.b ); - addToMap( vfMap, hash, i ); - - hash = edge_hash( face.b, face.c ); - addToMap( vfMap, hash, i ); - - hash = edge_hash( face.c, face.d ); - addToMap( vfMap, hash, i ); - - hash = edge_hash( face.d, face.a ); - addToMap( vfMap, hash, i ); - - } - - } - - // extract faces - - // var edges = []; - // - // var numOfEdges = 0; - // for (i in vfMap) { - // numOfEdges++; - // - // edge = vfMap[i]; - // edges.push(edge); - // - // } - - //console.log('vfMap', vfMap, 'geometry.edges',geometry.edges, 'numOfEdges', numOfEdges); - - return vfMap; - - }; - - var originalPoints = oldGeometry.vertices; - var originalFaces = oldGeometry.faces; - - var newPoints = originalPoints.concat(); // Vertices - - var facePoints = [], edgePoints = {}; - - var sharpEdges = {}, sharpVertices = [], sharpFaces = []; - - var uvForVertices = []; - - // Step 1 - // For each face, add a face point - // Set each face point to be the centroid of all original points for the respective face. - - var i, il, j, jl, face; - - // For Uvs - var uvs = oldGeometry.faceVertexUvs[0]; - var abcd = 'abcd', vertice; - - for (i=0, il = uvs.length; i2) { - // TODO - } - */ - - F.divideScalar(f); - - - - for (j=0; j= 0 ) { - - var inv = skin.invBindMatrices[ found ]; - - bone.invBindMatrix = inv; - bone.skinningMatrix = new THREE.Matrix4(); - bone.skinningMatrix.multiply(bone.world, inv); // (IBMi * JMi) - - bone.weights = []; - - for ( var j = 0; j < skin.weights.length; j ++ ) { - - for (var k = 0; k < skin.weights[ j ].length; k ++) { - - var w = skin.weights[ j ][ k ]; - - if ( w.joint == found ) { - - bone.weights.push( w ); - - } - - } - - } - - } else { - - throw 'ColladaLoader: Could not find joint \'' + bone.sid + '\'.'; - - } - - } - - }; - - function applySkin ( geometry, instanceCtrl, frame ) { - - var skinController = controllers[ instanceCtrl.url ]; - - frame = frame !== undefined ? frame : 40; - - if ( !skinController || !skinController.skin ) { - - console.log( 'ColladaLoader: Could not find skin controller.' ); - return; - - } - - if ( !instanceCtrl.skeleton || !instanceCtrl.skeleton.length ) { - - console.log( 'ColladaLoader: Could not find the skeleton for the skin. ' ); - return; - - } - - var animationBounds = calcAnimationBounds(); - var skeleton = daeScene.getChildById( instanceCtrl.skeleton[0], true ) || - daeScene.getChildBySid( instanceCtrl.skeleton[0], true ); - - var i, j, w, vidx, weight; - var v = new THREE.Vector3(), o, s; - - // move vertices to bind shape - - for ( i = 0; i < geometry.vertices.length; i ++ ) { - - skinController.skin.bindShapeMatrix.multiplyVector3( geometry.vertices[i].position ); - - } - - // process animation, or simply pose the rig if no animation - - for ( frame = 0; frame < animationBounds.frames; frame ++ ) { - - var bones = []; - var skinned = []; - - // zero skinned vertices - - for ( i = 0; i < geometry.vertices.length; i++ ) { - - skinned.push( new THREE.Vertex( new THREE.Vector3() ) ); - - } - - // process the frame and setup the rig with a fresh - // transform, possibly from the bone's animation channel(s) - - setupSkeleton( skeleton, bones, frame ); - setupSkinningMatrices( bones, skinController.skin ); - - // skin 'm - - for ( i = 0; i < bones.length; i ++ ) { - - if ( bones[ i ].type != 'JOINT' ) continue; - - for ( j = 0; j < bones[ i ].weights.length; j ++ ) { - - w = bones[ i ].weights[ j ]; - vidx = w.index; - weight = w.weight; - - o = geometry.vertices[vidx]; - s = skinned[vidx]; - - v.x = o.position.x; - v.y = o.position.y; - v.z = o.position.z; - - bones[i].skinningMatrix.multiplyVector3(v); - - s.position.x += (v.x * weight); - s.position.y += (v.y * weight); - s.position.z += (v.z * weight); - - } - - } - - geometry.morphTargets.push( { name: "target_" + frame, vertices: skinned } ); - - } - - }; - - function createSceneGraph ( node, parent ) { - - var obj = new THREE.Object3D(); - var skinned = false; - var skinController; - var morphController; - var i, j; - - // FIXME: controllers - - for ( i = 0; i < node.controllers.length; i ++ ) { - - var controller = controllers[ node.controllers[ i ].url ]; - - switch ( controller.type ) { - - case 'skin': - - if ( geometries[ controller.skin.source ] ) { - - var inst_geom = new InstanceGeometry(); - - inst_geom.url = controller.skin.source; - inst_geom.instance_material = node.controllers[ i ].instance_material; - - node.geometries.push( inst_geom ); - skinned = true; - skinController = node.controllers[ i ]; - - } else if ( controllers[ controller.skin.source ] ) { - - // urgh: controller can be chained - // handle the most basic case... - - var second = controllers[ controller.skin.source ]; - morphController = second; - // skinController = node.controllers[i]; - - if ( second.morph && geometries[ second.morph.source ] ) { - - var inst_geom = new InstanceGeometry(); - - inst_geom.url = second.morph.source; - inst_geom.instance_material = node.controllers[ i ].instance_material; - - node.geometries.push( inst_geom ); - - } - - } - - break; - - case 'morph': - - if ( geometries[ controller.morph.source ] ) { - - var inst_geom = new InstanceGeometry(); - - inst_geom.url = controller.morph.source; - inst_geom.instance_material = node.controllers[ i ].instance_material; - - node.geometries.push( inst_geom ); - morphController = node.controllers[ i ]; - - } - - console.log( 'ColladaLoader: Morph-controller partially supported.' ); - - default: - break; - - } - - } - - // FIXME: multi-material mesh? - // geometries - - for ( i = 0; i < node.geometries.length; i ++ ) { - - var instance_geometry = node.geometries[i]; - var instance_materials = instance_geometry.instance_material; - var geometry = geometries[instance_geometry.url]; - var used_materials = {}; - var used_materials_array = []; - var num_materials = 0; - var first_material; - - if ( geometry ) { - - if ( !geometry.mesh || !geometry.mesh.primitives ) - continue; - - if ( obj.name.length == 0 ) { - - obj.name = geometry.id; - - } - - // collect used fx for this geometry-instance - - if ( instance_materials ) { - - for ( j = 0; j < instance_materials.length; j ++ ) { - - var inst_material = instance_materials[j]; - var effect_id = materials[inst_material.target].instance_effect.url; - var shader = effects[effect_id].shader; - - shader.material.opacity = !shader.material.opacity ? 1 : shader.material.opacity; - used_materials[inst_material.symbol] = num_materials; - used_materials_array.push(shader.material) - first_material = shader.material; - num_materials ++; - - } - - } - - var mesh; - var material = first_material || new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.FlatShading } ); - var geom = geometry.mesh.geometry3js; - - if ( num_materials > 1 ) { - - material = new THREE.MeshFaceMaterial(); - geom.materials = used_materials_array; - - for ( j = 0; j < geom.faces.length; j ++ ) { - - var face = geom.faces[ j ]; - face.materialIndex = used_materials[ face.daeMaterial ] - - } - - } - - if ( skinController !== undefined) { - - applySkin( geom, skinController ); - - material.morphTargets = true; - - mesh = new THREE.SkinnedMesh( geom, material ); - mesh.skeleton = skinController.skeleton; - mesh.skinController = controllers[ skinController.url ]; - mesh.skinInstanceController = skinController; - mesh.name = 'skin_' + skins.length; - - skins.push( mesh ); - - } else if ( morphController !== undefined ) { - - createMorph( geom, morphController ); - - material.morphTargets = true; - - mesh = new THREE.Mesh( geom, material ); - mesh.name = 'morph_' + morphs.length; - - morphs.push( mesh ); - - } else { - - mesh = new THREE.Mesh( geom, material ); - // mesh.geom.name = geometry.id; - - } - - node.geometries.length > 1 ? obj.add( mesh ) : obj = mesh; - - } - - } - - obj.name = node.id || ""; - obj.matrix = node.matrix; - var props = node.matrix.decompose(); - obj.position = props[ 0 ]; - obj.quaternion = props[ 1 ]; - obj.useQuaternion = true; - obj.scale = props[ 2 ]; - - if ( options.centerGeometry && obj.geometry ) { - - var delta = THREE.GeometryUtils.center( obj.geometry ); - obj.quaternion.multiplyVector3( delta.multiplySelf( obj.scale ) ); - obj.position.subSelf( delta ); - - } - - for ( i = 0; i < node.nodes.length; i ++ ) { - - obj.add( createSceneGraph( node.nodes[i], node ) ); - - } - - return obj; - - }; - - function getJointId( skin, id ) { - - for ( var i = 0; i < skin.joints.length; i ++ ) { - - if ( skin.joints[ i ] == id ) { - - return i; - - } - - } - - }; - - function getLibraryNode( id ) { - - return COLLADA.evaluate( './/dae:library_nodes//dae:node[@id=\'' + id + '\']', COLLADA, _nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ).iterateNext(); - - }; - - function getChannelsForNode (node ) { - - var channels = []; - var startTime = 1000000; - var endTime = -1000000; - - for ( var id in animations ) { - - var animation = animations[id]; - - for ( var i = 0; i < animation.channel.length; i ++ ) { - - var channel = animation.channel[i]; - var sampler = animation.sampler[i]; - var id = channel.target.split('/')[0]; - - if ( id == node.id ) { - - sampler.create(); - channel.sampler = sampler; - startTime = Math.min(startTime, sampler.startTime); - endTime = Math.max(endTime, sampler.endTime); - channels.push(channel); - - } - - } - - } - - if ( channels.length ) { - - node.startTime = startTime; - node.endTime = endTime; - - } - - return channels; - - }; - - function calcFrameDuration( node ) { - - var minT = 10000000; - - for ( var i = 0; i < node.channels.length; i ++ ) { - - var sampler = node.channels[i].sampler; - - for ( var j = 0; j < sampler.input.length - 1; j ++ ) { - - var t0 = sampler.input[ j ]; - var t1 = sampler.input[ j + 1 ]; - minT = Math.min( minT, t1 - t0 ); - - } - } - - return minT; - - }; - - function calcMatrixAt( node, t ) { - - var animated = {}; - - var i, j; - - for ( i = 0; i < node.channels.length; i ++ ) { - - var channel = node.channels[ i ]; - animated[ channel.sid ] = channel; - - } - - var matrix = new THREE.Matrix4(); - - for ( i = 0; i < node.transforms.length; i ++ ) { - - var transform = node.transforms[ i ]; - var channel = animated[ transform.sid ]; - - if ( channel !== undefined ) { - - var sampler = channel.sampler; - var value; - - for ( j = 0; j < sampler.input.length - 1; j ++ ) { - - if ( sampler.input[ j + 1 ] > t ) { - - value = sampler.output[ j ]; - //console.log(value.flatten) - break; - - } - - } - - if ( value !== undefined ) { - - if ( value instanceof THREE.Matrix4 ) { - - matrix = matrix.multiply( matrix, value ); - - } else { - - // FIXME: handle other types - - matrix = matrix.multiply( matrix, transform.matrix ); - - } - - } else { - - matrix = matrix.multiply( matrix, transform.matrix ); - - } - - } else { - - matrix = matrix.multiply( matrix, transform.matrix ); - - } - - } - - return matrix; - - }; - - function bakeAnimations ( node ) { - - if ( node.channels && node.channels.length ) { - - var keys = [], - sids = []; - - for ( var i = 0, il = node.channels.length; i < il; i++ ) { - - var channel = node.channels[i], - fullSid = channel.fullSid, - member = getConvertedMember( channel.member ), - sampler = channel.sampler, - input = sampler.input, - transform = node.getTransformBySid( channel.sid ); - - if ( transform ) { - - if ( sids.indexOf( fullSid ) === -1 ) { - - sids.push( fullSid ); - - } - - for ( var j = 0, jl = input.length; j < jl; j++ ) { - - var time = input[j], - data = sampler.getData( transform.type, j ), - key = findKey( keys, time ); - - if ( !key ) { - - key = new Key( time ); - var timeNdx = findTimeNdx( keys, time ); - keys.splice( timeNdx == -1 ? keys.length : timeNdx, 0, key ); - - } - - key.addTarget( fullSid, transform, member, data ); - - } - - } else { - - console.log( 'Could not find transform "' + channel.sid + '" in node ' + node.id ); - - } - - } - - // post process - for ( var i = 0; i < sids.length; i++ ) { - - var sid = sids[ i ]; - - for ( var j = 0; j < keys.length; j++ ) { - - var key = keys[ j ]; - - if ( !key.hasTarget( sid ) ) { - - interpolateKeys( keys, key, j, sid ); - - } - - } - - } - - node.keys = keys; - node.sids = sids; - - } - - }; - - function findKey ( keys, time) { - - var retVal = null; - - for ( var i = 0, il = keys.length; i < il && retVal == null; i++ ) { - - var key = keys[i]; - - if ( key.time === time ) { - - retVal = key; - - } else if ( key.time > time ) { - - break; - - } - - } - - return retVal; - - }; - - function findTimeNdx ( keys, time) { - - var ndx = -1; - - for ( var i = 0, il = keys.length; i < il && ndx == -1; i++ ) { - - var key = keys[i]; - - if ( key.time >= time ) { - - ndx = i; - - } - - } - - return ndx; - - }; - - function interpolateKeys ( keys, key, ndx, fullSid ) { - - var prevKey = getPrevKeyWith( keys, fullSid, ndx ? ndx-1 : 0 ), - nextKey = getNextKeyWith( keys, fullSid, ndx+1 ); - - if ( prevKey && nextKey ) { - - var scale = (key.time - prevKey.time) / (nextKey.time - prevKey.time), - prevTarget = prevKey.getTarget( fullSid ), - nextData = nextKey.getTarget( fullSid ).data, - prevData = prevTarget.data, - data; - - if ( prevData.length ) { - - data = []; - - for ( var i = 0; i < prevData.length; ++i ) { - - data[ i ] = prevData[ i ] + ( nextData[ i ] - prevData[ i ] ) * scale; - - } - - } else { - - data = prevData + ( nextData - prevData ) * scale; - - } - - key.addTarget( fullSid, prevTarget.transform, prevTarget.member, data ); - - } - - }; - - // Get next key with given sid - - function getNextKeyWith( keys, fullSid, ndx ) { - - for ( ; ndx < keys.length; ndx++ ) { - - var key = keys[ ndx ]; - - if ( key.hasTarget( fullSid ) ) { - - return key; - - } - - } - - return null; - - }; - - // Get previous key with given sid - - function getPrevKeyWith( keys, fullSid, ndx ) { - - ndx = ndx >= 0 ? ndx : ndx + keys.length; - - for ( ; ndx >= 0; ndx-- ) { - - var key = keys[ ndx ]; - - if ( key.hasTarget( fullSid ) ) { - - return key; - - } - - } - - return null; - - }; - - function _Image() { - - this.id = ""; - this.init_from = ""; - - }; - - _Image.prototype.parse = function(element) { - - this.id = element.getAttribute('id'); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - - if ( child.nodeName == 'init_from' ) { - - this.init_from = child.textContent; - - } - - } - - return this; - - }; - - function Controller() { - - this.id = ""; - this.name = ""; - this.type = ""; - this.skin = null; - this.morph = null; - - }; - - Controller.prototype.parse = function( element ) { - - this.id = element.getAttribute('id'); - this.name = element.getAttribute('name'); - this.type = "none"; - - for ( var i = 0; i < element.childNodes.length; i++ ) { - - var child = element.childNodes[ i ]; - - switch ( child.nodeName ) { - - case 'skin': - - this.skin = (new Skin()).parse(child); - this.type = child.nodeName; - break; - - case 'morph': - - this.morph = (new Morph()).parse(child); - this.type = child.nodeName; - break; - - default: - break; - - } - } - - return this; - - }; - - function Morph() { - - this.method = null; - this.source = null; - this.targets = null; - this.weights = null; - - }; - - Morph.prototype.parse = function( element ) { - - var sources = {}; - var inputs = []; - var i; - - this.method = element.getAttribute( 'method' ); - this.source = element.getAttribute( 'source' ).replace( /^#/, '' ); - - for ( i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'source': - - var source = ( new Source() ).parse( child ); - sources[ source.id ] = source; - break; - - case 'targets': - - inputs = this.parseInputs( child ); - break; - - default: - - console.log( child.nodeName ); - break; - - } - - } - - for ( i = 0; i < inputs.length; i ++ ) { - - var input = inputs[ i ]; - var source = sources[ input.source ]; - - switch ( input.semantic ) { - - case 'MORPH_TARGET': - - this.targets = source.read(); - break; - - case 'MORPH_WEIGHT': - - this.weights = source.read(); - break; - - default: - break; - - } - } - - return this; - - }; - - Morph.prototype.parseInputs = function(element) { - - var inputs = []; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[i]; - if ( child.nodeType != 1) continue; - - switch ( child.nodeName ) { - - case 'input': - - inputs.push( (new Input()).parse(child) ); - break; - - default: - break; - } - } - - return inputs; - - }; - - function Skin() { - - this.source = ""; - this.bindShapeMatrix = null; - this.invBindMatrices = []; - this.joints = []; - this.weights = []; - - }; - - Skin.prototype.parse = function( element ) { - - var sources = {}; - var joints, weights; - - this.source = element.getAttribute( 'source' ).replace( /^#/, '' ); - this.invBindMatrices = []; - this.joints = []; - this.weights = []; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[i]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'bind_shape_matrix': - - var f = _floats(child.textContent); - this.bindShapeMatrix = getConvertedMat4( f ); - break; - - case 'source': - - var src = new Source().parse(child); - sources[ src.id ] = src; - break; - - case 'joints': - - joints = child; - break; - - case 'vertex_weights': - - weights = child; - break; - - default: - - console.log( child.nodeName ); - break; - - } - } - - this.parseJoints( joints, sources ); - this.parseWeights( weights, sources ); - - return this; - - }; - - Skin.prototype.parseJoints = function ( element, sources ) { - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'input': - - var input = ( new Input() ).parse( child ); - var source = sources[ input.source ]; - - if ( input.semantic == 'JOINT' ) { - - this.joints = source.read(); - - } else if ( input.semantic == 'INV_BIND_MATRIX' ) { - - this.invBindMatrices = source.read(); - - } - - break; - - default: - break; - } - - } - - }; - - Skin.prototype.parseWeights = function ( element, sources ) { - - var v, vcount, inputs = []; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'input': - - inputs.push( ( new Input() ).parse( child ) ); - break; - - case 'v': - - v = _ints( child.textContent ); - break; - - case 'vcount': - - vcount = _ints( child.textContent ); - break; - - default: - break; - - } - - } - - var index = 0; - - for ( var i = 0; i < vcount.length; i ++ ) { - - var numBones = vcount[i]; - var vertex_weights = []; - - for ( var j = 0; j < numBones; j++ ) { - - var influence = {}; - - for ( var k = 0; k < inputs.length; k ++ ) { - - var input = inputs[ k ]; - var value = v[ index + input.offset ]; - - switch ( input.semantic ) { - - case 'JOINT': - - influence.joint = value;//this.joints[value]; - break; - - case 'WEIGHT': - - influence.weight = sources[ input.source ].data[ value ]; - break; - - default: - break; - - } - - } - - vertex_weights.push( influence ); - index += inputs.length; - } - - for ( var j = 0; j < vertex_weights.length; j ++ ) { - - vertex_weights[ j ].index = i; - - } - - this.weights.push( vertex_weights ); - - } - - }; - - function VisualScene () { - - this.id = ""; - this.name = ""; - this.nodes = []; - this.scene = new THREE.Object3D(); - - }; - - VisualScene.prototype.getChildById = function( id, recursive ) { - - for ( var i = 0; i < this.nodes.length; i ++ ) { - - var node = this.nodes[ i ].getChildById( id, recursive ); - - if ( node ) { - - return node; - - } - - } - - return null; - - }; - - VisualScene.prototype.getChildBySid = function( sid, recursive ) { - - for ( var i = 0; i < this.nodes.length; i ++ ) { - - var node = this.nodes[ i ].getChildBySid( sid, recursive ); - - if ( node ) { - - return node; - - } - - } - - return null; - - }; - - VisualScene.prototype.parse = function( element ) { - - this.id = element.getAttribute( 'id' ); - this.name = element.getAttribute( 'name' ); - this.nodes = []; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'node': - - this.nodes.push( ( new Node() ).parse( child ) ); - break; - - default: - break; - - } - - } - - return this; - - }; - - function Node() { - - this.id = ""; - this.name = ""; - this.sid = ""; - this.nodes = []; - this.controllers = []; - this.transforms = []; - this.geometries = []; - this.channels = []; - this.matrix = new THREE.Matrix4(); - - }; - - Node.prototype.getChannelForTransform = function( transformSid ) { - - for ( var i = 0; i < this.channels.length; i ++ ) { - - var channel = this.channels[i]; - var parts = channel.target.split('/'); - var id = parts.shift(); - var sid = parts.shift(); - var dotSyntax = (sid.indexOf(".") >= 0); - var arrSyntax = (sid.indexOf("(") >= 0); - var arrIndices; - var member; - - if ( dotSyntax ) { - - parts = sid.split("."); - sid = parts.shift(); - member = parts.shift(); - - } else if ( arrSyntax ) { - - arrIndices = sid.split("("); - sid = arrIndices.shift(); - - for ( var j = 0; j < arrIndices.length; j ++ ) { - - arrIndices[ j ] = parseInt( arrIndices[ j ].replace( /\)/, '' ) ); - - } - - } - - if ( sid == transformSid ) { - - channel.info = { sid: sid, dotSyntax: dotSyntax, arrSyntax: arrSyntax, arrIndices: arrIndices }; - return channel; - - } - - } - - return null; - - }; - - Node.prototype.getChildById = function ( id, recursive ) { - - if ( this.id == id ) { - - return this; - - } - - if ( recursive ) { - - for ( var i = 0; i < this.nodes.length; i ++ ) { - - var n = this.nodes[ i ].getChildById( id, recursive ); - - if ( n ) { - - return n; - - } - - } - - } - - return null; - - }; - - Node.prototype.getChildBySid = function ( sid, recursive ) { - - if ( this.sid == sid ) { - - return this; - - } - - if ( recursive ) { - - for ( var i = 0; i < this.nodes.length; i ++ ) { - - var n = this.nodes[ i ].getChildBySid( sid, recursive ); - - if ( n ) { - - return n; - - } - - } - } - - return null; - - }; - - Node.prototype.getTransformBySid = function ( sid ) { - - for ( var i = 0; i < this.transforms.length; i ++ ) { - - if ( this.transforms[ i ].sid == sid ) return this.transforms[ i ]; - - } - - return null; - - }; - - Node.prototype.parse = function( element ) { - - var url; - - this.id = element.getAttribute('id'); - this.sid = element.getAttribute('sid'); - this.name = element.getAttribute('name'); - this.type = element.getAttribute('type'); - - this.type = this.type == 'JOINT' ? this.type : 'NODE'; - - this.nodes = []; - this.transforms = []; - this.geometries = []; - this.controllers = []; - this.matrix = new THREE.Matrix4(); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'node': - - this.nodes.push( ( new Node() ).parse( child ) ); - break; - - case 'instance_camera': - - break; - - case 'instance_controller': - - this.controllers.push( ( new InstanceController() ).parse( child ) ); - break; - - case 'instance_geometry': - - this.geometries.push( ( new InstanceGeometry() ).parse( child ) ); - break; - - case 'instance_light': - - break; - - case 'instance_node': - - url = child.getAttribute( 'url' ).replace( /^#/, '' ); - var iNode = getLibraryNode( url ); - - if ( iNode ) { - - this.nodes.push( ( new Node() ).parse( iNode )) ; - - } - - break; - - case 'rotate': - case 'translate': - case 'scale': - case 'matrix': - case 'lookat': - case 'skew': - - this.transforms.push( ( new Transform() ).parse( child ) ); - break; - - case 'extra': - break; - - default: - - console.log( child.nodeName ); - break; - - } - - } - - this.channels = getChannelsForNode( this ); - bakeAnimations( this ); - - this.updateMatrix(); - - return this; - - }; - - Node.prototype.updateMatrix = function () { - - this.matrix.identity(); - - for ( var i = 0; i < this.transforms.length; i ++ ) { - - this.transforms[ i ].apply( this.matrix ); - - } - - }; - - function Transform () { - - this.sid = ""; - this.type = ""; - this.data = []; - this.obj = null; - - }; - - Transform.prototype.parse = function ( element ) { - - this.sid = element.getAttribute( 'sid' ); - this.type = element.nodeName; - this.data = _floats( element.textContent ); - this.convert(); - - return this; - - }; - - Transform.prototype.convert = function () { - - switch ( this.type ) { - - case 'matrix': - - this.obj = getConvertedMat4( this.data ); - break; - - case 'rotate': - - this.angle = this.data[3] * TO_RADIANS; - - case 'translate': - - fixCoords( this.data, -1 ); - this.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] ); - break; - - case 'scale': - - fixCoords( this.data, 1 ); - this.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] ); - break; - - default: - console.log( 'Can not convert Transform of type ' + this.type ); - break; - - } - - }; - - Transform.prototype.apply = function ( matrix ) { - - switch ( this.type ) { - - case 'matrix': - - matrix.multiplySelf( this.obj ); - break; - - case 'translate': - - matrix.translate( this.obj ); - break; - - case 'rotate': - - matrix.rotateByAxis( this.obj, this.angle ); - break; - - case 'scale': - - matrix.scale( this.obj ); - break; - - } - - }; - - Transform.prototype.update = function ( data, member ) { - - switch ( this.type ) { - - case 'matrix': - - console.log( 'Currently not handling matrix transform updates' ); - break; - - case 'translate': - case 'scale': - - switch ( member ) { - - case 'X': - - this.obj.x = data; - break; - - case 'Y': - - this.obj.y = data; - break; - - case 'Z': - - this.obj.z = data; - break; - - default: - - this.obj.x = data[ 0 ]; - this.obj.y = data[ 1 ]; - this.obj.z = data[ 2 ]; - break; - - } - - break; - - case 'rotate': - - switch ( member ) { - - case 'X': - - this.obj.x = data; - break; - - case 'Y': - - this.obj.y = data; - break; - - case 'Z': - - this.obj.z = data; - break; - - case 'ANGLE': - - this.angle = data * TO_RADIANS; - break; - - default: - - this.obj.x = data[ 0 ]; - this.obj.y = data[ 1 ]; - this.obj.z = data[ 2 ]; - this.angle = data[ 3 ] * TO_RADIANS; - break; - - } - break; - - } - - }; - - function InstanceController() { - - this.url = ""; - this.skeleton = []; - this.instance_material = []; - - }; - - InstanceController.prototype.parse = function ( element ) { - - this.url = element.getAttribute('url').replace(/^#/, ''); - this.skeleton = []; - this.instance_material = []; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[i]; - if (child.nodeType != 1) continue; - - switch ( child.nodeName ) { - - case 'skeleton': - - this.skeleton.push( child.textContent.replace(/^#/, '') ); - break; - - case 'bind_material': - - var instances = COLLADA.evaluate( './/dae:instance_material', child, _nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); - - if ( instances ) { - - var instance = instances.iterateNext(); - - while ( instance ) { - - this.instance_material.push((new InstanceMaterial()).parse(instance)); - instance = instances.iterateNext(); - - } - - } - - break; - - case 'extra': - break; - - default: - break; - - } - } - - return this; - - }; - - function InstanceMaterial () { - - this.symbol = ""; - this.target = ""; - - }; - - InstanceMaterial.prototype.parse = function ( element ) { - - this.symbol = element.getAttribute('symbol'); - this.target = element.getAttribute('target').replace(/^#/, ''); - return this; - - }; - - function InstanceGeometry() { - - this.url = ""; - this.instance_material = []; - - }; - - InstanceGeometry.prototype.parse = function ( element ) { - - this.url = element.getAttribute('url').replace(/^#/, ''); - this.instance_material = []; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[i]; - if ( child.nodeType != 1 ) continue; - - if ( child.nodeName == 'bind_material' ) { - - var instances = COLLADA.evaluate( './/dae:instance_material', child, _nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); - - if ( instances ) { - - var instance = instances.iterateNext(); - - while ( instance ) { - - this.instance_material.push( (new InstanceMaterial()).parse(instance) ); - instance = instances.iterateNext(); - - } - - } - - break; - - } - - } - - return this; - - }; - - function Geometry() { - - this.id = ""; - this.mesh = null; - - }; - - Geometry.prototype.parse = function ( element ) { - - this.id = element.getAttribute('id'); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[i]; - - switch ( child.nodeName ) { - - case 'mesh': - - this.mesh = (new Mesh(this)).parse(child); - break; - - case 'extra': - - // console.log( child ); - break; - - default: - break; - } - } - - return this; - - }; - - function Mesh( geometry ) { - - this.geometry = geometry.id; - this.primitives = []; - this.vertices = null; - this.geometry3js = null; - - }; - - Mesh.prototype.parse = function( element ) { - - this.primitives = []; - - var i, j; - - for ( i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - - switch ( child.nodeName ) { - - case 'source': - - _source( child ); - break; - - case 'vertices': - - this.vertices = ( new Vertices() ).parse( child ); - break; - - case 'triangles': - - this.primitives.push( ( new Triangles().parse( child ) ) ); - break; - - case 'polygons': - - console.warn( 'polygon holes not yet supported!' ); - - case 'polylist': - - this.primitives.push( ( new Polylist().parse( child ) ) ); - break; - - default: - break; - - } - - } - - this.geometry3js = new THREE.Geometry(); - - var vertexData = sources[ this.vertices.input['POSITION'].source ].data; - - for ( i = 0; i < vertexData.length; i += 3 ) { - - var v = new THREE.Vertex( getConvertedVec3( vertexData, i ) ); - this.geometry3js.vertices.push( v ); - - } - - for ( i = 0; i < this.primitives.length; i ++ ) { - - var primitive = this.primitives[ i ]; - primitive.setVertices( this.vertices ); - this.handlePrimitive( primitive, this.geometry3js ); - - } - - this.geometry3js.computeCentroids(); - this.geometry3js.computeFaceNormals(); - this.geometry3js.computeVertexNormals(); - this.geometry3js.computeBoundingBox(); - - return this; - - }; - - Mesh.prototype.handlePrimitive = function( primitive, geom ) { - - var i = 0, j, k, p = primitive.p, inputs = primitive.inputs; - var input, index, idx32; - var source, numParams; - var vcIndex = 0, vcount = 3; - var texture_sets = []; - - for ( j = 0; j < inputs.length; j ++ ) { - - input = inputs[ j ]; - - switch ( input.semantic ) { - - case 'TEXCOORD': - texture_sets.push( input.set ); - break; - - } - - } - - while ( i < p.length ) { - - var vs = []; - var ns = []; - var ts = {}; - var cs = []; - - if ( primitive.vcount ) { - - vcount = primitive.vcount[ vcIndex ++ ]; - - } - - for ( j = 0; j < vcount; j ++ ) { - - for ( k = 0; k < inputs.length; k ++ ) { - - input = inputs[ k ]; - source = sources[ input.source ]; - - index = p[ i + ( j * inputs.length ) + input.offset ]; - numParams = source.accessor.params.length; - idx32 = index * numParams; - - switch ( input.semantic ) { - - case 'VERTEX': - - vs.push( index ); - - break; - - case 'NORMAL': - - ns.push( getConvertedVec3( source.data, idx32 ) ); - - break; - - case 'TEXCOORD': - - if ( ts[ input.set ] === undefined ) ts[ input.set ] = []; - // invert the V - ts[ input.set ].push( new THREE.UV( source.data[ idx32 ], 1.0 - source.data[ idx32 + 1 ] ) ); - - break; - - case 'COLOR': - - cs.push( new THREE.Color().setRGB( source.data[ idx32 ], source.data[ idx32 + 1 ], source.data[ idx32 + 2 ] ) ); - - break; - - default: - break; - - } - - } - - } - - - var face = null, faces = [], uv, uvArr; - - if ( vcount === 3 ) { - - faces.push( new THREE.Face3( vs[0], vs[1], vs[2], [ ns[0], ns[1], ns[2] ], cs.length ? cs : new THREE.Color() ) ); - - } else if ( vcount === 4 ) { - - faces.push( new THREE.Face4( vs[0], vs[1], vs[2], vs[3], [ ns[0], ns[1], ns[2], ns[3] ], cs.length ? cs : new THREE.Color() ) ); - - } else if ( vcount > 4 && options.subdivideFaces ) { - - var clr = cs.length ? cs : new THREE.Color(), - vec1, vec2, vec3, v1, v2, norm; - - // subdivide into multiple Face3s - for ( k = 1; k < vcount-1; ) { - - // FIXME: normals don't seem to be quite right - faces.push( new THREE.Face3( vs[0], vs[k], vs[k+1], [ ns[0], ns[k++], ns[k] ], clr ) ); - - } - - } - - if ( faces.length ) { - - for (var ndx = 0, len = faces.length; ndx < len; ndx++) { - - face = faces[ndx]; - face.daeMaterial = primitive.material; - geom.faces.push( face ); - - for ( k = 0; k < texture_sets.length; k++ ) { - - uv = ts[ texture_sets[k] ]; - - if ( vcount > 4 ) { - - // Grab the right UVs for the vertices in this face - uvArr = [ uv[0], uv[ndx+1], uv[ndx+2] ]; - - } else if ( vcount === 4 ) { - - uvArr = [ uv[0], uv[1], uv[2], uv[3] ]; - - } else { - - uvArr = [ uv[0], uv[1], uv[2] ]; - - } - - if ( !geom.faceVertexUvs[k] ) { - - geom.faceVertexUvs[k] = []; - - } - - geom.faceVertexUvs[k].push( uvArr ); - - } - - } - - } else { - - console.log( 'dropped face with vcount ' + vcount + ' for geometry with id: ' + geom.id ); - - } - - i += inputs.length * vcount; - - } - - }; - - - function Polylist () { - }; - - Polylist.prototype = new Triangles(); - Polylist.prototype.constructor = Polylist; - - function Triangles( flip_uv ) { - - this.material = ""; - this.count = 0; - this.inputs = []; - this.vcount = null; - this.p = []; - this.geometry = new THREE.Geometry(); - - }; - - Triangles.prototype.setVertices = function ( vertices ) { - - for ( var i = 0; i < this.inputs.length; i ++ ) { - - if ( this.inputs[ i ].source == vertices.id ) { - - this.inputs[ i ].source = vertices.input[ 'POSITION' ].source; - - } - - } - - }; - - Triangles.prototype.parse = function ( element ) { - - this.inputs = []; - this.material = element.getAttribute( 'material' ); - this.count = _attr_as_int( element, 'count', 0 ); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - - switch ( child.nodeName ) { - - case 'input': - - this.inputs.push( ( new Input() ).parse( element.childNodes[ i ] ) ); - break; - - case 'vcount': - - this.vcount = _ints( child.textContent ); - break; - - case 'p': - - this.p = _ints( child.textContent ); - break; - - default: - break; - - } - - } - - return this; - - }; - - function Accessor() { - - this.source = ""; - this.count = 0; - this.stride = 0; - this.params = []; - - }; - - Accessor.prototype.parse = function ( element ) { - - this.params = []; - this.source = element.getAttribute( 'source' ); - this.count = _attr_as_int( element, 'count', 0 ); - this.stride = _attr_as_int( element, 'stride', 0 ); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - - if ( child.nodeName == 'param' ) { - - var param = {}; - param[ 'name' ] = child.getAttribute( 'name' ); - param[ 'type' ] = child.getAttribute( 'type' ); - this.params.push( param ); - - } - - } - - return this; - - }; - - function Vertices() { - - this.input = {}; - - }; - - Vertices.prototype.parse = function ( element ) { - - this.id = element.getAttribute('id'); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - if ( element.childNodes[i].nodeName == 'input' ) { - - var input = ( new Input() ).parse( element.childNodes[ i ] ); - this.input[ input.semantic ] = input; - - } - - } - - return this; - - }; - - function Input () { - - this.semantic = ""; - this.offset = 0; - this.source = ""; - this.set = 0; - - }; - - Input.prototype.parse = function ( element ) { - - this.semantic = element.getAttribute('semantic'); - this.source = element.getAttribute('source').replace(/^#/, ''); - this.set = _attr_as_int(element, 'set', -1); - this.offset = _attr_as_int(element, 'offset', 0); - - if ( this.semantic == 'TEXCOORD' && this.set < 0 ) { - - this.set = 0; - - } - - return this; - - }; - - function Source ( id ) { - - this.id = id; - this.type = null; - - }; - - Source.prototype.parse = function ( element ) { - - this.id = element.getAttribute( 'id' ); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[i]; - - switch ( child.nodeName ) { - - case 'bool_array': - - this.data = _bools( child.textContent ); - this.type = child.nodeName; - break; - - case 'float_array': - - this.data = _floats( child.textContent ); - this.type = child.nodeName; - break; - - case 'int_array': - - this.data = _ints( child.textContent ); - this.type = child.nodeName; - break; - - case 'IDREF_array': - case 'Name_array': - - this.data = _strings( child.textContent ); - this.type = child.nodeName; - break; - - case 'technique_common': - - for ( var j = 0; j < child.childNodes.length; j ++ ) { - - if ( child.childNodes[ j ].nodeName == 'accessor' ) { - - this.accessor = ( new Accessor() ).parse( child.childNodes[ j ] ); - break; - - } - } - break; - - default: - // console.log(child.nodeName); - break; - - } - - } - - return this; - - }; - - Source.prototype.read = function () { - - var result = []; - - //for (var i = 0; i < this.accessor.params.length; i++) { - - var param = this.accessor.params[ 0 ]; - - //console.log(param.name + " " + param.type); - - switch ( param.type ) { - - case 'IDREF': - case 'Name': case 'name': - case 'float': - - return this.data; - - case 'float4x4': - - for ( var j = 0; j < this.data.length; j += 16 ) { - - var s = this.data.slice( j, j + 16 ); - var m = getConvertedMat4( s ); - result.push( m ); - } - - break; - - default: - - console.log( 'ColladaLoader: Source: Read dont know how to read ' + param.type + '.' ); - break; - - } - - //} - - return result; - - }; - - function Material () { - - this.id = ""; - this.name = ""; - this.instance_effect = null; - - }; - - Material.prototype.parse = function ( element ) { - - this.id = element.getAttribute( 'id' ); - this.name = element.getAttribute( 'name' ); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - if ( element.childNodes[ i ].nodeName == 'instance_effect' ) { - - this.instance_effect = ( new InstanceEffect() ).parse( element.childNodes[ i ] ); - break; - - } - - } - - return this; - - }; - - function ColorOrTexture () { - - this.color = new THREE.Color( 0 ); - this.color.setRGB( Math.random(), Math.random(), Math.random() ); - this.color.a = 1.0; - - this.texture = null; - this.texcoord = null; - this.texOpts = null; - - }; - - ColorOrTexture.prototype.isColor = function () { - - return ( this.texture == null ); - - }; - - ColorOrTexture.prototype.isTexture = function () { - - return ( this.texture != null ); - - }; - - ColorOrTexture.prototype.parse = function ( element ) { - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'color': - - var rgba = _floats( child.textContent ); - this.color = new THREE.Color(0); - this.color.setRGB( rgba[0], rgba[1], rgba[2] ); - this.color.a = rgba[3]; - break; - - case 'texture': - - this.texture = child.getAttribute('texture'); - this.texcoord = child.getAttribute('texcoord'); - // Defaults from: - // https://collada.org/mediawiki/index.php/Maya_texture_placement_MAYA_extension - this.texOpts = { - offsetU: 0, - offsetV: 0, - repeatU: 1, - repeatV: 1, - wrapU: 1, - wrapV: 1, - }; - this.parseTexture( child ); - break; - - default: - break; - - } - - } - - return this; - - }; - - ColorOrTexture.prototype.parseTexture = function ( element ) { - - if ( ! element.childNodes ) return this; - - // This should be supported by Maya, 3dsMax, and MotionBuilder - - if ( element.childNodes[1] && element.childNodes[1].nodeName === 'extra' ) { - - element = element.childNodes[1]; - - if ( element.childNodes[1] && element.childNodes[1].nodeName === 'technique' ) { - - element = element.childNodes[1]; - - } - - } - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - - switch ( child.nodeName ) { - - case 'offsetU': - case 'offsetV': - case 'repeatU': - case 'repeatV': - - this.texOpts[ child.nodeName ] = parseFloat( child.textContent ); - break; - - case 'wrapU': - case 'wrapV': - - this.texOpts[ child.nodeName ] = parseInt( child.textContent ); - break; - - default: - this.texOpts[ child.nodeName ] = child.textContent; - break; - - } - - } - - return this; - - }; - - function Shader ( type, effect ) { - - this.type = type; - this.effect = effect; - this.material = null; - - }; - - Shader.prototype.parse = function ( element ) { - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'ambient': - case 'emission': - case 'diffuse': - case 'specular': - case 'transparent': - - this[ child.nodeName ] = ( new ColorOrTexture() ).parse( child ); - break; - - case 'shininess': - case 'reflectivity': - case 'transparency': - - var f = evaluateXPath( child, './/dae:float' ); - - if ( f.length > 0 ) - this[ child.nodeName ] = parseFloat( f[ 0 ].textContent ); - - break; - - default: - break; - - } - - } - - this.create(); - return this; - - }; - - Shader.prototype.create = function() { - - var props = {}; - var transparent = ( this['transparency'] !== undefined && this['transparency'] < 1.0 ); - - for ( var prop in this ) { - - switch ( prop ) { - - case 'ambient': - case 'emission': - case 'diffuse': - case 'specular': - - var cot = this[prop]; - - if ( cot instanceof ColorOrTexture ) { - - if ( cot.isTexture() ) { - - if ( this.effect.sampler && this.effect.surface ) { - - if ( this.effect.sampler.source == this.effect.surface.sid ) { - - var image = images[this.effect.surface.init_from]; - - if ( image ) { - - var texture = THREE.ImageUtils.loadTexture(baseUrl + image.init_from); - texture.wrapS = cot.texOpts.wrapU ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping; - texture.wrapT = cot.texOpts.wrapV ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping; - texture.offset.x = cot.texOpts.offsetU; - texture.offset.y = cot.texOpts.offsetV; - texture.repeat.x = cot.texOpts.repeatU; - texture.repeat.y = cot.texOpts.repeatV; - props['map'] = texture; - - } - - } - - } - - } else { - - if ( prop == 'diffuse' ) { - - props[ 'color' ] = cot.color.getHex(); - - } else if ( !transparent ) { - - props[ prop ] = cot.color.getHex(); - - } - - } - - } - - break; - - case 'shininess': - case 'reflectivity': - - props[ prop ] = this[ prop ]; - break; - - case 'transparency': - - if ( transparent ) { - - props[ 'transparent' ] = true; - props[ 'opacity' ] = this[ prop ]; - transparent = true; - - } - - break; - - default: - break; - - } - - } - - props[ 'shading' ] = preferredShading; - this.material = new THREE.MeshLambertMaterial( props ); - - switch ( this.type ) { - - case 'constant': - case 'lambert': - break; - - case 'phong': - case 'blinn': - - default: - - /* - if ( !transparent ) { - - // this.material = new THREE.MeshPhongMaterial(props); - - } - */ - - break; - - } - - return this.material; - - }; - - function Surface ( effect ) { - - this.effect = effect; - this.init_from = null; - this.format = null; - - }; - - Surface.prototype.parse = function ( element ) { - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'init_from': - - this.init_from = child.textContent; - break; - - case 'format': - - this.format = child.textContent; - break; - - default: - - console.log( "unhandled Surface prop: " + child.nodeName ); - break; - - } - - } - - return this; - - }; - - function Sampler2D ( effect ) { - - this.effect = effect; - this.source = null; - this.wrap_s = null; - this.wrap_t = null; - this.minfilter = null; - this.magfilter = null; - this.mipfilter = null; - - }; - - Sampler2D.prototype.parse = function ( element ) { - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'source': - - this.source = child.textContent; - break; - - case 'minfilter': - - this.minfilter = child.textContent; - break; - - case 'magfilter': - - this.magfilter = child.textContent; - break; - - case 'mipfilter': - - this.mipfilter = child.textContent; - break; - - case 'wrap_s': - - this.wrap_s = child.textContent; - break; - - case 'wrap_t': - - this.wrap_t = child.textContent; - break; - - default: - - console.log( "unhandled Sampler2D prop: " + child.nodeName ); - break; - - } - - } - - return this; - - }; - - function Effect () { - - this.id = ""; - this.name = ""; - this.shader = null; - this.surface = null; - this.sampler = null; - - }; - - Effect.prototype.create = function () { - - if ( this.shader == null ) { - - return null; - - } - - }; - - Effect.prototype.parse = function ( element ) { - - this.id = element.getAttribute( 'id' ); - this.name = element.getAttribute( 'name' ); - this.shader = null; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'profile_COMMON': - - this.parseTechnique( this.parseProfileCOMMON( child ) ); - break; - - default: - break; - - } - - } - - return this; - - }; - - Effect.prototype.parseNewparam = function ( element ) { - - var sid = element.getAttribute( 'sid' ); - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'surface': - - this.surface = ( new Surface( this ) ).parse( child ); - this.surface.sid = sid; - break; - - case 'sampler2D': - - this.sampler = ( new Sampler2D( this ) ).parse( child ); - this.sampler.sid = sid; - break; - - case 'extra': - - break; - - default: - - console.log( child.nodeName ); - break; - - } - - } - - }; - - Effect.prototype.parseProfileCOMMON = function ( element ) { - - var technique; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'profile_COMMON': - - this.parseProfileCOMMON( child ); - break; - - case 'technique': - - technique = child; - break; - - case 'newparam': - - this.parseNewparam( child ); - break; - - case 'extra': - break; - - default: - - console.log( child.nodeName ); - break; - - } - - } - - return technique; - - }; - - Effect.prototype.parseTechnique= function ( element ) { - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[i]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'constant': - case 'lambert': - case 'blinn': - case 'phong': - - this.shader = ( new Shader( child.nodeName, this ) ).parse( child ); - break; - - default: - break; - - } - - } - - }; - - function InstanceEffect () { - - this.url = ""; - - }; - - InstanceEffect.prototype.parse = function ( element ) { - - this.url = element.getAttribute( 'url' ).replace( /^#/, '' ); - return this; - - }; - - function Animation() { - - this.id = ""; - this.name = ""; - this.source = {}; - this.sampler = []; - this.channel = []; - - }; - - Animation.prototype.parse = function ( element ) { - - this.id = element.getAttribute( 'id' ); - this.name = element.getAttribute( 'name' ); - this.source = {}; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'source': - - var src = ( new Source() ).parse( child ); - this.source[ src.id ] = src; - break; - - case 'sampler': - - this.sampler.push( ( new Sampler( this ) ).parse( child ) ); - break; - - case 'channel': - - this.channel.push( ( new Channel( this ) ).parse( child ) ); - break; - - default: - break; - - } - - } - - return this; - - }; - - function Channel( animation ) { - - this.animation = animation; - this.source = ""; - this.target = ""; - this.fullSid = null; - this.sid = null; - this.dotSyntax = null; - this.arrSyntax = null; - this.arrIndices = null; - this.member = null; - - }; - - Channel.prototype.parse = function ( element ) { - - this.source = element.getAttribute( 'source' ).replace( /^#/, '' ); - this.target = element.getAttribute( 'target' ); - - var parts = this.target.split( '/' ); - - var id = parts.shift(); - var sid = parts.shift(); - - var dotSyntax = ( sid.indexOf(".") >= 0 ); - var arrSyntax = ( sid.indexOf("(") >= 0 ); - - if ( dotSyntax ) { - - parts = sid.split("."); - this.sid = parts.shift(); - this.member = parts.shift(); - - } else if ( arrSyntax ) { - - var arrIndices = sid.split("("); - this.sid = arrIndices.shift(); - - for (var j = 0; j < arrIndices.length; j ++ ) { - - arrIndices[j] = parseInt( arrIndices[j].replace(/\)/, '') ); - - } - - this.arrIndices = arrIndices; - - } else { - - this.sid = sid; - - } - - this.fullSid = sid; - this.dotSyntax = dotSyntax; - this.arrSyntax = arrSyntax; - - return this; - - }; - - function Sampler ( animation ) { - - this.id = ""; - this.animation = animation; - this.inputs = []; - this.input = null; - this.output = null; - this.strideOut = null; - this.interpolation = null; - this.startTime = null; - this.endTime = null; - this.duration = 0; - - }; - - Sampler.prototype.parse = function ( element ) { - - this.id = element.getAttribute( 'id' ); - this.inputs = []; - - for ( var i = 0; i < element.childNodes.length; i ++ ) { - - var child = element.childNodes[ i ]; - if ( child.nodeType != 1 ) continue; - - switch ( child.nodeName ) { - - case 'input': - - this.inputs.push( (new Input()).parse( child ) ); - break; - - default: - break; - - } - - } - - return this; - - }; - - Sampler.prototype.create = function () { - - for ( var i = 0; i < this.inputs.length; i ++ ) { - - var input = this.inputs[ i ]; - var source = this.animation.source[ input.source ]; - - switch ( input.semantic ) { - - case 'INPUT': - - this.input = source.read(); - break; - - case 'OUTPUT': - - this.output = source.read(); - this.strideOut = source.accessor.stride; - break; - - case 'INTERPOLATION': - - this.interpolation = source.read(); - break; - - case 'IN_TANGENT': - - break; - - case 'OUT_TANGENT': - - break; - - default: - - console.log(input.semantic); - break; - - } - - } - - this.startTime = 0; - this.endTime = 0; - this.duration = 0; - - if ( this.input.length ) { - - this.startTime = 100000000; - this.endTime = -100000000; - - for ( var i = 0; i < this.input.length; i ++ ) { - - this.startTime = Math.min( this.startTime, this.input[ i ] ); - this.endTime = Math.max( this.endTime, this.input[ i ] ); - - } - - this.duration = this.endTime - this.startTime; - - } - - }; - - Sampler.prototype.getData = function ( type, ndx ) { - - var data; - - if ( this.strideOut > 1 ) { - - data = []; - ndx *= this.strideOut; - - for ( var i = 0; i < this.strideOut; ++i ) { - - data[ i ] = this.output[ ndx + i ]; - - } - - if ( this.strideOut === 3 ) { - - switch ( type ) { - - case 'rotate': - case 'translate': - - fixCoords( data, -1 ); - break; - - case 'scale': - - fixCoords( data, 1 ); - break; - - } - - } - - } else { - - data = this.output[ ndx ]; - - } - - return data; - - }; - - function Key ( time ) { - - this.targets = []; - this.time = time; - - }; - - Key.prototype.addTarget = function ( fullSid, transform, member, data ) { - - this.targets.push( { - sid: fullSid, - member: member, - transform: transform, - data: data - } ); - - }; - - Key.prototype.apply = function ( opt_sid ) { - - for ( var i = 0; i < this.targets.length; ++i ) { - - var target = this.targets[ i ]; - - if ( !opt_sid || target.sid === opt_sid ) { - - target.transform.update( target.data, target.member ); - - } - - } - - }; - - Key.prototype.getTarget = function ( fullSid ) { - - for ( var i = 0; i < this.targets.length; ++i ) { - - if ( this.targets[ i ].sid === fullSid ) { - - return this.targets[ i ]; - - } - - } - - return null; - - }; - - Key.prototype.hasTarget = function ( fullSid ) { - - for ( var i = 0; i < this.targets.length; ++i ) { - - if ( this.targets[ i ].sid === fullSid ) { - - return true; - - } - - } - - return false; - - }; - - // TODO: Currently only doing linear interpolation. Should support full COLLADA spec. - Key.prototype.interpolate = function ( nextKey, time ) { - - for ( var i = 0; i < this.targets.length; ++i ) { - - var target = this.targets[ i ], - nextTarget = nextKey.getTarget( target.sid ), - data; - - if ( nextTarget ) { - - var scale = ( time - this.time ) / ( nextKey.time - this.time ), - nextData = nextTarget.data, - prevData = target.data; - - // check scale error - - if ( scale < 0 || scale > 1 ) { - - console.log( "Key.interpolate: Warning! Scale out of bounds:" + scale ); - scale = scale < 0 ? 0 : 1; - - } - - if ( prevData.length ) { - - data = []; - - for ( var j = 0; j < prevData.length; ++j ) { - - data[ j ] = prevData[ j ] + ( nextData[ j ] - prevData[ j ] ) * scale; - - } - - } else { - - data = prevData + ( nextData - prevData ) * scale; - - } - - } else { - - data = target.data; - - } - - target.transform.update( data, target.member ); - - } - - }; - - function _source ( element ) { - - var id = element.getAttribute( 'id' ); - - if ( sources[ id ] != undefined ) { - - return sources[ id ]; - - } - - sources[ id ] = ( new Source(id )).parse( element ); - return sources[ id ]; - - }; - - function _nsResolver ( nsPrefix ) { - - if ( nsPrefix == "dae" ) { - - return "http://www.collada.org/2005/11/COLLADASchema"; - - } - - return null; - - }; - - function _bools ( str ) { - - var raw = _strings( str ); - var data = []; - - for ( var i = 0; i < raw.length; i ++ ) { - - data.push( (raw[i] == 'true' || raw[i] == '1') ? true : false ); - - } - - return data; - - }; - - function _floats ( str ) { - - var raw = _strings(str); - var data = []; - - for ( var i = 0; i < raw.length; i ++ ) { - - data.push( parseFloat( raw[ i ] ) ); - - } - - return data; - - }; - - function _ints ( str ) { - - var raw = _strings( str ); - var data = []; - - for ( var i = 0; i < raw.length; i ++ ) { - - data.push( parseInt( raw[ i ], 10 ) ); - - } - - return data; - - }; - - function _strings ( str ) { - - return _trimString( str ).split( /\s+/ ); - - }; - - function _trimString ( str ) { - - return str.replace( /^\s+/, "" ).replace( /\s+$/, "" ); - - }; - - function _attr_as_float ( element, name, defaultValue ) { - - if ( element.hasAttribute( name ) ) { - - return parseFloat( element.getAttribute( name ) ); - - } else { - - return defaultValue; - - } - - }; - - function _attr_as_int ( element, name, defaultValue ) { - - if ( element.hasAttribute( name ) ) { - - return parseInt( element.getAttribute( name ), 10) ; - - } else { - - return defaultValue; - - } - - }; - - function _attr_as_string ( element, name, defaultValue ) { - - if ( element.hasAttribute( name ) ) { - - return element.getAttribute( name ); - - } else { - - return defaultValue; - - } - - }; - - function _format_float ( f, num ) { - - if ( f === undefined ) { - - var s = '0.'; - - while ( s.length < num + 2 ) { - - s += '0'; - - } - - return s; - - } - - num = num || 2; - - var parts = f.toString().split( '.' ); - parts[ 1 ] = parts.length > 1 ? parts[ 1 ].substr( 0, num ) : "0"; - - while( parts[ 1 ].length < num ) { - - parts[ 1 ] += '0'; - - } - - return parts.join( '.' ); - - }; - - function evaluateXPath ( node, query ) { - - var instances = COLLADA.evaluate( query, node, _nsResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null ); - - var inst = instances.iterateNext(); - var result = []; - - while ( inst ) { - - result.push( inst ); - inst = instances.iterateNext(); - - } - - return result; - - }; - - // Up axis conversion - - function setUpConversion () { - - if ( !options.convertUpAxis || colladaUp === options.upAxis ) { - - upConversion = null; - - } else { - - switch ( colladaUp ) { - - case 'X': - - upConversion = options.upAxis === 'Y' ? 'XtoY' : 'XtoZ'; - break; - - case 'Y': - - upConversion = options.upAxis === 'X' ? 'YtoX' : 'YtoZ'; - break; - - case 'Z': - - upConversion = options.upAxis === 'X' ? 'ZtoX' : 'ZtoY'; - break; - - } - - } - - }; - - function fixCoords ( data, sign ) { - - if ( !options.convertUpAxis || colladaUp === options.upAxis ) { - - return; - - } - - switch ( upConversion ) { - - case 'XtoY': - - var tmp = data[ 0 ]; - data[ 0 ] = sign * data[ 1 ]; - data[ 1 ] = tmp; - break; - - case 'XtoZ': - - var tmp = data[ 2 ]; - data[ 2 ] = data[ 1 ]; - data[ 1 ] = data[ 0 ]; - data[ 0 ] = tmp; - break; - - case 'YtoX': - - var tmp = data[ 0 ]; - data[ 0 ] = data[ 1 ]; - data[ 1 ] = sign * tmp; - break; - - case 'YtoZ': - - var tmp = data[ 1 ]; - data[ 1 ] = sign * data[ 2 ]; - data[ 2 ] = tmp; - break; - - case 'ZtoX': - - var tmp = data[ 0 ]; - data[ 0 ] = data[ 1 ]; - data[ 1 ] = data[ 2 ]; - data[ 2 ] = tmp; - break; - - case 'ZtoY': - - var tmp = data[ 1 ]; - data[ 1 ] = data[ 2 ]; - data[ 2 ] = sign * tmp; - break; - - } - - }; - - function getConvertedVec3 ( data, offset ) { - - var arr = [ data[ offset ], data[ offset + 1 ], data[ offset + 2 ] ]; - fixCoords( arr, -1 ); - return new THREE.Vector3( arr[ 0 ], arr[ 1 ], arr[ 2 ] ); - - }; - - function getConvertedMat4 ( data ) { - - if ( options.convertUpAxis ) { - - // First fix rotation and scale - - // Columns first - var arr = [ data[ 0 ], data[ 4 ], data[ 8 ] ]; - fixCoords( arr, -1 ); - data[ 0 ] = arr[ 0 ]; - data[ 4 ] = arr[ 1 ]; - data[ 8 ] = arr[ 2 ]; - arr = [ data[ 1 ], data[ 5 ], data[ 9 ] ]; - fixCoords( arr, -1 ); - data[ 1 ] = arr[ 0 ]; - data[ 5 ] = arr[ 1 ]; - data[ 9 ] = arr[ 2 ]; - arr = [ data[ 2 ], data[ 6 ], data[ 10 ] ]; - fixCoords( arr, -1 ); - data[ 2 ] = arr[ 0 ]; - data[ 6 ] = arr[ 1 ]; - data[ 10 ] = arr[ 2 ]; - // Rows second - arr = [ data[ 0 ], data[ 1 ], data[ 2 ] ]; - fixCoords( arr, -1 ); - data[ 0 ] = arr[ 0 ]; - data[ 1 ] = arr[ 1 ]; - data[ 2 ] = arr[ 2 ]; - arr = [ data[ 4 ], data[ 5 ], data[ 6 ] ]; - fixCoords( arr, -1 ); - data[ 4 ] = arr[ 0 ]; - data[ 5 ] = arr[ 1 ]; - data[ 6 ] = arr[ 2 ]; - arr = [ data[ 8 ], data[ 9 ], data[ 10 ] ]; - fixCoords( arr, -1 ); - data[ 8 ] = arr[ 0 ]; - data[ 9 ] = arr[ 1 ]; - data[ 10 ] = arr[ 2 ]; - - // Now fix translation - arr = [ data[ 3 ], data[ 7 ], data[ 11 ] ]; - fixCoords( arr, -1 ); - data[ 3 ] = arr[ 0 ]; - data[ 7 ] = arr[ 1 ]; - data[ 11 ] = arr[ 2 ]; - - } - - return new THREE.Matrix4( - data[0], data[1], data[2], data[3], - data[4], data[5], data[6], data[7], - data[8], data[9], data[10], data[11], - data[12], data[13], data[14], data[15] - ); - - }; - - function getConvertedMember ( member ) { - - if ( options.convertUpAxis ) { - - switch ( member ) { - - case 'X': - - switch ( upConversion ) { - - case 'XtoY': - case 'XtoZ': - case 'YtoX': - - member = 'Y'; - break; - - case 'ZtoX': - - member = 'Z'; - break; - - } - - break; - - case 'Y': - - switch ( upConversion ) { - - case 'XtoY': - case 'YtoX': - case 'ZtoX': - - member = 'X'; - break; - - case 'XtoZ': - case 'YtoZ': - case 'ZtoY': - - member = 'Z'; - break; - - } - - break; - - case 'Z': - - switch ( upConversion ) { - - case 'XtoZ': - - member = 'X'; - break; - - case 'YtoZ': - case 'ZtoX': - case 'ZtoY': - - member = 'Y'; - break; - - } - - break; - - } - - } - - return member; - - }; - - return { - - load: load, - parse: parse, - setPreferredShading: setPreferredShading, - applySkin: applySkin, - geometries : geometries, - options: options - - }; - -}; -/** - * @author mrdoob / http://mrdoob.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.JSONLoader = function ( showStatus ) { - - THREE.Loader.call( this, showStatus ); - -}; - -THREE.JSONLoader.prototype = new THREE.Loader(); -THREE.JSONLoader.prototype.constructor = THREE.JSONLoader; -THREE.JSONLoader.prototype.supr = THREE.Loader.prototype; - -THREE.JSONLoader.prototype.load = function ( url, callback, texturePath ) { - - var worker, scope = this; - - if ( url instanceof Object ) { - - console.warn( 'DEPRECATED: JSONLoader( parameters ) is now JSONLoader( url, callback, texturePath ).' ); - - var parameters = url; - - url = parameters.model; - callback = parameters.callback; - texturePath = parameters.texture_path; - - } - - texturePath = texturePath ? texturePath : this.extractUrlbase( url ); - - this.onLoadStart(); - this.loadAjaxJSON( this, url, callback, texturePath ); - -}; - -THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, texturePath, callbackProgress ) { - - var xhr = new XMLHttpRequest(); - - var length = 0; - - xhr.onreadystatechange = function() { - - if ( xhr.readyState == 4 ) { - - if ( xhr.status == 200 || xhr.status == 0 ) { - - try { - - var jsonObject = JSON.parse( xhr.responseText ); - - } catch ( error ) { - - console.warn( "DEPRECATED: [" + url + "] seems to be using old model format" ); - - } - - context.createModel( jsonObject, callback, texturePath ); - context.onLoadComplete(); - - } else { - - console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" ); - - } - - } else if ( xhr.readyState == 3 ) { - - if ( callbackProgress ) { - - if ( length == 0 ) { - - length = xhr.getResponseHeader( "Content-Length" ); - - } - - callbackProgress( { total: length, loaded: xhr.responseText.length } ); - - } - - } else if ( xhr.readyState == 2 ) { - - length = xhr.getResponseHeader( "Content-Length" ); - - } - - }; - - xhr.open( "GET", url, true ); - if ( xhr.overrideMimeType ) xhr.overrideMimeType( "text/plain; charset=x-user-defined" ); - xhr.setRequestHeader( "Content-Type", "text/plain" ); - xhr.send( null ); - -}; - -THREE.JSONLoader.prototype.createModel = function ( json, callback, texture_path ) { - - var scope = this, - geometry = new THREE.Geometry(), - scale = ( json.scale !== undefined ) ? 1.0 / json.scale : 1.0; - - this.initMaterials( geometry, json.materials, texture_path ); - - parseModel( scale ); - - parseSkin(); - parseMorphing( scale ); - - geometry.computeCentroids(); - geometry.computeFaceNormals(); - - if ( this.hasNormals( geometry ) ) geometry.computeTangents(); - - - function parseModel( scale ) { - - if ( json.metadata === undefined || json.metadata.formatVersion === undefined || json.metadata.formatVersion !== 3 ) { - - console.error( 'Deprecated file format.' ); - return; - - } - - function isBitSet( value, position ) { - - return value & ( 1 << position ); - - }; - - var i, j, fi, - - offset, zLength, nVertices, - - colorIndex, normalIndex, uvIndex, materialIndex, - - type, - isQuad, - hasMaterial, - hasFaceUv, hasFaceVertexUv, - hasFaceNormal, hasFaceVertexNormal, - hasFaceColor, hasFaceVertexColor, - - vertex, face, color, normal, - - uvLayer, uvs, u, v, - - faces = json.faces, - vertices = json.vertices, - normals = json.normals, - colors = json.colors, - - nUvLayers = 0; - - // disregard empty arrays - - for ( i = 0; i < json.uvs.length; i++ ) { - - if ( json.uvs[ i ].length ) nUvLayers ++; - - } - - for ( i = 0; i < nUvLayers; i++ ) { - - geometry.faceUvs[ i ] = []; - geometry.faceVertexUvs[ i ] = []; - - } - - offset = 0; - zLength = vertices.length; - - while ( offset < zLength ) { - - vertex = new THREE.Vertex(); - - vertex.position.x = vertices[ offset ++ ] * scale; - vertex.position.y = vertices[ offset ++ ] * scale; - vertex.position.z = vertices[ offset ++ ] * scale; - - geometry.vertices.push( vertex ); - - } - - offset = 0; - zLength = faces.length; - - while ( offset < zLength ) { - - type = faces[ offset ++ ]; - - - isQuad = isBitSet( type, 0 ); - hasMaterial = isBitSet( type, 1 ); - hasFaceUv = isBitSet( type, 2 ); - hasFaceVertexUv = isBitSet( type, 3 ); - hasFaceNormal = isBitSet( type, 4 ); - hasFaceVertexNormal = isBitSet( type, 5 ); - hasFaceColor = isBitSet( type, 6 ); - hasFaceVertexColor = isBitSet( type, 7 ); - - //console.log("type", type, "bits", isQuad, hasMaterial, hasFaceUv, hasFaceVertexUv, hasFaceNormal, hasFaceVertexNormal, hasFaceColor, hasFaceVertexColor); - - if ( isQuad ) { - - face = new THREE.Face4(); - - face.a = faces[ offset ++ ]; - face.b = faces[ offset ++ ]; - face.c = faces[ offset ++ ]; - face.d = faces[ offset ++ ]; - - nVertices = 4; - - } else { - - face = new THREE.Face3(); - - face.a = faces[ offset ++ ]; - face.b = faces[ offset ++ ]; - face.c = faces[ offset ++ ]; - - nVertices = 3; - - } - - if ( hasMaterial ) { - - materialIndex = faces[ offset ++ ]; - face.materialIndex = materialIndex; - - } - - // to get face <=> uv index correspondence - - fi = geometry.faces.length; - - if ( hasFaceUv ) { - - for ( i = 0; i < nUvLayers; i++ ) { - - uvLayer = json.uvs[ i ]; - - uvIndex = faces[ offset ++ ]; - - u = uvLayer[ uvIndex * 2 ]; - v = uvLayer[ uvIndex * 2 + 1 ]; - - geometry.faceUvs[ i ][ fi ] = new THREE.UV( u, v ); - - } - - } - - if ( hasFaceVertexUv ) { - - for ( i = 0; i < nUvLayers; i++ ) { - - uvLayer = json.uvs[ i ]; - - uvs = []; - - for ( j = 0; j < nVertices; j ++ ) { - - uvIndex = faces[ offset ++ ]; - - u = uvLayer[ uvIndex * 2 ]; - v = uvLayer[ uvIndex * 2 + 1 ]; - - uvs[ j ] = new THREE.UV( u, v ); - - } - - geometry.faceVertexUvs[ i ][ fi ] = uvs; - - } - - } - - if ( hasFaceNormal ) { - - normalIndex = faces[ offset ++ ] * 3; - - normal = new THREE.Vector3(); - - normal.x = normals[ normalIndex ++ ]; - normal.y = normals[ normalIndex ++ ]; - normal.z = normals[ normalIndex ]; - - face.normal = normal; - - } - - if ( hasFaceVertexNormal ) { - - for ( i = 0; i < nVertices; i++ ) { - - normalIndex = faces[ offset ++ ] * 3; - - normal = new THREE.Vector3(); - - normal.x = normals[ normalIndex ++ ]; - normal.y = normals[ normalIndex ++ ]; - normal.z = normals[ normalIndex ]; - - face.vertexNormals.push( normal ); - - } - - } - - - if ( hasFaceColor ) { - - colorIndex = faces[ offset ++ ]; - - color = new THREE.Color( colors[ colorIndex ] ); - face.color = color; - - } - - - if ( hasFaceVertexColor ) { - - for ( i = 0; i < nVertices; i++ ) { - - colorIndex = faces[ offset ++ ]; - - color = new THREE.Color( colors[ colorIndex ] ); - face.vertexColors.push( color ); - - } - - } - - geometry.faces.push( face ); - - } - - }; - - function parseSkin() { - - var i, l, x, y, z, w, a, b, c, d; - - if ( json.skinWeights ) { - - for ( i = 0, l = json.skinWeights.length; i < l; i += 2 ) { - - x = json.skinWeights[ i ]; - y = json.skinWeights[ i + 1 ]; - z = 0; - w = 0; - - geometry.skinWeights.push( new THREE.Vector4( x, y, z, w ) ); - - } - - } - - if ( json.skinIndices ) { - - for ( i = 0, l = json.skinIndices.length; i < l; i += 2 ) { - - a = json.skinIndices[ i ]; - b = json.skinIndices[ i + 1 ]; - c = 0; - d = 0; - - geometry.skinIndices.push( new THREE.Vector4( a, b, c, d ) ); - - } - - } - - geometry.bones = json.bones; - geometry.animation = json.animation; - - }; - - function parseMorphing( scale ) { - - if ( json.morphTargets !== undefined ) { - - var i, l, v, vl, x, y, z, dstVertices, srcVertices; - - for ( i = 0, l = json.morphTargets.length; i < l; i++ ) { - - geometry.morphTargets[ i ] = {}; - geometry.morphTargets[ i ].name = json.morphTargets[ i ].name; - geometry.morphTargets[ i ].vertices = []; - - dstVertices = geometry.morphTargets[ i ].vertices; - srcVertices = json.morphTargets [ i ].vertices; - - - for( v = 0, vl = srcVertices.length; v < vl; v += 3 ) { - - x = srcVertices[ v ] * scale; - y = srcVertices[ v + 1 ] * scale; - z = srcVertices[ v + 2 ] * scale; - - dstVertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ); - - } - - } - - } - - if ( json.morphColors !== undefined ) { - - var i, l, c, cl, dstColors, srcColors, color; - - for ( i = 0, l = json.morphColors.length; i < l; i++ ) { - - geometry.morphColors[ i ] = {}; - geometry.morphColors[ i ].name = json.morphColors[ i ].name; - geometry.morphColors[ i ].colors = []; - - dstColors = geometry.morphColors[ i ].colors; - srcColors = json.morphColors [ i ].colors; - - for ( c = 0, cl = srcColors.length; c < cl; c += 3 ) { - - color = new THREE.Color( 0xffaa00 ); - color.setRGB( srcColors[ c ], srcColors[ c + 1 ], srcColors[ c + 2 ] ); - dstColors.push( color ); - - } - - } - - } - - }; - - callback( geometry ); - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.SceneLoader = function () { - - this.onLoadStart = function () {}; - this.onLoadProgress = function() {}; - this.onLoadComplete = function () {}; - - this.callbackSync = function () {}; - this.callbackProgress = function () {}; - -}; - -THREE.SceneLoader.prototype.constructor = THREE.SceneLoader; - -THREE.SceneLoader.prototype.load = function( url, callbackFinished ) { - - var context = this; - - var xhr = new XMLHttpRequest(); - - xhr.onreadystatechange = function() { - - if ( xhr.readyState == 4 ) { - - if ( xhr.status == 200 || xhr.status == 0 ) { - - try { - - var json = JSON.parse( xhr.responseText ); - - if ( json.metadata === undefined || json.metadata.formatVersion === undefined || json.metadata.formatVersion !== 3 ) { - - console.error( 'Deprecated file format.' ); - return; - - } - - context.createScene( json, callbackFinished, url ); - - } catch ( error ) { - - console.error( error ); - console.warn( "DEPRECATED: [" + url + "] seems to be using old model format" ); - - } - - } else { - - console.error( "Couldn't load [" + url + "] [" + xhr.status + "]" ); - - } - - } - - }; - - xhr.open( "GET", url, true ); - if ( xhr.overrideMimeType ) xhr.overrideMimeType( "text/plain; charset=x-user-defined" ); - xhr.setRequestHeader( "Content-Type", "text/plain" ); - xhr.send( null ); - -}; - -THREE.SceneLoader.prototype.createScene = function ( json, callbackFinished, url ) { - - var scope = this; - - var urlBase = THREE.Loader.prototype.extractUrlbase( url ); - - var dg, dm, dd, dl, dc, df, dt, - g, o, m, l, d, p, r, q, s, c, t, f, tt, pp, u, - geometry, material, camera, fog, - texture, images, - materials, light, - data, binLoader, jsonLoader, - counter_models, counter_textures, - total_models, total_textures, - result; - - data = json; - - binLoader = new THREE.BinaryLoader(); - jsonLoader = new THREE.JSONLoader(); - - counter_models = 0; - counter_textures = 0; - - result = { - - scene: new THREE.Scene(), - geometries: {}, - materials: {}, - textures: {}, - objects: {}, - cameras: {}, - lights: {}, - fogs: {}, - triggers: {}, - empties: {} - - }; - - // find out if there are some colliders - - var hasColliders = false; - - for( dd in data.objects ) { - - o = data.objects[ dd ]; - - if ( o.meshCollider ) { - - hasColliders = true; - break; - - } - - } - - if ( hasColliders ) { - - result.scene.collisions = new THREE.CollisionSystem(); - - } - - if ( data.transform ) { - - var position = data.transform.position, - rotation = data.transform.rotation, - scale = data.transform.scale; - - if ( position ) - result.scene.position.set( position[ 0 ], position[ 1 ], position [ 2 ] ); - - if ( rotation ) - result.scene.rotation.set( rotation[ 0 ], rotation[ 1 ], rotation [ 2 ] ); - - if ( scale ) - result.scene.scale.set( scale[ 0 ], scale[ 1 ], scale [ 2 ] ); - - if ( position || rotation || scale ) - result.scene.updateMatrix(); - - } - - function get_url( source_url, url_type ) { - - if ( url_type == "relativeToHTML" ) { - - return source_url; - - } else { - - return urlBase + "/" + source_url; - - } - - }; - - function handle_objects() { - - var object; - - for( dd in data.objects ) { - - if ( !result.objects[ dd ] ) { - - o = data.objects[ dd ]; - - if ( o.geometry !== undefined ) { - - geometry = result.geometries[ o.geometry ]; - - // geometry already loaded - - if ( geometry ) { - - var hasNormals = false; - - // not anymore support for multiple materials - // shouldn't really be array - - for( i = 0; i < o.materials.length; i ++ ) { - - materials = result.materials[ o.materials[ i ] ]; - - hasNormals = materials instanceof THREE.ShaderMaterial; - - } - - if ( hasNormals ) { - - geometry.computeTangents(); - - } - - p = o.position; - r = o.rotation; - q = o.quaternion; - s = o.scale; - - // turn off quaternions, for the moment - - q = 0; - - if ( materials.length == 0 ) { - - materials = new THREE.MeshFaceMaterial(); - - } - - // dirty hack to handle meshes with multiple materials - // just use face materials defined in model - - if ( materials.length > 1 ) { - - materials = new THREE.MeshFaceMaterial(); - - } - - object = new THREE.Mesh( geometry, materials ); - object.name = dd; - object.position.set( p[0], p[1], p[2] ); - - if ( q ) { - - object.quaternion.set( q[0], q[1], q[2], q[3] ); - object.useQuaternion = true; - - } else { - - object.rotation.set( r[0], r[1], r[2] ); - - } - - object.scale.set( s[0], s[1], s[2] ); - object.visible = o.visible; - - result.scene.add( object ); - - result.objects[ dd ] = object; - - if ( o.meshCollider ) { - - var meshCollider = THREE.CollisionUtils.MeshColliderWBox( object ); - result.scene.collisions.colliders.push( meshCollider ); - - } - - if ( o.castsShadow ) { - - //object.visible = true; - //object.materials = [ new THREE.MeshBasicMaterial( { color: 0xff0000 } ) ]; - - var shadow = new THREE.ShadowVolume( geometry ) - result.scene.add( shadow ); - - shadow.position = object.position; - shadow.rotation = object.rotation; - shadow.scale = object.scale; - - } - - if ( o.trigger && o.trigger.toLowerCase() != "none" ) { - - var trigger = { - "type" : o.trigger, - "object" : o - }; - - result.triggers[ object.name ] = trigger; - - } - - } - - // pure Object3D - - } else { - - p = o.position; - r = o.rotation; - q = o.quaternion; - s = o.scale; - - // turn off quaternions, for the moment - - q = 0; - - object = new THREE.Object3D(); - object.name = dd; - object.position.set( p[0], p[1], p[2] ); - - if ( q ) { - - object.quaternion.set( q[0], q[1], q[2], q[3] ); - object.useQuaternion = true; - - } else { - - object.rotation.set( r[0], r[1], r[2] ); - - } - - object.scale.set( s[0], s[1], s[2] ); - object.visible = ( o.visible !== undefined ) ? o.visible : false; - - result.scene.add( object ); - - result.objects[ dd ] = object; - result.empties[ dd ] = object; - - if ( o.trigger && o.trigger.toLowerCase() != "none" ) { - - var trigger = { - "type" : o.trigger, - "object" : o - }; - - result.triggers[ object.name ] = trigger; - - } - - } - - } - - } - - }; - - function handle_mesh( geo, id ) { - - result.geometries[ id ] = geo; - handle_objects(); - - }; - - function create_callback( id ) { - - return function( geo ) { - - handle_mesh( geo, id ); - - counter_models -= 1; - - scope.onLoadComplete(); - - async_callback_gate(); - - } - - }; - - function create_callback_embed( id ) { - - return function( geo ) { - - result.geometries[ id ] = geo; - - } - - }; - - function async_callback_gate() { - - var progress = { - - totalModels : total_models, - totalTextures : total_textures, - loadedModels : total_models - counter_models, - loadedTextures : total_textures - counter_textures - - }; - - scope.callbackProgress( progress, result ); - - scope.onLoadProgress(); - - if( counter_models == 0 && counter_textures == 0 ) { - - callbackFinished( result ); - - } - - }; - - var callbackTexture = function( images ) { - - counter_textures -= 1; - async_callback_gate(); - - scope.onLoadComplete(); - - }; - - // first go synchronous elements - - // cameras - - for( dc in data.cameras ) { - - c = data.cameras[ dc ]; - - if ( c.type == "perspective" ) { - - camera = new THREE.PerspectiveCamera( c.fov, c.aspect, c.near, c.far ); - - } else if ( c.type == "ortho" ) { - - camera = new THREE.OrthographicCamera( c.left, c.right, c.top, c.bottom, c.near, c.far ); - - } - - p = c.position; - t = c.target; - u = c.up; - - camera.position.set( p[0], p[1], p[2] ); - camera.target = new THREE.Vector3( t[0], t[1], t[2] ); - if ( u ) camera.up.set( u[0], u[1], u[2] ); - - result.cameras[ dc ] = camera; - - } - - // lights - - var hex, intensity; - - for ( dl in data.lights ) { - - l = data.lights[ dl ]; - - hex = ( l.color !== undefined ) ? l.color : 0xffffff; - intensity = ( l.intensity !== undefined ) ? l.intensity : 1; - - if ( l.type == "directional" ) { - - p = l.direction; - - light = new THREE.DirectionalLight( hex, intensity ); - light.position.set( p[0], p[1], p[2] ); - light.position.normalize(); - - } else if ( l.type == "point" ) { - - p = l.position; - d = l.distance; - - light = new THREE.PointLight( hex, intensity, d ); - light.position.set( p[0], p[1], p[2] ); - - } else if ( l.type == "ambient" ) { - - light = new THREE.AmbientLight( hex ); - - } - - result.scene.add( light ); - - result.lights[ dl ] = light; - - } - - // fogs - - for( df in data.fogs ) { - - f = data.fogs[ df ]; - - if ( f.type == "linear" ) { - - fog = new THREE.Fog( 0x000000, f.near, f.far ); - - } else if ( f.type == "exp2" ) { - - fog = new THREE.FogExp2( 0x000000, f.density ); - - } - - c = f.color; - fog.color.setRGB( c[0], c[1], c[2] ); - - result.fogs[ df ] = fog; - - } - - // defaults - - if ( result.cameras && data.defaults.camera ) { - - result.currentCamera = result.cameras[ data.defaults.camera ]; - - } - - if ( result.fogs && data.defaults.fog ) { - - result.scene.fog = result.fogs[ data.defaults.fog ]; - - } - - c = data.defaults.bgcolor; - result.bgColor = new THREE.Color(); - result.bgColor.setRGB( c[0], c[1], c[2] ); - - result.bgColorAlpha = data.defaults.bgalpha; - - // now come potentially asynchronous elements - - // geometries - - // count how many models will be loaded asynchronously - - for( dg in data.geometries ) { - - g = data.geometries[ dg ]; - - if ( g.type == "bin_mesh" || g.type == "ascii_mesh" ) { - - counter_models += 1; - - scope.onLoadStart(); - - } - - } - - total_models = counter_models; - - for ( dg in data.geometries ) { - - g = data.geometries[ dg ]; - - if ( g.type == "cube" ) { - - geometry = new THREE.CubeGeometry( g.width, g.height, g.depth, g.segmentsWidth, g.segmentsHeight, g.segmentsDepth, null, g.flipped, g.sides ); - result.geometries[ dg ] = geometry; - - } else if ( g.type == "plane" ) { - - geometry = new THREE.PlaneGeometry( g.width, g.height, g.segmentsWidth, g.segmentsHeight ); - result.geometries[ dg ] = geometry; - - } else if ( g.type == "sphere" ) { - - geometry = new THREE.SphereGeometry( g.radius, g.segmentsWidth, g.segmentsHeight ); - result.geometries[ dg ] = geometry; - - } else if ( g.type == "cylinder" ) { - - geometry = new THREE.CylinderGeometry( g.topRad, g.botRad, g.height, g.radSegs, g.heightSegs ); - result.geometries[ dg ] = geometry; - - } else if ( g.type == "torus" ) { - - geometry = new THREE.TorusGeometry( g.radius, g.tube, g.segmentsR, g.segmentsT ); - result.geometries[ dg ] = geometry; - - } else if ( g.type == "icosahedron" ) { - - geometry = new THREE.IcosahedronGeometry( g.subdivisions ); - result.geometries[ dg ] = geometry; - - } else if ( g.type == "bin_mesh" ) { - - binLoader.load( get_url( g.url, data.urlBaseType ), create_callback( dg ) ); - - } else if ( g.type == "ascii_mesh" ) { - - jsonLoader.load( get_url( g.url, data.urlBaseType ), create_callback( dg ) ); - - } else if ( g.type == "embedded_mesh" ) { - - var modelJson = data.embeds[ g.id ], - texture_path = ""; - - if ( modelJson ) { - - jsonLoader.createModel( modelJson, create_callback_embed( dg ), texture_path ); - - } - - } - - } - - // textures - - // count how many textures will be loaded asynchronously - - for( dt in data.textures ) { - - tt = data.textures[ dt ]; - - if( tt.url instanceof Array ) { - - counter_textures += tt.url.length; - - for( var n = 0; n < tt.url.length; n ++ ) { - - scope.onLoadStart(); - - } - - } else { - - counter_textures += 1; - - scope.onLoadStart(); - - } - - } - - total_textures = counter_textures; - - for( dt in data.textures ) { - - tt = data.textures[ dt ]; - - if ( tt.mapping != undefined && THREE[ tt.mapping ] != undefined ) { - - tt.mapping = new THREE[ tt.mapping ](); - - } - - if( tt.url instanceof Array ) { - - var url_array = []; - - for( var i = 0; i < tt.url.length; i ++ ) { - - url_array[ i ] = get_url( tt.url[ i ], data.urlBaseType ); - - } - - texture = THREE.ImageUtils.loadTextureCube( url_array, tt.mapping, callbackTexture ); - - } else { - - texture = THREE.ImageUtils.loadTexture( get_url( tt.url, data.urlBaseType ), tt.mapping, callbackTexture ); - - if ( THREE[ tt.minFilter ] != undefined ) - texture.minFilter = THREE[ tt.minFilter ]; - - if ( THREE[ tt.magFilter ] != undefined ) - texture.magFilter = THREE[ tt.magFilter ]; - - - if ( tt.repeat ) { - - texture.repeat.set( tt.repeat[ 0 ], tt.repeat[ 1 ] ); - - if ( tt.repeat[ 0 ] != 1 ) texture.wrapS = THREE.RepeatWrapping; - if ( tt.repeat[ 1 ] != 1 ) texture.wrapT = THREE.RepeatWrapping; - - } - - if ( tt.offset ) { - - texture.offset.set( tt.offset[ 0 ], tt.offset[ 1 ] ); - - } - - // handle wrap after repeat so that default repeat can be overriden - - if ( tt.wrap ) { - - var wrapMap = { - "repeat" : THREE.RepeatWrapping, - "mirror" : THREE.MirroredRepeatWrapping - } - - if ( wrapMap[ tt.wrap[ 0 ] ] !== undefined ) texture.wrapS = wrapMap[ tt.wrap[ 0 ] ]; - if ( wrapMap[ tt.wrap[ 1 ] ] !== undefined ) texture.wrapT = wrapMap[ tt.wrap[ 1 ] ]; - - } - - } - - result.textures[ dt ] = texture; - - } - - // materials - - for ( dm in data.materials ) { - - m = data.materials[ dm ]; - - for ( pp in m.parameters ) { - - if ( pp == "envMap" || pp == "map" || pp == "lightMap" ) { - - m.parameters[ pp ] = result.textures[ m.parameters[ pp ] ]; - - } else if ( pp == "shading" ) { - - m.parameters[ pp ] = ( m.parameters[ pp ] == "flat" ) ? THREE.FlatShading : THREE.SmoothShading; - - } else if ( pp == "blending" ) { - - m.parameters[ pp ] = THREE[ m.parameters[ pp ] ] ? THREE[ m.parameters[ pp ] ] : THREE.NormalBlending; - - } else if ( pp == "combine" ) { - - m.parameters[ pp ] = ( m.parameters[ pp ] == "MixOperation" ) ? THREE.MixOperation : THREE.MultiplyOperation; - - } else if ( pp == "vertexColors" ) { - - if ( m.parameters[ pp ] == "face" ) { - - m.parameters[ pp ] = THREE.FaceColors; - - // default to vertex colors if "vertexColors" is anything else face colors or 0 / null / false - - } else if ( m.parameters[ pp ] ) { - - m.parameters[ pp ] = THREE.VertexColors; - - } - - } - - } - - if ( m.parameters.opacity !== undefined && m.parameters.opacity < 1.0 ) { - - m.parameters.transparent = true; - - } - - if ( m.parameters.normalMap ) { - - var shader = THREE.ShaderUtils.lib[ "normal" ]; - var uniforms = THREE.UniformsUtils.clone( shader.uniforms ); - - var diffuse = m.parameters.color; - var specular = m.parameters.specular; - var ambient = m.parameters.ambient; - var shininess = m.parameters.shininess; - - uniforms[ "tNormal" ].texture = result.textures[ m.parameters.normalMap ]; - - if ( m.parameters.normalMapFactor ) { - - uniforms[ "uNormalScale" ].value = m.parameters.normalMapFactor; - - } - - if ( m.parameters.map ) { - - uniforms[ "tDiffuse" ].texture = m.parameters.map; - uniforms[ "enableDiffuse" ].value = true; - - } - - if ( m.parameters.lightMap ) { - - uniforms[ "tAO" ].texture = m.parameters.lightMap; - uniforms[ "enableAO" ].value = true; - - } - - if ( m.parameters.specularMap ) { - - uniforms[ "tSpecular" ].texture = result.textures[ m.parameters.specularMap ]; - uniforms[ "enableSpecular" ].value = true; - - } - - uniforms[ "uDiffuseColor" ].value.setHex( diffuse ); - uniforms[ "uSpecularColor" ].value.setHex( specular ); - uniforms[ "uAmbientColor" ].value.setHex( ambient ); - - uniforms[ "uShininess" ].value = shininess; - - if ( m.parameters.opacity ) { - - uniforms[ "uOpacity" ].value = m.parameters.opacity; - - } - - var parameters = { fragmentShader: shader.fragmentShader, vertexShader: shader.vertexShader, uniforms: uniforms, lights: true, fog: true }; - - material = new THREE.ShaderMaterial( parameters ); - - } else { - - material = new THREE[ m.type ]( m.parameters ); - - } - - result.materials[ dm ] = material; - - } - - // objects ( synchronous init of procedural primitives ) - - handle_objects(); - - // synchronous callback - - scope.callbackSync( result ); - - // just in case there are no async elements: - async_callback_gate(); - - -}; -/** - * Loader for UTF8 encoded models generated by: - * http://code.google.com/p/webgl-loader/ - * - * Limitations: - * - number of vertices < 65536 (this is after optimizations in compressor, input OBJ may have even less) - * - models must have normals and texture coordinates - * - texture coordinates must be only from <0,1> - * - no materials support yet - * - models are scaled and offset (copy numbers from compressor and use them as parameters in UTF8Loader.load() ) - * - * @author alteredq / http://alteredqualia.com/ - * @author won3d / http://twitter.com/won3d - */ - -THREE.UTF8Loader = function ( ) { - -}; - -THREE.UTF8Loader.prototype = new THREE.UTF8Loader(); -THREE.UTF8Loader.prototype.constructor = THREE.UTF8Loader; - - -// Load UTF8 compressed models generated by objcompress -// - parameters -// - url (required) -// - callback (required) -// - metaData (optional) - -THREE.UTF8Loader.prototype.load = function( url, callback, metaData ) { - - if ( url instanceof Object ) { - - console.warn( 'DEPRECATED: UTF8Loader( parameters ) is now UTF8Loader( url, callback, metaData ).' ); - - var parameters = url; - - url = parameters.model; - callback = parameters.callback; - metaData = { scale: parameters.scale, offsetX: parameters.offsetX, offsetY: parameters.offsetY, offsetZ: parameters.offsetZ }; - - } - - var xhr = new XMLHttpRequest(), - callbackProgress = null, - - scale = metaData.scale !== undefined ? metaData.scale : 1, - offsetX = metaData.offsetX !== undefined ? metaData.offsetX : 0, - offsetY = metaData.offsetY !== undefined ? metaData.offsetY : 0, - offsetZ = metaData.offsetZ !== undefined ? metaData.offsetZ : 0; - - var length = 0; - - xhr.onreadystatechange = function() { - - if ( xhr.readyState == 4 ) { - - if ( xhr.status == 200 || xhr.status == 0 ) { - - THREE.UTF8Loader.prototype.createModel( xhr.responseText, callback, scale, offsetX, offsetY, offsetZ ); - - } else { - - alert( "Couldn't load [" + url + "] [" + xhr.status + "]" ); - - } - - } else if ( xhr.readyState == 3 ) { - - if ( callbackProgress ) { - - if ( length == 0 ) { - - length = xhr.getResponseHeader( "Content-Length" ); - - } - - callbackProgress( { total: length, loaded: xhr.responseText.length } ); - - } - - } else if ( xhr.readyState == 2 ) { - - length = xhr.getResponseHeader( "Content-Length" ); - - } - - } - - xhr.open( "GET", url, true ); - xhr.send( null ); - -}; - -// UTF-8 decoder from webgl-loader -// http://code.google.com/p/webgl-loader/ - -// Copyright 2011 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); you -// may not use this file except in compliance with the License. You -// may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -// implied. See the License for the specific language governing -// permissions and limitations under the License. - -THREE.UTF8Loader.prototype.decompressMesh = function ( str ) { - - var num_verts = str.charCodeAt( 0 ); - - if ( num_verts >= 0xE000 ) { - - num_verts -= 0x0800; - - } - - num_verts ++; - - var attribs_out = new Float32Array( 8 * num_verts ); - - var offset = 1; - - for ( var i = 0; i < 8; i ++ ) { - - var prev_attrib = 0; - - for ( var j = 0; j < num_verts; ++ j ) { - - var code = str.charCodeAt( j + offset ); - - prev_attrib += ( code >> 1 ) ^ ( - ( code & 1 ) ); - - attribs_out[ 8 * j + i ] = prev_attrib; - - } - - offset += num_verts; - - } - - var num_indices = str.length - offset; - - var indices_out = new Uint16Array( num_indices ); - - var index_high_water_mark = 0; - - for ( var i = 0; i < num_indices; i ++ ) { - - var code = str.charCodeAt( i + offset ); - - indices_out[ i ] = index_high_water_mark - code; - - if ( code == 0 ) { - - index_high_water_mark ++; - - } - - } - - return [ attribs_out, indices_out ]; - -}; - -THREE.UTF8Loader.prototype.createModel = function ( data, callback, scale, offsetX, offsetY, offsetZ ) { - - var Model = function ( texture_path ) { - - //var s = (new Date).getTime(); - - var scope = this; - - scope.materials = []; - - THREE.Geometry.call( this ); - - var buffers = THREE.UTF8Loader.prototype.decompressMesh( data ); - - var normals = [], - uvs = []; - - init_vertices( buffers[ 0 ], 8, 0 ); - init_uvs( buffers[ 0 ], 8, 3 ); - init_normals( buffers[ 0 ], 8, 5 ); - - init_faces( buffers[ 1 ] ); - - this.computeCentroids(); - this.computeFaceNormals(); - //this.computeTangents(); - - //var e = (new Date).getTime(); - - //console.log( "utf8 data parse time: " + (e-s) + " ms" ); - - function init_vertices( data, stride, offset ) { - - var i, x, y, z, - end = data.length; - - for( i = offset; i < end; i += stride ) { - - x = data[ i ]; - y = data[ i + 1 ]; - z = data[ i + 2 ]; - - // fix scale and offsets - - x = ( x / 16383 ) * scale; - y = ( y / 16383 ) * scale; - z = ( z / 16383 ) * scale; - - x += offsetX; - y += offsetY; - z += offsetZ; - - vertex( scope, x, y, z ); - - } - - }; - - function init_normals( data, stride, offset ) { - - var i, x, y, z, - end = data.length; - - for( i = offset; i < end; i += stride ) { - - x = data[ i ]; - y = data[ i + 1 ]; - z = data[ i + 2 ]; - - // normalize to <-1,1> - - x = ( x - 512 ) / 511; - y = ( y - 512 ) / 511; - z = ( z - 512 ) / 511; - - normals.push( x, y, z ); - - } - - }; - - function init_uvs( data, stride, offset ) { - - var i, u, v, - end = data.length; - - for( i = offset; i < end; i += stride ) { - - u = data[ i ]; - v = data[ i + 1 ]; - - // normalize to <0,1> - - u /= 1023; - v /= 1023; - - uvs.push( u, 1 - v ); - - } - - }; - - function init_faces( indices ) { - - var i, - a, b, c, - u1, v1, u2, v2, u3, v3, - m, - end = indices.length; - - m = 0; // all faces defaulting to material 0 - - for( i = 0; i < end; i += 3 ) { - - a = indices[ i ]; - b = indices[ i + 1 ]; - c = indices[ i + 2 ]; - - f3n( scope, normals, a, b, c, m, a, b, c ); - - u1 = uvs[ a * 2 ]; - v1 = uvs[ a * 2 + 1 ]; - - u2 = uvs[ b * 2 ]; - v2 = uvs[ b * 2 + 1 ]; - - u3 = uvs[ c * 2 ]; - v3 = uvs[ c * 2 + 1 ]; - - uv3( scope.faceVertexUvs[ 0 ], u1, v1, u2, v2, u3, v3 ); - - } - - - } - - }; - - function vertex ( scope, x, y, z ) { - - scope.vertices.push( new THREE.Vertex( new THREE.Vector3( x, y, z ) ) ); - - }; - - function f3n ( scope, normals, a, b, c, mi, nai, nbi, nci ) { - - var nax = normals[ nai * 3 ], - nay = normals[ nai * 3 + 1 ], - naz = normals[ nai * 3 + 2 ], - - nbx = normals[ nbi * 3 ], - nby = normals[ nbi * 3 + 1 ], - nbz = normals[ nbi * 3 + 2 ], - - ncx = normals[ nci * 3 ], - ncy = normals[ nci * 3 + 1 ], - ncz = normals[ nci * 3 + 2 ]; - - var na = new THREE.Vector3( nax, nay, naz ), - nb = new THREE.Vector3( nbx, nby, nbz ), - nc = new THREE.Vector3( ncx, ncy, ncz ); - - scope.faces.push( new THREE.Face3( a, b, c, [ na, nb, nc ], null, mi ) ); - - }; - - function uv3 ( where, u1, v1, u2, v2, u3, v3 ) { - - var uv = []; - uv.push( new THREE.UV( u1, v1 ) ); - uv.push( new THREE.UV( u2, v2 ) ); - uv.push( new THREE.UV( u3, v3 ) ); - where.push( uv ); - - }; - - - Model.prototype = new THREE.Geometry(); - Model.prototype.constructor = Model; - - callback( new Model() ); - -}; -/** - * @author alteredq / http://alteredqualia.com/ - * - * Port of greggman's ThreeD version of marching cubes to Three.js - * http://webglsamples.googlecode.com/hg/blob/blob.html - */ - -THREE.MarchingCubes = function ( resolution, material ) { - - THREE.Object3D.call( this ); - - this.material = material; - - // functions have to be object properties - // prototype functions kill performance - // (tested and it was 4x slower !!!) - - this.init = function( resolution ) { - - this.resolution = resolution; - - // parameters - - this.isolation = 80.0; - - // size of field, 32 is pushing it in Javascript :) - - this.size = resolution; - this.size2 = this.size * this.size; - this.size3 = this.size2 * this.size; - this.halfsize = this.size / 2.0; - - // deltas - - this.delta = 2.0 / this.size; - this.yd = this.size; - this.zd = this.size2; - - this.field = new Float32Array( this.size3 ); - this.normal_cache = new Float32Array( this.size3 * 3 ); - - // temp buffers used in polygonize - - this.vlist = new Float32Array( 12 * 3 ); - this.nlist = new Float32Array( 12 * 3 ); - - this.firstDraw = true; - - // immediate render mode simulator - - this.maxCount = 4096; // TODO: find the fastest size for this buffer - this.count = 0; - this.hasPos = false; - this.hasNormal = false; - - this.positionArray = new Float32Array( this.maxCount * 3 ); - this.normalArray = new Float32Array( this.maxCount * 3 ); - - }; - - /////////////////////// - // Polygonization - /////////////////////// - - this.lerp = function( a, b, t ) { return a + ( b - a ) * t; }; - - this.VIntX = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) { - - var mu = ( isol - valp1 ) / ( valp2 - valp1 ), - nc = this.normal_cache; - - pout[ offset ] = x + mu * this.delta; - pout[ offset + 1 ] = y; - pout[ offset + 2 ] = z; - - nout[ offset ] = this.lerp( nc[ q ], nc[ q + 3 ], mu ); - nout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q + 4 ], mu ); - nout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q + 5 ], mu ); - - }; - - this.VIntY = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) { - - var mu = ( isol - valp1 ) / ( valp2 - valp1 ), - nc = this.normal_cache; - - pout[ offset ] = x; - pout[ offset + 1 ] = y + mu * this.delta; - pout[ offset + 2 ] = z; - - var q2 = q + this.yd * 3; - - nout[ offset ] = this.lerp( nc[ q ], nc[ q2 ], mu ); - nout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q2 + 1 ], mu ); - nout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q2 + 2 ], mu ); - - }; - - this.VIntZ = function( q, pout, nout, offset, isol, x, y, z, valp1, valp2 ) { - - var mu = ( isol - valp1 ) / ( valp2 - valp1 ), - nc = this.normal_cache; - - pout[ offset ] = x; - pout[ offset + 1 ] = y; - pout[ offset + 2 ] = z + mu * this.delta; - - var q2 = q + this.zd * 3; - - nout[ offset ] = this.lerp( nc[ q ], nc[ q2 ], mu ); - nout[ offset + 1 ] = this.lerp( nc[ q + 1 ], nc[ q2 + 1 ], mu ); - nout[ offset + 2 ] = this.lerp( nc[ q + 2 ], nc[ q2 + 2 ], mu ); - - }; - - this.compNorm = function( q ) { - - var q3 = q * 3; - - if ( this.normal_cache [ q3 ] === 0.0 ) { - - this.normal_cache[ q3 ] = this.field[ q - 1 ] - this.field[ q + 1 ]; - this.normal_cache[ q3 + 1 ] = this.field[ q - this.yd ] - this.field[ q + this.yd ]; - this.normal_cache[ q3 + 2 ] = this.field[ q - this.zd ] - this.field[ q + this.zd ]; - - } - - }; - - // Returns total number of triangles. Fills triangles. - // (this is where most of time is spent - it's inner work of O(n3) loop ) - - this.polygonize = function( fx, fy, fz, q, isol, render_callback ) { - - // cache indices - var q1 = q + 1, - qy = q + this.yd, - qz = q + this.zd, - q1y = q1 + this.yd, - q1z = q1 + this.zd, - qyz = q + this.yd + this.zd, - q1yz = q1 + this.yd + this.zd; - - var cubeindex = 0, - field0 = this.field[ q ], - field1 = this.field[ q1 ], - field2 = this.field[ qy ], - field3 = this.field[ q1y ], - field4 = this.field[ qz ], - field5 = this.field[ q1z ], - field6 = this.field[ qyz ], - field7 = this.field[ q1yz ]; - - if ( field0 < isol ) cubeindex |= 1; - if ( field1 < isol ) cubeindex |= 2; - if ( field2 < isol ) cubeindex |= 8; - if ( field3 < isol ) cubeindex |= 4; - if ( field4 < isol ) cubeindex |= 16; - if ( field5 < isol ) cubeindex |= 32; - if ( field6 < isol ) cubeindex |= 128; - if ( field7 < isol ) cubeindex |= 64; - - // if cube is entirely in/out of the surface - bail, nothing to draw - - var bits = THREE.edgeTable[ cubeindex ]; - if ( bits === 0 ) return 0; - - var d = this.delta, - fx2 = fx + d, - fy2 = fy + d, - fz2 = fz + d; - - // top of the cube - - if ( bits & 1 ) { - - this.compNorm( q ); - this.compNorm( q1 ); - this.VIntX( q * 3, this.vlist, this.nlist, 0, isol, fx, fy, fz, field0, field1 ); - - }; - - if ( bits & 2 ) { - - this.compNorm( q1 ); - this.compNorm( q1y ); - this.VIntY( q1 * 3, this.vlist, this.nlist, 3, isol, fx2, fy, fz, field1, field3 ); - - }; - - if ( bits & 4 ) { - - this.compNorm( qy ); - this.compNorm( q1y ); - this.VIntX( qy * 3, this.vlist, this.nlist, 6, isol, fx, fy2, fz, field2, field3 ); - - }; - - if ( bits & 8 ) { - - this.compNorm( q ); - this.compNorm( qy ); - this.VIntY( q * 3, this.vlist, this.nlist, 9, isol, fx, fy, fz, field0, field2 ); - - }; - - // bottom of the cube - - if ( bits & 16 ) { - - this.compNorm( qz ); - this.compNorm( q1z ); - this.VIntX( qz * 3, this.vlist, this.nlist, 12, isol, fx, fy, fz2, field4, field5 ); - - }; - - if ( bits & 32 ) { - - this.compNorm( q1z ); - this.compNorm( q1yz ); - this.VIntY( q1z * 3, this.vlist, this.nlist, 15, isol, fx2, fy, fz2, field5, field7 ); - - }; - - if ( bits & 64 ) { - - this.compNorm( qyz ); - this.compNorm( q1yz ); - this.VIntX( qyz * 3, this.vlist, this.nlist, 18, isol, fx, fy2, fz2, field6, field7 ); - - }; - - if ( bits & 128 ) { - - this.compNorm( qz ); - this.compNorm( qyz ); - this.VIntY( qz * 3, this.vlist, this.nlist, 21, isol, fx, fy, fz2, field4, field6 ); - - }; - - // vertical lines of the cube - - if ( bits & 256 ) { - - this.compNorm( q ); - this.compNorm( qz ); - this.VIntZ( q * 3, this.vlist, this.nlist, 24, isol, fx, fy, fz, field0, field4 ); - - }; - - if ( bits & 512 ) { - - this.compNorm( q1 ); - this.compNorm( q1z ); - this.VIntZ( q1 * 3, this.vlist, this.nlist, 27, isol, fx2, fy, fz, field1, field5 ); - - }; - - if ( bits & 1024 ) { - - this.compNorm( q1y ); - this.compNorm( q1yz ); - this.VIntZ( q1y * 3, this.vlist, this.nlist, 30, isol, fx2, fy2, fz, field3, field7 ); - - }; - - if ( bits & 2048 ) { - - this.compNorm( qy ); - this.compNorm( qyz ); - this.VIntZ( qy * 3, this.vlist, this.nlist, 33, isol, fx, fy2, fz, field2, field6 ); - - }; - - cubeindex <<= 4; // re-purpose cubeindex into an offset into triTable - - var o1, o2, o3, numtris = 0, i = 0; - - // here is where triangles are created - - while ( THREE.triTable[ cubeindex + i ] != -1 ) { - - o1 = cubeindex + i; - o2 = o1 + 1; - o3 = o1 + 2; - - this.posnormtriv( this.vlist, this.nlist, - 3 * THREE.triTable[ o1 ], - 3 * THREE.triTable[ o2 ], - 3 * THREE.triTable[ o3 ], - render_callback ); - - i += 3; - numtris ++; - - } - - return numtris; - - }; - - ///////////////////////////////////// - // Immediate render mode simulator - ///////////////////////////////////// - - this.posnormtriv = function( pos, norm, o1, o2, o3, render_callback ) { - - var c = this.count * 3; - - this.positionArray[ c ] = pos[ o1 ]; - this.positionArray[ c + 1 ] = pos[ o1 + 1 ]; - this.positionArray[ c + 2 ] = pos[ o1 + 2 ]; - - this.positionArray[ c + 3 ] = pos[ o2 ]; - this.positionArray[ c + 4 ] = pos[ o2 + 1 ]; - this.positionArray[ c + 5 ] = pos[ o2 + 2 ]; - - this.positionArray[ c + 6 ] = pos[ o3 ]; - this.positionArray[ c + 7 ] = pos[ o3 + 1 ]; - this.positionArray[ c + 8 ] = pos[ o3 + 2 ]; - - this.normalArray[ c ] = norm[ o1 ]; - this.normalArray[ c + 1 ] = norm[ o1 + 1 ]; - this.normalArray[ c + 2 ] = norm[ o1 + 2 ]; - - this.normalArray[ c + 3 ] = norm[ o2 ]; - this.normalArray[ c + 4 ] = norm[ o2 + 1 ]; - this.normalArray[ c + 5 ] = norm[ o2 + 2 ]; - - this.normalArray[ c + 6 ] = norm[ o3 ]; - this.normalArray[ c + 7 ] = norm[ o3 + 1 ]; - this.normalArray[ c + 8 ] = norm[ o3 + 2 ]; - - this.hasPos = true; - this.hasNormal = true; - - this.count += 3; - - if ( this.count >= this.maxCount - 3 ) { - - render_callback( this ); - - } - - }; - - this.begin = function( ) { - - this.count = 0; - this.hasPos = false; - this.hasNormal = false; - - }; - - this.end = function( render_callback ) { - - if ( this.count === 0 ) - return; - - for ( var i = this.count * 3; i < this.positionArray.length; i++ ) - this.positionArray[ i ] = 0.0; - - render_callback( this ); - - }; - - ///////////////////////////////////// - // Metaballs - ///////////////////////////////////// - - // Adds a reciprocal ball (nice and blobby) that, to be fast, fades to zero after - // a fixed distance, determined by strength and subtract. - - this.addBall = function( ballx, bally, ballz, strength, subtract ) { - - // Let's solve the equation to find the radius: - // 1.0 / (0.000001 + radius^2) * strength - subtract = 0 - // strength / (radius^2) = subtract - // strength = subtract * radius^2 - // radius^2 = strength / subtract - // radius = sqrt(strength / subtract) - - var radius = this.size * Math.sqrt( strength / subtract ), - zs = ballz * this.size, - ys = bally * this.size, - xs = ballx * this.size; - - var min_z = Math.floor( zs - radius ); if ( min_z < 1 ) min_z = 1; - var max_z = Math.floor( zs + radius ); if ( max_z > this.size - 1 ) max_z = this.size - 1; - var min_y = Math.floor( ys - radius ); if ( min_y < 1 ) min_y = 1; - var max_y = Math.floor( ys + radius ); if ( max_y > this.size - 1 ) max_y = this.size - 1; - var min_x = Math.floor( xs - radius ); if ( min_x < 1 ) min_x = 1; - var max_x = Math.floor( xs + radius ); if ( max_x > this.size - 1 ) max_x = this.size - 1; - - - // Don't polygonize in the outer layer because normals aren't - // well-defined there. - - var x, y, z, y_offset, z_offset, fx, fy, fz, fz2, fy2, val; - - for ( z = min_z; z < max_z; z++ ) { - - z_offset = this.size2 * z, - fz = z / this.size - ballz, - fz2 = fz * fz; - - for ( y = min_y; y < max_y; y++ ) { - - y_offset = z_offset + this.size * y; - fy = y / this.size - bally; - fy2 = fy * fy; - - for ( x = min_x; x < max_x; x++ ) { - - fx = x / this.size - ballx; - val = strength / ( 0.000001 + fx*fx + fy2 + fz2 ) - subtract; - if ( val > 0.0 ) this.field[ y_offset + x ] += val; - - } - - } - - } - - }; - - this.addPlaneX = function( strength, subtract ) { - - var x, y, z, xx, val, xdiv, cxy, - - // cache attribute lookups - size = this.size, - yd = this.yd, - zd = this.zd, - field = this.field, - - dist = size * Math.sqrt( strength / subtract ); - - if ( dist > size ) dist = size; - - for ( x = 0; x < dist; x++ ) { - - xdiv = x / size; - xx = xdiv * xdiv; - val = strength / ( 0.0001 + xx ) - subtract; - - if ( val > 0.0 ) { - - for ( y = 0; y < size; y++ ) { - - cxy = x + y * yd; - - for ( z = 0; z < size; z++ ) { - - field[ zd * z + cxy ] += val; - - } - - } - - } - - } - - }; - - this.addPlaneY = function( strength, subtract ) { - - var x, y, z, yy, val, ydiv, cy, cxy, - - // cache attribute lookups - size = this.size, - yd = this.yd, - zd = this.zd, - field = this.field, - - dist = size * Math.sqrt( strength / subtract ); - - if ( dist > size ) dist = size; - - for ( y = 0; y < dist; y++ ) { - - ydiv = y / size; - yy = ydiv * ydiv; - val = strength / ( 0.0001 + yy ) - subtract; - - if ( val > 0.0 ) { - - cy = y * yd; - - for ( x = 0; x < size; x++ ) { - - cxy = cy + x; - - for ( z = 0; z < size; z++ ) - field[ zd * z + cxy ] += val; - - } - - } - - } - - }; - - this.addPlaneZ = function( strength, subtract ) { - - var x, y, z, zz, val, zdiv, cz, cyz, - - // cache attribute lookups - size = this.size, - yd = this.yd, - zd = this.zd, - field = this.field, - - dist = size * Math.sqrt( strength / subtract ); - - if ( dist > size ) dist = size; - - for ( z = 0; z < dist; z++ ) { - - zdiv = z / size; - zz = zdiv * zdiv; - val = strength / ( 0.0001 + zz ) - subtract; - if ( val > 0.0 ) { - - cz = zd * z; - - for ( y = 0; y < size; y++ ) { - - cyz = cz + y * yd; - - for ( x = 0; x < size; x++ ) - field[ cyz + x ] += val; - - } - - } - - } - - }; - - ///////////////////////////////////// - // Updates - ///////////////////////////////////// - - this.reset = function() { - - var i; - - // wipe the normal cache - - for ( i = 0; i < this.size3; i++ ) { - - this.normal_cache[ i * 3 ] = 0.0; - this.field[ i ] = 0.0; - - } - - }; - - this.render = function( render_callback ) { - - this.begin(); - - // Triangulate. Yeah, this is slow. - - var q, x, y, z, fx, fy, fz, y_offset, z_offset, smin2 = this.size - 2; - - for ( z = 1; z < smin2; z++ ) { - - z_offset = this.size2 * z; - fz = ( z - this.halfsize ) / this.halfsize; //+ 1 - - for ( y = 1; y < smin2; y++ ) { - - y_offset = z_offset + this.size * y; - fy = ( y - this.halfsize ) / this.halfsize; //+ 1 - - for ( x = 1; x < smin2; x++ ) { - - fx = ( x - this.halfsize ) / this.halfsize; //+ 1 - q = y_offset + x; - - this.polygonize( fx, fy, fz, q, this.isolation, render_callback ); - - } - - } - - } - - this.end( render_callback ); - - }; - - this.generateGeometry = function() { - - var start = 0, geo = new THREE.Geometry(); - var normals = []; - - var geo_callback = function( object ) { - - var i, x, y, z, vertex, position, normal, - face, a, b, c, na, nb, nc, nfaces; - - - for ( i = 0; i < object.count; i++ ) { - - a = i * 3; - b = a + 1; - c = a + 2; - - x = object.positionArray[ a ]; - y = object.positionArray[ b ]; - z = object.positionArray[ c ]; - position = new THREE.Vector3( x, y, z ); - - x = object.normalArray[ a ]; - y = object.normalArray[ b ]; - z = object.normalArray[ c ]; - normal = new THREE.Vector3( x, y, z ); - normal.normalize(); - - vertex = new THREE.Vertex( position ); - - geo.vertices.push( vertex ); - normals.push( normal ); - - } - - nfaces = object.count / 3; - - for ( i = 0; i < nfaces; i++ ) { - - a = ( start + i ) * 3; - b = a + 1; - c = a + 2; - - na = normals[ a ]; - nb = normals[ b ]; - nc = normals[ c ]; - - face = new THREE.Face3( a, b, c, [ na, nb, nc ] ); - - geo.faces.push( face ); - - } - - start += nfaces; - object.count = 0; - - }; - - this.render( geo_callback ); - - // console.log( "generated " + geo.faces.length + " triangles" ); - - return geo; - - }; - - this.init( resolution ); - -}; - -THREE.MarchingCubes.prototype = new THREE.Object3D(); -THREE.MarchingCubes.prototype.constructor = THREE.MarchingCubes; - - -///////////////////////////////////// -// Marching cubes lookup tables -///////////////////////////////////// - -// These tables are straight from Paul Bourke's page: -// http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/ -// who in turn got them from Cory Gene Bloyd. - -THREE.edgeTable = new Int32Array([ -0x0 , 0x109, 0x203, 0x30a, 0x406, 0x50f, 0x605, 0x70c, -0x80c, 0x905, 0xa0f, 0xb06, 0xc0a, 0xd03, 0xe09, 0xf00, -0x190, 0x99 , 0x393, 0x29a, 0x596, 0x49f, 0x795, 0x69c, -0x99c, 0x895, 0xb9f, 0xa96, 0xd9a, 0xc93, 0xf99, 0xe90, -0x230, 0x339, 0x33 , 0x13a, 0x636, 0x73f, 0x435, 0x53c, -0xa3c, 0xb35, 0x83f, 0x936, 0xe3a, 0xf33, 0xc39, 0xd30, -0x3a0, 0x2a9, 0x1a3, 0xaa , 0x7a6, 0x6af, 0x5a5, 0x4ac, -0xbac, 0xaa5, 0x9af, 0x8a6, 0xfaa, 0xea3, 0xda9, 0xca0, -0x460, 0x569, 0x663, 0x76a, 0x66 , 0x16f, 0x265, 0x36c, -0xc6c, 0xd65, 0xe6f, 0xf66, 0x86a, 0x963, 0xa69, 0xb60, -0x5f0, 0x4f9, 0x7f3, 0x6fa, 0x1f6, 0xff , 0x3f5, 0x2fc, -0xdfc, 0xcf5, 0xfff, 0xef6, 0x9fa, 0x8f3, 0xbf9, 0xaf0, -0x650, 0x759, 0x453, 0x55a, 0x256, 0x35f, 0x55 , 0x15c, -0xe5c, 0xf55, 0xc5f, 0xd56, 0xa5a, 0xb53, 0x859, 0x950, -0x7c0, 0x6c9, 0x5c3, 0x4ca, 0x3c6, 0x2cf, 0x1c5, 0xcc , -0xfcc, 0xec5, 0xdcf, 0xcc6, 0xbca, 0xac3, 0x9c9, 0x8c0, -0x8c0, 0x9c9, 0xac3, 0xbca, 0xcc6, 0xdcf, 0xec5, 0xfcc, -0xcc , 0x1c5, 0x2cf, 0x3c6, 0x4ca, 0x5c3, 0x6c9, 0x7c0, -0x950, 0x859, 0xb53, 0xa5a, 0xd56, 0xc5f, 0xf55, 0xe5c, -0x15c, 0x55 , 0x35f, 0x256, 0x55a, 0x453, 0x759, 0x650, -0xaf0, 0xbf9, 0x8f3, 0x9fa, 0xef6, 0xfff, 0xcf5, 0xdfc, -0x2fc, 0x3f5, 0xff , 0x1f6, 0x6fa, 0x7f3, 0x4f9, 0x5f0, -0xb60, 0xa69, 0x963, 0x86a, 0xf66, 0xe6f, 0xd65, 0xc6c, -0x36c, 0x265, 0x16f, 0x66 , 0x76a, 0x663, 0x569, 0x460, -0xca0, 0xda9, 0xea3, 0xfaa, 0x8a6, 0x9af, 0xaa5, 0xbac, -0x4ac, 0x5a5, 0x6af, 0x7a6, 0xaa , 0x1a3, 0x2a9, 0x3a0, -0xd30, 0xc39, 0xf33, 0xe3a, 0x936, 0x83f, 0xb35, 0xa3c, -0x53c, 0x435, 0x73f, 0x636, 0x13a, 0x33 , 0x339, 0x230, -0xe90, 0xf99, 0xc93, 0xd9a, 0xa96, 0xb9f, 0x895, 0x99c, -0x69c, 0x795, 0x49f, 0x596, 0x29a, 0x393, 0x99 , 0x190, -0xf00, 0xe09, 0xd03, 0xc0a, 0xb06, 0xa0f, 0x905, 0x80c, -0x70c, 0x605, 0x50f, 0x406, 0x30a, 0x203, 0x109, 0x0]) - -THREE.triTable = new Int32Array([ --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 3, 9, 8, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 8, 3, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 2, 10, 0, 2, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 8, 3, 2, 10, 8, 10, 9, 8, -1, -1, -1, -1, -1, -1, -1, -3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 11, 2, 8, 11, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 0, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, 2, 1, 9, 11, 9, 8, 11, -1, -1, -1, -1, -1, -1, -1, -3, 10, 1, 11, 10, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 10, 1, 0, 8, 10, 8, 11, 10, -1, -1, -1, -1, -1, -1, -1, -3, 9, 0, 3, 11, 9, 11, 10, 9, -1, -1, -1, -1, -1, -1, -1, -9, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 3, 0, 7, 3, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 1, 9, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 1, 9, 4, 7, 1, 7, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 10, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -3, 4, 7, 3, 0, 4, 1, 2, 10, -1, -1, -1, -1, -1, -1, -1, -9, 2, 10, 9, 0, 2, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -2, 10, 9, 2, 9, 7, 2, 7, 3, 7, 9, 4, -1, -1, -1, -1, -8, 4, 7, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -11, 4, 7, 11, 2, 4, 2, 0, 4, -1, -1, -1, -1, -1, -1, -1, -9, 0, 1, 8, 4, 7, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -4, 7, 11, 9, 4, 11, 9, 11, 2, 9, 2, 1, -1, -1, -1, -1, -3, 10, 1, 3, 11, 10, 7, 8, 4, -1, -1, -1, -1, -1, -1, -1, -1, 11, 10, 1, 4, 11, 1, 0, 4, 7, 11, 4, -1, -1, -1, -1, -4, 7, 8, 9, 0, 11, 9, 11, 10, 11, 0, 3, -1, -1, -1, -1, -4, 7, 11, 4, 11, 9, 9, 11, 10, -1, -1, -1, -1, -1, -1, -1, -9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 5, 4, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 5, 4, 1, 5, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -8, 5, 4, 8, 3, 5, 3, 1, 5, -1, -1, -1, -1, -1, -1, -1, -1, 2, 10, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -3, 0, 8, 1, 2, 10, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -5, 2, 10, 5, 4, 2, 4, 0, 2, -1, -1, -1, -1, -1, -1, -1, -2, 10, 5, 3, 2, 5, 3, 5, 4, 3, 4, 8, -1, -1, -1, -1, -9, 5, 4, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 11, 2, 0, 8, 11, 4, 9, 5, -1, -1, -1, -1, -1, -1, -1, -0, 5, 4, 0, 1, 5, 2, 3, 11, -1, -1, -1, -1, -1, -1, -1, -2, 1, 5, 2, 5, 8, 2, 8, 11, 4, 8, 5, -1, -1, -1, -1, -10, 3, 11, 10, 1, 3, 9, 5, 4, -1, -1, -1, -1, -1, -1, -1, -4, 9, 5, 0, 8, 1, 8, 10, 1, 8, 11, 10, -1, -1, -1, -1, -5, 4, 0, 5, 0, 11, 5, 11, 10, 11, 0, 3, -1, -1, -1, -1, -5, 4, 8, 5, 8, 10, 10, 8, 11, -1, -1, -1, -1, -1, -1, -1, -9, 7, 8, 5, 7, 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 3, 0, 9, 5, 3, 5, 7, 3, -1, -1, -1, -1, -1, -1, -1, -0, 7, 8, 0, 1, 7, 1, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 7, 8, 9, 5, 7, 10, 1, 2, -1, -1, -1, -1, -1, -1, -1, -10, 1, 2, 9, 5, 0, 5, 3, 0, 5, 7, 3, -1, -1, -1, -1, -8, 0, 2, 8, 2, 5, 8, 5, 7, 10, 5, 2, -1, -1, -1, -1, -2, 10, 5, 2, 5, 3, 3, 5, 7, -1, -1, -1, -1, -1, -1, -1, -7, 9, 5, 7, 8, 9, 3, 11, 2, -1, -1, -1, -1, -1, -1, -1, -9, 5, 7, 9, 7, 2, 9, 2, 0, 2, 7, 11, -1, -1, -1, -1, -2, 3, 11, 0, 1, 8, 1, 7, 8, 1, 5, 7, -1, -1, -1, -1, -11, 2, 1, 11, 1, 7, 7, 1, 5, -1, -1, -1, -1, -1, -1, -1, -9, 5, 8, 8, 5, 7, 10, 1, 3, 10, 3, 11, -1, -1, -1, -1, -5, 7, 0, 5, 0, 9, 7, 11, 0, 1, 0, 10, 11, 10, 0, -1, -11, 10, 0, 11, 0, 3, 10, 5, 0, 8, 0, 7, 5, 7, 0, -1, -11, 10, 5, 7, 11, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 8, 3, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 0, 1, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8, 3, 1, 9, 8, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -1, 6, 5, 2, 6, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6, 5, 1, 2, 6, 3, 0, 8, -1, -1, -1, -1, -1, -1, -1, -9, 6, 5, 9, 0, 6, 0, 2, 6, -1, -1, -1, -1, -1, -1, -1, -5, 9, 8, 5, 8, 2, 5, 2, 6, 3, 2, 8, -1, -1, -1, -1, -2, 3, 11, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -11, 0, 8, 11, 2, 0, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -0, 1, 9, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -1, -1, -1, -5, 10, 6, 1, 9, 2, 9, 11, 2, 9, 8, 11, -1, -1, -1, -1, -6, 3, 11, 6, 5, 3, 5, 1, 3, -1, -1, -1, -1, -1, -1, -1, -0, 8, 11, 0, 11, 5, 0, 5, 1, 5, 11, 6, -1, -1, -1, -1, -3, 11, 6, 0, 3, 6, 0, 6, 5, 0, 5, 9, -1, -1, -1, -1, -6, 5, 9, 6, 9, 11, 11, 9, 8, -1, -1, -1, -1, -1, -1, -1, -5, 10, 6, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 3, 0, 4, 7, 3, 6, 5, 10, -1, -1, -1, -1, -1, -1, -1, -1, 9, 0, 5, 10, 6, 8, 4, 7, -1, -1, -1, -1, -1, -1, -1, -10, 6, 5, 1, 9, 7, 1, 7, 3, 7, 9, 4, -1, -1, -1, -1, -6, 1, 2, 6, 5, 1, 4, 7, 8, -1, -1, -1, -1, -1, -1, -1, -1, 2, 5, 5, 2, 6, 3, 0, 4, 3, 4, 7, -1, -1, -1, -1, -8, 4, 7, 9, 0, 5, 0, 6, 5, 0, 2, 6, -1, -1, -1, -1, -7, 3, 9, 7, 9, 4, 3, 2, 9, 5, 9, 6, 2, 6, 9, -1, -3, 11, 2, 7, 8, 4, 10, 6, 5, -1, -1, -1, -1, -1, -1, -1, -5, 10, 6, 4, 7, 2, 4, 2, 0, 2, 7, 11, -1, -1, -1, -1, -0, 1, 9, 4, 7, 8, 2, 3, 11, 5, 10, 6, -1, -1, -1, -1, -9, 2, 1, 9, 11, 2, 9, 4, 11, 7, 11, 4, 5, 10, 6, -1, -8, 4, 7, 3, 11, 5, 3, 5, 1, 5, 11, 6, -1, -1, -1, -1, -5, 1, 11, 5, 11, 6, 1, 0, 11, 7, 11, 4, 0, 4, 11, -1, -0, 5, 9, 0, 6, 5, 0, 3, 6, 11, 6, 3, 8, 4, 7, -1, -6, 5, 9, 6, 9, 11, 4, 7, 9, 7, 11, 9, -1, -1, -1, -1, -10, 4, 9, 6, 4, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 10, 6, 4, 9, 10, 0, 8, 3, -1, -1, -1, -1, -1, -1, -1, -10, 0, 1, 10, 6, 0, 6, 4, 0, -1, -1, -1, -1, -1, -1, -1, -8, 3, 1, 8, 1, 6, 8, 6, 4, 6, 1, 10, -1, -1, -1, -1, -1, 4, 9, 1, 2, 4, 2, 6, 4, -1, -1, -1, -1, -1, -1, -1, -3, 0, 8, 1, 2, 9, 2, 4, 9, 2, 6, 4, -1, -1, -1, -1, -0, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -8, 3, 2, 8, 2, 4, 4, 2, 6, -1, -1, -1, -1, -1, -1, -1, -10, 4, 9, 10, 6, 4, 11, 2, 3, -1, -1, -1, -1, -1, -1, -1, -0, 8, 2, 2, 8, 11, 4, 9, 10, 4, 10, 6, -1, -1, -1, -1, -3, 11, 2, 0, 1, 6, 0, 6, 4, 6, 1, 10, -1, -1, -1, -1, -6, 4, 1, 6, 1, 10, 4, 8, 1, 2, 1, 11, 8, 11, 1, -1, -9, 6, 4, 9, 3, 6, 9, 1, 3, 11, 6, 3, -1, -1, -1, -1, -8, 11, 1, 8, 1, 0, 11, 6, 1, 9, 1, 4, 6, 4, 1, -1, -3, 11, 6, 3, 6, 0, 0, 6, 4, -1, -1, -1, -1, -1, -1, -1, -6, 4, 8, 11, 6, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -7, 10, 6, 7, 8, 10, 8, 9, 10, -1, -1, -1, -1, -1, -1, -1, -0, 7, 3, 0, 10, 7, 0, 9, 10, 6, 7, 10, -1, -1, -1, -1, -10, 6, 7, 1, 10, 7, 1, 7, 8, 1, 8, 0, -1, -1, -1, -1, -10, 6, 7, 10, 7, 1, 1, 7, 3, -1, -1, -1, -1, -1, -1, -1, -1, 2, 6, 1, 6, 8, 1, 8, 9, 8, 6, 7, -1, -1, -1, -1, -2, 6, 9, 2, 9, 1, 6, 7, 9, 0, 9, 3, 7, 3, 9, -1, -7, 8, 0, 7, 0, 6, 6, 0, 2, -1, -1, -1, -1, -1, -1, -1, -7, 3, 2, 6, 7, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 3, 11, 10, 6, 8, 10, 8, 9, 8, 6, 7, -1, -1, -1, -1, -2, 0, 7, 2, 7, 11, 0, 9, 7, 6, 7, 10, 9, 10, 7, -1, -1, 8, 0, 1, 7, 8, 1, 10, 7, 6, 7, 10, 2, 3, 11, -1, -11, 2, 1, 11, 1, 7, 10, 6, 1, 6, 7, 1, -1, -1, -1, -1, -8, 9, 6, 8, 6, 7, 9, 1, 6, 11, 6, 3, 1, 3, 6, -1, -0, 9, 1, 11, 6, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -7, 8, 0, 7, 0, 6, 3, 11, 0, 11, 6, 0, -1, -1, -1, -1, -7, 11, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -3, 0, 8, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 1, 9, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -8, 1, 9, 8, 3, 1, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -10, 1, 2, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 10, 3, 0, 8, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -2, 9, 0, 2, 10, 9, 6, 11, 7, -1, -1, -1, -1, -1, -1, -1, -6, 11, 7, 2, 10, 3, 10, 8, 3, 10, 9, 8, -1, -1, -1, -1, -7, 2, 3, 6, 2, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -7, 0, 8, 7, 6, 0, 6, 2, 0, -1, -1, -1, -1, -1, -1, -1, -2, 7, 6, 2, 3, 7, 0, 1, 9, -1, -1, -1, -1, -1, -1, -1, -1, 6, 2, 1, 8, 6, 1, 9, 8, 8, 7, 6, -1, -1, -1, -1, -10, 7, 6, 10, 1, 7, 1, 3, 7, -1, -1, -1, -1, -1, -1, -1, -10, 7, 6, 1, 7, 10, 1, 8, 7, 1, 0, 8, -1, -1, -1, -1, -0, 3, 7, 0, 7, 10, 0, 10, 9, 6, 10, 7, -1, -1, -1, -1, -7, 6, 10, 7, 10, 8, 8, 10, 9, -1, -1, -1, -1, -1, -1, -1, -6, 8, 4, 11, 8, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -3, 6, 11, 3, 0, 6, 0, 4, 6, -1, -1, -1, -1, -1, -1, -1, -8, 6, 11, 8, 4, 6, 9, 0, 1, -1, -1, -1, -1, -1, -1, -1, -9, 4, 6, 9, 6, 3, 9, 3, 1, 11, 3, 6, -1, -1, -1, -1, -6, 8, 4, 6, 11, 8, 2, 10, 1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 10, 3, 0, 11, 0, 6, 11, 0, 4, 6, -1, -1, -1, -1, -4, 11, 8, 4, 6, 11, 0, 2, 9, 2, 10, 9, -1, -1, -1, -1, -10, 9, 3, 10, 3, 2, 9, 4, 3, 11, 3, 6, 4, 6, 3, -1, -8, 2, 3, 8, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -0, 4, 2, 4, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 9, 0, 2, 3, 4, 2, 4, 6, 4, 3, 8, -1, -1, -1, -1, -1, 9, 4, 1, 4, 2, 2, 4, 6, -1, -1, -1, -1, -1, -1, -1, -8, 1, 3, 8, 6, 1, 8, 4, 6, 6, 10, 1, -1, -1, -1, -1, -10, 1, 0, 10, 0, 6, 6, 0, 4, -1, -1, -1, -1, -1, -1, -1, -4, 6, 3, 4, 3, 8, 6, 10, 3, 0, 3, 9, 10, 9, 3, -1, -10, 9, 4, 6, 10, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 9, 5, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 8, 3, 4, 9, 5, 11, 7, 6, -1, -1, -1, -1, -1, -1, -1, -5, 0, 1, 5, 4, 0, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -11, 7, 6, 8, 3, 4, 3, 5, 4, 3, 1, 5, -1, -1, -1, -1, -9, 5, 4, 10, 1, 2, 7, 6, 11, -1, -1, -1, -1, -1, -1, -1, -6, 11, 7, 1, 2, 10, 0, 8, 3, 4, 9, 5, -1, -1, -1, -1, -7, 6, 11, 5, 4, 10, 4, 2, 10, 4, 0, 2, -1, -1, -1, -1, -3, 4, 8, 3, 5, 4, 3, 2, 5, 10, 5, 2, 11, 7, 6, -1, -7, 2, 3, 7, 6, 2, 5, 4, 9, -1, -1, -1, -1, -1, -1, -1, -9, 5, 4, 0, 8, 6, 0, 6, 2, 6, 8, 7, -1, -1, -1, -1, -3, 6, 2, 3, 7, 6, 1, 5, 0, 5, 4, 0, -1, -1, -1, -1, -6, 2, 8, 6, 8, 7, 2, 1, 8, 4, 8, 5, 1, 5, 8, -1, -9, 5, 4, 10, 1, 6, 1, 7, 6, 1, 3, 7, -1, -1, -1, -1, -1, 6, 10, 1, 7, 6, 1, 0, 7, 8, 7, 0, 9, 5, 4, -1, -4, 0, 10, 4, 10, 5, 0, 3, 10, 6, 10, 7, 3, 7, 10, -1, -7, 6, 10, 7, 10, 8, 5, 4, 10, 4, 8, 10, -1, -1, -1, -1, -6, 9, 5, 6, 11, 9, 11, 8, 9, -1, -1, -1, -1, -1, -1, -1, -3, 6, 11, 0, 6, 3, 0, 5, 6, 0, 9, 5, -1, -1, -1, -1, -0, 11, 8, 0, 5, 11, 0, 1, 5, 5, 6, 11, -1, -1, -1, -1, -6, 11, 3, 6, 3, 5, 5, 3, 1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 10, 9, 5, 11, 9, 11, 8, 11, 5, 6, -1, -1, -1, -1, -0, 11, 3, 0, 6, 11, 0, 9, 6, 5, 6, 9, 1, 2, 10, -1, -11, 8, 5, 11, 5, 6, 8, 0, 5, 10, 5, 2, 0, 2, 5, -1, -6, 11, 3, 6, 3, 5, 2, 10, 3, 10, 5, 3, -1, -1, -1, -1, -5, 8, 9, 5, 2, 8, 5, 6, 2, 3, 8, 2, -1, -1, -1, -1, -9, 5, 6, 9, 6, 0, 0, 6, 2, -1, -1, -1, -1, -1, -1, -1, -1, 5, 8, 1, 8, 0, 5, 6, 8, 3, 8, 2, 6, 2, 8, -1, -1, 5, 6, 2, 1, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 6, 1, 6, 10, 3, 8, 6, 5, 6, 9, 8, 9, 6, -1, -10, 1, 0, 10, 0, 6, 9, 5, 0, 5, 6, 0, -1, -1, -1, -1, -0, 3, 8, 5, 6, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -10, 5, 6, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -11, 5, 10, 7, 5, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -11, 5, 10, 11, 7, 5, 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, -5, 11, 7, 5, 10, 11, 1, 9, 0, -1, -1, -1, -1, -1, -1, -1, -10, 7, 5, 10, 11, 7, 9, 8, 1, 8, 3, 1, -1, -1, -1, -1, -11, 1, 2, 11, 7, 1, 7, 5, 1, -1, -1, -1, -1, -1, -1, -1, -0, 8, 3, 1, 2, 7, 1, 7, 5, 7, 2, 11, -1, -1, -1, -1, -9, 7, 5, 9, 2, 7, 9, 0, 2, 2, 11, 7, -1, -1, -1, -1, -7, 5, 2, 7, 2, 11, 5, 9, 2, 3, 2, 8, 9, 8, 2, -1, -2, 5, 10, 2, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -8, 2, 0, 8, 5, 2, 8, 7, 5, 10, 2, 5, -1, -1, -1, -1, -9, 0, 1, 5, 10, 3, 5, 3, 7, 3, 10, 2, -1, -1, -1, -1, -9, 8, 2, 9, 2, 1, 8, 7, 2, 10, 2, 5, 7, 5, 2, -1, -1, 3, 5, 3, 7, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 8, 7, 0, 7, 1, 1, 7, 5, -1, -1, -1, -1, -1, -1, -1, -9, 0, 3, 9, 3, 5, 5, 3, 7, -1, -1, -1, -1, -1, -1, -1, -9, 8, 7, 5, 9, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -5, 8, 4, 5, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -5, 0, 4, 5, 11, 0, 5, 10, 11, 11, 3, 0, -1, -1, -1, -1, -0, 1, 9, 8, 4, 10, 8, 10, 11, 10, 4, 5, -1, -1, -1, -1, -10, 11, 4, 10, 4, 5, 11, 3, 4, 9, 4, 1, 3, 1, 4, -1, -2, 5, 1, 2, 8, 5, 2, 11, 8, 4, 5, 8, -1, -1, -1, -1, -0, 4, 11, 0, 11, 3, 4, 5, 11, 2, 11, 1, 5, 1, 11, -1, -0, 2, 5, 0, 5, 9, 2, 11, 5, 4, 5, 8, 11, 8, 5, -1, -9, 4, 5, 2, 11, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 5, 10, 3, 5, 2, 3, 4, 5, 3, 8, 4, -1, -1, -1, -1, -5, 10, 2, 5, 2, 4, 4, 2, 0, -1, -1, -1, -1, -1, -1, -1, -3, 10, 2, 3, 5, 10, 3, 8, 5, 4, 5, 8, 0, 1, 9, -1, -5, 10, 2, 5, 2, 4, 1, 9, 2, 9, 4, 2, -1, -1, -1, -1, -8, 4, 5, 8, 5, 3, 3, 5, 1, -1, -1, -1, -1, -1, -1, -1, -0, 4, 5, 1, 0, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -8, 4, 5, 8, 5, 3, 9, 0, 5, 0, 3, 5, -1, -1, -1, -1, -9, 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 11, 7, 4, 9, 11, 9, 10, 11, -1, -1, -1, -1, -1, -1, -1, -0, 8, 3, 4, 9, 7, 9, 11, 7, 9, 10, 11, -1, -1, -1, -1, -1, 10, 11, 1, 11, 4, 1, 4, 0, 7, 4, 11, -1, -1, -1, -1, -3, 1, 4, 3, 4, 8, 1, 10, 4, 7, 4, 11, 10, 11, 4, -1, -4, 11, 7, 9, 11, 4, 9, 2, 11, 9, 1, 2, -1, -1, -1, -1, -9, 7, 4, 9, 11, 7, 9, 1, 11, 2, 11, 1, 0, 8, 3, -1, -11, 7, 4, 11, 4, 2, 2, 4, 0, -1, -1, -1, -1, -1, -1, -1, -11, 7, 4, 11, 4, 2, 8, 3, 4, 3, 2, 4, -1, -1, -1, -1, -2, 9, 10, 2, 7, 9, 2, 3, 7, 7, 4, 9, -1, -1, -1, -1, -9, 10, 7, 9, 7, 4, 10, 2, 7, 8, 7, 0, 2, 0, 7, -1, -3, 7, 10, 3, 10, 2, 7, 4, 10, 1, 10, 0, 4, 0, 10, -1, -1, 10, 2, 8, 7, 4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 9, 1, 4, 1, 7, 7, 1, 3, -1, -1, -1, -1, -1, -1, -1, -4, 9, 1, 4, 1, 7, 0, 8, 1, 8, 7, 1, -1, -1, -1, -1, -4, 0, 3, 7, 4, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -4, 8, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -9, 10, 8, 10, 11, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -3, 0, 9, 3, 9, 11, 11, 9, 10, -1, -1, -1, -1, -1, -1, -1, -0, 1, 10, 0, 10, 8, 8, 10, 11, -1, -1, -1, -1, -1, -1, -1, -3, 1, 10, 11, 3, 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2, 11, 1, 11, 9, 9, 11, 8, -1, -1, -1, -1, -1, -1, -1, -3, 0, 9, 3, 9, 11, 1, 2, 9, 2, 11, 9, -1, -1, -1, -1, -0, 2, 11, 8, 0, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -3, 2, 11, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 3, 8, 2, 8, 10, 10, 8, 9, -1, -1, -1, -1, -1, -1, -1, -9, 10, 2, 0, 9, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 3, 8, 2, 8, 10, 0, 1, 8, 1, 10, 8, -1, -1, -1, -1, -1, 10, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, 8, 9, 1, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 9, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, --1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]); -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.LensFlare = function ( texture, size, distance, blending, color ) { - - THREE.Object3D.call( this ); - - this.lensFlares = []; - - this.positionScreen = new THREE.Vector3(); - this.customUpdateCallback = undefined; - - if( texture !== undefined ) { - - this.add( texture, size, distance, blending, color ); - - } - -}; - -THREE.LensFlare.prototype = new THREE.Object3D(); -THREE.LensFlare.prototype.constructor = THREE.LensFlare; -THREE.LensFlare.prototype.supr = THREE.Object3D.prototype; - - -/* - * Add: adds another flare - */ - -THREE.LensFlare.prototype.add = function ( texture, size, distance, blending, color, opacity ) { - - if( size === undefined ) size = -1; - if( distance === undefined ) distance = 0; - if( opacity === undefined ) opacity = 1; - if( color === undefined ) color = new THREE.Color( 0xffffff ); - if( blending === undefined ) blending = THREE.NormalBlending; - - distance = Math.min( distance, Math.max( 0, distance ) ); - - this.lensFlares.push( { texture: texture, // THREE.Texture - size: size, // size in pixels (-1 = use texture.width) - distance: distance, // distance (0-1) from light source (0=at light source) - x: 0, y: 0, z: 0, // screen position (-1 => 1) z = 0 is ontop z = 1 is back - scale: 1, // scale - rotation: 1, // rotation - opacity: opacity, // opacity - color: color, // color - blending: blending } ); // blending - -}; - - -/* - * Update lens flares update positions on all flares based on the screen position - * Set myLensFlare.customUpdateCallback to alter the flares in your project specific way. - */ - -THREE.LensFlare.prototype.updateLensFlares = function () { - - var f, fl = this.lensFlares.length; - var flare; - var vecX = -this.positionScreen.x * 2; - var vecY = -this.positionScreen.y * 2; - - for( f = 0; f < fl; f ++ ) { - - flare = this.lensFlares[ f ]; - - flare.x = this.positionScreen.x + vecX * flare.distance; - flare.y = this.positionScreen.y + vecY * flare.distance; - - flare.wantedRotation = flare.x * Math.PI * 0.25; - flare.rotation += ( flare.wantedRotation - flare.rotation ) * 0.25; - - } - -}; - - - - - - - - - - - - -/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.LensFlarePlugin = function ( ) { - - var _gl, _renderer, _lensFlare = {}; - - this.init = function ( renderer ) { - - _gl = renderer.context; - _renderer = renderer; - - _lensFlare.vertices = new Float32Array( 8 + 8 ); - _lensFlare.faces = new Uint16Array( 6 ); - - var i = 0; - _lensFlare.vertices[ i++ ] = -1; _lensFlare.vertices[ i++ ] = -1; // vertex - _lensFlare.vertices[ i++ ] = 0; _lensFlare.vertices[ i++ ] = 0; // uv... etc. - - _lensFlare.vertices[ i++ ] = 1; _lensFlare.vertices[ i++ ] = -1; - _lensFlare.vertices[ i++ ] = 1; _lensFlare.vertices[ i++ ] = 0; - - _lensFlare.vertices[ i++ ] = 1; _lensFlare.vertices[ i++ ] = 1; - _lensFlare.vertices[ i++ ] = 1; _lensFlare.vertices[ i++ ] = 1; - - _lensFlare.vertices[ i++ ] = -1; _lensFlare.vertices[ i++ ] = 1; - _lensFlare.vertices[ i++ ] = 0; _lensFlare.vertices[ i++ ] = 1; - - i = 0; - _lensFlare.faces[ i++ ] = 0; _lensFlare.faces[ i++ ] = 1; _lensFlare.faces[ i++ ] = 2; - _lensFlare.faces[ i++ ] = 0; _lensFlare.faces[ i++ ] = 2; _lensFlare.faces[ i++ ] = 3; - - // buffers - - _lensFlare.vertexBuffer = _gl.createBuffer(); - _lensFlare.elementBuffer = _gl.createBuffer(); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, _lensFlare.vertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, _lensFlare.vertices, _gl.STATIC_DRAW ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, _lensFlare.elementBuffer ); - _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, _lensFlare.faces, _gl.STATIC_DRAW ); - - // textures - - _lensFlare.tempTexture = _gl.createTexture(); - _lensFlare.occlusionTexture = _gl.createTexture(); - - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.tempTexture ); - _gl.texImage2D( _gl.TEXTURE_2D, 0, _gl.RGB, 16, 16, 0, _gl.RGB, _gl.UNSIGNED_BYTE, null ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MIN_FILTER, _gl.NEAREST ); - - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.occlusionTexture ); - _gl.texImage2D( _gl.TEXTURE_2D, 0, _gl.RGBA, 16, 16, 0, _gl.RGBA, _gl.UNSIGNED_BYTE, null ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST ); - _gl.texParameteri( _gl.TEXTURE_2D, _gl.TEXTURE_MIN_FILTER, _gl.NEAREST ); - - if ( _gl.getParameter( _gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS ) <= 0 ) { - - _lensFlare.hasVertexTexture = false; - _lensFlare.program = createProgram( THREE.ShaderFlares[ "lensFlare" ] ); - - } else { - - _lensFlare.hasVertexTexture = true; - _lensFlare.program = createProgram( THREE.ShaderFlares[ "lensFlareVertexTexture" ] ); - - } - - _lensFlare.attributes = {}; - _lensFlare.uniforms = {}; - - _lensFlare.attributes.vertex = _gl.getAttribLocation ( _lensFlare.program, "position" ); - _lensFlare.attributes.uv = _gl.getAttribLocation ( _lensFlare.program, "uv" ); - - _lensFlare.uniforms.renderType = _gl.getUniformLocation( _lensFlare.program, "renderType" ); - _lensFlare.uniforms.map = _gl.getUniformLocation( _lensFlare.program, "map" ); - _lensFlare.uniforms.occlusionMap = _gl.getUniformLocation( _lensFlare.program, "occlusionMap" ); - _lensFlare.uniforms.opacity = _gl.getUniformLocation( _lensFlare.program, "opacity" ); - _lensFlare.uniforms.color = _gl.getUniformLocation( _lensFlare.program, "color" ); - _lensFlare.uniforms.scale = _gl.getUniformLocation( _lensFlare.program, "scale" ); - _lensFlare.uniforms.rotation = _gl.getUniformLocation( _lensFlare.program, "rotation" ); - _lensFlare.uniforms.screenPosition = _gl.getUniformLocation( _lensFlare.program, "screenPosition" ); - - _lensFlare.attributesEnabled = false; - - }; - - - /* - * Render lens flares - * Method: renders 16x16 0xff00ff-colored points scattered over the light source area, - * reads these back and calculates occlusion. - * Then _lensFlare.update_lensFlares() is called to re-position and - * update transparency of flares. Then they are rendered. - * - */ - - this.render = function ( scene, camera, viewportWidth, viewportHeight ) { - - var flares = scene.__webglFlares, - nFlares = flares.length; - - if ( ! nFlares ) return; - - var tempPosition = new THREE.Vector3(); - - var invAspect = viewportHeight / viewportWidth, - halfViewportWidth = viewportWidth * 0.5, - halfViewportHeight = viewportHeight * 0.5; - - var size = 16 / viewportHeight, - scale = new THREE.Vector2( size * invAspect, size ); - - var screenPosition = new THREE.Vector3( 1, 1, 0 ), - screenPositionPixels = new THREE.Vector2( 1, 1 ); - - var uniforms = _lensFlare.uniforms, - attributes = _lensFlare.attributes; - - // set _lensFlare program and reset blending - - _gl.useProgram( _lensFlare.program ); - - if ( ! _lensFlare.attributesEnabled ) { - - _gl.enableVertexAttribArray( _lensFlare.attributes.vertex ); - _gl.enableVertexAttribArray( _lensFlare.attributes.uv ); - - _lensFlare.attributesEnabled = true; - - } - - // loop through all lens flares to update their occlusion and positions - // setup gl and common used attribs/unforms - - _gl.uniform1i( uniforms.occlusionMap, 0 ); - _gl.uniform1i( uniforms.map, 1 ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, _lensFlare.vertexBuffer ); - _gl.vertexAttribPointer( attributes.vertex, 2, _gl.FLOAT, false, 2 * 8, 0 ); - _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 2 * 8, 8 ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, _lensFlare.elementBuffer ); - - _gl.disable( _gl.CULL_FACE ); - _gl.depthMask( false ); - - var i, j, jl, flare, sprite; - - for ( i = 0; i < nFlares; i ++ ) { - - size = 16 / viewportHeight; - scale.set( size * invAspect, size ); - - // calc object screen position - - flare = flares[ i ]; - - tempPosition.set( flare.matrixWorld.n14, flare.matrixWorld.n24, flare.matrixWorld.n34 ); - - camera.matrixWorldInverse.multiplyVector3( tempPosition ); - camera.projectionMatrix.multiplyVector3( tempPosition ); - - // setup arrays for gl programs - - screenPosition.copy( tempPosition ) - - screenPositionPixels.x = screenPosition.x * halfViewportWidth + halfViewportWidth; - screenPositionPixels.y = screenPosition.y * halfViewportHeight + halfViewportHeight; - - // screen cull - - if ( _lensFlare.hasVertexTexture || ( - screenPositionPixels.x > 0 && - screenPositionPixels.x < viewportWidth && - screenPositionPixels.y > 0 && - screenPositionPixels.y < viewportHeight ) ) { - - // save current RGB to temp texture - - _gl.activeTexture( _gl.TEXTURE1 ); - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.tempTexture ); - _gl.copyTexImage2D( _gl.TEXTURE_2D, 0, _gl.RGB, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 ); - - - // render pink quad - - _gl.uniform1i( uniforms.renderType, 0 ); - _gl.uniform2f( uniforms.scale, scale.x, scale.y ); - _gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); - - _gl.disable( _gl.BLEND ); - _gl.enable( _gl.DEPTH_TEST ); - - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - - // copy result to occlusionMap - - _gl.activeTexture( _gl.TEXTURE0 ); - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.occlusionTexture ); - _gl.copyTexImage2D( _gl.TEXTURE_2D, 0, _gl.RGBA, screenPositionPixels.x - 8, screenPositionPixels.y - 8, 16, 16, 0 ); - - - // restore graphics - - _gl.uniform1i( uniforms.renderType, 1 ); - _gl.disable( _gl.DEPTH_TEST ); - - _gl.activeTexture( _gl.TEXTURE1 ); - _gl.bindTexture( _gl.TEXTURE_2D, _lensFlare.tempTexture ); - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - - // update object positions - - flare.positionScreen.copy( screenPosition ) - - if ( flare.customUpdateCallback ) { - - flare.customUpdateCallback( flare ); - - } else { - - flare.updateLensFlares(); - - } - - // render flares - - _gl.uniform1i( uniforms.renderType, 2 ); - _gl.enable( _gl.BLEND ); - - for ( j = 0, jl = flare.lensFlares.length; j < jl; j ++ ) { - - sprite = flare.lensFlares[ j ]; - - if ( sprite.opacity > 0.001 && sprite.scale > 0.001 ) { - - screenPosition.x = sprite.x; - screenPosition.y = sprite.y; - screenPosition.z = sprite.z; - - size = sprite.size * sprite.scale / viewportHeight; - - scale.x = size * invAspect; - scale.y = size; - - _gl.uniform3f( uniforms.screenPosition, screenPosition.x, screenPosition.y, screenPosition.z ); - _gl.uniform2f( uniforms.scale, scale.x, scale.y ); - _gl.uniform1f( uniforms.rotation, sprite.rotation ); - - _gl.uniform1f( uniforms.opacity, sprite.opacity ); - _gl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b ); - - _renderer.setBlending( sprite.blending ); - _renderer.setTexture( sprite.texture, 1 ); - - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - } - - } - - } - - } - - // restore gl - - _gl.enable( _gl.CULL_FACE ); - _gl.enable( _gl.DEPTH_TEST ); - _gl.depthMask( true ); - - }; - - function createProgram ( shader ) { - - var program = _gl.createProgram(); - - var fragmentShader = _gl.createShader( _gl.FRAGMENT_SHADER ); - var vertexShader = _gl.createShader( _gl.VERTEX_SHADER ); - - _gl.shaderSource( fragmentShader, shader.fragmentShader ); - _gl.shaderSource( vertexShader, shader.vertexShader ); - - _gl.compileShader( fragmentShader ); - _gl.compileShader( vertexShader ); - - _gl.attachShader( program, fragmentShader ); - _gl.attachShader( program, vertexShader ); - - _gl.linkProgram( program ); - - return program; - - }; - -};/** - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.ShadowMapPlugin = function ( ) { - - var _gl, - _renderer, - _depthMaterial, _depthMaterialMorph, - - _frustum = new THREE.Frustum(), - _projScreenMatrix = new THREE.Matrix4(); - - this.init = function ( renderer ) { - - _gl = renderer.context; - _renderer = renderer; - - var depthShader = THREE.ShaderLib[ "depthRGBA" ]; - var depthUniforms = THREE.UniformsUtils.clone( depthShader.uniforms ); - - _depthMaterial = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms } ); - _depthMaterialMorph = new THREE.ShaderMaterial( { fragmentShader: depthShader.fragmentShader, vertexShader: depthShader.vertexShader, uniforms: depthUniforms, morphTargets: true } ); - - _depthMaterial._shadowPass = true; - _depthMaterialMorph._shadowPass = true; - - }; - - this.render = function ( scene, camera ) { - - if ( ! ( _renderer.shadowMapEnabled && _renderer.shadowMapAutoUpdate ) ) return; - - this.update( scene, camera ); - - }; - - this.update = function ( scene, camera ) { - - var i, il, j, jl, - - shadowMap, shadowMatrix, shadowCamera, - program, buffer, material, - webglObject, object, light, - renderList, - - lights = scene.lights, - fog = null; - - // set GL state for depth map - - _gl.clearColor( 1, 1, 1, 1 ); - _gl.disable( _gl.BLEND ); - if ( _renderer.shadowMapCullFrontFaces ) _gl.cullFace( _gl.FRONT ); - - _renderer.setDepthTest( true ); - - // render depth map - - for ( i = 0, il = lights.length; i < il; i ++ ) { - - light = lights[ i ]; - - if ( ! light.castShadow ) continue; - - if ( ! light.shadowMap ) { - - var pars = { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter, format: THREE.RGBAFormat }; - - light.shadowMap = new THREE.WebGLRenderTarget( light.shadowMapWidth, light.shadowMapHeight, pars ); - light.shadowMapSize = new THREE.Vector2( light.shadowMapWidth, light.shadowMapHeight ); - - light.shadowMatrix = new THREE.Matrix4(); - - } - - if ( ! light.shadowCamera ) { - - if ( light instanceof THREE.SpotLight ) { - - light.shadowCamera = new THREE.PerspectiveCamera( light.shadowCameraFov, light.shadowMapWidth / light.shadowMapHeight, light.shadowCameraNear, light.shadowCameraFar ); - - } else if ( light instanceof THREE.DirectionalLight ) { - - light.shadowCamera = new THREE.OrthographicCamera( light.shadowCameraLeft, light.shadowCameraRight, light.shadowCameraTop, light.shadowCameraBottom, light.shadowCameraNear, light.shadowCameraFar ); - - } else { - - console.error( "Unsupported light type for shadow" ); - continue; - - } - - scene.add( light.shadowCamera ); - - if ( _renderer.autoUpdateScene ) scene.updateMatrixWorld(); - - } - - - if ( light.shadowCameraVisible && ! light.cameraHelper ) { - - light.cameraHelper = new THREE.CameraHelper( light.shadowCamera ); - light.shadowCamera.add( light.cameraHelper ); - - } - - shadowMap = light.shadowMap; - shadowMatrix = light.shadowMatrix; - shadowCamera = light.shadowCamera; - - shadowCamera.position.copy( light.matrixWorld.getPosition() ); - shadowCamera.lookAt( light.target.matrixWorld.getPosition() ); - shadowCamera.updateMatrixWorld(); - - shadowCamera.matrixWorldInverse.getInverse( shadowCamera.matrixWorld ); - - if ( light.cameraHelper ) light.cameraHelper.lines.visible = light.shadowCameraVisible; - if ( light.shadowCameraVisible ) light.cameraHelper.update( light.shadowCamera ); - - // compute shadow matrix - - shadowMatrix.set( 0.5, 0.0, 0.0, 0.5, - 0.0, 0.5, 0.0, 0.5, - 0.0, 0.0, 0.5, 0.5, - 0.0, 0.0, 0.0, 1.0 ); - - shadowMatrix.multiplySelf( shadowCamera.projectionMatrix ); - shadowMatrix.multiplySelf( shadowCamera.matrixWorldInverse ); - - // render shadow map - - if ( ! shadowCamera._viewMatrixArray ) shadowCamera._viewMatrixArray = new Float32Array( 16 ); - shadowCamera.matrixWorldInverse.flattenToArray( shadowCamera._viewMatrixArray ); - - if ( ! shadowCamera._projectionMatrixArray ) shadowCamera._projectionMatrixArray = new Float32Array( 16 ); - shadowCamera.projectionMatrix.flattenToArray( shadowCamera._projectionMatrixArray ); - - _projScreenMatrix.multiply( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse ); - _frustum.setFromMatrix( _projScreenMatrix ); - - _renderer.setRenderTarget( shadowMap ); - _renderer.clear(); - - // set matrices & frustum culling - - renderList = scene.__webglObjects; - - for ( j = 0, jl = renderList.length; j < jl; j ++ ) { - - webglObject = renderList[ j ]; - object = webglObject.object; - - webglObject.render = false; - - if ( object.visible && object.castShadow ) { - - if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) { - - object.matrixWorld.flattenToArray( object._objectMatrixArray ); - object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray ); - - webglObject.render = true; - - } - - } - - } - - // render regular objects - - for ( j = 0, jl = renderList.length; j < jl; j ++ ) { - - webglObject = renderList[ j ]; - - if ( webglObject.render ) { - - object = webglObject.object; - buffer = webglObject.buffer; - - _renderer.setObjectFaces( object ); - - if ( object.customDepthMaterial ) { - - material = object.customDepthMaterial; - - } else if ( object.geometry.morphTargets.length ) { - - material = _depthMaterialMorph; - - } else { - - material = _depthMaterial; - - } - - if ( buffer instanceof THREE.BufferGeometry ) { - - _renderer.renderBufferDirect( shadowCamera, lights, fog, material, buffer, object ); - - } else { - - _renderer.renderBuffer( shadowCamera, lights, fog, material, buffer, object ); - - } - - } - - } - - // set matrices and render immediate objects - - renderList = scene.__webglObjectsImmediate; - - for ( j = 0, jl = renderList.length; j < jl; j ++ ) { - - webglObject = renderList[ j ]; - object = webglObject.object; - - if ( object.visible && object.castShadow ) { - - if( object.matrixAutoUpdate ) { - - object.matrixWorld.flattenToArray( object._objectMatrixArray ); - - } - - object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray ); - - _renderer.renderImmediateObject( shadowCamera, lights, fog, _depthMaterial, object ); - - } - - } - - } - - // restore GL state - - var clearColor = _renderer.getClearColor(), - clearAlpha = _renderer.getClearAlpha(); - - _gl.clearColor( clearColor.r, clearColor.g, clearColor.b, clearAlpha ); - _gl.enable( _gl.BLEND ); - if ( _renderer.shadowMapCullFrontFaces ) _gl.cullFace( _gl.BACK ); - - }; - -};/** - * @author mikael emtinger / http://gomo.se/ - * @author alteredq / http://alteredqualia.com/ - */ - -THREE.SpritePlugin = function ( ) { - - var _gl, _renderer, _sprite = {}; - - this.init = function ( renderer ) { - - _gl = renderer.context; - _renderer = renderer; - - _sprite.vertices = new Float32Array( 8 + 8 ); - _sprite.faces = new Uint16Array( 6 ); - - var i = 0; - - _sprite.vertices[ i++ ] = -1; _sprite.vertices[ i++ ] = -1; // vertex 0 - _sprite.vertices[ i++ ] = 0; _sprite.vertices[ i++ ] = 1; // uv 0 - - _sprite.vertices[ i++ ] = 1; _sprite.vertices[ i++ ] = -1; // vertex 1 - _sprite.vertices[ i++ ] = 1; _sprite.vertices[ i++ ] = 1; // uv 1 - - _sprite.vertices[ i++ ] = 1; _sprite.vertices[ i++ ] = 1; // vertex 2 - _sprite.vertices[ i++ ] = 1; _sprite.vertices[ i++ ] = 0; // uv 2 - - _sprite.vertices[ i++ ] = -1; _sprite.vertices[ i++ ] = 1; // vertex 3 - _sprite.vertices[ i++ ] = 0; _sprite.vertices[ i++ ] = 0; // uv 3 - - i = 0; - - _sprite.faces[ i++ ] = 0; _sprite.faces[ i++ ] = 1; _sprite.faces[ i++ ] = 2; - _sprite.faces[ i++ ] = 0; _sprite.faces[ i++ ] = 2; _sprite.faces[ i++ ] = 3; - - _sprite.vertexBuffer = _gl.createBuffer(); - _sprite.elementBuffer = _gl.createBuffer(); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, _sprite.vertexBuffer ); - _gl.bufferData( _gl.ARRAY_BUFFER, _sprite.vertices, _gl.STATIC_DRAW ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, _sprite.elementBuffer ); - _gl.bufferData( _gl.ELEMENT_ARRAY_BUFFER, _sprite.faces, _gl.STATIC_DRAW ); - - _sprite.program = createProgram( THREE.ShaderSprite[ "sprite" ] ); - - _sprite.attributes = {}; - _sprite.uniforms = {}; - - _sprite.attributes.position = _gl.getAttribLocation ( _sprite.program, "position" ); - _sprite.attributes.uv = _gl.getAttribLocation ( _sprite.program, "uv" ); - - _sprite.uniforms.uvOffset = _gl.getUniformLocation( _sprite.program, "uvOffset" ); - _sprite.uniforms.uvScale = _gl.getUniformLocation( _sprite.program, "uvScale" ); - - _sprite.uniforms.rotation = _gl.getUniformLocation( _sprite.program, "rotation" ); - _sprite.uniforms.scale = _gl.getUniformLocation( _sprite.program, "scale" ); - _sprite.uniforms.alignment = _gl.getUniformLocation( _sprite.program, "alignment" ); - - _sprite.uniforms.color = _gl.getUniformLocation( _sprite.program, "color" ); - _sprite.uniforms.map = _gl.getUniformLocation( _sprite.program, "map" ); - _sprite.uniforms.opacity = _gl.getUniformLocation( _sprite.program, "opacity" ); - - _sprite.uniforms.useScreenCoordinates = _gl.getUniformLocation( _sprite.program, "useScreenCoordinates" ); - _sprite.uniforms.affectedByDistance = _gl.getUniformLocation( _sprite.program, "affectedByDistance" ); - _sprite.uniforms.screenPosition = _gl.getUniformLocation( _sprite.program, "screenPosition" ); - _sprite.uniforms.modelViewMatrix = _gl.getUniformLocation( _sprite.program, "modelViewMatrix" ); - _sprite.uniforms.projectionMatrix = _gl.getUniformLocation( _sprite.program, "projectionMatrix" ); - - _sprite.attributesEnabled = false; - - }; - - this.render = function ( scene, camera, viewportWidth, viewportHeight ) { - - var sprites = scene.__webglSprites, - nSprites = sprites.length; - - if ( ! nSprites ) return; - - var attributes = _sprite.attributes, - uniforms = _sprite.uniforms; - - var invAspect = viewportHeight / viewportWidth; - - var halfViewportWidth = viewportWidth * 0.5, - halfViewportHeight = viewportHeight * 0.5; - - var mergeWith3D = true; - - // setup gl - - _gl.useProgram( _sprite.program ); - - if ( ! _sprite.attributesEnabled ) { - - _gl.enableVertexAttribArray( attributes.position ); - _gl.enableVertexAttribArray( attributes.uv ); - - _sprite.attributesEnabled = true; - - } - - _gl.disable( _gl.CULL_FACE ); - _gl.enable( _gl.BLEND ); - _gl.depthMask( true ); - - _gl.bindBuffer( _gl.ARRAY_BUFFER, _sprite.vertexBuffer ); - _gl.vertexAttribPointer( attributes.position, 2, _gl.FLOAT, false, 2 * 8, 0 ); - _gl.vertexAttribPointer( attributes.uv, 2, _gl.FLOAT, false, 2 * 8, 8 ); - - _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, _sprite.elementBuffer ); - - _gl.uniformMatrix4fv( uniforms.projectionMatrix, false, camera._projectionMatrixArray ); - - _gl.activeTexture( _gl.TEXTURE0 ); - _gl.uniform1i( uniforms.map, 0 ); - - // update positions and sort - - var i, sprite, screenPosition, size, scale = []; - - for( i = 0; i < nSprites; i ++ ) { - - sprite = sprites[ i ]; - - if ( ! sprite.visible || sprite.opacity === 0 ) continue; - - if( ! sprite.useScreenCoordinates ) { - - sprite._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, sprite.matrixWorld, sprite._modelViewMatrixArray ); - sprite.z = - sprite._modelViewMatrix.n34; - - } else { - - sprite.z = - sprite.position.z; - - } - - } - - sprites.sort( painterSort ); - - // render all sprites - - for( i = 0; i < nSprites; i ++ ) { - - sprite = sprites[ i ]; - - if ( ! sprite.visible || sprite.opacity === 0 ) continue; - - if ( sprite.map && sprite.map.image && sprite.map.image.width ) { - - if ( sprite.useScreenCoordinates ) { - - _gl.uniform1i( uniforms.useScreenCoordinates, 1 ); - _gl.uniform3f( uniforms.screenPosition, ( sprite.position.x - halfViewportWidth ) / halfViewportWidth, - ( halfViewportHeight - sprite.position.y ) / halfViewportHeight, - Math.max( 0, Math.min( 1, sprite.position.z ) ) ); - - } else { - - _gl.uniform1i( uniforms.useScreenCoordinates, 0 ); - _gl.uniform1i( uniforms.affectedByDistance, sprite.affectedByDistance ? 1 : 0 ); - _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrixArray ); - - } - - size = sprite.map.image.width / ( sprite.scaleByViewport ? viewportHeight : 1 ); - - scale[ 0 ] = size * invAspect * sprite.scale.x; - scale[ 1 ] = size * sprite.scale.y; - - _gl.uniform2f( uniforms.uvScale, sprite.uvScale.x, sprite.uvScale.y ); - _gl.uniform2f( uniforms.uvOffset, sprite.uvOffset.x, sprite.uvOffset.y ); - _gl.uniform2f( uniforms.alignment, sprite.alignment.x, sprite.alignment.y ); - - _gl.uniform1f( uniforms.opacity, sprite.opacity ); - _gl.uniform3f( uniforms.color, sprite.color.r, sprite.color.g, sprite.color.b ); - - _gl.uniform1f( uniforms.rotation, sprite.rotation ); - _gl.uniform2fv( uniforms.scale, scale ); - - if ( sprite.mergeWith3D && !mergeWith3D ) { - - _gl.enable( _gl.DEPTH_TEST ); - mergeWith3D = true; - - } else if ( ! sprite.mergeWith3D && mergeWith3D ) { - - _gl.disable( _gl.DEPTH_TEST ); - mergeWith3D = false; - - } - - _renderer.setBlending( sprite.blending ); - _renderer.setTexture( sprite.map, 0 ); - - _gl.drawElements( _gl.TRIANGLES, 6, _gl.UNSIGNED_SHORT, 0 ); - - } - - } - - // restore gl - - _gl.enable( _gl.CULL_FACE ); - _gl.enable( _gl.DEPTH_TEST ); - _gl.depthMask( true ); - - }; - - function createProgram ( shader ) { - - var program = _gl.createProgram(); - - var fragmentShader = _gl.createShader( _gl.FRAGMENT_SHADER ); - var vertexShader = _gl.createShader( _gl.VERTEX_SHADER ); - - _gl.shaderSource( fragmentShader, shader.fragmentShader ); - _gl.shaderSource( vertexShader, shader.vertexShader ); - - _gl.compileShader( fragmentShader ); - _gl.compileShader( vertexShader ); - - _gl.attachShader( program, fragmentShader ); - _gl.attachShader( program, vertexShader ); - - _gl.linkProgram( program ); - - return program; - - }; - - function painterSort ( a, b ) { - - return b.z - a.z; - - }; - -};/** - * @author mrdoob / http://mrdoob.com/ - * @author marklundin / http://mark-lundin.com/ - * @author alteredq / http://alteredqualia.com/ - */ - -if ( THREE.WebGLRenderer ) { - - THREE.AnaglyphWebGLRenderer = function ( parameters ) { - - THREE.WebGLRenderer.call( this, parameters ); - - this.autoUpdateScene = false; - - var _this = this, _setSize = this.setSize, _render = this.render; - - var _cameraL = new THREE.PerspectiveCamera(), - _cameraR = new THREE.PerspectiveCamera(); - - var eyeRight = new THREE.Matrix4(), - eyeLeft = new THREE.Matrix4(), - focalLength = 125, - _aspect, _near, _far, _fov; - - _cameraL.matrixAutoUpdate = _cameraR.matrixAutoUpdate = false; - - var _params = { minFilter: THREE.LinearFilter, magFilter: THREE.NearestFilter, format: THREE.RGBAFormat }; - - var _renderTargetL = new THREE.WebGLRenderTarget( 512, 512, _params ), - _renderTargetR = new THREE.WebGLRenderTarget( 512, 512, _params ); - - var _camera = new THREE.PerspectiveCamera( 53, 1, 1, 10000 ); - _camera.position.z = 2; - - var _material = new THREE.ShaderMaterial( { - - uniforms: { - - "mapLeft": { type: "t", value: 0, texture: _renderTargetL }, - "mapRight": { type: "t", value: 1, texture: _renderTargetR } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D mapLeft;", - "uniform sampler2D mapRight;", - "varying vec2 vUv;", - - "void main() {", - - "vec4 colorL, colorR;", - "vec2 uv = vUv;", - - "colorL = texture2D( mapLeft, uv );", - "colorR = texture2D( mapRight, uv );", - - // http://3dtv.at/Knowhow/AnaglyphComparison_en.aspx - - "gl_FragColor = vec4( colorL.g * 0.7 + colorL.b * 0.3, colorR.g, colorR.b, colorL.a + colorR.a ) * 1.1;", - - "}" - - ].join("\n") - - } ); - - var _scene = new THREE.Scene(); - _scene.add( new THREE.Mesh( new THREE.PlaneGeometry( 2, 2 ), _material ) ); - - _scene.add( _camera ); - - this.setSize = function ( width, height ) { - - _setSize.call( _this, width, height ); - - _renderTargetL.width = width; - _renderTargetL.height = height; - - _renderTargetR.width = width; - _renderTargetR.height = height; - - }; - - /* - * Renderer now uses an asymmetric perspective projection (http://paulbourke.net/miscellaneous/stereographics/stereorender/). - * Each camera is offset by the eye seperation and its projection matrix is also skewed asymetrically back to converge on the same - * projection plane. Added a focal length parameter to, this is where the parallax is equal to 0. - */ - - this.render = function ( scene, camera, renderTarget, forceClear ) { - - scene.updateMatrixWorld(); - - var hasCameraChanged = ( _aspect !== camera.aspect ) || ( _near !== camera.near ) || ( _far !== camera.far ) || ( _fov !== camera.fov ); - - if( hasCameraChanged ) { - - _aspect = camera.aspect; - _near = camera.near; - _far = camera.far; - _fov = camera.fov; - - var projectionMatrix = camera.projectionMatrix.clone(), - eyeSep = focalLength / 30 * 0.5, - eyeSepOnProjection = eyeSep * _near / focalLength, - ymax = _near * Math.tan( _fov * Math.PI / 360 ), - xmin, xmax; - - // translate xOffset - - eyeRight.n14 = eyeSep; - eyeLeft.n14 = -eyeSep; - - // for left eye - - xmin = -ymax * _aspect + eyeSepOnProjection; - xmax = ymax * _aspect + eyeSepOnProjection; - - projectionMatrix.n11 = 2 * _near / ( xmax - xmin ); - projectionMatrix.n13 = ( xmax + xmin ) / ( xmax - xmin ); - - _cameraL.projectionMatrix.copy( projectionMatrix ); - - // for right eye - - xmin = -ymax * _aspect - eyeSepOnProjection; - xmax = ymax * _aspect - eyeSepOnProjection; - - projectionMatrix.n11 = 2 * _near / ( xmax - xmin ); - projectionMatrix.n13 = ( xmax + xmin ) / ( xmax - xmin ); - - _cameraR.projectionMatrix.copy( projectionMatrix ); - - } - - _cameraL.matrixWorld.copy( camera.matrixWorld ).multiplySelf( eyeLeft ); - _cameraL.position.copy( camera.position ); - _cameraL.near = camera.near; - _cameraL.far = camera.far; - - _render.call( _this, scene, _cameraL, _renderTargetL, true ); - - _cameraR.matrixWorld.copy( camera.matrixWorld ).multiplySelf( eyeRight ); - _cameraR.position.copy( camera.position ); - _cameraR.near = camera.near; - _cameraR.far = camera.far; - - _render.call( _this, scene, _cameraR, _renderTargetR, true ); - - _scene.updateMatrixWorld(); - _render.call( _this, _scene, _camera ); - - }; - - }; - -}; -/** - * @author alteredq / http://alteredqualia.com/ - */ - -if ( THREE.WebGLRenderer ) { - - THREE.CrosseyedWebGLRenderer = function ( parameters ) { - - THREE.WebGLRenderer.call( this, parameters ); - - this.autoClear = false; - - var _this = this, _setSize = this.setSize, _render = this.render; - - var _width, _height; - - var _cameraL = new THREE.PerspectiveCamera(); - _cameraL.target = new THREE.Vector3( 0, 0, 0 ); - - var _cameraR = new THREE.PerspectiveCamera(); - _cameraR.target = new THREE.Vector3( 0, 0, 0 ); - - _this.separation = 10; - if ( parameters && parameters.separation !== undefined ) _this.separation = parameters.separation; - - var SCREEN_WIDTH = window.innerWidth; - var SCREEN_HEIGHT = window.innerHeight; - var HALF_WIDTH = SCREEN_WIDTH / 2; - - this.setSize = function ( width, height ) { - - _setSize.call( _this, width, height ); - - _width = width/2; - _height = height; - - }; - - this.render = function ( scene, camera, renderTarget, forceClear ) { - - this.clear(); - - _cameraL.fov = camera.fov; - _cameraL.aspect = 0.5 * camera.aspect; - _cameraL.near = camera.near; - _cameraL.far = camera.far; - _cameraL.updateProjectionMatrix(); - - _cameraL.position.copy( camera.position ); - _cameraL.target.copy( camera.target ); - _cameraL.translateX( _this.separation ); - _cameraL.lookAt( _cameraL.target ); - - _cameraR.projectionMatrix = _cameraL.projectionMatrix; - - _cameraR.position.copy( camera.position ); - _cameraR.target.copy( camera.target ); - _cameraR.translateX( - _this.separation ); - _cameraR.lookAt( _cameraR.target ); - - this.setViewport( 0, 0, _width, _height ); - _render.call( _this, scene, _cameraL ); - - this.setViewport( _width, 0, _width, _height ); - _render.call( _this, scene, _cameraR, false ); - - }; - - }; - -} -/** - * @author mikael emtinger / http://gomo.se/ - * - */ - -THREE.ShaderFlares = { - - 'lensFlareVertexTexture': { - - vertexShader: [ - - "uniform vec3 screenPosition;", - "uniform vec2 scale;", - "uniform float rotation;", - "uniform int renderType;", - - "uniform sampler2D occlusionMap;", - - "attribute vec2 position;", - "attribute vec2 uv;", - - "varying vec2 vUV;", - "varying float vVisibility;", - - "void main() {", - - "vUV = uv;", - - "vec2 pos = position;", - - "if( renderType == 2 ) {", - - "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) ) +", - "texture2D( occlusionMap, vec2( 0.5, 0.1 ) ) +", - "texture2D( occlusionMap, vec2( 0.9, 0.1 ) ) +", - "texture2D( occlusionMap, vec2( 0.9, 0.5 ) ) +", - "texture2D( occlusionMap, vec2( 0.9, 0.9 ) ) +", - "texture2D( occlusionMap, vec2( 0.5, 0.9 ) ) +", - "texture2D( occlusionMap, vec2( 0.1, 0.9 ) ) +", - "texture2D( occlusionMap, vec2( 0.1, 0.5 ) ) +", - "texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", - - "vVisibility = ( visibility.r / 9.0 ) *", - "( 1.0 - visibility.g / 9.0 ) *", - "( visibility.b / 9.0 ) *", - "( 1.0 - visibility.a / 9.0 );", - - "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", - "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", - - "}", - - "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", - - "}" - - ].join( "\n" ), - - fragmentShader: [ - - "precision mediump float;", - - "uniform sampler2D map;", - "uniform float opacity;", - "uniform int renderType;", - "uniform vec3 color;", - - "varying vec2 vUV;", - "varying float vVisibility;", - - "void main() {", - - // pink square - - "if( renderType == 0 ) {", - - "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", - - // restore - - "} else if( renderType == 1 ) {", - - "gl_FragColor = texture2D( map, vUV );", - - // flare - - "} else {", - - "vec4 texture = texture2D( map, vUV );", - "texture.a *= opacity * vVisibility;", - "gl_FragColor = texture;", - "gl_FragColor.rgb *= color;", - - "}", - - "}" - ].join( "\n" ) - - }, - - - 'lensFlare': { - - vertexShader: [ - - "uniform vec3 screenPosition;", - "uniform vec2 scale;", - "uniform float rotation;", - "uniform int renderType;", - - "attribute vec2 position;", - "attribute vec2 uv;", - - "varying vec2 vUV;", - - "void main() {", - - "vUV = uv;", - - "vec2 pos = position;", - - "if( renderType == 2 ) {", - - "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", - "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", - - "}", - - "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", - - "}" - - ].join( "\n" ), - - fragmentShader: [ - - "precision mediump float;", - - "uniform sampler2D map;", - "uniform sampler2D occlusionMap;", - "uniform float opacity;", - "uniform int renderType;", - "uniform vec3 color;", - - "varying vec2 vUV;", - - "void main() {", - - // pink square - - "if( renderType == 0 ) {", - - "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", - - // restore - - "} else if( renderType == 1 ) {", - - "gl_FragColor = texture2D( map, vUV );", - - // flare - - "} else {", - - "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a +", - "texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a +", - "texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a +", - "texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", - - "visibility = ( 1.0 - visibility / 4.0 );", - - "vec4 texture = texture2D( map, vUV );", - "texture.a *= opacity * visibility;", - "gl_FragColor = texture;", - "gl_FragColor.rgb *= color;", - - "}", - - "}" - - ].join( "\n" ) - - } - -}; -/** - * @author mikael emtinger / http://gomo.se/ - * - */ - -THREE.ShaderSprite = { - - 'sprite': { - - vertexShader: [ - - "uniform int useScreenCoordinates;", - "uniform int affectedByDistance;", - "uniform vec3 screenPosition;", - "uniform mat4 modelViewMatrix;", - "uniform mat4 projectionMatrix;", - "uniform float rotation;", - "uniform vec2 scale;", - "uniform vec2 alignment;", - "uniform vec2 uvOffset;", - "uniform vec2 uvScale;", - - "attribute vec2 position;", - "attribute vec2 uv;", - - "varying vec2 vUV;", - - "void main() {", - - "vUV = uvOffset + uv * uvScale;", - - "vec2 alignedPosition = position + alignment;", - - "vec2 rotatedPosition;", - "rotatedPosition.x = ( cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y ) * scale.x;", - "rotatedPosition.y = ( sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y ) * scale.y;", - - "vec4 finalPosition;", - - "if( useScreenCoordinates != 0 ) {", - - "finalPosition = vec4( screenPosition.xy + rotatedPosition, screenPosition.z, 1.0 );", - - "} else {", - - "finalPosition = projectionMatrix * modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", - "finalPosition.xy += rotatedPosition * ( affectedByDistance == 1 ? 1.0 : finalPosition.z );", - - "}", - - "gl_Position = finalPosition;", - - "}" - - ].join( "\n" ), - - fragmentShader: [ - - "precision mediump float;", - - "uniform vec3 color;", - "uniform sampler2D map;", - "uniform float opacity;", - - "varying vec2 vUV;", - - "void main() {", - - "vec4 texture = texture2D( map, vUV );", - "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", - - "}" - - ].join( "\n" ) - - } - -}; diff --git a/thirdparty/three.min.js b/thirdparty/three.min.js new file mode 100644 index 0000000..0252dd2 --- /dev/null +++ b/thirdparty/three.min.js @@ -0,0 +1,821 @@ +// threejs.org/license +'use strict';var THREE={REVISION:"70"};"object"===typeof module&&(module.exports=THREE);void 0===Math.sign&&(Math.sign=function(a){return 0>a?-1:0>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a))return a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a))return a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r= +Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\#([0-9a-f]{6})$/i.test(a))return a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g= +a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<< +8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cf&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= +.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= +-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this}, +multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,n=b._w;this._x=c*n+f*g+d*k-e*h;this._y=d*n+f*h+e*g-c*k;this._z=e*n+f*k+c*h-d*g;this._w=f*n-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); +return a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(.001>Math.abs(k))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h= +Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback= +a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; +THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, +b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this}, +subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}, +roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b= +this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+ +c;this.x=a.array[b];this.y=a.array[b+1];return this},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; +THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ +a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), +this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y= +a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x, +c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z= +(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,n=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-n*-f;this.y=k*a+b*-f+n*-e-h*-g;this.z=n*a+b*-g+h*-f-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0=== +a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x> +a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a, +b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z); +return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/ +b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this}, +projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length()); +return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}, +getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a, +b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x=== +this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}}; +THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; +THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x; +case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this}, +addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b= +this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this}, +setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var n=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+n-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;n=(n+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>n?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>n?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h), +b=d/c,d=k/c):.01>n?(c=b=.707106781,d=0):(d=Math.sqrt(n),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+n-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);this.wb.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w); +return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w); +return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, +setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]= +this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];this.w=a.array[b+3];return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; +THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x= +a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],n=e[9],p=e[2],q=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-n,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(n,-1,1)),.99999>Math.abs(n)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h, +k)):(this._y=Math.atan2(-p,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-p,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(p,-1,1)),.99999>Math.abs(p)?(this._x=Math.atan2(q,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-n,k),this._y=Math.atan2(-p,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z= +Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-n,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z, +b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new THREE.Vector3(this._x, +this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3}; +THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a, +b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); +this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)}; +THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.y +this.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& +a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)}; +THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x- +this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a= +new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y, +this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a); +this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);0this.determinant()&&(g=-g);c.x=f[12]; +c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,n=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=n;b.elements[9]*=n;b.elements[10]*=n;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0; +g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,n=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/n;g[14]=-((f+e)/n);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0], +a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; +THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin); +var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5); +b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),n=c.dot(this.direction),p=-c.dot(b),q=c.lengthSq(),m=Math.abs(1-k*k),t;0=-t?e<=t?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*n)+e*(k*d+e+2*p)+q):(e=h,d=Math.max(0,-(k*e+n)),k=-d*d+e*(e+2*p)+q):(e=-h,d=Math.max(0,-(k*e+n)),k=-d*d+e*(e+2*p)+q):e<=-t?(d=Math.max(0,-(-k*h+n)),e=0f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)}, +isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!==c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a)); +if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0}; +THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<= +this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius); +return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}}; +THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]}; +THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],n=c[7],p=c[8],q=c[9],m=c[10],t=c[11],s=c[12],r=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,n-g,t-p,c-s).normalize();b[1].setComponents(f+ +a,n+g,t+p,c+s).normalize();b[2].setComponents(f+d,n+h,t+q,c+r).normalize();b[3].setComponents(f-d,n-h,t-q,c-r).normalize();b[4].setComponents(f-e,n-k,t-m,c-u).normalize();b[5].setComponents(f+e,n+k,t+m,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes, +c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(), +containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0}; +THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d, +c);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a, +b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0a&&0f||1e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a= +180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}}; +THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,n,p,q,m;this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+ +2;n=this.points[c[0]];p=this.points[c[1]];q=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(n.x,p.x,q.x,m.x,g,h,k);d.y=b(n.y,p.y,q.y,m.y,g,h,k);d.z=b(n.z,p.z,q.z,m.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=b.x+b.y}}(); +THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| +new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}, +clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}; +THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(), +a=.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){}; +THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&& +c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;eya?-1:1;h[4*a]=ga.x;h[4*a+1]=ga.y;h[4*a+2]=ga.z;h[4*a+3]=$a}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array, +e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],n=[],p=0;pr;r++)s=a[3*c+r],-1==m[s]?(q[2*r]=s,q[2*r+1]=-1,p++):m[s]k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)r=q[p+1],-1p;p+=2)s=q[p],r=q[p+1],-1===r&&(r=g++),m[s]=r,t[r]=s,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;hd?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;cd;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;ca.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"=== +a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap, +a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&& +b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormalFactor&&(h.normalScale=new THREE.Vector2(a.mapNormalFactor,a.mapNormalFactor));g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}};THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;bg;g++)m=y[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*y[k++],t.normal.set(C[q++],C[q++],C[q]),r.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*y[k++],s=new THREE.Vector3(C[q++], +C[q++],C[q]),2!==d&&t.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);p&&(p=y[k++],p=x[p],t.color.setHex(p),r.color.setHex(p));if(b)for(d=0;4>d;d++)p=y[k++],p=x[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&r.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(r)}else{t=new THREE.Face3;t.a=y[k++];t.b=y[k++];t.c=y[k++];h&&(h=y[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)m=y[k++],v=u[2*m],m=u[2*m+1], +v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*y[k++],t.normal.set(C[q++],C[q++],C[q]));if(s)for(d=0;3>d;d++)q=3*y[k++],s=new THREE.Vector3(C[q++],C[q++],C[q]),t.vertexNormals.push(s);p&&(p=y[k++],t.color.setHex(x[p]));if(b)for(d=0;3>d;d++)p=y[k++],t.vertexColors.push(new THREE.Color(x[p]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;dthis.opacity&&(a.opacity=this.opacity);!1!==this.transparent&&(a.transparent=this.transparent);!1!==this.wireframe&&(a.wireframe=this.wireframe);return a},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor= +this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);THREE.MaterialIdCount=0; +THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.type="LineBasicMaterial";this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial; +THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.linecap=this.linecap;a.linejoin=this.linejoin;a.vertexColors=this.vertexColors;a.fog=this.fog;return a}; +THREE.LineDashedMaterial=function(a){THREE.Material.call(this);this.type="LineDashedMaterial";this.color=new THREE.Color(16777215);this.scale=this.linewidth=1;this.dashSize=3;this.gapSize=1;this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial; +THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.scale=this.scale;a.dashSize=this.dashSize;a.gapSize=this.gapSize;a.vertexColors=this.vertexColors;a.fog=this.fog;return a}; +THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.type="MeshBasicMaterial";this.color=new THREE.Color(16777215);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=!1;this.setValues(a)}; +THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial; +THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap; +a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;return a}; +THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.type="MeshLambertMaterial";this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth= +1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial; +THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog; +a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a}; +THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.type="MeshPhongMaterial";this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.metal=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.bumpMap=this.lightMap=this.map=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.envMap=this.alphaMap=this.specularMap=null;this.combine= +THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial; +THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.specular.copy(this.specular);a.shininess=this.shininess;a.metal=this.metal;a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.bumpMap=this.bumpMap;a.bumpScale=this.bumpScale;a.normalMap=this.normalMap;a.normalScale.copy(this.normalScale); +a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a}; +THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.type="MeshDepthMaterial";this.wireframe=this.morphTargets=!1;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial; +THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;THREE.Material.prototype.clone.call(this,a);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.type="MeshNormalMaterial";this.shading=THREE.FlatShading;this.wireframe=!1;this.wireframeLinewidth=1;this.morphTargets=!1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype); +THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;THREE.Material.prototype.clone.call(this,a);a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID();this.type="MeshFaceMaterial";this.materials=a instanceof Array?a:[]}; +THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;bf||(C=b.origin.distanceTo(p),Cd.far||e.push({distance:C,point:n.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this}))}}else for(m= +m.position.array,g=0;gf||(C=b.origin.distanceTo(p),Cd.far||e.push({distance:C,point:n.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;gf||(C=b.origin.distanceTo(p),Cd.far||e.push({distance:C,point:n.clone().applyMatrix4(this.matrixWorld), +face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype); +THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0g.far||h.push({distance:z,point:F,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=p.position.array,s=k=0,x=r.length;k +g.far||h.push({distance:z,point:F,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,r=!0===s?this.material.materials:null,t=g.precision,u=k.vertices,v=0,y=k.faces.length;vg.far||h.push({distance:z,point:F,face:C,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone; +THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; +THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn("animation["+a+"] undefined")}; +THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&& +(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b}; +THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;dthis.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a}; +THREE.Particle=THREE.Sprite;THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.constructor=THREE.LensFlare; +THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})}; +THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a dashSize ) {\n\t\tdiscard;\n\t}\n\tgl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment, +"}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment, +"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );", +THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_vertex, +"void main() {\n\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\tvWorldPosition = worldPosition.xyz;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment, +"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\tvWorldPosition = worldPosition.xyz;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;", +THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = clamp( tFlip * direction.y * -0.5 + 0.5, 0.0, 1.0);\nsampleUV.x = atan( direction.z, direction.x ) * 0.15915494309189533576888376337251 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex, +THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {", +THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}}; +THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate= +!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1h&&(e[v].counter+=1,k=e[v].hash+"_"+e[v].counter,k in q||(p={id:kc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,r.push(p)));q[k].faces3.push(t);q[k].vertices+=3}f[g]=r;b.groupsNeedUpdate=!1}f=sb[b.id];g=0;for(d=f.length;gY;Y++)qa=Q[Y],Pa[Va]=qa.x,Pa[Va+1]=qa.y,Pa[Va+2]=qa.z,Va+=3;else for(Y=0;3>Y;Y++)Pa[Va]=M.x,Pa[Va+1]=M.y,Pa[Va+2]=M.z,Va+=3;l.bindBuffer(l.ARRAY_BUFFER,v.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER, +Pa,z)}if(Ma&&Wa){w=0;for(F=V.length;wY;Y++)Da=T[Y],wb[mb]=Da.x,wb[mb+1]=Da.y,mb+=2;0Y;Y++)Aa=U[Y],ob[ya]=Aa.x,ob[ya+1]=Aa.y,ya+=2;0ua;ua++)gb[ua]=!I.autoScaleCubemaps||Fb||ba?ba?ka.image[ua].image:ka.image[ua]:M(ka.image[ua],Ec);var Qb=gb[0],Rb=THREE.Math.isPowerOfTwo(Qb.width)&&THREE.Math.isPowerOfTwo(Qb.height),qb=T(ka.format),Sb=T(ka.type);U(l.TEXTURE_CUBE_MAP,ka,Rb);for(ua=0;6>ua;ua++)if(Fb)for(var yb,Gb=gb[ua].mipmaps,rb=0,Yb=Gb.length;rb=pc&&console.warn("WebGLRenderer: trying to use "+ +a+" texture units while this GPU supports only "+pc);Mb+=1;return a}function G(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function E(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function w(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function D(a){a*=O;a!==qc&&(l.lineWidth(a),qc=a)}function A(a,b,c){rc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),rc=a);!a||sc===b&&tc===c|| +(l.polygonOffset(b,c),sc=b,tc=c)}function U(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,T(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,T(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+ +b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,N(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,N(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+b.sourceFile+" )"));(c=aa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function K(a,b){l.bindRenderbuffer(l.RENDERBUFFER, +a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function L(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP, +a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function N(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function T(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT; +if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1; +if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA; +if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA; +if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;b=aa.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT; +if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=aa.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=aa.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT; +if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var Q=void 0!==a.canvas?a.canvas:document.createElement("canvas"),W=void 0!==a.context?a.context:null,O=1,ga=void 0!==a.precision?a.precision:"highp",ea=void 0!==a.alpha?a.alpha:!1,xa=void 0!==a.depth?a.depth:!0,H=void 0!==a.stencil?a.stencil:!0,$a=void 0!==a.antialias?a.antialias:!1,qa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ya=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer: +!1,X=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,ta=new THREE.Color(0),Za=0,pa=[],Fa={},Ga=[],Ta=[],za=[],tb=[],eb=[];this.domElement=Q;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps= +!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var I=this,Xa=[],Wb=null,uc=null,Hb=-1,Sa="",Ib=null,Mb=0,zb=-1,Xb=-1,Yb=-1,Zb=-1,ec=-1,fc=-1,gc=-1,hc=-1,rc=null,sc=null,tc=null,qc=null,hb=0,Ya=0,ib=Q.width,jb=Q.height,vc=0,wc=0,kb=new Uint8Array(16),Ma=new Uint8Array(16),ub=new THREE.Frustum,vb=new THREE.Matrix4;new THREE.Matrix4;var Da=new THREE.Vector3,ma=new THREE.Vector3,Ob=!0,nc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]}, +point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l;try{var xc={alpha:ea,depth:xa,stencil:H,antialias:$a,premultipliedAlpha:qa,preserveDrawingBuffer:ya};l=W||Q.getContext("webgl",xc)||Q.getContext("experimental-webgl",xc);if(null===l){if(null!==Q.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."; +}Q.addEventListener("webglcontextlost",function(a){a.preventDefault();yc();zc();Fa={}},!1)}catch(Fc){console.error(Fc)}void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var aa=new THREE.WebGLExtensions(l);aa.get("OES_texture_float");aa.get("OES_texture_float_linear");aa.get("OES_standard_derivatives");X&&aa.get("EXT_frag_depth");var zc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL); +l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(hb,Ya,ib,jb);l.clearColor(ta.r,ta.g,ta.b,Za)},yc=function(){Ib=Wb=null;Xb=zb=hc=gc=Yb=-1;Sa="";Hb=-1;Ob=!0;for(var a=0;ab;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}I.info.memory.textures--},mc=function(a){a=a.target;a.removeEventListener("dispose",mc);lc(a)},Bc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "), +c=0,d=b.length;cd.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&n.push([0,0]);for(var m=0,r=d.numSupportedMorphTargets;mg;g++){a.__webglFramebuffer[g]=l.createFramebuffer();a.__webglRenderbuffer[g]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,d,a.width,a.height,0,d,e,null);var f=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+g;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[g]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0, +h,f.__webglTexture,0);K(a.__webglRenderbuffer[g],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),U(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture, +0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):K(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a? +(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=ib,a=jb,d=hb,e=Ya);b!==uc&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),uc=b);vc=c;wc=a};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")}; +this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}; +THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format: +THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null}; +THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps; +a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube; +THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); +break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.log("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}}; +THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,n=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var t="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",r="ENVMAP_BLENDING_MULTIPLY"; +if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:r="ENVMAP_BLENDING_MULTIPLY"; +break;case THREE.MixOperation:r="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:r="ENVMAP_BLENDING_ADD"}}var u,v;u=[];for(var y in g)v=g[y],!1!==v&&(v="#define "+y+" "+v,u.push(v));u=u.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",u,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights, +"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+s:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR": +"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION": +"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"), +b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",u,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG": +"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+t:"",e.envMap?"#define "+s:"",e.envMap?"#define "+r:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED": +"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));n=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+n);p=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+p);f.attachShader(g,n);f.attachShader(g,p);void 0!==q&&f.bindAttribLocation(g, +0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(n);f.deleteShader(p);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" "); +e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var C in h)q.push(C);h=q;C={};q=0;for(b=h.length;qL;L++)A[L]=new THREE.Vector3,w[L]=new THREE.Vector3;A=D.shadowCascadeNearZ[K];D=D.shadowCascadeFarZ[K];w[0].set(-1,-1,A);w[1].set(1,-1,A);w[2].set(-1,1,A);w[3].set(1,1,A);w[4].set(-1,-1,D);w[5].set(1,-1,D);w[6].set(-1,1,D);w[7].set(1,1,D);M.originalCamera=v;w=new THREE.Gyroscope;w.position.copy(z.shadowCascadeOffset);w.add(M);w.add(M.target);v.add(w);z.shadowCascadeArray[E]=M;console.log("Created virtualLight",M)}K= +z;A=E;D=K.shadowCascadeArray[A];D.position.copy(K.position);D.target.position.copy(K.target.position);D.lookAt(D.target);D.shadowCameraVisible=K.shadowCameraVisible;D.shadowDarkness=K.shadowDarkness;D.shadowBias=K.shadowCascadeBias[A];w=K.shadowCascadeNearZ[A];K=K.shadowCascadeFarZ[A];D=D.pointsFrustum;D[0].z=w;D[1].z=w;D[2].z=w;D[3].z=w;D[4].z=K;D[5].z=K;D[6].z=K;D[7].z=K;U[G]=M;G++}else U[G]=z,G++;u=0;for(F=U.length;uK;K++)A=D[K],A.copy(w[K]),A.unproject(E),A.applyMatrix4(G.matrixWorldInverse),A.xt.x&&(t.x=A.x),A.yt.y&&(t.y=A.y),A.zt.z&&(t.z=A.z);G.left=m.x;G.right=t.x;G.top=t.y;G.bottom=m.y;G.updateProjectionMatrix()}G=z.shadowMap;w=z.shadowMatrix;E=z.shadowCamera;E.position.setFromMatrixPosition(z.matrixWorld);s.setFromMatrixPosition(z.target.matrixWorld);E.lookAt(s);E.updateMatrixWorld();E.matrixWorldInverse.getInverse(E.matrixWorld);z.cameraHelper&& +(z.cameraHelper.visible=z.shadowCameraVisible);z.shadowCameraVisible&&z.cameraHelper.update();w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);w.multiply(E.projectionMatrix);w.multiply(E.matrixWorldInverse);q.multiplyMatrices(E.projectionMatrix,E.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(G);a.clear();r.length=0;e(c,c,E);z=0;for(G=r.length;z 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); +x.compileShader(L);x.compileShader(N);x.attachShader(K,L);x.attachShader(K,N);x.linkProgram(K);G=K;v=x.getAttribLocation(G,"position");y=x.getAttribLocation(G,"uv");c=x.getUniformLocation(G,"uvOffset");d=x.getUniformLocation(G,"uvScale");e=x.getUniformLocation(G,"rotation");f=x.getUniformLocation(G,"scale");g=x.getUniformLocation(G,"color");h=x.getUniformLocation(G,"map");k=x.getUniformLocation(G,"opacity");n=x.getUniformLocation(G,"modelViewMatrix");p=x.getUniformLocation(G,"projectionMatrix");q= +x.getUniformLocation(G,"fogType");m=x.getUniformLocation(G,"fogDensity");t=x.getUniformLocation(G,"fogNear");s=x.getUniformLocation(G,"fogFar");r=x.getUniformLocation(G,"fogColor");u=x.getUniformLocation(G,"alphaTest");K=document.createElement("canvas");K.width=8;K.height=8;L=K.getContext("2d");L.fillStyle="white";L.fillRect(0,0,8,8);E=new THREE.Texture(K);E.needsUpdate=!0}x.useProgram(G);x.enableVertexAttribArray(v);x.enableVertexAttribArray(y);x.disable(x.CULL_FACE);x.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER, +F);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(y,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(p,!1,M.projectionMatrix.elements);x.activeTexture(x.TEXTURE0);x.uniform1i(h,0);L=K=0;(N=U.fog)?(x.uniform3f(r,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(x.uniform1f(t,N.near),x.uniform1f(s,N.far),x.uniform1i(q,1),L=K=1):N instanceof THREE.FogExp2&&(x.uniform1f(m,N.density),x.uniform1i(q,2),L=K=2)):(x.uniform1i(q,0),L=K=0);for(var N=0,T=b.length;N< +T;N++){var Q=b[N];Q._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}b.sort(C);for(var W=[],N=0,T=b.length;Nq-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>p-1?0:p-1,r=p+1>d-1?d-1:p+1,u=[],v=[0,0,h[4*(q*d+p)]/255*b];u.push([-1,0,h[4*(q*d+s)]/255*b]);u.push([-1,-1,h[4*(m*d+s)]/255*b]);u.push([0,-1,h[4*(m*d+p)]/255*b]);u.push([1,-1,h[4*(m*d+r)]/255*b]);u.push([1,0,h[4*(q*d+r)]/255*b]);u.push([1,1,h[4*(t*d+r)]/255*b]);u.push([0,1,h[4*(t*d+p)]/255* +b]);u.push([-1,1,h[4*(t*d+s)]/255*b]);m=[];s=u.length;for(t=0;te)return null;var f=[],g=[],h=[],k,n,p;if(0=q--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var m;a:{var t=m=void 0,s=void 0,r=void 0,u=void 0,v=void 0,y=void 0,C=void 0,x=void 0, +t=a[g[k]].x,s=a[g[k]].y,r=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,y=a[g[p]].y;if(1E-10>(r-t)*(y-s)-(u-s)*(v-t))m=!1;else{var F=void 0,z=void 0,G=void 0,E=void 0,w=void 0,D=void 0,A=void 0,U=void 0,M=void 0,K=void 0,M=U=A=x=C=void 0,F=v-r,z=y-u,G=t-v,E=s-y,w=r-t,D=u-s;for(m=0;mk)g=d+1;else if(0b&&(b=0);1=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; +THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb?b=h.x:h.xc?c=h.y:h.yd?d=h.z:h.zMath.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c}; +THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;cm&&(f=b[g],k=-k,h=b[e],m=-m),!(a.yh.y))if(a.y==f.y){if(a.x==f.x)return!0}else{e=m*(a.x-f.x)-k*(a.y-f.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==f.y&&(h.x<=a.x&&a.x<=f.x||f.x<=a.x&&a.x<= +h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;bE||E>G)return[];k=n*p-k*q;if(0>k||k>G)return[]}else{if(0d?[]:k==d?g?[]:[f]:a<=d?[f,h]: +[f,n]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1; +d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cK){console.log("Infinite Loop! Holes left:"+ +n.length+", Probably Hole outside Shape!");break}for(q=D;qh;h++)n=k[h].x+":"+k[h].y, +n=p[n],void 0!==n&&(k[h]=n);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a, +b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()}; +THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b}; +THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);return b.normalize()};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve; +THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; +THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.constructor=THREE.SplineCurve; +THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector2;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);return c};THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g}; +THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype);THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve;THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);a=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;b=new THREE.Vector2;b.x=this.aX+this.xRadius*Math.cos(a);b.y=this.aY+this.yRadius*Math.sin(a);return b}; +THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype);THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b}); +THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return b}); +THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return b}); +THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a);return c}); +THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time= +0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;cd;d++){for(var e=this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.timef.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}}; +THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;aa.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];r=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],t[0],s[0],r[0],e,c,m);d[1]=f(q[1],t[1],s[1],r[1],e,c,m);d[2]=f(q[2],t[2],s[2],r[2],e,c,m);return d},f=function(a,b,c,d,e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+ +(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;fq;q++){var m=this.keyTypes[q],t=n.prevKey[m],s=n.nextKey[m];if(0this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(m,f,1);s.timet.index;)t=s,s=this.getNextKeyWith(m,f,s.index+1);n.prevKey[m]=t;n.nextKey[m]=s}var r=(this.currentTime-t.time)/(s.time-t.time),u=t[m],v=s[m];0>r&&(r=0);1a&&(this.currentTime%=a);this.currentTime=Math.min(this.currentTime,a);a=0;for(var b=this.hierarchy.length;af.index;)f=g,g=e[f.index+1];d.prevKey= +f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorldNeedsUpdate=!0}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;cthis.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a);b!=this.currentFrame&&(this.mesh.morphTargetInfluences[this.lastFrame]=0,this.mesh.morphTargetInfluences[this.currentFrame]= +1,this.mesh.morphTargetInfluences[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);this.mesh.morphTargetInfluences[b]=this.currentTime%a/a;this.mesh.morphTargetInfluences[this.lastFrame]=1-this.mesh.morphTargetInfluences[b]}}}; +THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var u,v=h.widthSegments,y=h.heightSegments,C=e/2,x=f/2,F=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",y=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var z=v+1,G=y+1,E=e/v,w=f/y,D=new THREE.Vector3;D[u]=0=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10d?-1E-10>f&&(a=!0):Math.sign(e)== +Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(H=a.length;0<=--H;){c=H;d=H-1;0>d&&(d=a.length-1);for(var e=0,f=t+2*p,e=0;eMath.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y, +1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cc&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5, +a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,n=0,p=a.length;nt&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));n=0;for(p=this.vertices.length;nc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,a-b,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()}; +THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype);THREE.BoxHelper.prototype.constructor=THREE.BoxHelper; +THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y; +d[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrix=a.matrixWorld; +this.matrixAutoUpdate=!1};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper;THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)}; +THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200); +b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()}; +THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);THREE.CameraHelper.prototype.constructor=THREE.CameraHelper; +THREE.CameraHelper.prototype.update=function(){var a,b,c=new THREE.Vector3,d=new THREE.Camera,e=function(e,g,h,k){c.set(g,h,k).unproject(d);e=b[e];if(void 0!==e)for(g=0,h=e.length;gs;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?(e[r]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[r].face2=q}d=new Float32Array(6*p);f=0;for(r in e)if(g=e[r],void 0===g.face2|| +.9999>k[g.face1].normal.dot(k[g.face2].normal))p=n[g.vert1],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z,p=n[g.vert2],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3));THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper; +THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;cb;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere); +this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper;THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()}; +THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}(); +THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper; +THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}; +THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;cr;r++){d[0]=s[g[r]];d[1]=s[g[(r+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++)}d=new Float32Array(6*p);m=0;for(t=p;mr;r++)p= +k[q[2*m+r]],g=6*m+3*r,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;t=a.geometry.attributes.index.array;n=a.geometry.drawcalls;p=0;0===n.length&&(n=[{count:t.length,index:0,start:0}]);for(var q=new Uint32Array(2*t.length),s=0,v=n.length;sr;r++)d[0]= +g+t[m+r],d[1]=g+t[m+(r+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++);d=new Float32Array(6*p);m=0;for(t=p;mr;r++)g=6*m+3*r,p=3*q[2*m+r],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,d=new Float32Array(6*p),m=0,t=q;mr;r++)g=18*m+6*r,q=9*m+3*r,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],p=9*m+(r+1)%3*3,d[g+3]=k[p],d[g+4]=k[p+1],d[g+5]=k[p+2];h.addAttribute("position",new THREE.BufferAttribute(d, +3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject; +THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh; +THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)}; +THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b=/([a-z]+)_?(\d+)/,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;fh.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; +THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)}; +THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; +THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; +THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight; +f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; From 05219ac90b63654474de42842766196457b80bc9 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 11:10:06 -0500 Subject: [PATCH 038/190] Cleared out a bunch of useless code to make it easier to figure out what's going on. --- index.html | 2 +- js/datguicontrol.js | 5 -- js/main.js | 183 +++----------------------------------------- js/visualize.js | 7 -- 4 files changed, 11 insertions(+), 186 deletions(-) diff --git a/index.html b/index.html index 6a09ad9..9b34d5f 100755 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - +

Loading Data. Please wait...

diff --git a/js/datguicontrol.js b/js/datguicontrol.js index 65291a1..55786d5 100644 --- a/js/datguicontrol.js +++ b/js/datguicontrol.js @@ -6,8 +6,3 @@ var controllers = { spin: 0, transitionTime: 2000, }; - -function buildGUI(){ - var selection = new Selection(); - selectionData = selection; -} diff --git a/js/main.js b/js/main.js index 4f0ceaf..28cc32f 100644 --- a/js/main.js +++ b/js/main.js @@ -1,33 +1,19 @@ var masterContainer = document.getElementById('visualization'); - var overlay = document.getElementById('visualization'); - -var mapIndexedImage; -var mapOutlineImage; - -// where in html to hold all our things var glContainer = document.getElementById( 'glContainer' ); // contains a list of country codes with their matching country names var isoFile = 'country_iso3166.json'; var latlonFile = 'country_lat_lon.json'; -var camera, scene, renderer, controls; +var camera, scene, renderer, controls, + mapIndexedImage, mapOutlineImage, + pinsBase, pinsBaseMat, + lookupCanvas, lookupTexture, backTexture, worldCanvas, + sphere, rotating, visualizationMesh, + mapUniforms; -var pinsBase, pinsBaseMat; -var lookupCanvas; -var lookupTexture; -var backTexture; -var worldCanvas; -var sphere; -var rotating; -var visualizationMesh; - -var mapUniforms; - -// contains the data loaded from the arms data file -// contains a list of years, followed by trades within that year -// properties for each "trade" is: e - exporter, i - importer, v - value (USD), wc - weapons code (see table) +// contains our sample data, loaded from categories/All.json var sampleData; // contains latlon data for each country @@ -40,29 +26,13 @@ var countryData = {}; // contains a list of country code to country name for running lookups var countryLookup; -var selectableCountries = []; - var exportColor = 0xdd380c; var importColor = 0x154492; -// the currently selected country -var selectedCountry = null; -var previouslySelectedCountry = null; - -// contains info about what year, what countries, categories, etc that's being visualized -var selectionData; - -// when the app is idle this will be true -var idle = false; - -// for svg loading -// deprecated, not using svg loading anymore -var assetList = []; - // TODO // use underscore and ".after" to load these in order // don't look at me I'm ugly -function start( e ){ +$(function() { // detect for webgl and reject everything else if ( ! Detector.webgl ) { Detector.addGetWebGLMessage(); @@ -93,7 +63,7 @@ function start( e ){ }; }; } -} +}); var currIndexIntoData = 0; var nextIndexIntoData = 5; @@ -108,34 +78,6 @@ function startDataPump() { }, 2500 ); } -var Selection = function(){ - this.selectedCountry = 'UNITED STATES'; - // this.showExports = true; - // this.showImports = true; - // this.importExportFilter = 'both'; - - this.exportCategories = {}; - this.importCategories = {}; - - this.getExportCategories = function(){ - var list = []; - for( var i in this.exportCategories ){ - if( this.exportCategories[i] ) - list.push(i); - } - return list; - }; - - this.getImportCategories = function(){ - var list = []; - for( var i in this.importCategories ){ - if( this.importCategories[i] ) - list.push(i); - } - return list; - }; -}; - // ----------------------------------------------------------------------------- // All the initialization stuff for THREE function initScene() { @@ -227,25 +169,6 @@ function initScene() { sphere.id = "base"; rotating.add( sphere ); - for( var i in sampleData ){ - var set = sampleData[i]; - // if( set.v < 1000000 ) - // continue; - - var exporterName = set.e.toUpperCase(); - var importerName = set.i.toUpperCase(); - - // let's track a list of actual countries listed in this data set - // this is actually really slow... consider re-doing this with a map - if( $.inArray(exporterName, selectableCountries) < 0 ) - selectableCountries.push( exporterName ); - - if( $.inArray(importerName, selectableCountries) < 0 ) - selectableCountries.push( importerName ); - } - - // console.log( selectableCountries ); - // load geo data (country lat lons in this case) // console.time('loadGeoData'); loadGeoData( latlonData ); @@ -258,17 +181,9 @@ function initScene() { visualizationMesh = new THREE.Object3D(); rotating.add(visualizationMesh); - buildGUI(); - - // selectVisualization( sampleData ); - - // test for highlighting specific countries - // highlightCountry( ["United States", "Switzerland", "China"] ); - - // ----------------------------------------------------------------------------- // Setup our renderer - renderer = new THREE.WebGLRenderer({antialias:false}); + renderer = new THREE.WebGLRenderer({antialias:false, alpha: true}); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.autoClear = false; @@ -401,81 +316,3 @@ function render() { renderer.clear(); renderer.render( scene, camera ); } - -function findCode(countryName){ - countryName = countryName.toUpperCase(); - for( var i in countryLookup ){ - if( countryLookup[i] === countryName ) - return i; - } - return 'not found'; -} - -// ordered lookup list for country color index -// used for GLSL to find which country needs to be highlighted -var countryColorMap = {'PE':1, -'BF':2,'FR':3,'LY':4,'BY':5,'PK':6,'ID':7,'YE':8,'MG':9,'BO':10,'CI':11,'DZ':12,'CH':13,'CM':14,'MK':15,'BW':16,'UA':17, -'KE':18,'TW':19,'JO':20,'MX':21,'AE':22,'BZ':23,'BR':24,'SL':25,'ML':26,'CD':27,'IT':28,'SO':29,'AF':30,'BD':31,'DO':32,'GW':33, -'GH':34,'AT':35,'SE':36,'TR':37,'UG':38,'MZ':39,'JP':40,'NZ':41,'CU':42,'VE':43,'PT':44,'CO':45,'MR':46,'AO':47,'DE':48,'SD':49, -'TH':50,'AU':51,'PG':52,'IQ':53,'HR':54,'GL':55,'NE':56,'DK':57,'LV':58,'RO':59,'ZM':60,'IR':61,'MM':62,'ET':63,'GT':64,'SR':65, -'EH':66,'CZ':67,'TD':68,'AL':69,'FI':70,'SY':71,'KG':72,'SB':73,'OM':74,'PA':75,'AR':76,'GB':77,'CR':78,'PY':79,'GN':80,'IE':81, -'NG':82,'TN':83,'PL':84,'NA':85,'ZA':86,'EG':87,'TZ':88,'GE':89,'SA':90,'VN':91,'RU':92,'HT':93,'BA':94,'IN':95,'CN':96,'CA':97, -'SV':98,'GY':99,'BE':100,'GQ':101,'LS':102,'BG':103,'BI':104,'DJ':105,'AZ':106,'MY':107,'PH':108,'UY':109,'CG':110,'RS':111,'ME':112,'EE':113, -'RW':114,'AM':115,'SN':116,'TG':117,'ES':118,'GA':119,'HU':120,'MW':121,'TJ':122,'KH':123,'KR':124,'HN':125,'IS':126,'NI':127,'CL':128,'MA':129, -'LR':130,'NL':131,'CF':132,'SK':133,'LT':134,'ZW':135,'LK':136,'IL':137,'LA':138,'KP':139,'GR':140,'TM':141,'EC':142,'BJ':143,'SI':144,'NO':145, -'MD':146,'LB':147,'NP':148,'ER':149,'US':150,'KZ':151,'AQ':152,'SZ':153,'UZ':154,'MN':155,'BT':156,'NC':157,'FJ':158,'KW':159,'TL':160,'BS':161, -'VU':162,'FK':163,'GM':164,'QA':165,'JM':166,'CY':167,'PR':168,'PS':169,'BN':170,'TT':171,'CV':172,'PF':173,'WS':174,'LU':175,'KM':176,'MU':177, -'FO':178,'ST':179,'AN':180,'DM':181,'TO':182,'KI':183,'FM':184,'BH':185,'AD':186,'MP':187,'PW':188,'SC':189,'AG':190,'BB':191,'TC':192,'VC':193, -'LC':194,'YT':195,'VI':196,'GD':197,'MT':198,'MV':199,'KY':200,'KN':201,'MS':202,'BL':203,'NU':204,'PM':205,'CK':206,'WF':207,'AS':208,'MH':209, -'AW':210,'LI':211,'VG':212,'SH':213,'JE':214,'AI':215,'MF_1_':216,'GG':217,'SM':218,'BM':219,'TV':220,'NR':221,'GI':222,'PN':223,'MC':224,'VA':225, -'IM':226,'GU':227,'SG':228}; - -function highlightCountry( countries ){ - var countryCodes = []; - for( var i in countries ){ - var code = findCode(countries[i]); - countryCodes.push(code); - } - - var ctx = lookupCanvas.getContext('2d'); - ctx.clearRect(0,0,256,1); - - // color index 0 is the ocean, leave it something neutral - - // this fixes a bug where the fill for ocean was being applied during pick - // all non-countries were being pointed to 10 - bolivia - // the fact that it didn't select was because bolivia shows up as an invalid country due to country name mismatch - // ... - var pickMask = countries.length === 0 ? 0 : 1; - var oceanFill = 10 * pickMask; - ctx.fillStyle = 'rgb(' + oceanFill + ',' + oceanFill + ',' + oceanFill +')'; - ctx.fillRect( 0, 0, 1, 1 ); - - // for( var i = 0; i<255; i++ ){ - // var fillCSS = 'rgb(' + i + ',' + 0 + ',' + i + ')'; - // ctx.fillStyle = fillCSS; - // ctx.fillRect( i, 0, 1, 1 ); - // } - - // var selectedCountryCode = selectedCountry.countryCode; - // - // for( i in countryCodes ){ - // var countryCode = countryCodes[i]; - // var colorIndex = countryColorMap[ countryCode ]; - // - // var mapColor = countryData[countries[i]].mapColor; - // // var fillCSS = '#ff0000'; - // var fillCSS = '#333333'; - // if( countryCode === selectedCountryCode ) - // fillCSS = '#eeeeee'; - // // if( mapColor !== undefined ){ - // // var k = map( mapColor, 0, 200000000, 0, 255 ); - // // k = Math.floor( constrain( k, 0, 255 ) ); - // // fillCSS = 'rgb(' + k + ',' + k + ',' + k + ')'; - // // } - // ctx.fillStyle = fillCSS; - // ctx.fillRect( colorIndex, 0, 1, 1 ); - // } - - lookupTexture.needsUpdate = true; -} diff --git a/js/visualize.js b/js/visualize.js index 9f412f5..cf936a9 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -106,13 +106,6 @@ function getVisualizedMesh( linearData ){ // sizeAttenuation: true, }); - - - var particleGraphic = THREE.ImageUtils.loadTexture("images/map_mask.png"); - var particleMat = new THREE.PointCloudMaterial( { map: particleGraphic, color: 0xffffff, size: 60, - blending: THREE.NormalBlending, transparent:true, - depthWrite: false, vertexColors: true, - sizeAttenuation: true } ); particlesGeo.colors = particleColors; var pSystem = new THREE.PointCloud( particlesGeo, shaderMaterial ); pSystem.dynamic = true; From 52cedaaa003eba800510da7ec5e0c4ee6c09dcb3 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 11:20:10 -0500 Subject: [PATCH 039/190] More code cleanup --- js/main.js | 54 +++++++++--------------------------------------------- 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/js/main.js b/js/main.js index 28cc32f..ac76b90 100644 --- a/js/main.js +++ b/js/main.js @@ -143,22 +143,8 @@ function initScene() { // sizeAttenuation: true, }); - - // ----------------------------------------------------------------------------- - // Create the backing (sphere) - // var mapGraphic = new THREE.Texture(worldCanvas);//THREE.ImageUtils.loadTexture("images/map.png"); - // backTexture = mapGraphic; - // mapGraphic.needsUpdate = true; - backMat = new THREE.MeshBasicMaterial( - { - // color: 0xffffff, - // shininess: 10, -// specular: 0x333333, - // map: mapGraphic, - // lightMap: mapGraphic - } - ); - // backMat.ambient = new THREE.Color(255,255,255); + // ----------------------------------------------------------------------------- + // Create the backing (sphere) sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); // sphere.receiveShadow = true; // sphere.castShadow = true; @@ -175,7 +161,7 @@ function initScene() { // console.timeEnd('loadGeoData'); // console.time('buildDataVizGeometries'); - var vizilines = buildDataVizGeometries(sampleData); + buildDataVizGeometries(sampleData); // console.timeEnd('buildDataVizGeometries'); visualizationMesh = new THREE.Object3D(); @@ -214,9 +200,9 @@ function initScene() { document.addEventListener( 'keydown', onKeyDown, false); - // ----------------------------------------------------------------------------- - // Setup our camera - camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ); + // ----------------------------------------------------------------------------- + // Setup our camera + camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ); camera.position.z = 1400; camera.position.y = 0; camera.lookAt(scene.width/2, scene.height/2); @@ -231,29 +217,11 @@ function initScene() { function animate() { - // Disallow roll for now, this is interfering with keyboard input during search -/* - if(keyboard.pressed('o') && keyboard.pressed('shift') == false) - camera.rotation.z -= 0.08; - if(keyboard.pressed('p') && keyboard.pressed('shift') == false) - camera.rotation.z += 0.08; -*/ - if( rotateTargetX !== undefined && rotateTargetY !== undefined ){ rotateVX += (rotateTargetX - rotateX) * 0.012; rotateVY += (rotateTargetY - rotateY) * 0.012; - // var move = new THREE.Vector3( rotateVX, rotateVY, 0 ); - // var distance = move.length(); - // if( distance > .01 ) - // distance = .01; - // move.normalize(); - // move.multiplyScalar( distance ); - - // rotateVX = move.x; - // rotateVy = move.y; - if( Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1 ){ rotateTargetX = undefined; rotateTargetY = undefined; @@ -263,8 +231,6 @@ function animate() { rotateX += rotateVX; rotateY += rotateVY; - //rotateY = wrap( rotateY, -Math.PI, Math.PI ); - rotateVX *= 0.98; rotateVY *= 0.98; @@ -291,10 +257,9 @@ function animate() { rotating.rotation.x = rotateX; rotating.rotation.y = rotateY; - render(); - - requestAnimationFrame( animate ); + render(); + requestAnimationFrame( animate ); rotating.traverse( function(mesh) { @@ -309,10 +274,9 @@ function animate() { // var marker = markers[i]; // marker.update(); // } - } function render() { renderer.clear(); - renderer.render( scene, camera ); + renderer.render( scene, camera ); } From 5e76a1798dc820554c46a34c8148e75b4f903b60 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 11:36:00 -0500 Subject: [PATCH 040/190] More code cleanup. --- js/main.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/js/main.js b/js/main.js index ac76b90..1e77987 100644 --- a/js/main.js +++ b/js/main.js @@ -10,8 +10,7 @@ var camera, scene, renderer, controls, mapIndexedImage, mapOutlineImage, pinsBase, pinsBaseMat, lookupCanvas, lookupTexture, backTexture, worldCanvas, - sphere, rotating, visualizationMesh, - mapUniforms; + sphere, rotating, visualizationMesh; // contains our sample data, loaded from categories/All.json var sampleData; @@ -53,7 +52,7 @@ $(function() { function(){ initScene(); animate(); - startDataPump(); + //startDataPump(); } ); } @@ -83,10 +82,9 @@ function startDataPump() { function initScene() { // ----------------------------------------------------------------------------- - // Let's make a scene + // Let's make a scene scene = new THREE.Scene(); scene.matrixAutoUpdate = false; - // scene.fog = new THREE.FogExp2( 0xBBBBBB, 0.00003 ); scene.add( new THREE.AmbientLight( 0x505050 ) ); @@ -132,7 +130,6 @@ function initScene() { 'outline': { type: 't', value: 2, texture: outlinedMapTexture }, 'outlineLevel': {type: 'f', value: 1 }, }; - mapUniforms = uniforms; var shaderMaterial = new THREE.ShaderMaterial( { @@ -257,9 +254,9 @@ function animate() { rotating.rotation.x = rotateX; rotating.rotation.y = rotateY; - render(); - requestAnimationFrame( animate ); + // renderer.clear(); + renderer.render( scene, camera ); rotating.traverse( function(mesh) { @@ -275,8 +272,3 @@ function animate() { // marker.update(); // } } - -function render() { - renderer.clear(); - renderer.render( scene, camera ); -} From f641e9d7e84bf072814dbc1eba5616c873f0f145 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 11:58:24 -0500 Subject: [PATCH 041/190] Fixed some of the rendering issues. The shader material for the globe still needs work. --- js/main.js | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/js/main.js b/js/main.js index 1e77987..2b2efe6 100644 --- a/js/main.js +++ b/js/main.js @@ -132,19 +132,14 @@ function initScene() { }; var shaderMaterial = new THREE.ShaderMaterial( { - uniforms: uniforms, - // attributes: attributes, vertexShader: document.getElementById( 'globeVertexShader' ).textContent, - fragmentShader: document.getElementById( 'globeFragmentShader' ).textContent, - // sizeAttenuation: true, + fragmentShader: document.getElementById( 'globeFragmentShader' ).textContent }); // ----------------------------------------------------------------------------- // Create the backing (sphere) - sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); - // sphere.receiveShadow = true; - // sphere.castShadow = true; + sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), new THREE.MeshBasicMaterial({color: 0x00ff00}) ); sphere.doubleSided = false; sphere.rotation.x = Math.PI; sphere.rotation.y = -Math.PI/2; @@ -152,20 +147,14 @@ function initScene() { sphere.id = "base"; rotating.add( sphere ); - // load geo data (country lat lons in this case) - // console.time('loadGeoData'); loadGeoData( latlonData ); - // console.timeEnd('loadGeoData'); - - // console.time('buildDataVizGeometries'); buildDataVizGeometries(sampleData); - // console.timeEnd('buildDataVizGeometries'); visualizationMesh = new THREE.Object3D(); rotating.add(visualizationMesh); - // ----------------------------------------------------------------------------- - // Setup our renderer + // ----------------------------------------------------------------------------- + // Setup our renderer renderer = new THREE.WebGLRenderer({antialias:false, alpha: true}); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.autoClear = false; @@ -176,13 +165,11 @@ function initScene() { glContainer.appendChild( renderer.domElement ); - // ----------------------------------------------------------------------------- - // Event listeners + // ----------------------------------------------------------------------------- + // Event listeners document.addEventListener( 'mousemove', onDocumentMouseMove, true ); document.addEventListener( 'windowResize', onDocumentResize, false ); - //masterContainer.addEventListener( 'mousedown', onDocumentMouseDown, true ); - //masterContainer.addEventListener( 'mouseup', onDocumentMouseUp, false ); document.addEventListener( 'mousedown', onDocumentMouseDown, true ); document.addEventListener( 'mouseup', onDocumentMouseUp, false ); @@ -202,7 +189,6 @@ function initScene() { camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ); camera.position.z = 1400; camera.position.y = 0; - camera.lookAt(scene.width/2, scene.height/2); scene.add( camera ); var windowResize = THREEx.WindowResize(renderer, camera); From dc354ea303da30f0a69464d6b2446dafb2d9195c Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 12:06:12 -0500 Subject: [PATCH 042/190] Fixed issue with Globe's shader material. --- js/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/main.js b/js/main.js index 2b2efe6..8204a8f 100644 --- a/js/main.js +++ b/js/main.js @@ -125,9 +125,9 @@ function initScene() { // outlinedMapTexture.minFilter = THREE.NearestFilter; var uniforms = { - 'mapIndex': { type: 't', value: 0, texture: indexedMapTexture }, - 'lookup': { type: 't', value: 1, texture: lookupTexture }, - 'outline': { type: 't', value: 2, texture: outlinedMapTexture }, + 'mapIndex': { type: 't', value: indexedMapTexture }, + 'lookup': { type: 't', value: lookupTexture }, + 'outline': { type: 't', value: outlinedMapTexture }, 'outlineLevel': {type: 'f', value: 1 }, }; @@ -139,7 +139,7 @@ function initScene() { // ----------------------------------------------------------------------------- // Create the backing (sphere) - sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), new THREE.MeshBasicMaterial({color: 0x00ff00}) ); + sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); sphere.doubleSided = false; sphere.rotation.x = Math.PI; sphere.rotation.y = -Math.PI/2; From 538ef08910d9b53b60c22a8427f6a8140c20b9ee Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 12:10:31 -0500 Subject: [PATCH 043/190] Fixed particle issue --- js/main.js | 2 +- js/visualize.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 8204a8f..91ff0c7 100644 --- a/js/main.js +++ b/js/main.js @@ -52,7 +52,7 @@ $(function() { function(){ initScene(); animate(); - //startDataPump(); + startDataPump(); } ); } diff --git a/js/visualize.js b/js/visualize.js index cf936a9..c995155 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -89,7 +89,7 @@ function getVisualizedMesh( linearData ){ uniforms = { amplitude: { type: "f", value: 1.0 }, color: { type: "c", value: new THREE.Color( 0xffffff ) }, - texture: { type: "t", value: 0, texture: THREE.ImageUtils.loadTexture( "images/particleA.png" ) }, + texture: { type: "t", value: THREE.ImageUtils.loadTexture( "images/particleA.png" ) }, }; var shaderMaterial = new THREE.ShaderMaterial( { From 810c5dd835186d31363e086c540a990c6154c628 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 13:49:48 -0500 Subject: [PATCH 044/190] First checkin of mesh pooling code --- js/main.js | 3 - js/visualize.js | 196 ++++++++++++++++++++---------------------- js/visualize_lines.js | 7 -- 3 files changed, 93 insertions(+), 113 deletions(-) diff --git a/js/main.js b/js/main.js index 91ff0c7..3bf203b 100644 --- a/js/main.js +++ b/js/main.js @@ -25,9 +25,6 @@ var countryData = {}; // contains a list of country code to country name for running lookups var countryLookup; -var exportColor = 0xdd380c; -var importColor = 0x154492; - // TODO // use underscore and ".after" to load these in order // don't look at me I'm ugly diff --git a/js/visualize.js b/js/visualize.js index c995155..1f314f9 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -26,37 +26,35 @@ function buildDataVizGeometries( linearData ){ loadLayer.style.display = 'none'; } +var _meshPool = []; +var MESH_POOL_SIZE = 100; + +function _getMeshFromPool( callback ) { + if( _meshPool.length > 0 ) { + callback( _meshPool.pop() ); + } else { + window.setTimeout( _getMeshFromPool, 500, callback ); + } +} + +function _returnMeshToPool( mesh ) { + _meshPool.push( mesh ); +} + +/* + * TODO: This method should reuse a pool of meshes, rather than allocating new + * ones for every invocation. + */ function getVisualizedMesh( linearData ){ if( !linearData.lineGeometry ) { return null; } - var linesGeo = new THREE.Geometry(); - var lineColors = []; - - var particlesGeo = new THREE.Geometry(); - var particleColors = []; - - var lineColor = new THREE.Color(importColor);//thisLineIsExport ? new THREE.Color(exportColor) : new THREE.Color(importColor); - - var lastColor; - - // grab the colors from the vertices - for( var s in linearData.lineGeometry.vertices ){ - var v = linearData.lineGeometry.vertices[s]; - lineColors.push(lineColor); - lastColor = lineColor; - } + var meshObj = new ParticleMesh(); // merge it all together - linesGeo.merge( linearData.lineGeometry ); - - var particleColor = lastColor.clone(); + meshObj.linesGeo.merge( linearData.lineGeometry ); var points = linearData.lineGeometry.vertices; - var particleCount = 1; - particleCount = constrain(particleCount,1,100); - var particleSize = linearData.lineGeometry.size; - var point = points[0]; var particle = point.clone(); particle.moveIndex = 0; @@ -64,38 +62,70 @@ function getVisualizedMesh( linearData ){ particle.lerpN = 0; particle.isFinished = false; particle.path = points; - particlesGeo.vertices.push( particle ); - particle.size = particleSize; - particleColors.push( particleColor ); - - linesGeo.colors = lineColors; - - // make a final mesh out of this composite - var splineOutline = new THREE.Line( linesGeo, new THREE.LineBasicMaterial( - { color: 0xffffff, opacity: 0.0, blending: - THREE.AdditiveBlending, transparent:true, - depthWrite: false, vertexColors: false, - linewidth: 1 } ) - ); + particle.size = meshObj.particleSize; + meshObj.particlesGeo.vertices.push( particle ); - splineOutline.renderDepth = false; + return meshObj.splineOutline; +} +function selectVisualization( linearData ){ + // clear off the country's internally held color data we used from last highlight + for( var i in countryData ){ + var country = countryData[i]; + country.exportedAmount = 0; + country.importedAmount = 0; + country.mapColor = 0; + } - attributes = { - size: { type: 'f', value: [] }, - customColor: { type: 'c', value: [] } - }; + /* Removing markers for now until I decide how to use them */ + // clear markers + // for( var i in selectableCountries ){ + // removeMarkerFromCountry( selectableCountries[i] ); + // } - uniforms = { - amplitude: { type: "f", value: 1.0 }, - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - texture: { type: "t", value: THREE.ImageUtils.loadTexture( "images/particleA.png" ) }, - }; + // build the meshes. One for each entry in our data + for( i in linearData ) { + var mesh = getVisualizedMesh( linearData[i] ); + if( mesh !== null ) { + visualizationMesh.add( mesh ); + } + } - var shaderMaterial = new THREE.ShaderMaterial( { + /* Removing markers for now until I decide how to use them */ + // for( var i in mesh.affectedCountries ){ + // var countryName = mesh.affectedCountries[i]; + // var country = countryData[countryName]; + // attachMarkerToCountry( countryName, country.mapColor ); + // } +} - uniforms: uniforms, - attributes: attributes, +function ParticleMesh() { + this.linesGeo = new THREE.Geometry(); + this.particlesGeo = new THREE.Geometry(); + this.particleColor = new THREE.Color( 0x154492 ); + this.particleSize = 50; + + this.lineMat = new THREE.LineBasicMaterial({ + color: 0xffffff, + opacity: 0.0, + blending: THREE.AdditiveBlending, + transparent: true, + depthWrite: false, + vertexColors: false, + linewidth: 1 + }); + this.splineOutline = new THREE.Line( null, this.lineMat ); + + this.shaderMaterial = new THREE.ShaderMaterial({ + uniforms: { + amplitude: { type: "f", value: 1.0 }, + color: { type: "c", value: new THREE.Color( 0xffffff ) }, + texture: { type: "t", value: THREE.ImageUtils.loadTexture( "images/particleA.png" ) }, + }, + attributes: { + size: { type: 'f', value: [ this.particleSize ] }, + customColor: { type: 'c', value: [ this.particleColor ] } + }, vertexShader: document.getElementById( 'vertexshader' ).textContent, fragmentShader: document.getElementById( 'fragmentshader' ).textContent, @@ -103,25 +133,15 @@ function getVisualizedMesh( linearData ){ depthTest: true, depthWrite: false, transparent: true, - // sizeAttenuation: true, }); - - particlesGeo.colors = particleColors; - var pSystem = new THREE.PointCloud( particlesGeo, shaderMaterial ); - pSystem.dynamic = true; - splineOutline.add( pSystem ); - - var vertices = pSystem.geometry.vertices; - var values_size = attributes.size.value; - var values_color = attributes.customColor.value; - - for( var x = 0; x < vertices.length; x++ ) { - values_size[ x ] = pSystem.geometry.vertices[x].size; - values_color[ x ] = particleColors[x]; - } - - pSystem.update = function(){ - // var time = Date.now() + this.pSystem = new THREE.PointCloud( null, this.shaderMaterial ); + + this.splineOutline.renderDepth = false; + this.pSystem.dynamic = true; + this.splineOutline.add( this.pSystem ); + this.splineOutline.geometry = this.linesGeo; + this.pSystem.geometry = this.particlesGeo; + this.pSystem.update = function(){ var finishedCtr = 0; for( var i in this.geometry.vertices ){ var particle = this.geometry.vertices[i]; @@ -146,7 +166,12 @@ function getVisualizedMesh( linearData ){ particle.isFinished = true; // Need to clean up after ourselves so we don't leak memory. Note that // scene is a global variable leaked into this scope from main.js - scene.remove( splineOutline ); + // See http://stackoverflow.com/questions/12945092/memory-leak-with-three-js-and-many-shapes?rq=1 + // for details + // scene.remove( splineOutline ); + //splineOutline.dispose(); + // particlesGeo.dispose(); + //shaderMaterial.dispose(); } } @@ -154,7 +179,6 @@ function getVisualizedMesh( linearData ){ var currentPoint = path[particle.moveIndex]; var nextPoint = path[particle.nextIndex]; - particle.copy( currentPoint ); particle.lerp( nextPoint, particle.lerpN ); } @@ -165,38 +189,4 @@ function getVisualizedMesh( linearData ){ this.geometry.verticesNeedUpdate = true; } }; - - return splineOutline; -} - -function selectVisualization( linearData ){ - // clear off the country's internally held color data we used from last highlight - for( var i in countryData ){ - var country = countryData[i]; - country.exportedAmount = 0; - country.importedAmount = 0; - country.mapColor = 0; - } - - /* Removing markers for now until I decide how to use them */ - // clear markers - // for( var i in selectableCountries ){ - // removeMarkerFromCountry( selectableCountries[i] ); - // } - - // build the meshes. One for each entry in our data - // TODO: ensure this isn't a horrible memory sinkhole - for( i in linearData ) { - var mesh = getVisualizedMesh( linearData[i] ); - if( mesh !== null ) { - visualizationMesh.add( mesh ); - } - } - - /* Removing markers for now until I decide how to use them */ - // for( var i in mesh.affectedCountries ){ - // var countryName = mesh.affectedCountries[i]; - // var country = countryData[countryName]; - // attachMarkerToCountry( countryName, country.mapColor ); - // } } diff --git a/js/visualize_lines.js b/js/visualize_lines.js index 74240f4..154e962 100644 --- a/js/visualize_lines.js +++ b/js/visualize_lines.js @@ -69,16 +69,9 @@ function makeConnectionLineGeometry( exporter, importer, value, type ){ // we need this for drawing multiple arcs, but piled into one geometry buffer points.push( vec3_origin ); - var val = value * 0.0003; - - var size = (10 + Math.sqrt(val)); - size = constrain(size,0.1, 60); - // create a line geometry out of these var curveGeometry = THREE.Curve.Utils.createLineGeometry( points ); - curveGeometry.size = size; - return curveGeometry; } From 18d6d5a211ef86b465e28c1085ef9a11016b6ba7 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 14:06:06 -0500 Subject: [PATCH 045/190] Next commit of mesh pooling code --- js/main.js | 3 ++- js/visualize.js | 68 ++++++++++++++++++++++++++----------------------- 2 files changed, 38 insertions(+), 33 deletions(-) diff --git a/js/main.js b/js/main.js index 3bf203b..bb2f1d2 100644 --- a/js/main.js +++ b/js/main.js @@ -48,6 +48,7 @@ $(function() { loadContentData( function(){ initScene(); + initMeshPool( 100 ); // defined in visualize.js animate(); startDataPump(); } @@ -71,7 +72,7 @@ function startDataPump() { } selectVisualization( sampleData.slice( currIndexIntoData, endIndex ) ); currIndexIntoData = (currIndexIntoData + 5) % sampleData.length; - }, 2500 ); + }, 500 ); } // ----------------------------------------------------------------------------- diff --git a/js/visualize.js b/js/visualize.js index 1f314f9..cde344b 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -27,7 +27,11 @@ function buildDataVizGeometries( linearData ){ } var _meshPool = []; -var MESH_POOL_SIZE = 100; +function initMeshPool( poolSize ) { + for( var i = 0; i < poolSize; i++ ) { + _meshPool.push( new ParticleMesh() ); + } +} function _getMeshFromPool( callback ) { if( _meshPool.length > 0 ) { @@ -38,34 +42,34 @@ function _getMeshFromPool( callback ) { } function _returnMeshToPool( mesh ) { + // clean up the two geometries + mesh.linesGeo.vertices = []; + mesh.particlesGeo.vertices = []; + _meshPool.push( mesh ); } -/* - * TODO: This method should reuse a pool of meshes, rather than allocating new - * ones for every invocation. - */ -function getVisualizedMesh( linearData ){ +function getVisualizedMesh( linearData, callback ){ if( !linearData.lineGeometry ) { return null; } - var meshObj = new ParticleMesh(); - - // merge it all together - meshObj.linesGeo.merge( linearData.lineGeometry ); - var points = linearData.lineGeometry.vertices; - var point = points[0]; - var particle = point.clone(); - particle.moveIndex = 0; - particle.nextIndex = 1; - particle.lerpN = 0; - particle.isFinished = false; - particle.path = points; - particle.size = meshObj.particleSize; - meshObj.particlesGeo.vertices.push( particle ); - - return meshObj.splineOutline; + _getMeshFromPool( function( meshObj ) { + // merge it all together + meshObj.linesGeo.merge( linearData.lineGeometry ); + var points = linearData.lineGeometry.vertices; + var point = points[0]; + var particle = point.clone(); + particle.moveIndex = 0; + particle.nextIndex = 1; + particle.lerpN = 0; + particle.isFinished = false; + particle.path = points; + particle.size = meshObj.particleSize; + meshObj.particlesGeo.vertices.push( particle ); + + return callback( meshObj.splineOutline ); + }); } function selectVisualization( linearData ){ @@ -85,10 +89,7 @@ function selectVisualization( linearData ){ // build the meshes. One for each entry in our data for( i in linearData ) { - var mesh = getVisualizedMesh( linearData[i] ); - if( mesh !== null ) { - visualizationMesh.add( mesh ); - } + getVisualizedMesh( linearData[i], _addMeshToViz ); } /* Removing markers for now until I decide how to use them */ @@ -99,6 +100,12 @@ function selectVisualization( linearData ){ // } } +function _addMeshToViz( mesh ) { + if( mesh !== null ) { + visualizationMesh.add( mesh ); + } +} + function ParticleMesh() { this.linesGeo = new THREE.Geometry(); this.particlesGeo = new THREE.Geometry(); @@ -166,12 +173,9 @@ function ParticleMesh() { particle.isFinished = true; // Need to clean up after ourselves so we don't leak memory. Note that // scene is a global variable leaked into this scope from main.js - // See http://stackoverflow.com/questions/12945092/memory-leak-with-three-js-and-many-shapes?rq=1 - // for details - // scene.remove( splineOutline ); - //splineOutline.dispose(); - // particlesGeo.dispose(); - //shaderMaterial.dispose(); + scene.remove( splineOutline ); + + // TODO: figure out scope so we can re-add to the pool } } From 91a17e0e56318e5a1367d15b5ddef9993750dc38 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 18 Feb 2015 14:42:44 -0500 Subject: [PATCH 046/190] Finished mesh pooling code. This also appears to fix the memory leak, as anticipated. --- README.md | 2 +- js/visualize.js | 83 ++++++++++++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 7d1749f..f62558b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This fork attempts to make the globe data-agnostic so that users can simply prov ## TODOs -* Get rid of the memory leak caused by adding new visualized meshes constantly without ever deleting them +* ~~Get rid of the memory leak caused by adding new visualized meshes constantly without ever deleting them~~ * Highlight the destination country when the particle "hits" it * Allow particle colour to be set via the data * Clean up sample data to remove unneeded fields diff --git a/js/visualize.js b/js/visualize.js index cde344b..bb5a49a 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -45,6 +45,11 @@ function _returnMeshToPool( mesh ) { // clean up the two geometries mesh.linesGeo.vertices = []; mesh.particlesGeo.vertices = []; + mesh.pSystem.systemComplete = false; + + // have to remove from the scene or else bad things happen. 'scene' is leaked + // into this scope from main.js + scene.remove( mesh.splineOutline ); _meshPool.push( mesh ); } @@ -63,7 +68,6 @@ function getVisualizedMesh( linearData, callback ){ particle.moveIndex = 0; particle.nextIndex = 1; particle.lerpN = 0; - particle.isFinished = false; particle.path = points; particle.size = meshObj.particleSize; meshObj.particlesGeo.vertices.push( particle ); @@ -145,52 +149,53 @@ function ParticleMesh() { this.splineOutline.renderDepth = false; this.pSystem.dynamic = true; + this.pSystem.systemComplete = false; // So we can know when to re-pool this mesh this.splineOutline.add( this.pSystem ); this.splineOutline.geometry = this.linesGeo; this.pSystem.geometry = this.particlesGeo; - this.pSystem.update = function(){ - var finishedCtr = 0; - for( var i in this.geometry.vertices ){ - var particle = this.geometry.vertices[i]; - - // no point doing all the calculations if the particle is already done - if( particle.isFinished ) { - finishedCtr++; - continue; - } - var path = particle.path; - var moveLength = path.length; - - particle.lerpN += 0.15; - if(particle.lerpN > 1){ - particle.lerpN = 0; - particle.moveIndex = particle.nextIndex; - particle.nextIndex++; - if( particle.nextIndex >= path.length ){ - particle.moveIndex = 0; - particle.nextIndex = 0; - particle.isFinished = true; - // Need to clean up after ourselves so we don't leak memory. Note that - // scene is a global variable leaked into this scope from main.js - scene.remove( splineOutline ); - - // TODO: figure out scope so we can re-add to the pool - } - } + this.pSystem.addEventListener( 'ParticleSystemComplete', _returnMeshToPool.bind( this, this ) ); - if( !particle.isFinished ) { - var currentPoint = path[particle.moveIndex]; - var nextPoint = path[particle.nextIndex]; + /* + This update method is what actually gets our points moving across the scene. + Once the point has finished its path, this method will emit a "ParticleSystemComplete" + event, to allow us to re-pool the mesh. + */ + this.pSystem.update = function(){ + /* + Simplified this as our particle geometry will only ever have one point + */ + var particle = this.geometry.vertices[0]; + + // no point doing all the calculations if the particle is already done + if( this.systemComplete || !particle ) { + return; + } - particle.copy( currentPoint ); - particle.lerp( nextPoint, particle.lerpN ); + var path = particle.path; + var moveLength = path.length; + + particle.lerpN += 0.15; + if(particle.lerpN > 1){ + particle.lerpN = 0; + particle.moveIndex = particle.nextIndex; + particle.nextIndex++; + if( particle.nextIndex >= path.length ){ + particle.moveIndex = 0; + particle.nextIndex = 0; + + this.systemComplete = true; + this.dispatchEvent( { type: 'ParticleSystemComplete' } ); + return; } } - // only mark the vertices as dirty if something actually changed - if( finishedCtr !== this.geometry.vertices.length ) { - this.geometry.verticesNeedUpdate = true; - } + var currentPoint = path[particle.moveIndex]; + var nextPoint = path[particle.nextIndex]; + + particle.copy( currentPoint ); + particle.lerp( nextPoint, particle.lerpN ); + + this.geometry.verticesNeedUpdate = true; }; } From eded3e859007ca54f9455090357fce4030bb30d7 Mon Sep 17 00:00:00 2001 From: dpetker Date: Thu, 19 Feb 2015 09:19:17 -0500 Subject: [PATCH 047/190] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index f62558b..2d35b58 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ This fork attempts to make the globe data-agnostic so that users can simply prov * Highlight the destination country when the particle "hits" it * Allow particle colour to be set via the data * Clean up sample data to remove unneeded fields +* Allow source/destination data to be specified as lat/long, rather than country names ## Notes From e8e56384e8b712d5df495bd56c243847ad5d3132 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 19 Feb 2015 14:56:49 -0500 Subject: [PATCH 048/190] Cleaned up the sample data --- README.md | 2 +- categories/All.json | 174 ++++++++++++++++++++++---------------------- js/visualize.js | 4 +- 3 files changed, 90 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index 2d35b58..378aec6 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This fork attempts to make the globe data-agnostic so that users can simply prov * ~~Get rid of the memory leak caused by adding new visualized meshes constantly without ever deleting them~~ * Highlight the destination country when the particle "hits" it * Allow particle colour to be set via the data -* Clean up sample data to remove unneeded fields +* ~~Clean up sample data to remove unneeded fields~~ * Allow source/destination data to be specified as lat/long, rather than country names ## Notes diff --git a/categories/All.json b/categories/All.json index 70401c2..5b6e2ec 100644 --- a/categories/All.json +++ b/categories/All.json @@ -1,89 +1,89 @@ [ - {"i": "United States", "wc": "mil", "e": "Australia", "v": 58142}, - {"i": "United States", "wc": "mil", "e": "Austria", "v": 87748}, - {"i": "United States", "wc": "mil", "e": "Belgium", "v": 348696}, - {"i": "United States", "wc": "mil", "e": "Brazil", "v": 3135}, - {"i": "United States", "wc": "mil", "e": "Canada", "v": 27565}, - {"i": "United States", "wc": "mil", "e": "Czechoslovakia", "v": 50787}, - {"i": "United States", "wc": "mil", "e": "Finland", "v": 120275}, - {"i": "United States", "wc": "mil", "e": "France", "v": 125171}, - {"i": "United States", "wc": "mil", "e": "Germany", "v": 2209537}, - {"i": "United States", "wc": "mil", "e": "India", "v": 10370}, - {"i": "United States", "wc": "mil", "e": "Israel", "v": 177888}, - {"i": "United States", "wc": "mil", "e": "Italy", "v": 174563}, - {"i": "United States", "wc": "mil", "e": "Mexico", "v": 320155}, - {"i": "United States", "wc": "mil", "e": "Netherlands", "v": 1884}, - {"i": "United States", "wc": "mil", "e": "Portugal", "v": 71950}, - {"i": "United States", "wc": "mil", "e": "Russian Federation", "v": 139169}, - {"i": "United States", "wc": "mil", "e": "Saudi Arabia", "v": 3504}, - {"i": "United States", "wc": "mil", "e": "Spain", "v": 700791}, - {"i": "United States", "wc": "mil", "e": "Sweden", "v": 479204}, - {"i": "United States", "wc": "mil", "e": "Switzerland", "v": 36724}, - {"i": "United States", "wc": "mil", "e": "United Kingdom", "v": 4429632}, - {"i": "Algeria", "wc": "mil", "e": "United States", "v": 444581}, - {"i": "Argentina", "wc": "mil", "e": "United States", "v": 9044}, - {"i": "Australia", "wc": "mil", "e": "United States", "v": 2416543}, - {"i": "Austria", "wc": "mil", "e": "United States", "v": 1514415}, - {"i": "Bahrain", "wc": "mil", "e": "United States", "v": 25676412}, - {"i": "Belgium", "wc": "mil", "e": "United States", "v": 2291374}, - {"i": "Belize", "wc": "mil", "e": "United States", "v": 4313}, - {"i": "Bolivia, Plurinational State of", "wc": "mil", "e": "United States", "v": 432198}, - {"i": "Brazil", "wc": "mil", "e": "United States", "v": 156516}, - {"i": "Canada", "wc": "mil", "e": "United States", "v": 15248301}, - {"i": "Chile", "wc": "mil", "e": "United States", "v": 2964}, - {"i": "Colombia", "wc": "mil", "e": "United States", "v": 2725781}, - {"i": "Costa Rica", "wc": "mil", "e": "United States", "v": 32162}, - {"i": "Denmark", "wc": "mil", "e": "United States", "v": 386729}, - {"i": "Ecuador", "wc": "mil", "e": "United States", "v": 441105}, - {"i": "Egypt", "wc": "mil", "e": "United States", "v": 3853577}, - {"i": "El Salvador", "wc": "mil", "e": "United States", "v": 124401}, - {"i": "Fiji", "wc": "mil", "e": "United States", "v": 5899}, - {"i": "Finland", "wc": "mil", "e": "United States", "v": 8194}, - {"i": "France", "wc": "mil", "e": "United States", "v": 1157855}, - {"i": "Germany", "wc": "mil", "e": "United States", "v": 15147397}, - {"i": "Greece", "wc": "mil", "e": "United States", "v": 897593}, - {"i": "Guatemala", "wc": "mil", "e": "United States", "v": 140824}, - {"i": "Guyana", "wc": "mil", "e": "United States", "v": 1201}, - {"i": "Honduras", "wc": "mil", "e": "United States", "v": 334583}, - {"i": "Hong Kong", "wc": "mil", "e": "United States", "v": 12694}, - {"i": "Indonesia", "wc": "mil", "e": "United States", "v": 667530}, - {"i": "Ireland", "wc": "mil", "e": "United States", "v": 8909}, - {"i": "Israel", "wc": "mil", "e": "United States", "v": 771482}, - {"i": "Italy", "wc": "mil", "e": "United States", "v": 2417863}, - {"i": "Japan", "wc": "mil", "e": "United States", "v": 26125881}, - {"i": "Jordan", "wc": "mil", "e": "United States", "v": 829939}, - {"i": "Kenya", "wc": "mil", "e": "United States", "v": 4783}, - {"i": "Korea, Republic of", "wc": "mil", "e": "United States", "v": 6560716}, - {"i": "Kuwait", "wc": "mil", "e": "United States", "v": 11046619}, - {"i": "Malaysia", "wc": "mil", "e": "United States", "v": 113181}, - {"i": "Mexico", "wc": "mil", "e": "United States", "v": 988000}, - {"i": "Morocco", "wc": "mil", "e": "United States", "v": 6651007}, - {"i": "Nepal", "wc": "mil", "e": "United States", "v": 13250}, - {"i": "Netherlands", "wc": "mil", "e": "United States", "v": 546528}, - {"i": "New Zealand", "wc": "mil", "e": "United States", "v": 55723}, - {"i": "Nicaragua", "wc": "mil", "e": "United States", "v": 62703}, - {"i": "Norway", "wc": "mil", "e": "United States", "v": 2539583}, - {"i": "Oman", "wc": "mil", "e": "United States", "v": 128110}, - {"i": "Pakistan", "wc": "mil", "e": "United States", "v": 96908}, - {"i": "Panama", "wc": "mil", "e": "United States", "v": 9649}, - {"i": "Paraguay", "wc": "mil", "e": "United States", "v": 26220}, - {"i": "Peru", "wc": "mil", "e": "United States", "v": 130220}, - {"i": "Philippines", "wc": "mil", "e": "United States", "v": 769844}, - {"i": "Portugal", "wc": "mil", "e": "United States", "v": 256854}, - {"i": "Qatar", "wc": "mil", "e": "United States", "v": 16229}, - {"i": "Saudi Arabia", "wc": "mil", "e": "United States", "v": 10593891}, - {"i": "Senegal", "wc": "mil", "e": "United States", "v": 959316}, - {"i": "Singapore", "wc": "mil", "e": "United States", "v": 915991}, - {"i": "South Africa", "wc": "mil", "e": "United States", "v": 27089}, - {"i": "Spain", "wc": "mil", "e": "United States", "v": 20415150}, - {"i": "Sweden", "wc": "mil", "e": "United States", "v": 261801}, - {"i": "Switzerland", "wc": "mil", "e": "United States", "v": 90598}, - {"i": "Taiwan", "wc": "mil", "e": "United States", "v": 8478001}, - {"i": "Thailand", "wc": "mil", "e": "United States", "v": 5905490}, - {"i": "Tunisia", "wc": "mil", "e": "United States", "v": 88479}, - {"i": "Turkey", "wc": "mil", "e": "United States", "v": 5052760}, - {"i": "United Arab Emirates", "wc": "mil", "e": "United States", "v": 2189219}, - {"i": "United Kingdom", "wc": "mil", "e": "United States", "v": 16556826}, - {"i": "Venezuela, Bolivarian Republic of", "wc": "mil", "e": "United States", "v": 631000}, - {"i": "United States", "wc": "civ", "e": "Argentina", "v": 1718906} + {"src": "United States", "dest": "Australia"}, + {"src": "United States", "dest": "Austria"}, + {"src": "United States", "dest": "Belgium"}, + {"src": "United States", "dest": "Brazil"}, + {"src": "United States", "dest": "Canada"}, + {"src": "United States", "dest": "Czechoslovakia"}, + {"src": "United States", "dest": "Finland"}, + {"src": "United States", "dest": "France"}, + {"src": "United States", "dest": "Germany"}, + {"src": "United States", "dest": "India"}, + {"src": "United States", "dest": "Israel"}, + {"src": "United States", "dest": "Italy"}, + {"src": "United States", "dest": "Mexico"}, + {"src": "United States", "dest": "Netherlands"}, + {"src": "United States", "dest": "Portugal"}, + {"src": "United States", "dest": "Russian Federation"}, + {"src": "United States", "dest": "Saudi Arabia"}, + {"src": "United States", "dest": "Spain"}, + {"src": "United States", "dest": "Sweden"}, + {"src": "United States", "dest": "Switzerland"}, + {"src": "United States", "dest": "United Kingdom"}, + {"src": "Algeria", "dest": "United States"}, + {"src": "Argentina", "dest": "United States"}, + {"src": "Australia", "dest": "United States"}, + {"src": "Austria", "dest": "United States"}, + {"src": "Bahrain", "dest": "United States"}, + {"src": "Belgium", "dest": "United States"}, + {"src": "Belize", "dest": "United States"}, + {"src": "Bolivia, Plurinational State of", "dest": "United States"}, + {"src": "Brazil", "dest": "United States"}, + {"src": "Canada", "dest": "United States"}, + {"src": "Chile", "dest": "United States"}, + {"src": "Colombia", "dest": "United States"}, + {"src": "Costa Rica", "dest": "United States"}, + {"src": "Denmark", "dest": "United States"}, + {"src": "Ecuador", "dest": "United States"}, + {"src": "Egypt", "dest": "United States"}, + {"src": "El Salvador", "dest": "United States"}, + {"src": "Fiji", "dest": "United States"}, + {"src": "Finland", "dest": "United States"}, + {"src": "France", "dest": "United States"}, + {"src": "Germany", "dest": "United States"}, + {"src": "Greece", "dest": "United States"}, + {"src": "Guatemala", "dest": "United States"}, + {"src": "Guyana", "dest": "United States"}, + {"src": "Honduras", "dest": "United States"}, + {"src": "Hong Kong", "dest": "United States"}, + {"src": "Indonesia", "dest": "United States"}, + {"src": "Ireland", "dest": "United States"}, + {"src": "Israel", "dest": "United States"}, + {"src": "Italy", "dest": "United States"}, + {"src": "Japan", "dest": "United States"}, + {"src": "Jordan", "dest": "United States"}, + {"src": "Kenya", "dest": "United States"}, + {"src": "Korea, Republic of", "dest": "United States"}, + {"src": "Kuwait", "dest": "United States"}, + {"src": "Malaysia", "dest": "United States"}, + {"src": "Mexico", "dest": "United States"}, + {"src": "Morocco", "dest": "United States"}, + {"src": "Nepal", "dest": "United States"}, + {"src": "Netherlands", "dest": "United States"}, + {"src": "New Zealand", "dest": "United States"}, + {"src": "Nicaragua", "dest": "United States"}, + {"src": "Norway", "dest": "United States"}, + {"src": "Oman", "dest": "United States"}, + {"src": "Pakistan", "dest": "United States"}, + {"src": "Panama", "dest": "United States"}, + {"src": "Paraguay", "dest": "United States"}, + {"src": "Peru", "dest": "United States"}, + {"src": "Philippines", "dest": "United States"}, + {"src": "Portugal", "dest": "United States"}, + {"src": "Qatar", "dest": "United States"}, + {"src": "Saudi Arabia", "dest": "United States"}, + {"src": "Senegal", "dest": "United States"}, + {"src": "Singapore", "dest": "United States"}, + {"src": "South Africa", "dest": "United States"}, + {"src": "Spain", "dest": "United States"}, + {"src": "Sweden", "dest": "United States"}, + {"src": "Switzerland", "dest": "United States"}, + {"src": "Taiwan", "dest": "United States"}, + {"src": "Thailand", "dest": "United States"}, + {"src": "Tunisia", "dest": "United States"}, + {"src": "Turkey", "dest": "United States"}, + {"src": "United Arab Emirates", "dest": "United States"}, + {"src": "United Kingdom", "dest": "United States"}, + {"src": "Venezuela, Bolivarian Republic of", "dest": "United States"}, + {"src": "United States", "dest": "Argentina"} ] diff --git a/js/visualize.js b/js/visualize.js index bb5a49a..e97fd7f 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -6,8 +6,8 @@ function buildDataVizGeometries( linearData ){ for( var i in linearData ){ var set = linearData[i]; - var exporterName = set.e.toUpperCase(); - var importerName = set.i.toUpperCase(); + var exporterName = set.src.toUpperCase(); + var importerName = set.dest.toUpperCase(); exporter = countryData[exporterName]; importer = countryData[importerName]; From f02ef9750b1f8c60ebe00123c33902643551523c Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 19 Feb 2015 15:18:09 -0500 Subject: [PATCH 049/190] Colours can now be set by the sample data. --- README.md | 2 +- categories/All.json | 174 ++++++++++++++++++++++---------------------- js/main.js | 11 +++ js/visualize.js | 15 +++- 4 files changed, 113 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 378aec6..c9f5aa2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This fork attempts to make the globe data-agnostic so that users can simply prov * ~~Get rid of the memory leak caused by adding new visualized meshes constantly without ever deleting them~~ * Highlight the destination country when the particle "hits" it -* Allow particle colour to be set via the data +* ~~Allow particle colour to be set via the data~~ * ~~Clean up sample data to remove unneeded fields~~ * Allow source/destination data to be specified as lat/long, rather than country names diff --git a/categories/All.json b/categories/All.json index 5b6e2ec..5026297 100644 --- a/categories/All.json +++ b/categories/All.json @@ -1,89 +1,89 @@ [ - {"src": "United States", "dest": "Australia"}, - {"src": "United States", "dest": "Austria"}, - {"src": "United States", "dest": "Belgium"}, - {"src": "United States", "dest": "Brazil"}, - {"src": "United States", "dest": "Canada"}, - {"src": "United States", "dest": "Czechoslovakia"}, - {"src": "United States", "dest": "Finland"}, - {"src": "United States", "dest": "France"}, - {"src": "United States", "dest": "Germany"}, - {"src": "United States", "dest": "India"}, - {"src": "United States", "dest": "Israel"}, - {"src": "United States", "dest": "Italy"}, - {"src": "United States", "dest": "Mexico"}, - {"src": "United States", "dest": "Netherlands"}, - {"src": "United States", "dest": "Portugal"}, - {"src": "United States", "dest": "Russian Federation"}, - {"src": "United States", "dest": "Saudi Arabia"}, - {"src": "United States", "dest": "Spain"}, - {"src": "United States", "dest": "Sweden"}, - {"src": "United States", "dest": "Switzerland"}, - {"src": "United States", "dest": "United Kingdom"}, - {"src": "Algeria", "dest": "United States"}, - {"src": "Argentina", "dest": "United States"}, - {"src": "Australia", "dest": "United States"}, - {"src": "Austria", "dest": "United States"}, - {"src": "Bahrain", "dest": "United States"}, - {"src": "Belgium", "dest": "United States"}, - {"src": "Belize", "dest": "United States"}, - {"src": "Bolivia, Plurinational State of", "dest": "United States"}, - {"src": "Brazil", "dest": "United States"}, - {"src": "Canada", "dest": "United States"}, - {"src": "Chile", "dest": "United States"}, - {"src": "Colombia", "dest": "United States"}, - {"src": "Costa Rica", "dest": "United States"}, - {"src": "Denmark", "dest": "United States"}, - {"src": "Ecuador", "dest": "United States"}, - {"src": "Egypt", "dest": "United States"}, - {"src": "El Salvador", "dest": "United States"}, - {"src": "Fiji", "dest": "United States"}, - {"src": "Finland", "dest": "United States"}, - {"src": "France", "dest": "United States"}, - {"src": "Germany", "dest": "United States"}, - {"src": "Greece", "dest": "United States"}, - {"src": "Guatemala", "dest": "United States"}, - {"src": "Guyana", "dest": "United States"}, - {"src": "Honduras", "dest": "United States"}, - {"src": "Hong Kong", "dest": "United States"}, - {"src": "Indonesia", "dest": "United States"}, - {"src": "Ireland", "dest": "United States"}, - {"src": "Israel", "dest": "United States"}, - {"src": "Italy", "dest": "United States"}, - {"src": "Japan", "dest": "United States"}, - {"src": "Jordan", "dest": "United States"}, - {"src": "Kenya", "dest": "United States"}, - {"src": "Korea, Republic of", "dest": "United States"}, - {"src": "Kuwait", "dest": "United States"}, - {"src": "Malaysia", "dest": "United States"}, - {"src": "Mexico", "dest": "United States"}, - {"src": "Morocco", "dest": "United States"}, - {"src": "Nepal", "dest": "United States"}, - {"src": "Netherlands", "dest": "United States"}, - {"src": "New Zealand", "dest": "United States"}, - {"src": "Nicaragua", "dest": "United States"}, - {"src": "Norway", "dest": "United States"}, - {"src": "Oman", "dest": "United States"}, - {"src": "Pakistan", "dest": "United States"}, - {"src": "Panama", "dest": "United States"}, - {"src": "Paraguay", "dest": "United States"}, - {"src": "Peru", "dest": "United States"}, - {"src": "Philippines", "dest": "United States"}, - {"src": "Portugal", "dest": "United States"}, - {"src": "Qatar", "dest": "United States"}, - {"src": "Saudi Arabia", "dest": "United States"}, - {"src": "Senegal", "dest": "United States"}, - {"src": "Singapore", "dest": "United States"}, - {"src": "South Africa", "dest": "United States"}, - {"src": "Spain", "dest": "United States"}, - {"src": "Sweden", "dest": "United States"}, - {"src": "Switzerland", "dest": "United States"}, - {"src": "Taiwan", "dest": "United States"}, - {"src": "Thailand", "dest": "United States"}, - {"src": "Tunisia", "dest": "United States"}, - {"src": "Turkey", "dest": "United States"}, - {"src": "United Arab Emirates", "dest": "United States"}, - {"src": "United Kingdom", "dest": "United States"}, - {"src": "Venezuela, Bolivarian Republic of", "dest": "United States"}, - {"src": "United States", "dest": "Argentina"} + {"src": "United States", "dest": "Australia", "colour": "r"}, + {"src": "United States", "dest": "Austria", "colour": "o"}, + {"src": "United States", "dest": "Belgium", "colour": "b"}, + {"src": "United States", "dest": "Brazil", "colour": "g"}, + {"src": "United States", "dest": "Canada", "colour": "p"}, + {"src": "United States", "dest": "Czechoslovakia", "colour": "r"}, + {"src": "United States", "dest": "Finland", "colour": "o"}, + {"src": "United States", "dest": "France", "colour": "b"}, + {"src": "United States", "dest": "Germany", "colour": "g"}, + {"src": "United States", "dest": "India", "colour": "p"}, + {"src": "United States", "dest": "Israel", "colour": "r"}, + {"src": "United States", "dest": "Italy", "colour": "o"}, + {"src": "United States", "dest": "Mexico", "colour": "b"}, + {"src": "United States", "dest": "Netherlands", "colour": "g"}, + {"src": "United States", "dest": "Portugal", "colour": "p"}, + {"src": "United States", "dest": "Russian Federation", "colour": "r"}, + {"src": "United States", "dest": "Saudi Arabia", "colour": "o"}, + {"src": "United States", "dest": "Spain", "colour": "b"}, + {"src": "United States", "dest": "Sweden", "colour": "g"}, + {"src": "United States", "dest": "Switzerland", "colour": "p"}, + {"src": "United States", "dest": "United Kingdom", "colour": "r"}, + {"src": "Algeria", "dest": "United States", "colour": "o"}, + {"src": "Argentina", "dest": "United States", "colour": "b"}, + {"src": "Australia", "dest": "United States", "colour": "g"}, + {"src": "Austria", "dest": "United States", "colour": "p"}, + {"src": "Bahrain", "dest": "United States", "colour": "r"}, + {"src": "Belgium", "dest": "United States", "colour": "o"}, + {"src": "Belize", "dest": "United States", "colour": "b"}, + {"src": "Bolivia, Plurinational State of", "dest": "United States", "colour": "g"}, + {"src": "Brazil", "dest": "United States", "colour": "p"}, + {"src": "Canada", "dest": "United States", "colour": "r"}, + {"src": "Chile", "dest": "United States", "colour": "o"}, + {"src": "Colombia", "dest": "United States", "colour": "b"}, + {"src": "Costa Rica", "dest": "United States", "colour": "g"}, + {"src": "Denmark", "dest": "United States", "colour": "p"}, + {"src": "Ecuador", "dest": "United States", "colour": "r"}, + {"src": "Egypt", "dest": "United States", "colour": "o"}, + {"src": "El Salvador", "dest": "United States", "colour": "b"}, + {"src": "Fiji", "dest": "United States", "colour": "g"}, + {"src": "Finland", "dest": "United States", "colour": "p"}, + {"src": "France", "dest": "United States", "colour": "r"}, + {"src": "Germany", "dest": "United States", "colour": "o"}, + {"src": "Greece", "dest": "United States", "colour": "b"}, + {"src": "Guatemala", "dest": "United States", "colour": "g"}, + {"src": "Guyana", "dest": "United States", "colour": "p"}, + {"src": "Honduras", "dest": "United States", "colour": "r"}, + {"src": "Hong Kong", "dest": "United States", "colour": "o"}, + {"src": "Indonesia", "dest": "United States", "colour": "b"}, + {"src": "Ireland", "dest": "United States", "colour": "g"}, + {"src": "Israel", "dest": "United States", "colour": "p"}, + {"src": "Italy", "dest": "United States", "colour": "r"}, + {"src": "Japan", "dest": "United States", "colour": "o"}, + {"src": "Jordan", "dest": "United States", "colour": "b"}, + {"src": "Kenya", "dest": "United States", "colour": "g"}, + {"src": "Korea, Republic of", "dest": "United States", "colour": "p"}, + {"src": "Kuwait", "dest": "United States", "colour": "r"}, + {"src": "Malaysia", "dest": "United States", "colour": "o"}, + {"src": "Mexico", "dest": "United States", "colour": "b"}, + {"src": "Morocco", "dest": "United States", "colour": "g"}, + {"src": "Nepal", "dest": "United States", "colour": "p"}, + {"src": "Netherlands", "dest": "United States", "colour": "r"}, + {"src": "New Zealand", "dest": "United States", "colour": "o"}, + {"src": "Nicaragua", "dest": "United States", "colour": "b"}, + {"src": "Norway", "dest": "United States", "colour": "g"}, + {"src": "Oman", "dest": "United States", "colour": "p"}, + {"src": "Pakistan", "dest": "United States", "colour": "r"}, + {"src": "Panama", "dest": "United States", "colour": "o"}, + {"src": "Paraguay", "dest": "United States", "colour": "b"}, + {"src": "Peru", "dest": "United States", "colour": "g"}, + {"src": "Philippines", "dest": "United States", "colour": "p"}, + {"src": "Portugal", "dest": "United States", "colour": "r"}, + {"src": "Qatar", "dest": "United States", "colour": "o"}, + {"src": "Saudi Arabia", "dest": "United States", "colour": "b"}, + {"src": "Senegal", "dest": "United States", "colour": "g"}, + {"src": "Singapore", "dest": "United States", "colour": "p"}, + {"src": "South Africa", "dest": "United States", "colour": "r"}, + {"src": "Spain", "dest": "United States", "colour": "o"}, + {"src": "Sweden", "dest": "United States", "colour": "b"}, + {"src": "Switzerland", "dest": "United States", "colour": "g"}, + {"src": "Taiwan", "dest": "United States", "colour": "p"}, + {"src": "Thailand", "dest": "United States", "colour": "r"}, + {"src": "Tunisia", "dest": "United States", "colour": "o"}, + {"src": "Turkey", "dest": "United States", "colour": "b"}, + {"src": "United Arab Emirates", "dest": "United States", "colour": "g"}, + {"src": "United Kingdom", "dest": "United States", "colour": "p"}, + {"src": "Venezuela, Bolivarian Republic of", "dest": "United States", "colour": "r"}, + {"src": "United States", "dest": "Argentina", "colour": "o"} ] diff --git a/js/main.js b/js/main.js index bb2f1d2..af9862b 100644 --- a/js/main.js +++ b/js/main.js @@ -2,6 +2,17 @@ var masterContainer = document.getElementById('visualization'); var overlay = document.getElementById('visualization'); var glContainer = document.getElementById( 'glContainer' ); +/* +Colour Constants +*/ +COLOUR_MAP = { + r: new THREE.Color( 0xFF1E00 ), + o: new THREE.Color( 0xFF7F00 ), + b: new THREE.Color( 0x008EAF ), + g: new THREE.Color( 0x00CA35 ), + p: new THREE.Color( 0xDC0068 ) +}; + // contains a list of country codes with their matching country names var isoFile = 'country_iso3166.json'; var latlonFile = 'country_lat_lon.json'; diff --git a/js/visualize.js b/js/visualize.js index e97fd7f..a0d5403 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -72,6 +72,9 @@ function getVisualizedMesh( linearData, callback ){ particle.size = meshObj.particleSize; meshObj.particlesGeo.vertices.push( particle ); + // set the colour + meshObj.setParticleColour( linearData.colour ); + return callback( meshObj.splineOutline ); }); } @@ -113,7 +116,7 @@ function _addMeshToViz( mesh ) { function ParticleMesh() { this.linesGeo = new THREE.Geometry(); this.particlesGeo = new THREE.Geometry(); - this.particleColor = new THREE.Color( 0x154492 ); + this.particleColor = COLOUR_MAP.r; this.particleSize = 50; this.lineMat = new THREE.LineBasicMaterial({ @@ -199,3 +202,13 @@ function ParticleMesh() { this.geometry.verticesNeedUpdate = true; }; } + +ParticleMesh.prototype.setParticleColour = function( colourStr ) { + var colour = COLOUR_MAP[colourStr]; + if( !colour ) { + colour = COLOUR_MAP.r; + } + + this.particleColor = colour; + this.shaderMaterial.attributes.customColor.value = [ colour ]; +}; From 5fe45604bea168eb3842183e039b58f0e37d8ad5 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 19 Feb 2015 15:41:28 -0500 Subject: [PATCH 050/190] Minor refactoring to eventually support data using arbitrary lat/long. --- country_lat_lon.json | 2 +- js/geopins.js | 55 ++++++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/country_lat_lon.json b/country_lat_lon.json index 0cb426d..34a5d22 100644 --- a/country_lat_lon.json +++ b/country_lat_lon.json @@ -1 +1 @@ -{"countries": {"BD": {"lat": "24", "lon": "90"}, "BE": {"lat": "50.8333", "lon": "4"}, "BF": {"lat": "13", "lon": "-2"}, "BG": {"lat": "43", "lon": "25"}, "BA": {"lat": "44", "lon": "18"}, "BB": {"lat": "13.1667", "lon": "-59.5333"}, "WF": {"lat": "-13.3", "lon": "-176.2"}, "BM": {"lat": "32.3333", "lon": "-64.75"}, "BN": {"lat": "4.5", "lon": "114.6667"}, "BO": {"lat": "-17", "lon": "-65"}, "BH": {"lat": "26", "lon": "50.55"}, "BI": {"lat": "-3.5", "lon": "30"}, "BJ": {"lat": "9.5", "lon": "2.25"}, "BT": {"lat": "27.5", "lon": "90.5"}, "JM": {"lat": "18.25", "lon": "-77.5"}, "BV": {"lat": "-54.4333", "lon": "3.4"}, "BW": {"lat": "-22", "lon": "24"}, "WS": {"lat": "-13.5833", "lon": "-172.3333"}, "BR": {"lat": "-10", "lon": "-55"}, "BS": {"lat": "24.25", "lon": "-76"}, "JE": {"lat": "49.21", "lon": "-2.13"}, "BY": {"lat": "53", "lon": "28"}, "BZ": {"lat": "17.25", "lon": "-88.75"}, "RU": {"lat": "60", "lon": "100"}, "RW": {"lat": "-2", "lon": "30"}, "RS": {"lat": "44", "lon": "21"}, "TL": {"lat": "-8.55", "lon": "125.5167"}, "RE": {"lat": "-21.1", "lon": "55.6"}, "TM": {"lat": "40", "lon": "60"}, "TJ": {"lat": "39", "lon": "71"}, "RO": {"lat": "46", "lon": "25"}, "TK": {"lat": "-9", "lon": "-172"}, "GW": {"lat": "12", "lon": "-15"}, "GU": {"lat": "13.4667", "lon": "144.7833"}, "GT": {"lat": "15.5", "lon": "-90.25"}, "GS": {"lat": "-54.5", "lon": "-37"}, "GR": {"lat": "39", "lon": "22"}, "GQ": {"lat": "2", "lon": "10"}, "GP": {"lat": "16.25", "lon": "-61.5833"}, "JP": {"lat": "36", "lon": "138"}, "GY": {"lat": "5", "lon": "-59"}, "GG": {"lat": "49.5", "lon": "-2.56"}, "GF": {"lat": "4", "lon": "-53"}, "GE": {"lat": "42", "lon": "43.5"}, "GD": {"lat": "12.1167", "lon": "-61.6667"}, "GB": {"lat": "54", "lon": "-2"}, "GA": {"lat": "-1", "lon": "11.75"}, "GN": {"lat": "11", "lon": "-10"}, "GM": {"lat": "13.4667", "lon": "-16.5667"}, "GL": {"lat": "72", "lon": "-40"}, "GI": {"lat": "36.1833", "lon": "-5.3667"}, "GH": {"lat": "8", "lon": "-2"}, "OM": {"lat": "21", "lon": "57"}, "TN": {"lat": "34", "lon": "9"}, "JO": {"lat": "31", "lon": "36"}, "HR": {"lat": "45.1667", "lon": "15.5"}, "HT": {"lat": "19", "lon": "-72.4167"}, "HU": {"lat": "47", "lon": "20"}, "HK": {"lat": "22.25", "lon": "114.1667"}, "HN": {"lat": "15", "lon": "-86.5"}, "HM": {"lat": "-53.1", "lon": "72.5167"}, "VE": {"lat": "8", "lon": "-66"}, "PR": {"lat": "18.25", "lon": "-66.5"}, "PS": {"lat": "32", "lon": "35.25"}, "PW": {"lat": "7.5", "lon": "134.5"}, "PT": {"lat": "39.5", "lon": "-8"}, "KN": {"lat": "17.3333", "lon": "-62.75"}, "PY": {"lat": "-23", "lon": "-58"}, "IQ": {"lat": "33", "lon": "44"}, "PA": {"lat": "9", "lon": "-80"}, "PF": {"lat": "-15", "lon": "-140"}, "PG": {"lat": "-6", "lon": "147"}, "PE": {"lat": "-10", "lon": "-76"}, "PK": {"lat": "30", "lon": "70"}, "PH": {"lat": "13", "lon": "122"}, "PN": {"lat": "-24.7", "lon": "-127.4"}, "PL": {"lat": "52", "lon": "20"}, "PM": {"lat": "46.8333", "lon": "-56.3333"}, "ZM": {"lat": "-15", "lon": "30"}, "EH": {"lat": "24.5", "lon": "-13"}, "EE": {"lat": "59", "lon": "26"}, "EG": {"lat": "27", "lon": "30"}, "ZA": {"lat": "-29", "lon": "24"}, "EC": {"lat": "-2", "lon": "-77.5"}, "IT": {"lat": "42.8333", "lon": "12.8333"}, "VN": {"lat": "16", "lon": "106"}, "SB": {"lat": "-8", "lon": "159"}, "ET": {"lat": "8", "lon": "38"}, "SO": {"lat": "10", "lon": "49"}, "ZW": {"lat": "-20", "lon": "30"}, "SA": {"lat": "25", "lon": "45"}, "ES": {"lat": "40", "lon": "-4"}, "ER": {"lat": "15", "lon": "39"}, "ME": {"lat": "42", "lon": "19"}, "MD": {"lat": "47", "lon": "29"}, "MG": {"lat": "-20", "lon": "47"}, "MA": {"lat": "32", "lon": "-5"}, "MC": {"lat": "43.7333", "lon": "7.4"}, "UZ": {"lat": "41", "lon": "64"}, "MM": {"lat": "22", "lon": "98"}, "ML": {"lat": "17", "lon": "-4"}, "MO": {"lat": "22.1667", "lon": "113.55"}, "MN": {"lat": "46", "lon": "105"}, "MH": {"lat": "9", "lon": "168"}, "MK": {"lat": "41.8333", "lon": "22"}, "MU": {"lat": "-20.2833", "lon": "57.55"}, "MT": {"lat": "35.8333", "lon": "14.5833"}, "MW": {"lat": "-13.5", "lon": "34"}, "MV": {"lat": "3.25", "lon": "73"}, "MQ": {"lat": "14.6667", "lon": "-61"}, "MP": {"lat": "15.2", "lon": "145.75"}, "MS": {"lat": "16.75", "lon": "-62.2"}, "MR": {"lat": "20", "lon": "-12"}, "IM": {"lat": "54.23", "lon": "-4.55"}, "UG": {"lat": "1", "lon": "32"}, "MY": {"lat": "2.5", "lon": "112.5"}, "MX": {"lat": "23", "lon": "-102"}, "IL": {"lat": "31.5", "lon": "34.75"}, "FR": {"lat": "46", "lon": "2"}, "AW": {"lat": "12.5", "lon": "-69.9667"}, "SH": {"lat": "-15.9333", "lon": "-5.7"}, "SJ": {"lat": "78", "lon": "20"}, "FI": {"lat": "64", "lon": "26"}, "FJ": {"lat": "-18", "lon": "175"}, "FK": {"lat": "-51.75", "lon": "-59"}, "FM": {"lat": "6.9167", "lon": "158.25"}, "FO": {"lat": "62", "lon": "-7"}, "NI": {"lat": "13", "lon": "-85"}, "NL": {"lat": "52.5", "lon": "5.75"}, "NO": {"lat": "62", "lon": "10"}, "NA": {"lat": "-22", "lon": "17"}, "VU": {"lat": "-16", "lon": "167"}, "NC": {"lat": "-21.5", "lon": "165.5"}, "NE": {"lat": "16", "lon": "8"}, "NF": {"lat": "-29.0333", "lon": "167.95"}, "NG": {"lat": "10", "lon": "8"}, "NZ": {"lat": "-41", "lon": "174"}, "NP": {"lat": "28", "lon": "84"}, "NR": {"lat": "-0.5333", "lon": "166.9167"}, "NU": {"lat": "-19.0333", "lon": "-169.8667"}, "CK": {"lat": "-21.2333", "lon": "-159.7667"}, "CI": {"lat": "8", "lon": "-5"}, "CH": {"lat": "47", "lon": "8"}, "CO": {"lat": "4", "lon": "-72"}, "CN": {"lat": "35", "lon": "105"}, "CM": {"lat": "6", "lon": "12"}, "CL": {"lat": "-30", "lon": "-71"}, "CC": {"lat": "-12.5", "lon": "96.8333"}, "CA": {"lat": "60", "lon": "-95"}, "CG": {"lat": "-1", "lon": "15"}, "CF": {"lat": "7", "lon": "21"}, "CD": {"lat": "0", "lon": "25"}, "CZ": {"lat": "49.75", "lon": "15.5"}, "CY": {"lat": "35", "lon": "33"}, "CX": {"lat": "-10.5", "lon": "105.6667"}, "CR": {"lat": "10", "lon": "-84"}, "CV": {"lat": "16", "lon": "-24"}, "CU": {"lat": "21.5", "lon": "-80"}, "SZ": {"lat": "-26.5", "lon": "31.5"}, "SY": {"lat": "35", "lon": "38"}, "KG": {"lat": "41", "lon": "75"}, "KE": {"lat": "1", "lon": "38"}, "SR": {"lat": "4", "lon": "-56"}, "KI": {"lat": "1.4167", "lon": "173"}, "KH": {"lat": "13", "lon": "105"}, "SV": {"lat": "13.8333", "lon": "-88.9167"}, "KM": {"lat": "-12.1667", "lon": "44.25"}, "ST": {"lat": "1", "lon": "7"}, "SK": {"lat": "48.6667", "lon": "19.5"}, "KR": {"lat": "37", "lon": "127.5"}, "SI": {"lat": "46", "lon": "15"}, "KP": {"lat": "40", "lon": "127"}, "KW": {"lat": "29.3375", "lon": "47.6581"}, "SN": {"lat": "14", "lon": "-14"}, "SM": {"lat": "43.7667", "lon": "12.4167"}, "SL": {"lat": "8.5", "lon": "-11.5"}, "SC": {"lat": "-4.5833", "lon": "55.6667"}, "KZ": {"lat": "48", "lon": "68"}, "KY": {"lat": "19.5", "lon": "-80.5"}, "SG": {"lat": "1.3667", "lon": "103.8"}, "SE": {"lat": "62", "lon": "15"}, "SD": {"lat": "15", "lon": "30"}, "DO": {"lat": "19", "lon": "-70.6667"}, "DM": {"lat": "15.4167", "lon": "-61.3333"}, "DJ": {"lat": "11.5", "lon": "43"}, "DK": {"lat": "56", "lon": "10"}, "VG": {"lat": "18.5", "lon": "-64.5"}, "DE": {"lat": "51", "lon": "9"}, "YE": {"lat": "15", "lon": "48"}, "DZ": {"lat": "28", "lon": "3"}, "US": {"lat": "38", "lon": "-97"}, "UY": {"lat": "-33", "lon": "-56"}, "YT": {"lat": "-12.8333", "lon": "45.1667"}, "UM": {"lat": "19.2833", "lon": "166.6"}, "LB": {"lat": "33.8333", "lon": "35.8333"}, "LC": {"lat": "13.8833", "lon": "-61.1333"}, "LA": {"lat": "18", "lon": "105"}, "TV": {"lat": "-8", "lon": "178"}, "TW": {"lat": "23.5", "lon": "121"}, "TT": {"lat": "11", "lon": "-61"}, "TR": {"lat": "39", "lon": "35"}, "LK": {"lat": "7", "lon": "81"}, "LI": {"lat": "47.1667", "lon": "9.5333"}, "LV": {"lat": "57", "lon": "25"}, "TO": {"lat": "-20", "lon": "-175"}, "LT": {"lat": "56", "lon": "24"}, "LU": {"lat": "49.75", "lon": "6.1667"}, "LR": {"lat": "6.5", "lon": "-9.5"}, "LS": {"lat": "-29.5", "lon": "28.5"}, "TH": {"lat": "15", "lon": "100"}, "TF": {"lat": "-43", "lon": "67"}, "TG": {"lat": "8", "lon": "1.1667"}, "TD": {"lat": "15", "lon": "19"}, "TC": {"lat": "21.75", "lon": "-71.5833"}, "LY": {"lat": "25", "lon": "17"}, "VA": {"lat": "41.9", "lon": "12.45"}, "VC": {"lat": "13.25", "lon": "-61.2"}, "AE": {"lat": "24", "lon": "54"}, "AD": {"lat": "42.5", "lon": "1.6"}, "AG": {"lat": "17.05", "lon": "-61.8"}, "AF": {"lat": "33", "lon": "65"}, "AI": {"lat": "18.25", "lon": "-63.1667"}, "VI": {"lat": "18.3333", "lon": "-64.8333"}, "IS": {"lat": "65", "lon": "-18"}, "IR": {"lat": "32", "lon": "53"}, "AM": {"lat": "40", "lon": "45"}, "AL": {"lat": "41", "lon": "20"}, "AO": {"lat": "-12.5", "lon": "18.5"}, "AN": {"lat": "12.25", "lon": "-68.75"}, "AQ": {"lat": "-90", "lon": "0"}, "AS": {"lat": "-14.3333", "lon": "-170"}, "AR": {"lat": "-34", "lon": "-64"}, "AU": {"lat": "-27", "lon": "133"}, "AT": {"lat": "47.3333", "lon": "13.3333"}, "IO": {"lat": "-6", "lon": "71.5"}, "IN": {"lat": "20", "lon": "77"}, "TZ": {"lat": "-6", "lon": "35"}, "AZ": {"lat": "40.5", "lon": "47.5"}, "IE": {"lat": "53", "lon": "-8"}, "ID": {"lat": "-5", "lon": "120"}, "UA": {"lat": "49", "lon": "32"}, "QA": {"lat": "25.5", "lon": "51.25"}, "MZ": {"lat": "-18.25", "lon": "35"}}} \ No newline at end of file +{"countries": {"BD": {"lat": "24", "lon": "90"}, "BE": {"lat": "50.8333", "lon": "4"}, "BF": {"lat": "13", "lon": "-2"}, "BG": {"lat": "43", "lon": "25"}, "BA": {"lat": "44", "lon": "18"}, "BB": {"lat": "13.1667", "lon": "-59.5333"}, "WF": {"lat": "-13.3", "lon": "-176.2"}, "BM": {"lat": "32.3333", "lon": "-64.75"}, "BN": {"lat": "4.5", "lon": "114.6667"}, "BO": {"lat": "-17", "lon": "-65"}, "BH": {"lat": "26", "lon": "50.55"}, "BI": {"lat": "-3.5", "lon": "30"}, "BJ": {"lat": "9.5", "lon": "2.25"}, "BT": {"lat": "27.5", "lon": "90.5"}, "JM": {"lat": "18.25", "lon": "-77.5"}, "BV": {"lat": "-54.4333", "lon": "3.4"}, "BW": {"lat": "-22", "lon": "24"}, "WS": {"lat": "-13.5833", "lon": "-172.3333"}, "BR": {"lat": "-10", "lon": "-55"}, "BS": {"lat": "24.25", "lon": "-76"}, "JE": {"lat": "49.21", "lon": "-2.13"}, "BY": {"lat": "53", "lon": "28"}, "BZ": {"lat": "17.25", "lon": "-88.75"}, "RU": {"lat": "60", "lon": "100"}, "RW": {"lat": "-2", "lon": "30"}, "RS": {"lat": "44", "lon": "21"}, "TL": {"lat": "-8.55", "lon": "125.5167"}, "RE": {"lat": "-21.1", "lon": "55.6"}, "TM": {"lat": "40", "lon": "60"}, "TJ": {"lat": "39", "lon": "71"}, "RO": {"lat": "46", "lon": "25"}, "TK": {"lat": "-9", "lon": "-172"}, "GW": {"lat": "12", "lon": "-15"}, "GU": {"lat": "13.4667", "lon": "144.7833"}, "GT": {"lat": "15.5", "lon": "-90.25"}, "GS": {"lat": "-54.5", "lon": "-37"}, "GR": {"lat": "39", "lon": "22"}, "GQ": {"lat": "2", "lon": "10"}, "GP": {"lat": "16.25", "lon": "-61.5833"}, "JP": {"lat": "36", "lon": "138"}, "GY": {"lat": "5", "lon": "-59"}, "GG": {"lat": "49.5", "lon": "-2.56"}, "GF": {"lat": "4", "lon": "-53"}, "GE": {"lat": "42", "lon": "43.5"}, "GD": {"lat": "12.1167", "lon": "-61.6667"}, "GB": {"lat": "54", "lon": "-2"}, "GA": {"lat": "-1", "lon": "11.75"}, "GN": {"lat": "11", "lon": "-10"}, "GM": {"lat": "13.4667", "lon": "-16.5667"}, "GL": {"lat": "72", "lon": "-40"}, "GI": {"lat": "36.1833", "lon": "-5.3667"}, "GH": {"lat": "8", "lon": "-2"}, "OM": {"lat": "21", "lon": "57"}, "TN": {"lat": "34", "lon": "9"}, "JO": {"lat": "31", "lon": "36"}, "HR": {"lat": "45.1667", "lon": "15.5"}, "HT": {"lat": "19", "lon": "-72.4167"}, "HU": {"lat": "47", "lon": "20"}, "HK": {"lat": "22.25", "lon": "114.1667"}, "HN": {"lat": "15", "lon": "-86.5"}, "HM": {"lat": "-53.1", "lon": "72.5167"}, "VE": {"lat": "8", "lon": "-66"}, "PR": {"lat": "18.25", "lon": "-66.5"}, "PS": {"lat": "32", "lon": "35.25"}, "PW": {"lat": "7.5", "lon": "134.5"}, "PT": {"lat": "39.5", "lon": "-8"}, "KN": {"lat": "17.3333", "lon": "-62.75"}, "PY": {"lat": "-23", "lon": "-58"}, "IQ": {"lat": "33", "lon": "44"}, "PA": {"lat": "9", "lon": "-80"}, "PF": {"lat": "-15", "lon": "-140"}, "PG": {"lat": "-6", "lon": "147"}, "PE": {"lat": "-10", "lon": "-76"}, "PK": {"lat": "30", "lon": "70"}, "PH": {"lat": "13", "lon": "122"}, "PN": {"lat": "-24.7", "lon": "-127.4"}, "PL": {"lat": "52", "lon": "20"}, "PM": {"lat": "46.8333", "lon": "-56.3333"}, "ZM": {"lat": "-15", "lon": "30"}, "EH": {"lat": "24.5", "lon": "-13"}, "EE": {"lat": "59", "lon": "26"}, "EG": {"lat": "27", "lon": "30"}, "ZA": {"lat": "-29", "lon": "24"}, "EC": {"lat": "-2", "lon": "-77.5"}, "IT": {"lat": "42.8333", "lon": "12.8333"}, "VN": {"lat": "16", "lon": "106"}, "SB": {"lat": "-8", "lon": "159"}, "ET": {"lat": "8", "lon": "38"}, "SO": {"lat": "10", "lon": "49"}, "ZW": {"lat": "-20", "lon": "30"}, "SA": {"lat": "25", "lon": "45"}, "ES": {"lat": "40", "lon": "-4"}, "ER": {"lat": "15", "lon": "39"}, "ME": {"lat": "42", "lon": "19"}, "MD": {"lat": "47", "lon": "29"}, "MG": {"lat": "-20", "lon": "47"}, "MA": {"lat": "32", "lon": "-5"}, "MC": {"lat": "43.7333", "lon": "7.4"}, "UZ": {"lat": "41", "lon": "64"}, "MM": {"lat": "22", "lon": "98"}, "ML": {"lat": "17", "lon": "-4"}, "MO": {"lat": "22.1667", "lon": "113.55"}, "MN": {"lat": "46", "lon": "105"}, "MH": {"lat": "9", "lon": "168"}, "MK": {"lat": "41.8333", "lon": "22"}, "MU": {"lat": "-20.2833", "lon": "57.55"}, "MT": {"lat": "35.8333", "lon": "14.5833"}, "MW": {"lat": "-13.5", "lon": "34"}, "MV": {"lat": "3.25", "lon": "73"}, "MQ": {"lat": "14.6667", "lon": "-61"}, "MP": {"lat": "15.2", "lon": "145.75"}, "MS": {"lat": "16.75", "lon": "-62.2"}, "MR": {"lat": "20", "lon": "-12"}, "IM": {"lat": "54.23", "lon": "-4.55"}, "UG": {"lat": "1", "lon": "32"}, "MY": {"lat": "2.5", "lon": "112.5"}, "MX": {"lat": "23", "lon": "-102"}, "IL": {"lat": "31.5", "lon": "34.75"}, "FR": {"lat": "46", "lon": "2"}, "AW": {"lat": "12.5", "lon": "-69.9667"}, "SH": {"lat": "-15.9333", "lon": "-5.7"}, "SJ": {"lat": "78", "lon": "20"}, "FI": {"lat": "64", "lon": "26"}, "FJ": {"lat": "-18", "lon": "175"}, "FK": {"lat": "-51.75", "lon": "-59"}, "FM": {"lat": "6.9167", "lon": "158.25"}, "FO": {"lat": "62", "lon": "-7"}, "NI": {"lat": "13", "lon": "-85"}, "NL": {"lat": "52.5", "lon": "5.75"}, "NO": {"lat": "62", "lon": "10"}, "NA": {"lat": "-22", "lon": "17"}, "VU": {"lat": "-16", "lon": "167"}, "NC": {"lat": "-21.5", "lon": "165.5"}, "NE": {"lat": "16", "lon": "8"}, "NF": {"lat": "-29.0333", "lon": "167.95"}, "NG": {"lat": "10", "lon": "8"}, "NZ": {"lat": "-41", "lon": "174"}, "NP": {"lat": "28", "lon": "84"}, "NR": {"lat": "-0.5333", "lon": "166.9167"}, "NU": {"lat": "-19.0333", "lon": "-169.8667"}, "CK": {"lat": "-21.2333", "lon": "-159.7667"}, "CI": {"lat": "8", "lon": "-5"}, "CH": {"lat": "47", "lon": "8"}, "CO": {"lat": "4", "lon": "-72"}, "CN": {"lat": "35", "lon": "105"}, "CM": {"lat": "6", "lon": "12"}, "CL": {"lat": "-30", "lon": "-71"}, "CC": {"lat": "-12.5", "lon": "96.8333"}, "CA": {"lat": "60", "lon": "-95"}, "CG": {"lat": "-1", "lon": "15"}, "CF": {"lat": "7", "lon": "21"}, "CD": {"lat": "0", "lon": "25"}, "CZ": {"lat": "49.75", "lon": "15.5"}, "CY": {"lat": "35", "lon": "33"}, "CX": {"lat": "-10.5", "lon": "105.6667"}, "CR": {"lat": "10", "lon": "-84"}, "CV": {"lat": "16", "lon": "-24"}, "CU": {"lat": "21.5", "lon": "-80"}, "SZ": {"lat": "-26.5", "lon": "31.5"}, "SY": {"lat": "35", "lon": "38"}, "KG": {"lat": "41", "lon": "75"}, "KE": {"lat": "1", "lon": "38"}, "SR": {"lat": "4", "lon": "-56"}, "KI": {"lat": "1.4167", "lon": "173"}, "KH": {"lat": "13", "lon": "105"}, "SV": {"lat": "13.8333", "lon": "-88.9167"}, "KM": {"lat": "-12.1667", "lon": "44.25"}, "ST": {"lat": "1", "lon": "7"}, "SK": {"lat": "48.6667", "lon": "19.5"}, "KR": {"lat": "37", "lon": "127.5"}, "SI": {"lat": "46", "lon": "15"}, "KP": {"lat": "40", "lon": "127"}, "KW": {"lat": "29.3375", "lon": "47.6581"}, "SN": {"lat": "14", "lon": "-14"}, "SM": {"lat": "43.7667", "lon": "12.4167"}, "SL": {"lat": "8.5", "lon": "-11.5"}, "SC": {"lat": "-4.5833", "lon": "55.6667"}, "KZ": {"lat": "48", "lon": "68"}, "KY": {"lat": "19.5", "lon": "-80.5"}, "SG": {"lat": "1.3667", "lon": "103.8"}, "SE": {"lat": "62", "lon": "15"}, "SD": {"lat": "15", "lon": "30"}, "DO": {"lat": "19", "lon": "-70.6667"}, "DM": {"lat": "15.4167", "lon": "-61.3333"}, "DJ": {"lat": "11.5", "lon": "43"}, "DK": {"lat": "56", "lon": "10"}, "VG": {"lat": "18.5", "lon": "-64.5"}, "DE": {"lat": "51", "lon": "9"}, "YE": {"lat": "15", "lon": "48"}, "DZ": {"lat": "28", "lon": "3"}, "US": {"lat": "38", "lon": "-97"}, "UY": {"lat": "-33", "lon": "-56"}, "YT": {"lat": "-12.8333", "lon": "45.1667"}, "UM": {"lat": "19.2833", "lon": "166.6"}, "LB": {"lat": "33.8333", "lon": "35.8333"}, "LC": {"lat": "13.8833", "lon": "-61.1333"}, "LA": {"lat": "18", "lon": "105"}, "TV": {"lat": "-8", "lon": "178"}, "TW": {"lat": "23.5", "lon": "121"}, "TT": {"lat": "11", "lon": "-61"}, "TR": {"lat": "39", "lon": "35"}, "LK": {"lat": "7", "lon": "81"}, "LI": {"lat": "47.1667", "lon": "9.5333"}, "LV": {"lat": "57", "lon": "25"}, "TO": {"lat": "-20", "lon": "-175"}, "LT": {"lat": "56", "lon": "24"}, "LU": {"lat": "49.75", "lon": "6.1667"}, "LR": {"lat": "6.5", "lon": "-9.5"}, "LS": {"lat": "-29.5", "lon": "28.5"}, "TH": {"lat": "15", "lon": "100"}, "TF": {"lat": "-43", "lon": "67"}, "TG": {"lat": "8", "lon": "1.1667"}, "TD": {"lat": "15", "lon": "19"}, "TC": {"lat": "21.75", "lon": "-71.5833"}, "LY": {"lat": "25", "lon": "17"}, "VA": {"lat": "41.9", "lon": "12.45"}, "VC": {"lat": "13.25", "lon": "-61.2"}, "AE": {"lat": "24", "lon": "54"}, "AD": {"lat": "42.5", "lon": "1.6"}, "AG": {"lat": "17.05", "lon": "-61.8"}, "AF": {"lat": "33", "lon": "65"}, "AI": {"lat": "18.25", "lon": "-63.1667"}, "VI": {"lat": "18.3333", "lon": "-64.8333"}, "IS": {"lat": "65", "lon": "-18"}, "IR": {"lat": "32", "lon": "53"}, "AM": {"lat": "40", "lon": "45"}, "AL": {"lat": "41", "lon": "20"}, "AO": {"lat": "-12.5", "lon": "18.5"}, "AN": {"lat": "12.25", "lon": "-68.75"}, "AQ": {"lat": "-90", "lon": "0"}, "AS": {"lat": "-14.3333", "lon": "-170"}, "AR": {"lat": "-34", "lon": "-64"}, "AU": {"lat": "-27", "lon": "133"}, "AT": {"lat": "47.3333", "lon": "13.3333"}, "IO": {"lat": "-6", "lon": "71.5"}, "IN": {"lat": "20", "lon": "77"}, "TZ": {"lat": "-6", "lon": "35"}, "AZ": {"lat": "40.5", "lon": "47.5"}, "IE": {"lat": "53", "lon": "-8"}, "ID": {"lat": "-5", "lon": "120"}, "UA": {"lat": "49", "lon": "32"}, "QA": {"lat": "25.5", "lon": "51.25"}, "MZ": {"lat": "-18.25", "lon": "35"}}} diff --git a/js/geopins.js b/js/geopins.js index edc8654..28fb97a 100644 --- a/js/geopins.js +++ b/js/geopins.js @@ -1,45 +1,50 @@ function loadGeoData( latlonData ){ // ----------------------------------------------------------------------------- - // Load the world geo data json, per country - - var sphereRad = 1; - var rad = 100; + // Load the world geo data json, per country // iterate through each set of country pins - for ( var i in latlonData.countries ) { - var country = latlonData.countries[i]; - + for ( var i in latlonData.countries ) { + var country = latlonData.countries[i]; + // can we even find the country in the list? // if( countryLookup[country.n.toUpperCase()] === undefined ){ // console.log('could not find country that has country code: ' + country.n) - // continue; + // continue; // } // save out country name and code info country.countryCode = i; - country.countryName = countryLookup[i]; + country.countryName = countryLookup[i]; // take the lat lon from the data and convert this to 3d globe space - var lon = country.lon - 90; - var lat = country.lat; - - var phi = Math.PI/2 - lat * Math.PI / 180 - Math.PI * 0.01; - var theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06; - - var center = new THREE.Vector3(); - center.x = Math.sin(phi) * Math.cos(theta) * rad; - center.y = Math.cos(phi) * rad; - center.z = Math.sin(phi) * Math.sin(theta) * rad; - - // save and catalogue + var center = convertLatLonToVector( country.lat, country.lon ); + + // save and catalogue country.center = center; - countryData[country.countryName] = country; - } + countryData[country.countryName] = country; + } // console.log(countryData); -} +} + +// Convert arbitrary lat/lon to a vector within the globe's space +function convertLatLonToVector( lat, lon ) { + var rad = 100; + + lon -= 90; + + var phi = Math.PI/2 - lat * Math.PI / 180 - Math.PI * 0.01; + var theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06; + + var vec = new THREE.Vector3(); + vec.x = Math.sin(phi) * Math.cos(theta) * rad; + vec.y = Math.cos(phi) * rad; + vec.z = Math.sin(phi) * Math.sin(theta) * rad; + + return vec; +} // convenience function to get the country object by name function getCountry(name){ return countryData[name.toUpperCase()] -} \ No newline at end of file +} From 28af755996326dda15c469072a30b7449e7a89d7 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 19 Feb 2015 16:46:36 -0500 Subject: [PATCH 051/190] Switched the globe over to using a built-in material that respects the scene lighting. --- index.html | 33 --------------------------------- js/main.js | 4 ++-- 2 files changed, 2 insertions(+), 35 deletions(-) diff --git a/index.html b/index.html index 9b34d5f..f1863b2 100755 --- a/index.html +++ b/index.html @@ -98,39 +98,6 @@

Data Visualization Globe } - - - - diff --git a/js/main.js b/js/main.js index af9862b..b5913f8 100644 --- a/js/main.js +++ b/js/main.js @@ -140,11 +140,11 @@ function initScene() { 'outlineLevel': {type: 'f', value: 1 }, }; - var shaderMaterial = new THREE.ShaderMaterial( { + var shaderMaterial = new THREE.MeshLambertMaterial( { map: outlinedMapTexture } );/*new THREE.ShaderMaterial( { uniforms: uniforms, vertexShader: document.getElementById( 'globeVertexShader' ).textContent, fragmentShader: document.getElementById( 'globeFragmentShader' ).textContent - }); + });*/ // ----------------------------------------------------------------------------- // Create the backing (sphere) From 31c78fb5efbb57e16fdcf94ae55817138e93f869 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Feb 2015 01:15:28 +0000 Subject: [PATCH 052/190] Tweaked the scene lighting --- js/main.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/js/main.js b/js/main.js index b5913f8..fab2693 100644 --- a/js/main.js +++ b/js/main.js @@ -95,19 +95,24 @@ function initScene() { scene = new THREE.Scene(); scene.matrixAutoUpdate = false; - scene.add( new THREE.AmbientLight( 0x505050 ) ); - - light1 = new THREE.SpotLight( 0xeeeeee, 3 ); + var light1 = new THREE.SpotLight( 0xeeeeee, 3 ); light1.position.x = 730; light1.position.y = 520; light1.position.z = 626; light1.castShadow = true; scene.add( light1 ); - - light2 = new THREE.PointLight( 0x222222, 14.8 ); - light2.position.x = -640; - light2.position.y = -500; - light2.position.z = -1000; + + var light3 = new THREE.SpotLight( 0xeeeeee, 1.5 ); + light3.position.x = -730; + light3.position.y = 520; + light3.position.z = 626; + light3.castShadow = true; + scene.add( light3 ); + + var light2 = new THREE.PointLight( 0x222222, 14.8 ); + light2.position.x = 0; + light2.position.y = -750; + light2.position.z = 0; scene.add( light2 ); rotating = new THREE.Object3D(); From b916c41ca02f09dc9dd4308047575d4c538549e9 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Feb 2015 09:23:58 -0500 Subject: [PATCH 053/190] Tweaked a couple styling things. Need to adjust the particle graphic, though. --- style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/style.css b/style.css index 44fef86..52d7e75 100755 --- a/style.css +++ b/style.css @@ -77,7 +77,7 @@ li { list-style-type:none; } } #dataviz { - background-color: #000000; + background-color: #111; margin: 0px; overflow-y: hidden; overflow-x: auto; @@ -184,7 +184,6 @@ Elements to control the title and country selector top: 20px; color: #fff; font-family: 'RopaSans'; - display: none; background: rgba(0,0,0,0.4); } #hudHeader h1 { From 56cb4f8f34a9ff74b0a81b79d77ecb62cd5407ac Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Feb 2015 10:01:21 -0500 Subject: [PATCH 054/190] Switched particle to use the built-in point cloud material, rather than a custom material. --- index.html | 34 ---------------------------------- js/visualize.js | 21 ++++++--------------- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/index.html b/index.html index f1863b2..4229742 100755 --- a/index.html +++ b/index.html @@ -64,40 +64,6 @@

Data Visualization Globe - - - - diff --git a/js/visualize.js b/js/visualize.js index a0d5403..a80e141 100644 --- a/js/visualize.js +++ b/js/visualize.js @@ -117,7 +117,7 @@ function ParticleMesh() { this.linesGeo = new THREE.Geometry(); this.particlesGeo = new THREE.Geometry(); this.particleColor = COLOUR_MAP.r; - this.particleSize = 50; + this.particleSize = 150; this.lineMat = new THREE.LineBasicMaterial({ color: 0xffffff, @@ -130,23 +130,14 @@ function ParticleMesh() { }); this.splineOutline = new THREE.Line( null, this.lineMat ); - this.shaderMaterial = new THREE.ShaderMaterial({ - uniforms: { - amplitude: { type: "f", value: 1.0 }, - color: { type: "c", value: new THREE.Color( 0xffffff ) }, - texture: { type: "t", value: THREE.ImageUtils.loadTexture( "images/particleA.png" ) }, - }, - attributes: { - size: { type: 'f', value: [ this.particleSize ] }, - customColor: { type: 'c', value: [ this.particleColor ] } - }, - vertexShader: document.getElementById( 'vertexshader' ).textContent, - fragmentShader: document.getElementById( 'fragmentshader' ).textContent, - + this.shaderMaterial = new THREE.PointCloudMaterial({ + map: THREE.ImageUtils.loadTexture( "images/particleA.png" ), + size: this.particleSize, blending: THREE.AdditiveBlending, depthTest: true, depthWrite: false, transparent: true, + color: this.particleColor }); this.pSystem = new THREE.PointCloud( null, this.shaderMaterial ); @@ -210,5 +201,5 @@ ParticleMesh.prototype.setParticleColour = function( colourStr ) { } this.particleColor = colour; - this.shaderMaterial.attributes.customColor.value = [ colour ]; + this.shaderMaterial.color = colour; }; From 654e4d904090ca3e5543dea8ba766c8c2b51da74 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Feb 2015 10:25:38 -0500 Subject: [PATCH 055/190] Updated particle texture to look/work better. --- images/particleA.png | Bin 37672 -> 0 bytes images/particleB.png | Bin 0 -> 49103 bytes js/visualize.js | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100755 images/particleA.png create mode 100644 images/particleB.png diff --git a/images/particleA.png b/images/particleA.png deleted file mode 100755 index b9a18be90a9e75ee2c0cddcf27abfa3c19f27c58..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 37672 zcmV)QK(xP!P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QM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nz6|glA6TjfHkQSAr-H9^g9T66?e=*IbZ(d8_k}1U+o5Wd4e&f?>d0&2mpNRl_;>5>J=Qp?hulj7h&IjII5|pZf;IP4|NabczYnaI#b2EYzRnF+Jz=-s*}h-jfwE-(Up*66xM#&^ zHrV|)GX47kKP>FB)vTX?W9$D~2Y|A`D+5gOb5eK1p+XASo z4ImWQu`zwum1I6!7D0RqB}AdvT@3am6Zs0$zdP_lxh1#2W^Lj7_3K&z--f5SCl9QY z1lv-Mf3pnm^**o- z4lN_1d)xpLp>k#!R`46`_xouCY(dtK?^yrvE_YD4J0fP!;aU<-+-Lgbz<&?y`Hijr zTROms53Er`OFpn66}$%&EqQ1Bi?|`+yMF7Udu+Ayt)H&m0}nL6Z1Mh~g2E{t3!Ki~ z*1xy}=$lyoH+F!#eBdkK&?ZC#iCQ!7AR9aZ5sfihGQhnq@ty>*_Q4lsCO6uBAvY|X zP+7wDUk!VH1MB}@*?MDHypjrFLl12wq^HKdm=Fp#x(-0;)A+9D{xvS4MIE&+-tN=em;rQYcwnQ1 zdXuucX!;ui|344(|3(h*^>An@3#_|AIU6h`guEx1s_OcF@#MRIS`yImNucks`xVo_ zQ+fLB0{?fi{_pDm-_8dhFHl=A49b)cERV7Tw^V}$uHZyP?i0V4tryHh7fa|OrYTQZ zmJX}b)eY6}3jDvl^?z^1?tLY}ov8rwlAJ}RXuBuC;c&cOuM2qYj`#7~bi%e;{7O_` zoG#W4D$_Ndrx^Gl*X8}qK>u%=0lp#?WMXJ>&gM=xfZWN~B~KW_f7V~hzt6V~FeM1H zcyZxunMGuzCAsN#(}&{HqI*sMH?aQS&H>)<18a!rem7W32&s){3IHtI`?t-t_a=dD sH)Sj2HMDbw=|g#``|r*A0pR}|04VvQqjCDkI{*Lx07*qoM6N<$f*XZGQ2+n{ diff --git a/images/particleB.png b/images/particleB.png new file mode 100644 index 0000000000000000000000000000000000000000..013f8990efa655b64bb11a2f607936fc0bff5417 GIT binary patch literal 49103 zcmXt9cTf{w7fnJ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fPl2nz1ZZg44pe?#RDDq zNs6bBHAR9b)25>&wyMcau>eyPZ-O!g;Y?#7lX%^FcoYMua8nN~X!(eAdTzsPr2cFwKhLBnI&d{YsJi@VpoxXF~dAeNXs?d~iEQlYjWa7`GZMG!_1ZbOoAPBl<_O4a_MtyK8y`Schn`BHt3mj&75~qO8{_DY zL|_4?WTrq6aCvpkh*Qsm)2_^gLl6|Q)2pg;|7;P1%1cK1(Xz3^qV%(Po_|~<&mu)w zBpcbGI|+lnIZlt_Mgdb?gsYwe6@t)mt;2w?iA0T+9-|;-B|(*T5Xx-_FXc%2D%R)9 zqW6lfnO^-AnHA54QKW0P-jspqRG*bq&;K2U()>X{y#&VC*d<>6`g;Z@YwVdEyfZB{ z(a{?c$nk*w6_3daJ?R%Jui2s7bKo3oI}b^Hggxch9fXiM0z@&QAR6nYY#n=N{=FNZ Pv&Z;`xnY&QOVs}X#9 Date: Fri, 20 Feb 2015 11:20:18 -0500 Subject: [PATCH 056/190] Added legend to the visualization --- index.html | 11 +++++++++++ style.css | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/index.html b/index.html index 4229742..9e229f2 100755 --- a/index.html +++ b/index.html @@ -34,6 +34,17 @@

Data Visualization Globe
An interactive visualization of source/destination data over time.

+ +
+

Legend

+
    +
  • - Red
  • +
  • - Orange
  • +
  • - Blue
  • +
  • - Green
  • +
  • - Purple
  • +
+
diff --git a/style.css b/style.css index 52d7e75..bead23a 100755 --- a/style.css +++ b/style.css @@ -196,5 +196,57 @@ Elements to control the title and country selector #hudHeader h1 .subtitle { font-size: 14px; color: #ddd; +} + +#legend { + position: absolute; + left: 30px; + bottom: 20px; + color: #fff; + font-family: 'RopaSans'; + background: rgba(0,0,0,0.4); + padding: 10px; +} + +#legend h2 { + font-size: 18px; + margin-top: 0; +} + +#legend ul { + list-style-type: none; + padding: 0; + margin: 0; +} +#legend li { + height: 20px; + padding-bottom: 5px; + color: #ddd; +} + +.circle { + display: inline-block; + width: 15px; + height: 15px; + border-radius: 50%; + /* This is what lets us get the text centered */ + margin-top: 3px; + margin-bottom: -2px; +} + +.red-back { + background-color: #ff1e00; +} +.orange-back { + background-color: #ff7f00; +} +.blue-back { + background-color: #008eaf; +} +.green-back { + background-color: #00ca35; +} +.purple-back { + background-color: #dc0068; } From ed473eca789b29b22e13fe4d4c1efac876c02e68 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Feb 2015 16:00:24 -0500 Subject: [PATCH 057/190] Cleaned out a bunch of JS that's no longer needed. --- index.html | 11 - js/camerastates.js | 5 - js/main.js | 4 +- js/svgtoy.js | 352 --- thirdparty/ShaderExtras.js | 1779 -------------- thirdparty/Stats.js | 7 - thirdparty/Tween.js | 530 ----- thirdparty/canvg.js | 2620 --------------------- thirdparty/d3.v2.min.js | 4 - thirdparty/dat.gui.min.js | 94 - thirdparty/innersvg.js | 97 - thirdparty/jquery-ui-1.8.21.custom.min.js | 25 - thirdparty/rgbcolor.js | 288 --- 13 files changed, 1 insertion(+), 5815 deletions(-) delete mode 100644 js/camerastates.js delete mode 100755 js/svgtoy.js delete mode 100755 thirdparty/ShaderExtras.js delete mode 100755 thirdparty/Stats.js delete mode 100755 thirdparty/Tween.js delete mode 100755 thirdparty/canvg.js delete mode 100644 thirdparty/d3.v2.min.js delete mode 100755 thirdparty/dat.gui.min.js delete mode 100644 thirdparty/innersvg.js delete mode 100755 thirdparty/jquery-ui-1.8.21.custom.min.js delete mode 100755 thirdparty/rgbcolor.js diff --git a/index.html b/index.html index 9e229f2..71a30b8 100755 --- a/index.html +++ b/index.html @@ -48,32 +48,21 @@

Legend

- - - - - - - - - - - diff --git a/js/camerastates.js b/js/camerastates.js deleted file mode 100644 index 5af6d43..0000000 --- a/js/camerastates.js +++ /dev/null @@ -1,5 +0,0 @@ -var cameraStates = new Object(); -var currentCameraState = null; -var targetCameraState = null; - -var defaultCameraState; \ No newline at end of file diff --git a/js/main.js b/js/main.js index fab2693..56897e5 100644 --- a/js/main.js +++ b/js/main.js @@ -101,7 +101,7 @@ function initScene() { light1.position.z = 626; light1.castShadow = true; scene.add( light1 ); - + var light3 = new THREE.SpotLight( 0xeeeeee, 1.5 ); light3.position.x = -730; light3.position.y = 520; @@ -249,8 +249,6 @@ function animate() { rotateVX *= -0.95; } - TWEEN.update(); - rotating.rotation.x = rotateX; rotating.rotation.y = rotateY; diff --git a/js/svgtoy.js b/js/svgtoy.js deleted file mode 100755 index 3701eba..0000000 --- a/js/svgtoy.js +++ /dev/null @@ -1,352 +0,0 @@ -var assets = {}; - -function loadSVGAssets( filelist, callback ){ - var _this = this; - this.svgList = []; - - this.tempCallback = function( svgToy ){ - _this.svgList.push(svgToy); - _this.checkFinished(); - } - - this.checkFinished = function(){ - if( _this.svgList.length < filelist.length ) - loadSVGAsset( filelist[_this.svgList.length], _this.tempCallback ); - else - callback( this.svgList ); - } - - loadSVGAsset( filelist[0], this.tempCallback ); - -} - -function loadSVGAsset( filename, callback ){ - var _this = this; - _this.filename = filename; - - if( (filename in assets) === false ){ - // console.log("loading " + filename); - // reserve it so that multiple calls to this don't load multiple times - assets[filename] = ""; - xhr = new XMLHttpRequest(); - xhr.open( 'GET', filename, true ); - xhr.send( null ); - xhr.onreadystatechange = function() { - if ( xhr.readyState === 4 && xhr.status === 200 ) { - var svgString = xhr.responseText; - var dXML = new DOMParser(); - dXML.async = false; - var svg = dXML.parseFromString( svgString, 'text/xml').documentElement; - svg.svgText = svgString; - assets[_this.filename] = svg; - // console.log("loaded " + _this.filename); - callback(svg); - } - }; - } -} - - -function SVGToy( svgFile, domContainer ){ - var _this = this; - this.container = document.createElement('div'); - if( domContainer ) - domContainer.appendChild( this.container ); - - this.parentContainer = domContainer; - - this.container.style['-webkit-transform-style'] = 'preserve-3d'; - this.container.style.position = 'absolute'; - this.container.style['pointer-events'] = 'none'; - - // find the asset - this.svg = assets[svgFile].cloneNode(true); - this.svg.style.position = 'relative'; - this.svg.style.display = 'block'; - this.svg.style['pointer-events'] = 'visibleFill'; - this.container.appendChild( this.svg ); - - this.origin = this.getOriginFromFile(); - this.setOrigin( this.origin.x, this.origin.y ); - - this.TransformHelper = function(){ - this.value = ''; - - this.translate = function(x,y){ - this.value += 'translate(' + x + ',' + y + ') '; - return this; - } - this.rotate = function(angle){ - this.value += 'rotate(' + angle + ') '; - return this; - } - this.rotateOrigin = function(angle, originX, originY){ - this.value += 'translate(' + originX + ',' + originY + ') '; - this.value += 'rotate(' + angle + ') '; - this.value += 'translate(' + -originX + ',' + -originY + ') '; - return this; - } - this.scale = function(s){ - this.value += 'scale(' + s + ') '; - return this; - } - this.scaleOrigin = function(s, originX, originY){ - this.value += 'translate(' + originX + ',' + originY + ') '; - this.value += 'scale(' + s + ') '; - this.value += 'translate(' + -originX + ',' + -originY + ') '; - return this; - } - this.endTransform = function(){ - return this.value; - } - } - - this.prepVars = function( vars ){ - if( vars._ox === undefined ) - vars._ox = _this.origin.x; - if( vars._oy === undefined ) - vars._oy = _this.origin.y; - if( vars._tx === undefined ) - vars._tx = 0; - if( vars._ty === undefined ) - vars._ty = 0; - if( vars._ro === undefined ) - vars._ro = 0; - if( vars._so === undefined ) - vars._so = 1; - return vars; - } - - this.getInitialStateFromElement = function( element, vars ){ - var state = {t:element}; - // console.log(state); - for( prop in element ){ - // if( typeof element[prop] == 'SVGAnimatedLength' ) - // console.log(prop); - // console.log( typeof element[prop] ); - } - // return state; - return {}; - } - - this.setAnimation = function( elementName, keyframes ){ - var element = this.svg.getElementById( elementName ); - if( element === undefined || element === null ) - return; - - // _this.getInitialStateFromElement( element, keyframes[0].vars ); - - var lastEndState; - var lastTween; - var firstTween; - for( var i = 0; i 0 ){ - beginState = keyframes[i - 1].vars; - } - - // copy over from begin state to keep the state from last animation - var endState = keyframe.vars; - for( var prop in beginState ) { - if (!(prop in endState)) { - endState[prop] = beginState[prop]; - } - - // additive - // else { - // endState[prop] += beginState[prop]; - // } - } - - var tween = _this.setTweenStates( elementName, beginState, endState, duration, easing ); - - if( i == 0 ){ - firstTween = tween; - } - else{ - lastTween.chain( tween ); - } - - if( loop ){ - tween.chain( tween ); - } - - if( loopedVars !== undefined ){ - tween.onComplete( function(){ - for( var prop in loopedVars ){ - beginState[prop] = loopedVars[prop]; - } - }); - } - - lastTween = tween; - } - firstTween.start(); - } - - this.setTweenStates = function( elementName, beginState, endState, duration, easing ){ - _this.prepVars( beginState ); - _this.prepVars( endState ); - - var state = beginState; - var tween = _this.makeTween( state, endState, duration, easing, function(){ - var value = _this.beginTransform() - .translate( state._tx, state._ty) - .rotateOrigin( state._ro, state._ox, state._oy ) - .scaleOrigin( state._so, state._ox, state._oy ) - .endTransform(); - _this.setProperty( elementName, 'transform', value ); - for( prop in state ){ - if( _this.isEscapeProperty(prop) ) - continue; - // console.log(state[prop]); - _this.setProperty( elementName, prop, state[prop] ); - } - }); - return tween; - } - - this.makeTween = function( start, end, duration, easing, updatefunction ){ - var tween = new TWEEN.Tween( start ); - tween.to( end, duration ); - tween.easing( easing ); - tween.onUpdate(updatefunction); - return tween; - } - - this.isEscapeProperty = function( propName ){ - if( propName === '_ox' || propName === '_oy' || - propName === '_tx' || propName === '_ty' || - propName === '_ro' || propName === '_so' || - propName === 'duration' || propName === 'easing' || - propName === 'vars' || propName === 'loop' || - propName === 'loopedVars' ) - return true; - return false; - } - - -} - -SVGToy.prototype.getOriginFromFile = function(){ - if( this.svg === undefined ) - return {x:0,y:0}; - var originObject = this.svg.getElementById('Origin'); - var p = { - x : 0, - y : 0 - }; - if( originObject === undefined || originObject === null ) - return {x:0,y:0}; - - p.x = parseFloat(originObject.getAttribute('cx')); - p.y = parseFloat(originObject.getAttribute('cy')); - - return p; -} - -SVGToy.prototype.setOrigin = function( x, y ){ - this.svg.style.marginLeft = (-x) + 'px'; - this.svg.style.marginTop = (-y) + 'px'; - this.origin.x = x; - this.origin.y = y; -}; - -SVGToy.prototype.setPosition = function( x, y, z ){ - this.container.style.left = x + 'px'; - this.container.style.top = y + 'px'; - - // umm can't get this to work - // vvvvvvvvvvvvvvvvvvvvvvvvvv - - // this.container.style.webkitTransform = 'translate3d(' + x + ',' + y + ',' + 0 + ')'; - // var str = 'translate3d(' + x + 'px,' + y + 'px,' + z + 'px)'; - // console.log(str); - // this.container.style['webkit-transform'] = str; - // console.log(this.container.style.webkitTransform); - // var fin = 'translate3d(' + x + ',' + y + ',' + '0' + ')' - // console.log(fin); - // console.log = function(){}; -}; - -SVGToy.prototype.setAlpha = function( alpha ){ - this.container.style.opacity = alpha; -} - -SVGToy.prototype.setZIndex = function( index ){ - this.container.style['z-index'] = index + ''; -} - -SVGToy.prototype.setScale = function( scale ){ - this.svg.style.width = (scale * 100) + "%"; - this.svg.style.height = (scale * 100) + "%"; - var transform = this.beginTransform().scaleOrigin(scale).endTransform(); - this.setProperty('transform', transform); -} - -SVGToy.prototype.setProperty = function( elementName, elementProperty, value ){ - var element = this.svg.getElementById( elementName ); - if( element === undefined || element === null ) - return; - element.setAttribute( elementProperty, value ); -}; - -SVGToy.prototype.getProperty = function( elementName, elementProperty ){ - var element = this.svg.getElementById( elementName ); - if( element === undefined || element === null ) - return undefined; - return element.getAttribute( elementProperty ); -}; - -SVGToy.prototype.hide = function(){ - if( this.container.style.visibility === 'visibile' || this.container.style.visibility === undefined ) - if( this.hideEvent !== undefined ) - this.hideEvent(); - this.container.style.visibility = 'hidden'; - this.svg.style.visibility = 'hidden'; -}; - -SVGToy.prototype.show = function(){ - if( this.container.style.visibility === 'hidden' || this.container.style.visibility === undefined ) - if( this.showEvent !== undefined ) - this.showEvent(); - this.container.style.visibility = 'visible'; - this.svg.style.visibility = 'visible'; -}; - -SVGToy.prototype.visibile = function(){ - return this.container.style.visibility == 'visible' ? true : false; -}; - -SVGToy.prototype.setText = function( elementName, value ){ - if( this.svg === undefined ) - return; - var element = this.svg.getElementById( elementName ); - if( element === undefined || element === null ) - return undefined; - element.textContent = value; -}; - -SVGToy.prototype.beginTransform = function(){ - return new this.TransformHelper(); -}; - -SVGToy.prototype.removeFromDom = function(){ - this.parentContainer.removeChild( this.container ); -}; \ No newline at end of file diff --git a/thirdparty/ShaderExtras.js b/thirdparty/ShaderExtras.js deleted file mode 100755 index 0fcda20..0000000 --- a/thirdparty/ShaderExtras.js +++ /dev/null @@ -1,1779 +0,0 @@ -/** - * @author alteredq / http://alteredqualia.com/ - * @author zz85 / http://www.lab4games.net/zz85/blog - * - * ShaderExtras currently contains: - * - * screen - * convolution - * film - * bokeh - * sepia - * dotscreen - * vignette - * bleachbypass - * basic - * dofmipmap - * focus - * triangleBlur - * horizontalBlur + verticalBlur - * horizontalTiltShift + verticalTiltShift - * blend - * fxaa - * luminosity - * colorCorrection - * normalmap - * ssao - * colorify - * unpackDepthRGBA - */ - -THREE.ShaderExtras = { - - /* ------------------------------------------------------------------------- - // Full-screen textured quad shader - ------------------------------------------------------------------------- */ - - 'screen': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - opacity: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "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") - - }, - - /* ------------------------------------------------------------------------ - // Convolution shader - // - ported from o3d sample to WebGL / GLSL - // http://o3d.googlecode.com/svn/trunk/samples/convolution.html - ------------------------------------------------------------------------ */ - - 'convolution': { - - uniforms: { - - "tDiffuse" : { type: "t", value: 0, texture: null }, - "uImageIncrement" : { type: "v2", value: new THREE.Vector2( 0.001953125, 0.0 ) }, - "cKernel" : { type: "fv1", value: [] } - - }, - - vertexShader: [ - - //"#define KERNEL_SIZE 25.0", - - "uniform vec2 uImageIncrement;", - - "varying vec2 vUv;", - - "void main() {", - - "vUv = uv - ( ( KERNEL_SIZE - 1.0 ) / 2.0 ) * uImageIncrement;", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - //"#define KERNEL_SIZE 25", - "uniform float cKernel[ KERNEL_SIZE ];", - - "uniform sampler2D tDiffuse;", - "uniform vec2 uImageIncrement;", - - "varying vec2 vUv;", - - "void main() {", - - "vec2 imageCoord = vUv;", - "vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );", - - "for( int i = 0; i < KERNEL_SIZE; i ++ ) {", - - "sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];", - "imageCoord += uImageIncrement;", - - "}", - - "gl_FragColor = sum;", - - "}" - - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - - // Film grain & scanlines shader - - // - ported from HLSL to WebGL / GLSL - // http://www.truevision3d.com/forums/showcase/staticnoise_colorblackwhite_scanline_shaders-t18698.0.html - - // Screen Space Static Postprocessor - // - // Produces an analogue noise overlay similar to a film grain / TV static - // - // Original implementation and noise algorithm - // Pat 'Hawthorne' Shearon - // - // Optimized scanlines + noise version with intensity scaling - // Georg 'Leviathan' Steinrohder - - // This version is provided under a Creative Commons Attribution 3.0 License - // http://creativecommons.org/licenses/by/3.0/ - ------------------------------------------------------------------------- */ - - 'film': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - time: { type: "f", value: 0.0 }, - nIntensity: { type: "f", value: 0.5 }, - sIntensity: { type: "f", value: 0.05 }, - sCount: { type: "f", value: 4096 }, - grayscale: { type: "i", value: 1 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - // control parameter - "uniform float time;", - - "uniform bool grayscale;", - - // noise effect intensity value (0 = no effect, 1 = full effect) - "uniform float nIntensity;", - - // scanlines effect intensity value (0 = no effect, 1 = full effect) - "uniform float sIntensity;", - - // scanlines effect count value (0 = no effect, 4096 = full effect) - "uniform float sCount;", - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "void main() {", - - // sample the source - "vec4 cTextureScreen = texture2D( tDiffuse, vUv );", - - // make some noise - "float x = vUv.x * vUv.y * time * 1000.0;", - "x = mod( x, 13.0 ) * mod( x, 123.0 );", - "float dx = mod( x, 0.01 );", - - // add noise - "vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx * 100.0, 0.0, 1.0 );", - - // get us a sine and cosine - "vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );", - - // add scanlines - "cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;", - - // interpolate between source and result by intensity - "cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );", - - // convert to grayscale if desired - "if( grayscale ) {", - - "cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );", - - "}", - - "gl_FragColor = vec4( cResult, cTextureScreen.a );", - - "}" - - ].join("\n") - - }, - - - /* ------------------------------------------------------------------------- - // Depth-of-field shader with bokeh - // ported from GLSL shader by Martins Upitis - // http://artmartinsh.blogspot.com/2010/02/glsl-lens-blur-filter-with-bokeh.html - ------------------------------------------------------------------------- */ - - 'bokeh' : { - - uniforms: { tColor: { type: "t", value: 0, texture: null }, - tDepth: { type: "t", value: 1, texture: null }, - focus: { type: "f", value: 1.0 }, - aspect: { type: "f", value: 1.0 }, - aperture: { type: "f", value: 0.025 }, - maxblur: { type: "f", value: 1.0 }, - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "varying vec2 vUv;", - - "uniform sampler2D tColor;", - "uniform sampler2D tDepth;", - - "uniform float maxblur;", // max blur amount - "uniform float aperture;", // aperture - bigger values for shallower depth of field - - "uniform float focus;", - "uniform float aspect;", - - "void main() {", - - "vec2 aspectcorrect = vec2( 1.0, aspect );", - - "vec4 depth1 = texture2D( tDepth, vUv );", - - "float factor = depth1.x - focus;", - - "vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );", - - "vec2 dofblur9 = dofblur * 0.9;", - "vec2 dofblur7 = dofblur * 0.7;", - "vec2 dofblur4 = dofblur * 0.4;", - - "vec4 col = vec4( 0.0 );", - - "col += texture2D( tColor, vUv.xy );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );", - - "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );", - - "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );", - - "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );", - "col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );", - "col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );", - - "gl_FragColor = col / 41.0;", - "gl_FragColor.a = 1.0;", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Depth-of-field shader using mipmaps - // - from Matt Handley @applmak - // - requires power-of-2 sized render target with enabled mipmaps - ------------------------------------------------------------------------- */ - - 'dofmipmap': { - - uniforms: { - - tColor: { type: "t", value: 0, texture: null }, - tDepth: { type: "t", value: 1, texture: null }, - focus: { type: "f", value: 1.0 }, - maxblur: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float focus;", - "uniform float maxblur;", - - "uniform sampler2D tColor;", - "uniform sampler2D tDepth;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 depth = texture2D( tDepth, vUv );", - - "float factor = depth.x - focus;", - - "vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );", - - "gl_FragColor = col;", - "gl_FragColor.a = 1.0;", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Sepia tone shader - // - based on glfx.js sepia shader - // https://github.com/evanw/glfx.js - ------------------------------------------------------------------------- */ - - 'sepia': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - amount: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float amount;", - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 color = texture2D( tDiffuse, vUv );", - "vec3 c = color.rgb;", - - "color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );", - "color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );", - "color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );", - - "gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Dot screen shader - // - based on glfx.js sepia shader - // https://github.com/evanw/glfx.js - ------------------------------------------------------------------------- */ - - 'dotscreen': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - tSize: { type: "v2", value: new THREE.Vector2( 256, 256 ) }, - center: { type: "v2", value: new THREE.Vector2( 0.5, 0.5 ) }, - angle: { type: "f", value: 1.57 }, - scale: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform vec2 center;", - "uniform float angle;", - "uniform float scale;", - "uniform vec2 tSize;", - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "float pattern() {", - - "float s = sin( angle ), c = cos( angle );", - - "vec2 tex = vUv * tSize - center;", - "vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;", - - "return ( sin( point.x ) * sin( point.y ) ) * 4.0;", - - "}", - - "void main() {", - - "vec4 color = texture2D( tDiffuse, vUv );", - - "float average = ( color.r + color.g + color.b ) / 3.0;", - - "gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------------------------------ - // Vignette shader - // - based on PaintEffect postprocess from ro.me - // http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js - ------------------------------------------------------------------------------------------------ */ - - 'vignette': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - offset: { type: "f", value: 1.0 }, - darkness: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float offset;", - "uniform float darkness;", - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "void main() {", - - // Eskil's vignette - - "vec4 texel = texture2D( tDiffuse, vUv );", - "vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );", - "gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );", - - /* - // alternative version from glfx.js - // this one makes more "dusty" look (as opposed to "burned") - - "vec4 color = texture2D( tDiffuse, vUv );", - "float dist = distance( vUv, vec2( 0.5 ) );", - "color.rgb *= smoothstep( 0.8, offset * 0.799, dist *( darkness + offset ) );", - "gl_FragColor = color;", - */ - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Bleach bypass shader [http://en.wikipedia.org/wiki/Bleach_bypass] - // - based on Nvidia example - // http://developer.download.nvidia.com/shaderlibrary/webpages/shader_library.html#post_bleach_bypass - ------------------------------------------------------------------------- */ - - 'bleachbypass': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - opacity: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float opacity;", - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 base = texture2D( tDiffuse, vUv );", - - "vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );", - "float lum = dot( lumCoeff, base.rgb );", - "vec3 blend = vec3( lum );", - - "float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );", - - "vec3 result1 = 2.0 * base.rgb * blend;", - "vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );", - - "vec3 newColor = mix( result1, result2, L );", - - "float A2 = opacity * base.a;", - "vec3 mixRGB = A2 * newColor.rgb;", - "mixRGB += ( ( 1.0 - A2 ) * base.rgb );", - - "gl_FragColor = vec4( mixRGB, base.a );", - - "}" - - ].join("\n") - - }, - - /* -------------------------------------------------------------------------------------------------- - // Focus shader - // - based on PaintEffect postprocess from ro.me - // http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js - -------------------------------------------------------------------------------------------------- */ - - 'focus': { - - uniforms : { - - "tDiffuse": { type: "t", value: 0, texture: null }, - "screenWidth": { type: "f", value: 1024 }, - "screenHeight": { type: "f", value: 1024 }, - "sampleDistance": { type: "f", value: 0.94 }, - "waveFactor": { type: "f", value: 0.00125 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float screenWidth;", - "uniform float screenHeight;", - "uniform float sampleDistance;", - "uniform float waveFactor;", - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 color, org, tmp, add;", - "float sample_dist, f;", - "vec2 vin;", - "vec2 uv = vUv;", - - "add += color = org = texture2D( tDiffuse, uv );", - - "vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );", - "sample_dist = dot( vin, vin ) * 2.0;", - - "f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;", - - "vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );", - - "add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );", - "if( tmp.b < color.b ) color = tmp;", - - "add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );", - "if( tmp.b < color.b ) color = tmp;", - - "add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );", - "if( tmp.b < color.b ) color = tmp;", - - "add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );", - "if( tmp.b < color.b ) color = tmp;", - - "add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );", - "if( tmp.b < color.b ) color = tmp;", - - "add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );", - "if( tmp.b < color.b ) color = tmp;", - - "add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );", - "if( tmp.b < color.b ) color = tmp;", - - "color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );", - "color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );", - - "gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );", - - "}" - - - ].join("\n") - }, - - /* ------------------------------------------------------------------------- - // Triangle blur shader - // - based on glfx.js triangle blur shader - // https://github.com/evanw/glfx.js - - // A basic blur filter, which convolves the image with a - // pyramid filter. The pyramid filter is separable and is applied as two - // perpendicular triangle filters. - ------------------------------------------------------------------------- */ - - 'triangleBlur': { - - - uniforms : { - - "texture": { type: "t", value: 0, texture: null }, - "delta": { type: "v2", value:new THREE.Vector2( 1, 1 ) } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "#define ITERATIONS 10.0", - - "uniform sampler2D texture;", - "uniform vec2 delta;", - - "varying vec2 vUv;", - - "float random( vec3 scale, float seed ) {", - - // use the fragment position for a different seed per-pixel - - "return fract( sin( dot( gl_FragCoord.xyz + seed, scale ) ) * 43758.5453 + seed );", - - "}", - - "void main() {", - - "vec4 color = vec4( 0.0 );", - - "float total = 0.0;", - - // randomize the lookup values to hide the fixed number of samples - - "float offset = random( vec3( 12.9898, 78.233, 151.7182 ), 0.0 );", - - "for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {", - - "float percent = ( t + offset - 0.5 ) / ITERATIONS;", - "float weight = 1.0 - abs( percent );", - - "color += texture2D( texture, vUv + delta * percent ) * weight;", - "total += weight;", - - "}", - - "gl_FragColor = color / total;", - - "}", - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Simple test shader - ------------------------------------------------------------------------- */ - - 'basic': { - - uniforms: {}, - - vertexShader: [ - - "void main() {", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "void main() {", - - "gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );", - - "}" - - ].join("\n") - - }, - - /* -------------------------------------------------------------------------------------------------- - // Two pass Gaussian blur filter (horizontal and vertical blur shaders) - // - described in http://www.gamerendering.com/2008/10/11/gaussian-blur-filter-shader/ - // and used in http://www.cake23.de/traveling-wavefronts-lit-up.html - // - // - 9 samples per pass - // - standard deviation 2.7 - // - "h" and "v" parameters should be set to "1 / width" and "1 / height" - -------------------------------------------------------------------------------------------------- */ - - 'horizontalBlur': { - - uniforms: { - - "tDiffuse": { type: "t", value: 0, texture: null }, - "h": { type: "f", value: 1.0 / 512.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D tDiffuse;", - "uniform float h;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 sum = vec4( 0.0 );", - - "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", - "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", - - "gl_FragColor = sum;", - - "}" - - - ].join("\n") - - }, - - 'verticalBlur': { - - uniforms: { - - "tDiffuse": { type: "t", value: 0, texture: null }, - "v": { type: "f", value: 1.0 / 512.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D tDiffuse;", - "uniform float v;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 sum = vec4( 0.0 );", - - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", - - "gl_FragColor = sum;", - - "}" - - - ].join("\n") - - }, - - /* -------------------------------------------------------------------------------------------------- - // Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position - // - // - 9 samples per pass - // - standard deviation 2.7 - // - "h" and "v" parameters should be set to "1 / width" and "1 / height" - // - "r" parameter control where "focused" horizontal line lies - -------------------------------------------------------------------------------------------------- */ - - 'horizontalTiltShift': { - - uniforms: { - - "tDiffuse": { type: "t", value: 0, texture: null }, - "h": { type: "f", value: 1.0 / 512.0 }, - "r": { type: "f", value: 0.35 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D tDiffuse;", - "uniform float h;", - "uniform float r;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 sum = vec4( 0.0 );", - - "float hh = h * abs( r - vUv.y );", - - "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;", - "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;", - - "gl_FragColor = sum;", - - "}" - - - ].join("\n") - - }, - - 'verticalTiltShift': { - - uniforms: { - - "tDiffuse": { type: "t", value: 0, texture: null }, - "v": { type: "f", value: 1.0 / 512.0 }, - "r": { type: "f", value: 0.35 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D tDiffuse;", - "uniform float v;", - "uniform float r;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 sum = vec4( 0.0 );", - - "float vv = v * abs( r - vUv.y );", - - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;", - "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;", - - "gl_FragColor = sum;", - - "}" - - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Blend two textures - ------------------------------------------------------------------------- */ - - 'blend': { - - uniforms: { - - tDiffuse1: { type: "t", value: 0, texture: null }, - tDiffuse2: { type: "t", value: 1, texture: null }, - mixRatio: { type: "f", value: 0.5 }, - opacity: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float opacity;", - "uniform float mixRatio;", - - "uniform sampler2D tDiffuse1;", - "uniform sampler2D tDiffuse2;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 texel1 = texture2D( tDiffuse1, vUv );", - "vec4 texel2 = texture2D( tDiffuse2, vUv );", - "gl_FragColor = opacity * mix( texel1, texel2, mixRatio );", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // NVIDIA FXAA by Timothy Lottes - // http://timothylottes.blogspot.com/2011/06/fxaa3-source-released.html - // - WebGL port by @supereggbert - // http://www.glge.org/demos/fxaa/ - ------------------------------------------------------------------------- */ - - 'fxaa': { - - uniforms: { - - "tDiffuse": { type: "t", value: 0, texture: null }, - "resolution": { type: "v2", value: new THREE.Vector2( 1 / 1024, 1 / 512 ) } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D tDiffuse;", - "uniform vec2 resolution;", - - "varying vec2 vUv;", - - "#define FXAA_REDUCE_MIN (1.0/128.0)", - "#define FXAA_REDUCE_MUL (1.0/8.0)", - "#define FXAA_SPAN_MAX 8.0", - - "void main() {", - - "vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;", - "vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;", - "vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;", - "vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;", - "vec3 rgbM = texture2D( tDiffuse, gl_FragCoord.xy * resolution ).xyz;", - - "vec3 luma = vec3( 0.299, 0.587, 0.114 );", - - "float lumaNW = dot( rgbNW, luma );", - "float lumaNE = dot( rgbNE, luma );", - "float lumaSW = dot( rgbSW, luma );", - "float lumaSE = dot( rgbSE, luma );", - "float lumaM = dot( rgbM, luma );", - "float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );", - "float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );", - - "vec2 dir;", - "dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));", - "dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));", - - "float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );", - - "float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );", - "dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),", - "max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),", - "dir * rcpDirMin)) * resolution;", - - "vec3 rgbA = 0.5 * (", - "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz +", - "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz );", - - "vec3 rgbB = rgbA * 0.5 + 0.25 * (", - "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * -0.5 ).xyz +", - "texture2D( tDiffuse, gl_FragCoord.xy * resolution + dir * 0.5 ).xyz );", - - "float lumaB = dot( rgbB, luma );", - - "if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {", - - "gl_FragColor = vec4( rgbA, 1.0 );", - - "} else {", - - "gl_FragColor = vec4( rgbB, 1.0 );", - - "}", - - "}", - - ].join("\n"), - - }, - - /* ------------------------------------------------------------------------- - // Luminosity - // http://en.wikipedia.org/wiki/Luminosity - ------------------------------------------------------------------------- */ - - 'luminosity': { - - uniforms: { - - "tDiffuse": { type: "t", value: 0, texture: null } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 texel = texture2D( tDiffuse, vUv );", - - "vec3 luma = vec3( 0.299, 0.587, 0.114 );", - - "float v = dot( texel.xyz, luma );", - - "gl_FragColor = vec4( v, v, v, texel.w );", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Color correction - ------------------------------------------------------------------------- */ - - 'colorCorrection': { - - uniforms: { - - "tDiffuse" : { type: "t", value: 0, texture: null }, - "powRGB" : { type: "v3", value: new THREE.Vector3( 2, 2, 2 ) }, - "mulRGB" : { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform sampler2D tDiffuse;", - "uniform vec3 powRGB;", - "uniform vec3 mulRGB;", - - "varying vec2 vUv;", - - "void main() {", - - "gl_FragColor = texture2D( tDiffuse, vUv );", - "gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Normal map shader - // - compute normals from heightmap - ------------------------------------------------------------------------- */ - - 'normalmap': { - - uniforms: { - - "heightMap" : { type: "t", value: 0, texture: null }, - "resolution": { type: "v2", value: new THREE.Vector2( 512, 512 ) }, - "scale" : { type: "v2", value: new THREE.Vector2( 1, 1 ) }, - "height" : { type: "f", value: 0.05 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float height;", - "uniform vec2 resolution;", - "uniform sampler2D heightMap;", - - "varying vec2 vUv;", - - "void main() {", - - "float val = texture2D( heightMap, vUv ).x;", - - "float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;", - "float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;", - - "gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );", - - "}", - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Screen-space ambient occlusion shader - // - ported from - // SSAO GLSL shader v1.2 - // assembled by Martins Upitis (martinsh) (http://devlog-martinsh.blogspot.com) - // original technique is made by ArKano22 (http://www.gamedev.net/topic/550699-ssao-no-halo-artifacts/) - // - modifications - // - modified to use RGBA packed depth texture (use clear color 1,1,1,1 for depth pass) - // - made fog more compatible with three.js linear fog - // - refactoring and optimizations - ------------------------------------------------------------------------- */ - - 'ssao': { - - uniforms: { - - "tDiffuse": { type: "t", value: 0, texture: null }, - "tDepth": { type: "t", value: 1, texture: null }, - "size": { type: "v2", value: new THREE.Vector2( 512, 512 ) }, - "cameraNear": { type: "f", value: 1 }, - "cameraFar": { type: "f", value: 100 }, - "fogNear": { type: "f", value: 5 }, - "fogFar": { type: "f", value: 100 }, - "fogEnabled": { type: "i", value: 0 }, - "aoClamp": { type: "f", value: 0.3 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float cameraNear;", - "uniform float cameraFar;", - - "uniform float fogNear;", - "uniform float fogFar;", - - "uniform bool fogEnabled;", - - "uniform vec2 size;", // texture width, height - "uniform float aoClamp;", // depth clamp - reduces haloing at screen edges - - "uniform sampler2D tDiffuse;", - "uniform sampler2D tDepth;", - - "varying vec2 vUv;", - - //"#define PI 3.14159265", - "#define DL 2.399963229728653", // PI * ( 3.0 - sqrt( 5.0 ) ) - "#define EULER 2.718281828459045", - - // helpers - - "float width = size.x;", // texture width - "float height = size.y;", // texture height - - "float cameraFarPlusNear = cameraFar + cameraNear;", - "float cameraFarMinusNear = cameraFar - cameraNear;", - "float cameraCoef = 2.0 * cameraNear;", - - // user variables - - "const int samples = 8;", // ao sample count - "const float radius = 5.0;", // ao radius - - "const bool useNoise = false;", // use noise instead of pattern for sample dithering - "const float noiseAmount = 0.0002;", // dithering amount - - "const float diffArea = 0.4;", // self-shadowing reduction - "const float gDisplace = 0.4;", // gauss bell center - - "const bool onlyAO = false;", // use only ambient occlusion pass? - "const float lumInfluence = 0.3;", // how much luminance affects occlusion - - // RGBA depth - - "float unpackDepth( const in vec4 rgba_depth ) {", - - "const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );", - "float depth = dot( rgba_depth, bit_shift );", - "return depth;", - - "}", - - // generating noise / pattern texture for dithering - - "vec2 rand( const vec2 coord ) {", - - "vec2 noise;", - - "if ( useNoise ) {", - - "float nx = dot ( coord, vec2( 12.9898, 78.233 ) );", - "float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );", - - "noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );", - - "} else {", - - "float ff = fract( 1.0 - coord.s * ( width / 2.0 ) );", - "float gg = fract( coord.t * ( height / 2.0 ) );", - - "noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;", - - "}", - - "return ( noise * 2.0 - 1.0 ) * noiseAmount;", - - "}", - - "float doFog() {", - - "float zdepth = unpackDepth( texture2D( tDepth, vUv ) );", - "float depth = -cameraFar * cameraNear / ( zdepth * cameraFarMinusNear - cameraFar );", - - "return smoothstep( fogNear, fogFar, depth );", - - "}", - - "float readDepth( const in vec2 coord ) {", - - //"return ( 2.0 * cameraNear ) / ( cameraFar + cameraNear - unpackDepth( texture2D( tDepth, coord ) ) * ( cameraFar - cameraNear ) );", - "return cameraCoef / ( cameraFarPlusNear - unpackDepth( texture2D( tDepth, coord ) ) * cameraFarMinusNear );", - - - "}", - - "float compareDepths( const in float depth1, const in float depth2, inout int far ) {", - - "float garea = 2.0;", // gauss bell width - "float diff = ( depth1 - depth2 ) * 100.0;", // depth difference (0-100) - - // reduce left bell width to avoid self-shadowing - - "if ( diff < gDisplace ) {", - - "garea = diffArea;", - - "} else {", - - "far = 1;", - - "}", - - "float dd = diff - gDisplace;", - "float gauss = pow( EULER, -2.0 * dd * dd / ( garea * garea ) );", - "return gauss;", - - "}", - - "float calcAO( float depth, float dw, float dh ) {", - - "float dd = radius - depth * radius;", - "vec2 vv = vec2( dw, dh );", - - "vec2 coord1 = vUv + dd * vv;", - "vec2 coord2 = vUv - dd * vv;", - - "float temp1 = 0.0;", - "float temp2 = 0.0;", - - "int far = 0;", - "temp1 = compareDepths( depth, readDepth( coord1 ), far );", - - // DEPTH EXTRAPOLATION - - "if ( far > 0 ) {", - - "temp2 = compareDepths( readDepth( coord2 ), depth, far );", - "temp1 += ( 1.0 - temp1 ) * temp2;", - - "}", - - "return temp1;", - - "}", - - "void main() {", - - "vec2 noise = rand( vUv );", - "float depth = readDepth( vUv );", - - "float tt = clamp( depth, aoClamp, 1.0 );", - - "float w = ( 1.0 / width ) / tt + ( noise.x * ( 1.0 - noise.x ) );", - "float h = ( 1.0 / height ) / tt + ( noise.y * ( 1.0 - noise.y ) );", - - "float pw;", - "float ph;", - - "float ao;", - - "float dz = 1.0 / float( samples );", - "float z = 1.0 - dz / 2.0;", - "float l = 0.0;", - - "for ( int i = 0; i <= samples; i ++ ) {", - - "float r = sqrt( 1.0 - z );", - - "pw = cos( l ) * r;", - "ph = sin( l ) * r;", - "ao += calcAO( depth, pw * w, ph * h );", - "z = z - dz;", - "l = l + DL;", - - "}", - - "ao /= float( samples );", - "ao = 1.0 - ao;", - - "if ( fogEnabled ) {", - - "ao = mix( ao, 1.0, doFog() );", - - "}", - - "vec3 color = texture2D( tDiffuse, vUv ).rgb;", - - "vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );", - "float lum = dot( color.rgb, lumcoeff );", - "vec3 luminance = vec3( lum );", - - "vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );", // mix( color * ao, white, luminance ) - - "if ( onlyAO ) {", - - "final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );", // ambient occlusion only - - "}", - - "gl_FragColor = vec4( final, 1.0 );", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Colorify shader - ------------------------------------------------------------------------- */ - - 'colorify': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - color: { type: "c", value: new THREE.Color( 0xffffff ) } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform vec3 color;", - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - "void main() {", - - "vec4 texel = texture2D( tDiffuse, vUv );", - - "vec3 luma = vec3( 0.299, 0.587, 0.114 );", - "float v = dot( texel.xyz, luma );", - - "gl_FragColor = vec4( v * color, texel.w );", - - "}" - - ].join("\n") - - }, - - /* ------------------------------------------------------------------------- - // Unpack RGBA depth shader - // - show RGBA encoded depth as monochrome color - ------------------------------------------------------------------------- */ - - 'unpackDepthRGBA': { - - uniforms: { - - tDiffuse: { type: "t", value: 0, texture: null }, - opacity: { type: "f", value: 1.0 } - - }, - - vertexShader: [ - - "varying vec2 vUv;", - - "void main() {", - - "vUv = vec2( uv.x, 1.0 - uv.y );", - "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", - - "}" - - ].join("\n"), - - fragmentShader: [ - - "uniform float opacity;", - - "uniform sampler2D tDiffuse;", - - "varying vec2 vUv;", - - // RGBA depth - - "float unpackDepth( const in vec4 rgba_depth ) {", - - "const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );", - "float depth = dot( rgba_depth, bit_shift );", - "return depth;", - - "}", - - "void main() {", - - "float depth = 1.0 - unpackDepth( texture2D( tDiffuse, vUv ) );", - "gl_FragColor = opacity * vec4( vec3( depth ), 1.0 );", - - "}" - - ].join("\n") - - }, - - // METHODS - - buildKernel: function( sigma ) { - - // We lop off the sqrt(2 * pi) * sigma term, since we're going to normalize anyway. - - function gauss( x, sigma ) { - - return Math.exp( - ( x * x ) / ( 2.0 * sigma * sigma ) ); - - } - - var i, values, sum, halfWidth, kMaxKernelSize = 25, kernelSize = 2 * Math.ceil( sigma * 3.0 ) + 1; - - if ( kernelSize > kMaxKernelSize ) kernelSize = kMaxKernelSize; - halfWidth = ( kernelSize - 1 ) * 0.5 - - values = new Array( kernelSize ); - sum = 0.0; - for ( i = 0; i < kernelSize; ++i ) { - - values[ i ] = gauss( i - halfWidth, sigma ); - sum += values[ i ]; - - } - - // normalize the kernel - - for ( i = 0; i < kernelSize; ++i ) values[ i ] /= sum; - - return values; - - } - -}; diff --git a/thirdparty/Stats.js b/thirdparty/Stats.js deleted file mode 100755 index 31c054a..0000000 --- a/thirdparty/Stats.js +++ /dev/null @@ -1,7 +0,0 @@ -// stats.js r9 - http://github.com/mrdoob/stats.js -var Stats=function(){var h,a,r=0,s=0,i=Date.now(),u=i,t=i,l=0,n=1E3,o=0,e,j,f,b=[[16,16,48],[0,255,255]],m=0,p=1E3,q=0,d,k,g,c=[[16,48,16],[0,255,0]];h=document.createElement("div");h.style.cursor="pointer";h.style.width="80px";h.style.opacity="0.9";h.style.zIndex="10001";h.addEventListener("mousedown",function(a){a.preventDefault();r=(r+1)%2;0==r?(e.style.display="block",d.style.display="none"):(e.style.display="none",d.style.display="block")},!1);e=document.createElement("div");e.style.textAlign= -"left";e.style.lineHeight="1.2em";e.style.backgroundColor="rgb("+Math.floor(b[0][0]/2)+","+Math.floor(b[0][1]/2)+","+Math.floor(b[0][2]/2)+")";e.style.padding="0 0 3px 3px";h.appendChild(e);j=document.createElement("div");j.style.fontFamily="Helvetica, Arial, sans-serif";j.style.fontSize="9px";j.style.color="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";j.style.fontWeight="bold";j.innerHTML="FPS";e.appendChild(j);f=document.createElement("div");f.style.position="relative";f.style.width="74px";f.style.height= -"30px";f.style.backgroundColor="rgb("+b[1][0]+","+b[1][1]+","+b[1][2]+")";for(e.appendChild(f);74>f.children.length;)a=document.createElement("span"),a.style.width="1px",a.style.height="30px",a.style.cssFloat="left",a.style.backgroundColor="rgb("+b[0][0]+","+b[0][1]+","+b[0][2]+")",f.appendChild(a);d=document.createElement("div");d.style.textAlign="left";d.style.lineHeight="1.2em";d.style.backgroundColor="rgb("+Math.floor(c[0][0]/2)+","+Math.floor(c[0][1]/2)+","+Math.floor(c[0][2]/2)+")";d.style.padding= -"0 0 3px 3px";d.style.display="none";h.appendChild(d);k=document.createElement("div");k.style.fontFamily="Helvetica, Arial, sans-serif";k.style.fontSize="9px";k.style.color="rgb("+c[1][0]+","+c[1][1]+","+c[1][2]+")";k.style.fontWeight="bold";k.innerHTML="MS";d.appendChild(k);g=document.createElement("div");g.style.position="relative";g.style.width="74px";g.style.height="30px";g.style.backgroundColor="rgb("+c[1][0]+","+c[1][1]+","+c[1][2]+")";for(d.appendChild(g);74>g.children.length;)a=document.createElement("span"), -a.style.width="1px",a.style.height=30*Math.random()+"px",a.style.cssFloat="left",a.style.backgroundColor="rgb("+c[0][0]+","+c[0][1]+","+c[0][2]+")",g.appendChild(a);return{getDomElement:function(){return h},getFps:function(){return l},getFpsMin:function(){return n},getFpsMax:function(){return o},getMs:function(){return m},getMsMin:function(){return p},getMsMax:function(){return q},update:function(){i=Date.now();m=i-u;p=Math.min(p,m);q=Math.max(q,m);k.textContent=m+" MS ("+p+"-"+q+")";var a=Math.min(30, -30-30*(m/200));g.appendChild(g.firstChild).style.height=a+"px";u=i;s++;if(i>t+1E3)l=Math.round(1E3*s/(i-t)),n=Math.min(n,l),o=Math.max(o,l),j.textContent=l+" FPS ("+n+"-"+o+")",a=Math.min(30,30-30*(l/100)),f.appendChild(f.firstChild).style.height=a+"px",t=i,s=0}}}; diff --git a/thirdparty/Tween.js b/thirdparty/Tween.js deleted file mode 100755 index fc1d26c..0000000 --- a/thirdparty/Tween.js +++ /dev/null @@ -1,530 +0,0 @@ -/** - * @author sole / http://soledadpenades.com - * @author mr.doob / http://mrdoob.com - * @author Robert Eisele / http://www.xarg.org - * @author Philippe / http://philippe.elsass.me - * @author Robert Penner / http://www.robertpenner.com/easing_terms_of_use.html - * @author Paul Lewis / http://www.aerotwist.com/ - * @author lechecacharro - * @author Josh Faul / http://jocafa.com/ - */ - -var TWEEN = TWEEN || ( function () { - - var i, tl, interval, time, fps = 60, autostart = false, tweens = [], num_tweens; - - return { - - setFPS: function ( f ) { - - fps = f || 60; - - }, - - start: function ( f ) { - - if( arguments.length != 0 ) { - this.setFPS( f ); - } - - interval = setInterval( this.update, 1000 / fps ); - - }, - - stop: function () { - - clearInterval( interval ); - - }, - - setAutostart: function ( value ) { - - autostart = value; - - if(autostart && !interval) { - this.start(); - } - - }, - - add: function ( tween ) { - - tweens.push( tween ); - - if (autostart && !interval) { - - this.start(); - - } - - }, - - getAll: function() { - - return tweens; - - }, - - removeAll: function() { - - tweens = []; - - }, - - remove: function ( tween ) { - - i = tweens.indexOf( tween ); - - if ( i !== -1 ) { - - tweens.splice( i, 1 ); - - } - - }, - - update: function (_time) { - - i = 0; num_tweens = tweens.length; - var time = _time || Date.now(); - - while ( i < num_tweens ) { - - if ( tweens[ i ].update( time ) ) { - - i++; - - } else { - - tweens.splice( i, 1 ); - num_tweens--; - - } - - } - - if (num_tweens == 0 && autostart == true) { - - this.stop(); - - } - - } - - }; - -} )(); - -TWEEN.Tween = function ( object ) { - - var _object = object, - _valuesStart = {}, - _valuesDelta = {}, - _valuesEnd = {}, - _duration = 1000, - _delayTime = 0, - _startTime = null, - _easingFunction = TWEEN.Easing.Linear.EaseNone, - _chainedTween = null, - _onUpdateCallback = null, - _onCompleteCallback = null; - - this.to = function ( properties, duration ) { - - if( duration !== null ) { - - _duration = duration; - - } - - for ( var property in properties ) { - - // This prevents the engine from interpolating null values - if ( _object[ property ] === null ) { - - continue; - - } - - // The current values are read when the tween starts; - // here we only store the final desired values - _valuesEnd[ property ] = properties[ property ]; - - } - - return this; - - }; - - this.start = function (_time) { - - TWEEN.add( this ); - - _startTime = _time ? _time + _delayTime : Date.now() + _delayTime; - - for ( var property in _valuesEnd ) { - - // Again, prevent dealing with null values - if ( _object[ property ] === null ) { - - continue; - - } - - _valuesStart[ property ] = _object[ property ]; - _valuesDelta[ property ] = _valuesEnd[ property ] - _object[ property ]; - - } - - return this; - }; - - this.stop = function () { - - TWEEN.remove( this ); - return this; - - }; - - this.delay = function ( amount ) { - - _delayTime = amount; - return this; - - }; - - this.easing = function ( easing ) { - - _easingFunction = easing; - return this; - - }; - - this.chain = function ( chainedTween ) { - - _chainedTween = chainedTween; - - }; - - this.onUpdate = function ( onUpdateCallback ) { - - _onUpdateCallback = onUpdateCallback; - return this; - - }; - - this.onComplete = function ( onCompleteCallback ) { - - _onCompleteCallback = onCompleteCallback; - return this; - - }; - - this.update = function ( time ) { - - var property, elapsed, value; - - if ( time < _startTime ) { - - return true; - - } - - elapsed = ( time - _startTime ) / _duration; - elapsed = elapsed > 1 ? 1 : elapsed; - - value = _easingFunction( elapsed ); - - for ( property in _valuesDelta ) { - - _object[ property ] = _valuesStart[ property ] + _valuesDelta[ property ] * value; - - } - - if ( _onUpdateCallback !== null ) { - - _onUpdateCallback.call( _object, value ); - - } - - if ( elapsed == 1 ) { - - if ( _onCompleteCallback !== null ) { - - _onCompleteCallback.call( _object ); - - } - - if ( _chainedTween !== null ) { - - _chainedTween.start(); - - } - - return false; - - } - - return true; - - }; - - /* - this.destroy = function () { - - TWEEN.remove( this ); - - }; - */ -} - -TWEEN.Easing = { Linear: {}, Quadratic: {}, Cubic: {}, Quartic: {}, Quintic: {}, Sinusoidal: {}, Exponential: {}, Circular: {}, Elastic: {}, Back: {}, Bounce: {} }; - - -TWEEN.Easing.Linear.EaseNone = function ( k ) { - - return k; - -}; - -// - -TWEEN.Easing.Quadratic.EaseIn = function ( k ) { - - return k * k; - -}; - -TWEEN.Easing.Quadratic.EaseOut = function ( k ) { - - return - k * ( k - 2 ); - -}; - -TWEEN.Easing.Quadratic.EaseInOut = function ( k ) { - - if ( ( k *= 2 ) < 1 ) return 0.5 * k * k; - return - 0.5 * ( --k * ( k - 2 ) - 1 ); - -}; - -// - -TWEEN.Easing.Cubic.EaseIn = function ( k ) { - - return k * k * k; - -}; - -TWEEN.Easing.Cubic.EaseOut = function ( k ) { - - return --k * k * k + 1; - -}; - -TWEEN.Easing.Cubic.EaseInOut = function ( k ) { - - if ( ( k *= 2 ) < 1 ) return 0.5 * k * k * k; - return 0.5 * ( ( k -= 2 ) * k * k + 2 ); - -}; - -// - -TWEEN.Easing.Quartic.EaseIn = function ( k ) { - - return k * k * k * k; - -}; - -TWEEN.Easing.Quartic.EaseOut = function ( k ) { - - return - ( --k * k * k * k - 1 ); - -} - -TWEEN.Easing.Quartic.EaseInOut = function ( k ) { - - if ( ( k *= 2 ) < 1) return 0.5 * k * k * k * k; - return - 0.5 * ( ( k -= 2 ) * k * k * k - 2 ); - -}; - -// - -TWEEN.Easing.Quintic.EaseIn = function ( k ) { - - return k * k * k * k * k; - -}; - -TWEEN.Easing.Quintic.EaseOut = function ( k ) { - - return ( k = k - 1 ) * k * k * k * k + 1; - -}; - -TWEEN.Easing.Quintic.EaseInOut = function ( k ) { - - if ( ( k *= 2 ) < 1 ) return 0.5 * k * k * k * k * k; - return 0.5 * ( ( k -= 2 ) * k * k * k * k + 2 ); - -}; - -// - -TWEEN.Easing.Sinusoidal.EaseIn = function ( k ) { - - return - Math.cos( k * Math.PI / 2 ) + 1; - -}; - -TWEEN.Easing.Sinusoidal.EaseOut = function ( k ) { - - return Math.sin( k * Math.PI / 2 ); - -}; - -TWEEN.Easing.Sinusoidal.EaseInOut = function ( k ) { - - return - 0.5 * ( Math.cos( Math.PI * k ) - 1 ); - -}; - -// - -TWEEN.Easing.Exponential.EaseIn = function ( k ) { - - return k == 0 ? 0 : Math.pow( 2, 10 * ( k - 1 ) ); - -}; - -TWEEN.Easing.Exponential.EaseOut = function ( k ) { - - return k == 1 ? 1 : - Math.pow( 2, - 10 * k ) + 1; - -}; - -TWEEN.Easing.Exponential.EaseInOut = function ( k ) { - - if ( k == 0 ) return 0; - if ( k == 1 ) return 1; - if ( ( k *= 2 ) < 1 ) return 0.5 * Math.pow( 2, 10 * ( k - 1 ) ); - return 0.5 * ( - Math.pow( 2, - 10 * ( k - 1 ) ) + 2 ); - -}; - -// - -TWEEN.Easing.Circular.EaseIn = function ( k ) { - - return - ( Math.sqrt( 1 - k * k ) - 1); - -}; - -TWEEN.Easing.Circular.EaseOut = function ( k ) { - - return Math.sqrt( 1 - --k * k ); - -}; - -TWEEN.Easing.Circular.EaseInOut = function ( k ) { - - if ( ( k /= 0.5 ) < 1) return - 0.5 * ( Math.sqrt( 1 - k * k) - 1); - return 0.5 * ( Math.sqrt( 1 - ( k -= 2) * k) + 1); - -}; - -// - -TWEEN.Easing.Elastic.EaseIn = function( k ) { - - var s, a = 0.1, p = 0.4; - if ( k == 0 ) return 0; if ( k == 1 ) return 1; if ( !p ) p = 0.3; - if ( !a || a < 1 ) { a = 1; s = p / 4; } - else s = p / ( 2 * Math.PI ) * Math.asin( 1 / a ); - return - ( a * Math.pow( 2, 10 * ( k -= 1 ) ) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) ); - -}; - -TWEEN.Easing.Elastic.EaseOut = function( k ) { - - var s, a = 0.1, p = 0.4; - if ( k == 0 ) return 0; if ( k == 1 ) return 1; if ( !p ) p = 0.3; - if ( !a || a < 1 ) { a = 1; s = p / 4; } - else s = p / ( 2 * Math.PI ) * Math.asin( 1 / a ); - return ( a * Math.pow( 2, - 10 * k) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) + 1 ); - -}; - -TWEEN.Easing.Elastic.EaseInOut = function( k ) { - - var s, a = 0.1, p = 0.4; - if ( k == 0 ) return 0; if ( k == 1 ) return 1; if ( !p ) p = 0.3; - if ( !a || a < 1 ) { a = 1; s = p / 4; } - else s = p / ( 2 * Math.PI ) * Math.asin( 1 / a ); - if ( ( k *= 2 ) < 1 ) return - 0.5 * ( a * Math.pow( 2, 10 * ( k -= 1 ) ) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) ); - return a * Math.pow( 2, -10 * ( k -= 1 ) ) * Math.sin( ( k - s ) * ( 2 * Math.PI ) / p ) * 0.5 + 1; - -}; - -// - -TWEEN.Easing.Back.EaseIn = function( k ) { - - var s = 1.70158; - return k * k * ( ( s + 1 ) * k - s ); - -}; - -TWEEN.Easing.Back.EaseOut = function( k ) { - - var s = 1.70158; - return ( k = k - 1 ) * k * ( ( s + 1 ) * k + s ) + 1; - -}; - -TWEEN.Easing.Back.EaseInOut = function( k ) { - - var s = 1.70158 * 1.525; - if ( ( k *= 2 ) < 1 ) return 0.5 * ( k * k * ( ( s + 1 ) * k - s ) ); - return 0.5 * ( ( k -= 2 ) * k * ( ( s + 1 ) * k + s ) + 2 ); - -}; - -// - -TWEEN.Easing.Bounce.EaseIn = function( k ) { - - return 1 - TWEEN.Easing.Bounce.EaseOut( 1 - k ); - -}; - -TWEEN.Easing.Bounce.EaseOut = function( k ) { - - if ( ( k /= 1 ) < ( 1 / 2.75 ) ) { - - return 7.5625 * k * k; - - } else if ( k < ( 2 / 2.75 ) ) { - - return 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75; - - } else if ( k < ( 2.5 / 2.75 ) ) { - - return 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375; - - } else { - - return 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375; - - } - -}; - -TWEEN.Easing.Bounce.EaseInOut = function( k ) { - - if ( k < 0.5 ) return TWEEN.Easing.Bounce.EaseIn( k * 2 ) * 0.5; - return TWEEN.Easing.Bounce.EaseOut( k * 2 - 1 ) * 0.5 + 0.5; - -}; diff --git a/thirdparty/canvg.js b/thirdparty/canvg.js deleted file mode 100755 index 7b24a38..0000000 --- a/thirdparty/canvg.js +++ /dev/null @@ -1,2620 +0,0 @@ -/* - * canvg.js - Javascript SVG parser and renderer on Canvas - * MIT Licensed - * Gabe Lerner (gabelerner@gmail.com) - * http://code.google.com/p/canvg/ - * - * Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/ - */ -if(!window.console) { - window.console = {}; - window.console.log = function(str) {}; - window.console.dir = function(str) {}; -} - -if(!Array.prototype.indexOf){ - Array.prototype.indexOf = function(obj){ - for(var i=0; i ignore mouse events - // ignoreAnimation: true => ignore animations - // ignoreDimensions: true => does not try to resize canvas - // ignoreClear: true => does not clear canvas - // offsetX: int => draws at a x offset - // offsetY: int => draws at a y offset - // scaleWidth: int => scales horizontally to width - // scaleHeight: int => scales vertically to height - // renderCallback: function => will call the function after the first render is completed - // forceRedraw: function => will call the function on every frame, if it returns true, will redraw - this.canvg = function (target, s, opts) { - // no parameters - if (target == null && s == null && opts == null) { - var svgTags = document.getElementsByTagName('svg'); - for (var i=0; i]*>/, ''); - var xmlDoc = new ActiveXObject('Microsoft.XMLDOM'); - xmlDoc.async = 'false'; - xmlDoc.loadXML(xml); - return xmlDoc; - } - } - - svg.Property = function(name, value) { - this.name = name; - this.value = value; - - this.hasValue = function() { - return (this.value != null && this.value !== ''); - } - - // return the numerical value of the property - this.numValue = function() { - if (!this.hasValue()) return 0; - - var n = parseFloat(this.value); - if ((this.value + '').match(/%$/)) { - n = n / 100.0; - } - return n; - } - - this.valueOrDefault = function(def) { - if (this.hasValue()) return this.value; - return def; - } - - this.numValueOrDefault = function(def) { - if (this.hasValue()) return this.numValue(); - return def; - } - - /* EXTENSIONS */ - var that = this; - - // color extensions - this.Color = { - // augment the current color value with the opacity - addOpacity: function(opacity) { - var newValue = that.value; - if (opacity != null && opacity != '') { - var color = new RGBColor(that.value); - if (color.ok) { - newValue = 'rgba(' + color.r + ', ' + color.g + ', ' + color.b + ', ' + opacity + ')'; - } - } - return new svg.Property(that.name, newValue); - } - } - - // definition extensions - this.Definition = { - // get the definition from the definitions table - getDefinition: function() { - var name = that.value.replace(/^(url\()?#([^\)]+)\)?$/, '$2'); - return svg.Definitions[name]; - }, - - isUrl: function() { - return that.value.indexOf('url(') == 0 - }, - - getFillStyle: function(e) { - var def = this.getDefinition(); - - // gradient - if (def != null && def.createGradient) { - return def.createGradient(svg.ctx, e); - } - - // pattern - if (def != null && def.createPattern) { - return def.createPattern(svg.ctx, e); - } - - return null; - } - } - - // length extensions - this.Length = { - DPI: function(viewPort) { - return 96.0; // TODO: compute? - }, - - EM: function(viewPort) { - var em = 12; - - var fontSize = new svg.Property('fontSize', svg.Font.Parse(svg.ctx.font).fontSize); - if (fontSize.hasValue()) em = fontSize.Length.toPixels(viewPort); - - return em; - }, - - // get the length as pixels - toPixels: function(viewPort) { - if (!that.hasValue()) return 0; - var s = that.value+''; - if (s.match(/em$/)) return that.numValue() * this.EM(viewPort); - if (s.match(/ex$/)) return that.numValue() * this.EM(viewPort) / 2.0; - if (s.match(/px$/)) return that.numValue(); - if (s.match(/pt$/)) return that.numValue() * 1.25; - if (s.match(/pc$/)) return that.numValue() * 15; - if (s.match(/cm$/)) return that.numValue() * this.DPI(viewPort) / 2.54; - if (s.match(/mm$/)) return that.numValue() * this.DPI(viewPort) / 25.4; - if (s.match(/in$/)) return that.numValue() * this.DPI(viewPort); - if (s.match(/%$/)) return that.numValue() * svg.ViewPort.ComputeSize(viewPort); - return that.numValue(); - } - } - - // time extensions - this.Time = { - // get the time as milliseconds - toMilliseconds: function() { - if (!that.hasValue()) return 0; - var s = that.value+''; - if (s.match(/s$/)) return that.numValue() * 1000; - if (s.match(/ms$/)) return that.numValue(); - return that.numValue(); - } - } - - // angle extensions - this.Angle = { - // get the angle as radians - toRadians: function() { - if (!that.hasValue()) return 0; - var s = that.value+''; - if (s.match(/deg$/)) return that.numValue() * (Math.PI / 180.0); - if (s.match(/grad$/)) return that.numValue() * (Math.PI / 200.0); - if (s.match(/rad$/)) return that.numValue(); - return that.numValue() * (Math.PI / 180.0); - } - } - } - - // fonts - svg.Font = new (function() { - this.Styles = ['normal','italic','oblique','inherit']; - this.Variants = ['normal','small-caps','inherit']; - this.Weights = ['normal','bold','bolder','lighter','100','200','300','400','500','600','700','800','900','inherit']; - - this.CreateFont = function(fontStyle, fontVariant, fontWeight, fontSize, fontFamily, inherit) { - var f = inherit != null ? this.Parse(inherit) : this.CreateFont('', '', '', '', '', svg.ctx.font); - return { - fontFamily: fontFamily || f.fontFamily, - fontSize: fontSize || f.fontSize, - fontStyle: fontStyle || f.fontStyle, - fontWeight: fontWeight || f.fontWeight, - fontVariant: fontVariant || f.fontVariant, - toString: function () { return [this.fontStyle, this.fontVariant, this.fontWeight, this.fontSize, this.fontFamily].join(' ') } - } - } - - var that = this; - this.Parse = function(s) { - var f = {}; - var d = svg.trim(svg.compressSpaces(s || '')).split(' '); - var set = { fontSize: false, fontStyle: false, fontWeight: false, fontVariant: false } - var ff = ''; - for (var i=0; i this.x2) this.x2 = x; - } - - if (y != null) { - if (isNaN(this.y1) || isNaN(this.y2)) { - this.y1 = y; - this.y2 = y; - } - if (y < this.y1) this.y1 = y; - if (y > this.y2) this.y2 = y; - } - } - this.addX = function(x) { this.addPoint(x, null); } - this.addY = function(y) { this.addPoint(null, y); } - - this.addBoundingBox = function(bb) { - this.addPoint(bb.x1, bb.y1); - this.addPoint(bb.x2, bb.y2); - } - - this.addQuadraticCurve = function(p0x, p0y, p1x, p1y, p2x, p2y) { - var cp1x = p0x + 2/3 * (p1x - p0x); // CP1 = QP0 + 2/3 *(QP1-QP0) - var cp1y = p0y + 2/3 * (p1y - p0y); // CP1 = QP0 + 2/3 *(QP1-QP0) - var cp2x = cp1x + 1/3 * (p2x - p0x); // CP2 = CP1 + 1/3 *(QP2-QP0) - var cp2y = cp1y + 1/3 * (p2y - p0y); // CP2 = CP1 + 1/3 *(QP2-QP0) - this.addBezierCurve(p0x, p0y, cp1x, cp2x, cp1y, cp2y, p2x, p2y); - } - - this.addBezierCurve = function(p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y) { - // from http://blog.hackers-cafe.net/2009/06/how-to-calculate-bezier-curves-bounding.html - var p0 = [p0x, p0y], p1 = [p1x, p1y], p2 = [p2x, p2y], p3 = [p3x, p3y]; - this.addPoint(p0[0], p0[1]); - this.addPoint(p3[0], p3[1]); - - for (i=0; i<=1; i++) { - var f = function(t) { - return Math.pow(1-t, 3) * p0[i] - + 3 * Math.pow(1-t, 2) * t * p1[i] - + 3 * (1-t) * Math.pow(t, 2) * p2[i] - + Math.pow(t, 3) * p3[i]; - } - - var b = 6 * p0[i] - 12 * p1[i] + 6 * p2[i]; - var a = -3 * p0[i] + 9 * p1[i] - 9 * p2[i] + 3 * p3[i]; - var c = 3 * p1[i] - 3 * p0[i]; - - if (a == 0) { - if (b == 0) continue; - var t = -c / b; - if (0 < t && t < 1) { - if (i == 0) this.addX(f(t)); - if (i == 1) this.addY(f(t)); - } - continue; - } - - var b2ac = Math.pow(b, 2) - 4 * c * a; - if (b2ac < 0) continue; - var t1 = (-b + Math.sqrt(b2ac)) / (2 * a); - if (0 < t1 && t1 < 1) { - if (i == 0) this.addX(f(t1)); - if (i == 1) this.addY(f(t1)); - } - var t2 = (-b - Math.sqrt(b2ac)) / (2 * a); - if (0 < t2 && t2 < 1) { - if (i == 0) this.addX(f(t2)); - if (i == 1) this.addY(f(t2)); - } - } - } - - this.isPointInBox = function(x, y) { - return (this.x1 <= x && x <= this.x2 && this.y1 <= y && y <= this.y2); - } - - this.addPoint(x1, y1); - this.addPoint(x2, y2); - } - - // transforms - svg.Transform = function(v) { - var that = this; - this.Type = {} - - // translate - this.Type.translate = function(s) { - this.p = svg.CreatePoint(s); - this.apply = function(ctx) { - ctx.translate(this.p.x || 0.0, this.p.y || 0.0); - } - this.applyToPoint = function(p) { - p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); - } - } - - // rotate - this.Type.rotate = function(s) { - var a = svg.ToNumberArray(s); - this.angle = new svg.Property('angle', a[0]); - this.cx = a[1] || 0; - this.cy = a[2] || 0; - this.apply = function(ctx) { - ctx.translate(this.cx, this.cy); - ctx.rotate(this.angle.Angle.toRadians()); - ctx.translate(-this.cx, -this.cy); - } - this.applyToPoint = function(p) { - var a = this.angle.Angle.toRadians(); - p.applyTransform([1, 0, 0, 1, this.p.x || 0.0, this.p.y || 0.0]); - p.applyTransform([Math.cos(a), Math.sin(a), -Math.sin(a), Math.cos(a), 0, 0]); - p.applyTransform([1, 0, 0, 1, -this.p.x || 0.0, -this.p.y || 0.0]); - } - } - - this.Type.scale = function(s) { - this.p = svg.CreatePoint(s); - this.apply = function(ctx) { - ctx.scale(this.p.x || 1.0, this.p.y || this.p.x || 1.0); - } - this.applyToPoint = function(p) { - p.applyTransform([this.p.x || 0.0, 0, 0, this.p.y || 0.0, 0, 0]); - } - } - - this.Type.matrix = function(s) { - this.m = svg.ToNumberArray(s); - this.apply = function(ctx) { - ctx.transform(this.m[0], this.m[1], this.m[2], this.m[3], this.m[4], this.m[5]); - } - this.applyToPoint = function(p) { - p.applyTransform(this.m); - } - } - - this.Type.SkewBase = function(s) { - this.base = that.Type.matrix; - this.base(s); - this.angle = new svg.Property('angle', s); - } - this.Type.SkewBase.prototype = new this.Type.matrix; - - this.Type.skewX = function(s) { - this.base = that.Type.SkewBase; - this.base(s); - this.m = [1, 0, Math.tan(this.angle.Angle.toRadians()), 1, 0, 0]; - } - this.Type.skewX.prototype = new this.Type.SkewBase; - - this.Type.skewY = function(s) { - this.base = that.Type.SkewBase; - this.base(s); - this.m = [1, Math.tan(this.angle.Angle.toRadians()), 0, 1, 0, 0]; - } - this.Type.skewY.prototype = new this.Type.SkewBase; - - this.transforms = []; - - this.apply = function(ctx) { - for (var i=0; i= this.tokens.length - 1; - } - - this.isCommandOrEnd = function() { - if (this.isEnd()) return true; - return this.tokens[this.i + 1].match(/^[A-Za-z]$/) != null; - } - - this.isRelativeCommand = function() { - return this.command == this.command.toLowerCase(); - } - - this.getToken = function() { - this.i = this.i + 1; - return this.tokens[this.i]; - } - - this.getScalar = function() { - return parseFloat(this.getToken()); - } - - this.nextCommand = function() { - this.previousCommand = this.command; - this.command = this.getToken(); - } - - this.getPoint = function() { - var p = new svg.Point(this.getScalar(), this.getScalar()); - return this.makeAbsolute(p); - } - - this.getAsControlPoint = function() { - var p = this.getPoint(); - this.control = p; - return p; - } - - this.getAsCurrentPoint = function() { - var p = this.getPoint(); - this.current = p; - return p; - } - - this.getReflectedControlPoint = function() { - if (this.previousCommand.toLowerCase() != 'c' && this.previousCommand.toLowerCase() != 's') { - return this.current; - } - - // reflect point - var p = new svg.Point(2 * this.current.x - this.control.x, 2 * this.current.y - this.control.y); - return p; - } - - this.makeAbsolute = function(p) { - if (this.isRelativeCommand()) { - p.x = this.current.x + p.x; - p.y = this.current.y + p.y; - } - return p; - } - - this.addMarker = function(p, from, priorTo) { - // if the last angle isn't filled in because we didn't have this point yet ... - if (priorTo != null && this.angles.length > 0 && this.angles[this.angles.length-1] == null) { - this.angles[this.angles.length-1] = this.points[this.points.length-1].angleTo(priorTo); - } - this.addMarkerAngle(p, from == null ? null : from.angleTo(p)); - } - - this.addMarkerAngle = function(p, a) { - this.points.push(p); - this.angles.push(a); - } - - this.getMarkerPoints = function() { return this.points; } - this.getMarkerAngles = function() { - for (var i=0; i 1) { - rx *= Math.sqrt(l); - ry *= Math.sqrt(l); - } - // cx', cy' - var s = (largeArcFlag == sweepFlag ? -1 : 1) * Math.sqrt( - ((Math.pow(rx,2)*Math.pow(ry,2))-(Math.pow(rx,2)*Math.pow(currp.y,2))-(Math.pow(ry,2)*Math.pow(currp.x,2))) / - (Math.pow(rx,2)*Math.pow(currp.y,2)+Math.pow(ry,2)*Math.pow(currp.x,2)) - ); - if (isNaN(s)) s = 0; - var cpp = new svg.Point(s * rx * currp.y / ry, s * -ry * currp.x / rx); - // cx, cy - var centp = new svg.Point( - (curr.x + cp.x) / 2.0 + Math.cos(xAxisRotation) * cpp.x - Math.sin(xAxisRotation) * cpp.y, - (curr.y + cp.y) / 2.0 + Math.sin(xAxisRotation) * cpp.x + Math.cos(xAxisRotation) * cpp.y - ); - // vector magnitude - var m = function(v) { return Math.sqrt(Math.pow(v[0],2) + Math.pow(v[1],2)); } - // ratio between two vectors - var r = function(u, v) { return (u[0]*v[0]+u[1]*v[1]) / (m(u)*m(v)) } - // angle between two vectors - var a = function(u, v) { return (u[0]*v[1] < u[1]*v[0] ? -1 : 1) * Math.acos(r(u,v)); } - // initial angle - var a1 = a([1,0], [(currp.x-cpp.x)/rx,(currp.y-cpp.y)/ry]); - // angle delta - var u = [(currp.x-cpp.x)/rx,(currp.y-cpp.y)/ry]; - var v = [(-currp.x-cpp.x)/rx,(-currp.y-cpp.y)/ry]; - var ad = a(u, v); - if (r(u,v) <= -1) ad = Math.PI; - if (r(u,v) >= 1) ad = 0; - - if (sweepFlag == 0 && ad > 0) ad = ad - 2 * Math.PI; - if (sweepFlag == 1 && ad < 0) ad = ad + 2 * Math.PI; - - // for markers - var halfWay = new svg.Point( - centp.x - rx * Math.cos((a1 + ad) / 2), - centp.y - ry * Math.sin((a1 + ad) / 2) - ); - pp.addMarkerAngle(halfWay, (a1 + ad) / 2 + (sweepFlag == 0 ? 1 : -1) * Math.PI / 2); - pp.addMarkerAngle(cp, ad + (sweepFlag == 0 ? 1 : -1) * Math.PI / 2); - - bb.addPoint(cp.x, cp.y); // TODO: this is too naive, make it better - if (ctx != null) { - var r = rx > ry ? rx : ry; - var sx = rx > ry ? 1 : rx / ry; - var sy = rx > ry ? ry / rx : 1; - - ctx.translate(centp.x, centp.y); - ctx.rotate(xAxisRotation); - ctx.scale(sx, sy); - ctx.arc(0, 0, r, a1, a1 + ad, 1 - sweepFlag); - ctx.scale(1/sx, 1/sy); - ctx.rotate(-xAxisRotation); - ctx.translate(-centp.x, -centp.y); - } - } - break; - case 'Z': - if (ctx != null) ctx.closePath(); - pp.current = pp.start; - } - } - - return bb; - } - - this.getMarkers = function() { - var points = this.PathParser.getMarkerPoints(); - var angles = this.PathParser.getMarkerAngles(); - - var markers = []; - for (var i=0; i this.maxDuration) { - // loop for indefinitely repeating animations - if (this.attribute('repeatCount').value == 'indefinite') { - this.duration = 0.0 - } - else if (this.attribute('fill').valueOrDefault('remove') == 'remove' && !this.removed) { - this.removed = true; - this.getProperty().value = this.initialValue; - return true; - } - else { - return false; // no updates made - } - } - this.duration = this.duration + delta; - - // if we're past the begin time - var updated = false; - if (this.begin < this.duration) { - var newValue = this.calcValue(); // tween - - if (this.attribute('type').hasValue()) { - // for transform, etc. - var type = this.attribute('type').value; - newValue = type + '(' + newValue + ')'; - } - - this.getProperty().value = newValue; - updated = true; - } - - return updated; - } - - // fraction of duration we've covered - this.progress = function() { - return ((this.duration - this.begin) / (this.maxDuration - this.begin)); - } - } - svg.Element.AnimateBase.prototype = new svg.Element.ElementBase; - - // animate element - svg.Element.animate = function(node) { - this.base = svg.Element.AnimateBase; - this.base(node); - - this.calcValue = function() { - var from = this.attribute('from').numValue(); - var to = this.attribute('to').numValue(); - - // tween value linearly - return from + (to - from) * this.progress(); - }; - } - svg.Element.animate.prototype = new svg.Element.AnimateBase; - - // animate color element - svg.Element.animateColor = function(node) { - this.base = svg.Element.AnimateBase; - this.base(node); - - this.calcValue = function() { - var from = new RGBColor(this.attribute('from').value); - var to = new RGBColor(this.attribute('to').value); - - if (from.ok && to.ok) { - // tween color linearly - var r = from.r + (to.r - from.r) * this.progress(); - var g = from.g + (to.g - from.g) * this.progress(); - var b = from.b + (to.b - from.b) * this.progress(); - return 'rgb('+parseInt(r,10)+','+parseInt(g,10)+','+parseInt(b,10)+')'; - } - return this.attribute('from').value; - }; - } - svg.Element.animateColor.prototype = new svg.Element.AnimateBase; - - // animate transform element - svg.Element.animateTransform = function(node) { - this.base = svg.Element.animate; - this.base(node); - } - svg.Element.animateTransform.prototype = new svg.Element.animate; - - // font element - svg.Element.font = function(node) { - this.base = svg.Element.ElementBase; - this.base(node); - - this.horizAdvX = this.attribute('horiz-adv-x').numValue(); - - this.isRTL = false; - this.isArabic = false; - this.fontFace = null; - this.missingGlyph = null; - this.glyphs = []; - for (var i=0; i0 && text[i-1]!=' ' && i0 && text[i-1]!=' ' && (i == text.length-1 || text[i+1]==' ')) arabicForm = 'initial'; - if (typeof(font.glyphs[c]) != 'undefined') { - glyph = font.glyphs[c][arabicForm]; - if (glyph == null && font.glyphs[c].type == 'glyph') glyph = font.glyphs[c]; - } - } - else { - glyph = font.glyphs[c]; - } - if (glyph == null) glyph = font.missingGlyph; - return glyph; - } - - this.renderChildren = function(ctx) { - var customFont = this.parent.style('font-family').Definition.getDefinition(); - if (customFont != null) { - var fontSize = this.parent.style('font-size').numValueOrDefault(svg.Font.Parse(svg.ctx.font).fontSize); - var fontStyle = this.parent.style('font-style').valueOrDefault(svg.Font.Parse(svg.ctx.font).fontStyle); - var text = this.getText(); - if (customFont.isRTL) text = text.split("").reverse().join(""); - - var dx = svg.ToNumberArray(this.parent.attribute('dx').value); - for (var i=0; i 0 ? node.childNodes[0].nodeValue : // element - node.text; - this.getText = function() { - return this.text; - } - } - svg.Element.tspan.prototype = new svg.Element.TextElementBase; - - // tref - svg.Element.tref = function(node) { - this.base = svg.Element.TextElementBase; - this.base(node); - - this.getText = function() { - var element = this.attribute('xlink:href').Definition.getDefinition(); - if (element != null) return element.children[0].getText(); - } - } - svg.Element.tref.prototype = new svg.Element.TextElementBase; - - // a element - svg.Element.a = function(node) { - this.base = svg.Element.TextElementBase; - this.base(node); - - this.hasText = true; - for (var i=0; i 1 ? node.childNodes[1].nodeValue : ''); - css = css.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, ''); // remove comments - css = svg.compressSpaces(css); // replace whitespace - var cssDefs = css.split('}'); - for (var i=0; i 0) { - var urlStart = srcs[s].indexOf('url'); - var urlEnd = srcs[s].indexOf(')', urlStart); - var url = srcs[s].substr(urlStart + 5, urlEnd - urlStart - 6); - var doc = svg.parseXml(svg.ajax(url)); - var fonts = doc.getElementsByTagName('font'); - for (var f=0; f=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function H(a,b){var c=Math.pow(10,Math.abs(8-b)*3);return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function N(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function O(a){return function(b){return 1-a(1-b)}}function P(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function Q(a){return a}function R(a){return function(b){return Math.pow(b,a)}}function S(a){return 1-Math.cos(a*Math.PI/2)}function T(a){return Math.pow(2,10*(a-1))}function U(a){return 1-Math.sqrt(1-a*a)}function V(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function W(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function X(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Y(){d3.event.stopPropagation(),d3.event.preventDefault()}function Z(){var a=d3.event,b;while(b=a.sourceEvent)a=b;return a}function $(a){var b=new z,c=0,d=arguments.length;while(++c360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}function g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,bd(g(a+120),g(a),g(a-120))}function bn(a){return i(a,bt),a}function bu(a){return function(){return bo(a,this)}}function bv(a){return function(){return bp(a,this)}}function bw(a,b){function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=v(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=v(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bx(a){return{__data__:a}}function by(a){return function(){return bs(this,a)}}function bz(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bA(a,b){for(var c=0,d=a.length;cb?q():(m.active=b,d.forEach(function(b,c){(c=c.call(a,n,h))&&j.push(c)}),e.start.call(a,n,h),p(f)||d3.timer(p,0,c),1)}function p(c){if(m.active!==b)return q();var d=(c-k)/l,g=f(d),i=j.length;while(i>0)j[--i].call(a,g);if(d>=1)return q(),bK=b,e.end.call(a,n,h),bK=0,1}function q(){return--m.count||delete a.__transition__,1}var j=[],k=a.delay,l=a.duration,m=(a=a.node).__transition__||(a.__transition__={active:0,count:0}),n=a.__data__;++m.count,k<=g?o(g):d3.timer(o,k,c)})},0,c),a}function bG(a,b,c){return c!=""&&bF}function bH(a,b){function d(a,d,e){var f=b.call(this,a,d);return f==null?e!=""&&bF:e!=f&&c(e,f)}function e(a,d,e){return e!=b&&c(e,b)}var c=ba(a);return typeof b=="function"?d:b==null?bG:(b+="",e)}function bR(a){var b=bK,c=bQ,d=bO,e=bP;return bK=this.id,bQ=this.ease(),bA(this,function(b,c,d){bO=b.delay,bP=b.duration,a.call(b=b.node,b.__data__,c,d)}),bK=b,bQ=c,bO=d,bP=e,this}function bV(){var a,b=Date.now(),c=bS;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bW()-b;d>24?(isFinite(d)&&(clearTimeout(bU),bU=setTimeout(bV,d)),bT=0):(bT=1,bX(bV))}function bW(){var a=null,b=bS,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bS=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bY(a){var b=[a.a,a.b],c=[a.c,a.d],d=b$(b),e=bZ(b,c),f=b$(b_(c,b,-e))||0;b[0]*c[1]2?cp:co,i=d?bc:bb;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return cm(a,b)},h.tickFormat=function(b){return cn(a,b)},h.nice=function(){return cg(a,ck),g()},h.copy=function(){return ci(a,b,c,d)},g()}function cj(a,b){return d3.rebind(a,b,"range","rangeRound","interpolate","clamp")}function ck(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function cl(a,b){var c=ce(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function cm(a,b){return d3.range.apply(d3,cl(a,b))}function cn(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(cl(a,b)[2])/Math.LN10+.01))+"f")}function co(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function cp(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;a[h]0;j--)e.push(c(f)*j)}else{for(;fi;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=cr);if(arguments.length<1)return e;var f=Math.max(.1,a/d.ticks().length),g=b===ct?(h=-1e-12,Math.floor):(h=1e-12,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<=f?e(a):""}},d.copy=function(){return cq(a.copy(),b)},cj(d,a)}function cs(a){return Math.log(a<0?0:a)/Math.LN10}function ct(a){return-Math.log(a>0?0:-a)/Math.LN10}function cu(a,b){function e(b){return a(c(b))}var c=cv(b),d=cv(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return cm(e.domain(),a)},e.tickFormat=function(a){return cn(e.domain(),a)},e.nice=function(){return e.domain(cg(e.domain(),ck))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=cv(b=a),d=cv(1/b),e.domain(f)},e.copy=function(){return cu(a.copy(),b)},cj(e,a)}function cv(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function cw(a,b){function f(b){return d[((c.get(b)||c.set(b,a.push(b)))-1)%d.length]}function g(b,c){return d3.range(a.length).map(function(a){return b+c*a})}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c=new j;var e=-1,g=d.length,h;while(++e1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function dh(a){return a.length<3?cP(a):a[0]+cV(a,dg(a))}function di(a){var b,c=-1,d=a.length,e,f;while(++c1){var d=ce(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++id&&(c=b,d=e);return c}function d_(a){return a.reduce(ea,0)}function ea(a,b){return a+b[1]}function eb(a,b){return ec(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function ec(a,b){var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];while(++c<=b)f[c]=e*c+d;return f}function ed(a){return[d3.min(a),d3.max(a)]}function ee(a,b){return d3.rebind(a,b,"sort","children","value"),a.links=ei,a.nodes=function(b){return ej=!0,(a.nodes=a)(b)},a}function ef(a){return a.children}function eg(a){return a.value}function eh(a,b){return b.value-a.value}function ei(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function ek(a,b){return a.value-b.value}function el(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function em(a,b){a._pack_next=b,b._pack_prev=a}function en(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return e*e-c*c-d*d>.001}function eo(a){function l(a){b=Math.min(a.x-a.r,b),c=Math.max(a.x+a.r,c),d=Math.min(a.y-a.r,d),e=Math.max(a.y+a.r,e)}var b=Infinity,c=-Infinity,d=Infinity,e=-Infinity,f=a.length,g,h,i,j,k;a.forEach(ep),g=a[0],g.x=-g.r,g.y=0,l(g);if(f>1){h=a[1],h.x=h.r,h.y=0,l(h);if(f>2){i=a[2],et(g,h,i),l(i),el(g,i),g._pack_prev=i,el(i,h),h=g._pack_next;for(var m=3;m0&&(a=d)}return a}function eC(a,b){return a.x-b.x}function eD(a,b){return b.x-a.x}function eE(a,b){return a.depth-b.depth}function eF(a,b){function c(a,d){var e=a.children;if(e&&(i=e.length)){var f,g=null,h=-1,i;while(++h=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function eH(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function eI(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function eJ(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function eK(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return e<0&&(c+=e/2,e=0),f<0&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function eL(a){return a.map(eM).join(",")}function eM(a){return/[",\n]/.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}function eO(a,b){return function(c){return c&&a.hasOwnProperty(c.type)?a[c.type](c):b}}function eP(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+ -2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function eQ(a,b){eR.hasOwnProperty(a.type)&&eR[a.type](a,b)}function eS(a,b){eQ(a.geometry,b)}function eT(a,b){for(var c=a.features,d=0,e=c.length;d0}function fg(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function fh(a,b,c,d){var e=a[0],f=b[0],g=c[0],h=d[0],i=a[1],j=b[1],k=c[1],l=d[1],m=e-g,n=f-e,o=h-g,p=i-k,q=j-i,r=l-k,s=(o*p-r*m)/(r*n-o*q);return[e+s*n,i+s*q]}function fj(a,b){var c={list:a.map(function(a,b){return{index:b,x:a[0],y:a[1]}}).sort(function(a,b){return a.yb.y?1:a.xb.x?1:0}),bottomSite:null},d={list:[],leftEnd:null,rightEnd:null,init:function(){d.leftEnd=d.createHalfEdge(null,"l"),d.rightEnd=d.createHalfEdge(null,"l"),d.leftEnd.r=d.rightEnd,d.rightEnd.l=d.leftEnd,d.list.unshift(d.leftEnd,d.rightEnd)},createHalfEdge:function(a,b){return{edge:a,side:b,vertex:null,l:null,r:null}},insert:function(a,b){b.l=a,b.r=a.r,a.r.l=b,a.r=b},leftBound:function(a){var b=d.leftEnd;do b=b.r;while(b!=d.rightEnd&&e.rightOf(b,a));return b=b.l,b},del:function(a){a.l.r=a.r,a.r.l=a.l,a.edge=null},right:function(a){return a.r},left:function(a){return a.l},leftRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[a.side]},rightRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[fi[a.side]]}},e={bisect:function(a,b){var c={region:{l:a,r:b},ep:{l:null,r:null}},d=b.x-a.x,e=b.y-a.y,f=d>0?d:-d,g=e>0?e:-e;return c.c=a.x*d+a.y*e+(d*d+e*e)*.5,f>g?(c.a=1,c.b=e/d,c.c/=d):(c.b=1,c.a=d/e,c.c/=e),c},intersect:function(a,b){var c=a.edge,d=b.edge;if(!c||!d||c.region.r==d.region.r)return null;var e=c.a*d.b-c.b*d.a;if(Math.abs(e)<1e-10)return null;var f=(c.c*d.b-d.c*c.b)/e,g=(d.c*c.a-c.c*d.a)/e,h=c.region.r,i=d.region.r,j,k;h.y=k.region.r.x;return l&&j.side==="l"||!l&&j.side==="r"?null:{x:f,y:g}},rightOf:function(a,b){var c=a.edge,d=c.region.r,e=b.x>d.x;if(e&&a.side==="l")return 1;if(!e&&a.side==="r")return 0;if(c.a===1){var f=b.y-d.y,g=b.x-d.x,h=0,i=0;!e&&c.b<0||e&&c.b>=0?i=h=f>=c.b*g:(i=b.x+b.y*c.b>c.c,c.b<0&&(i=!i),i||(h=1));if(!h){var j=d.x-c.region.l.x;i=c.b*(g*g-f*f)m*m+n*n}return a.side==="l"?i:!i},endPoint:function(a,c,d){a.ep[c]=d;if(!a.ep[fi[c]])return;b(a)},distance:function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}},f={list:[],insert:function(a,b,c){a.vertex=b,a.ystar=b.y+c;for(var d=0,e=f.list,g=e.length;dh.ystar||a.ystar==h.ystar&&b.x>h.vertex.x)continue;break}e.splice(d,0,a)},del:function(a){for(var b=0,c=f.list,d=c.length;bo.y&&(p=n,n=o,o=p,t="r"),s=e.bisect(n,o),m=d.createHalfEdge(s,t),d.insert(k,m),e.endPoint(s,fi[t],r),q=e.intersect(k,m),q&&(f.del(k),f.insert(k,q,e.distance(q,n))),q=e.intersect(m,l),q&&f.insert(m,q,e.distance(q,n));else break}for(i=d.right(d.leftEnd);i!=d.rightEnd;i=d.right(i))b(i.edge)}function fk(){return{leaf:!0,nodes:[],point:null}}function fl(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=(c+e)*.5,h=(d+f)*.5,i=b.nodes;i[0]&&fl(a,i[0],c,d,g,h),i[1]&&fl(a,i[1],g,d,e,h),i[2]&&fl(a,i[2],c,h,g,f),i[3]&&fl(a,i[3],g,h,e,f)}}function fm(a){return{x:a[0],y:a[1]}}function fo(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function fq(a,b,c,d){var e,f,g=0,h=b.length,i=c.length;while(g=i)return-1;e=b.charCodeAt(g++);if(e==37){f=fw[b.charAt(g++)];if(!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function fx(a,b,c){return fz.test(b.substring(c,c+=3))?c:-1}function fy(a,b,c){fA.lastIndex=0;var d=fA.exec(b.substring(c,c+10));return d?c+=d[0].length:-1}function fC(a,b,c){var d=fD.get(b.substring(c,c+=3).toLowerCase());return d==null?-1:(a.m=d,c)}function fE(a,b,c){fF.lastIndex=0;var d=fF.exec(b.substring(c,c+12));return d?(a.m=fG.get(d[0].toLowerCase()),c+=d[0].length):-1}function fI(a,b,c){return fq(a,fv.c.toString(),b,c)}function fJ(a,b,c){return fq(a,fv.x.toString(),b,c)}function fK(a,b,c){return fq(a,fv.X.toString(),b,c)}function fL(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+4));return d?(a.y=+d[0],c+=d[0].length):-1}function fM(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.y=fN()+ +d[0],c+=d[0].length):-1}function fN(){return~~((new Date).getFullYear()/1e3)*1e3}function fO(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.m=d[0]-1,c+=d[0].length):-1}function fP(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.d=+d[0],c+=d[0].length):-1}function fQ(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.H=+d[0],c+=d[0].length):-1}function fR(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.M=+d[0],c+=d[0].length):-1}function fS(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+2));return d?(a.S=+d[0],c+=d[0].length):-1}function fT(a,b,c){fU.lastIndex=0;var d=fU.exec(b.substring(c,c+3));return d?(a.L=+d[0],c+=d[0].length):-1}function fV(a,b,c){var d=fW.get(b.substring(c,c+=2).toLowerCase());return d==null?-1:(a.p=d,c)}function fX(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=~~(Math.abs(b)/60),e=Math.abs(b)%60;return c+fr(d)+fr(e)}function fZ(a){return a.toISOString()}function f$(a,b,c){function d(b){var c=a(b),d=f(c,1);return b-c1)while(gb?1:a>=b?0:NaN},d3.descending=function(a,b){return ba?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f1&&(a=a.map(b)),a=a.filter(r),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++cf&&(e=f)}else{while(++cf&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++ce&&(e=f)}else{while(++ce&&(e=f)}return e},d3.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(arguments.length===1){while(++cf&&(e=f),gf&&(e=f),g1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}}},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f>1;a.call(b,b[f],f)>1;c0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,k=b[g++],l,m,n=new j,o,p={};while(++h=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++db)d.push(g/e);else while((g=a+c*++f)=200&&a<300||a===304?d:null)}},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)};var y={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:y,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.substring(0,b),a=a.substring(b+1)),y.hasOwnProperty(c)?{space:y[c],local:a}:a}},d3.dispatch=function(){var a=new z,b=-1,c=arguments.length;while(++b0&&(d=a.substring(c+1),a=a.substring(0,c)),arguments.length<2?this[a].on(d):this[a].on(d,b)},d3.format=function(a){var b=B.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=C.get(i)||E,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a=m.scale(a),k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,C=d3.map({g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=D(a,b)).toFixed(Math.max(0,Math.min(20,b)))}}),G=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(H);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,D(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),G[8+c/3]};var I=R(2),J=R(3),K=function(){return Q},L=d3.map({linear:K,poly:R,quad:function(){return I},cubic:function(){return J},sin:function(){return S},exp:function(){return T},circle:function(){return U},elastic:V,back:W,bounce:function(){return X}}),M=d3.map({"in":Q,out:O,"in-out":P,"out-in":function(a){return P(O(a))}});d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=L.get(c)||K,d=M.get(d)||Q,N(d(c.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;_.lastIndex=0;for(d=0;c=_.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=_.lastIndex;f180?k+=360:k-j>180&&(j+=360),d.push({i:c.push(c.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(j,k)})):k&&c.push(c.pop()+"rotate("+k+")"),l!=m?d.push({i:c.push(c.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(l,m)}):m&&c.push(c.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(e=c.push(c.pop()+"scale(",null,",",null,")"),d.push({i:e-4,x:d3.interpolateNumber(n[0],o[0])},{i:e-2,x:d3.interpolateNumber(n[1],o[1])})):(o[0]!=1||o[1]!=1)&&c.push(c.pop()+"scale("+o+")"),e=d.length,function(a){var b=-1,f;while(++b180?f-=360:f<-180&&(f+=360),function(a){return bm(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h1){while(++e=0;)if(f=c[d])e&&e!==f.nextSibling&&e.parentNode.insertBefore(f,e),e=f;return this},bt.sort=function(a){a=bz.apply(this,arguments);for(var b=-1,c=this.length;++b0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function i(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this,h=g[d];h&&(g.removeEventListener(a,h,h.$),delete g[d]),b&&(g.addEventListener(a,g[d]=i,i.$=c),i._=b)})},bt.each=function(a){return bA(this,function(b,c,d){a.call(b,b.__data__,c,d)})},bt.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bt.empty=function(){return!this.node()},bt.node=function(a){for(var b=0,c=this.length;b=cF?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=cG,b=cH,c=cI,d=cJ;return e.innerRadius=function(b){return arguments.length?(a=p(b),e):a},e.outerRadius=function(a){return arguments.length?(b=p(a),e):b},e.startAngle=function(a){return arguments.length?(c=p(a),e):c},e.endAngle=function(a){return arguments.length?(d=p(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cE;return[Math.cos(f)*e,Math.sin(f)*e]},e};var cE=-Math.PI/2,cF=2*Math.PI-1e-6;d3.svg.line=function(){return cK(m)};var cN="linear",cO=d3.map({linear:cP,"step-before":cQ,"step-after":cR,basis:cX,"basis-open":cY,"basis-closed":cZ,bundle:c$,cardinal:cU,"cardinal-open":cS,"cardinal-closed":cT,monotone:dh}),da=[0,2/3,1/3,0],db=[0,1/3,2/3,0],dc=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cK(di);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},cQ.reverse=cR,cR.reverse=cQ,d3.svg.area=function(){return dj(Object)},d3.svg.area.radial=function(){var a=dj(di);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1,e.a1-e.a0)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1,f.a1-f.a0)+j(f.r,f.p1,e.r,e.p0))+"Z"}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+cE,k=e.call(a,h,g)+cE;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Math.PI)+",1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=dk,b=dl,c=dm,d=cI,e=cJ;return f.radius=function(a){return arguments.length?(c=p(a),f):c},f.source=function(b){return arguments.length?(a=p(b),f):a},f.target=function(a){return arguments.length?(b=p(a),f):b},f.startAngle=function(a){return arguments.length?(d=p(a),f):d},f.endAngle=function(a){return arguments.length?(e=p(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=dk,b=dl,c=dq;return d.source=function(b){return arguments.length?(a=p(b),d):a},d.target=function(a){return arguments.length?(b=p(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal -.radial=function(){var a=d3.svg.diagonal(),b=dq,c=a.projection;return a.projection=function(a){return arguments.length?c(dr(b=a)):b},a},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function c(c,d){return(dv.get(a.call(this,c,d))||du)(b.call(this,c,d))}var a=dt,b=ds;return c.type=function(b){return arguments.length?(a=p(b),c):a},c.size=function(a){return arguments.length?(b=p(a),c):b},c};var dv=d3.map({circle:du,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*dx)),c=b*dx;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/dw),c=b*dw/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dw),c=b*dw/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}});d3.svg.symbolTypes=dv.keys();var dw=Math.sqrt(3),dx=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function k(k){k.each(function(){var k=d3.select(this),l=h==null?a.ticks?a.ticks.apply(a,g):a.domain():h,m=i==null?a.tickFormat?a.tickFormat.apply(a,g):String:i,n=dA(a,l,j),o=k.selectAll(".minor").data(n,String),p=o.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),q=d3.transition(o.exit()).style("opacity",1e-6).remove(),r=d3.transition(o).style("opacity",1),s=k.selectAll("g").data(l,String),t=s.enter().insert("g","path").style("opacity",1e-6),u=d3.transition(s.exit()).style("opacity",1e-6).remove(),v=d3.transition(s).style("opacity",1),w,x=cf(a),y=k.selectAll(".domain").data([0]),z=y.enter().append("path").attr("class","domain"),A=d3.transition(y),B=a.copy(),C=this.__chart__||B;this.__chart__=B,t.append("line").attr("class","tick"),t.append("text");var D=t.select("line"),E=v.select("line"),F=s.select("text").text(m),G=t.select("text"),H=v.select("text");switch(b){case"bottom":w=dy,p.attr("y2",d),r.attr("x2",0).attr("y2",d),D.attr("y2",c),G.attr("y",Math.max(c,0)+f),E.attr("x2",0).attr("y2",c),H.attr("x",0).attr("y",Math.max(c,0)+f),F.attr("dy",".71em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+e+"V0H"+x[1]+"V"+e);break;case"top":w=dy,p.attr("y2",-d),r.attr("x2",0).attr("y2",-d),D.attr("y2",-c),G.attr("y",-(Math.max(c,0)+f)),E.attr("x2",0).attr("y2",-c),H.attr("x",0).attr("y",-(Math.max(c,0)+f)),F.attr("dy","0em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+ -e+"V0H"+x[1]+"V"+ -e);break;case"left":w=dz,p.attr("x2",-d),r.attr("x2",-d).attr("y2",0),D.attr("x2",-c),G.attr("x",-(Math.max(c,0)+f)),E.attr("x2",-c).attr("y2",0),H.attr("x",-(Math.max(c,0)+f)).attr("y",0),F.attr("dy",".32em").attr("text-anchor","end"),A.attr("d","M"+ -e+","+x[0]+"H0V"+x[1]+"H"+ -e);break;case"right":w=dz,p.attr("x2",d),r.attr("x2",d).attr("y2",0),D.attr("x2",c),G.attr("x",Math.max(c,0)+f),E.attr("x2",c).attr("y2",0),H.attr("x",Math.max(c,0)+f).attr("y",0),F.attr("dy",".32em").attr("text-anchor","start"),A.attr("d","M"+e+","+x[0]+"H0V"+x[1]+"H"+e)}if(a.ticks)t.call(w,C),v.call(w,B),u.call(w,B),p.call(w,C),r.call(w,B),q.call(w,B);else{var I=B.rangeBand()/2,J=function(a){return B(a)+I};t.call(w,J),v.call(w,J)}})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h=null,i,j=0;return k.scale=function(b){return arguments.length?(a=b,k):a},k.orient=function(a){return arguments.length?(b=a,k):b},k.ticks=function(){return arguments.length?(g=arguments,k):g},k.tickValues=function(a){return arguments.length?(h=a,k):h},k.tickFormat=function(a){return arguments.length?(i=a,k):i},k.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,k},k.tickPadding=function(a){return arguments.length?(f=+a,k):f},k.tickSubdivide=function(a){return arguments.length?(j=+a,k):j},k},d3.svg.brush=function(){function g(a){a.each(function(){var a=d3.select(this),e=a.selectAll(".background").data([0]),f=a.selectAll(".extent").data([0]),l=a.selectAll(".resize").data(d,String),m;a.style("pointer-events","all").on("mousedown.brush",k).on("touchstart.brush",k),e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.enter().append("rect").attr("class","extent").style("cursor","move"),l.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return dB[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",g.empty()?"none":null),l.exit().remove(),b&&(m=cf(b),e.attr("x",m[0]).attr("width",m[1]-m[0]),i(a)),c&&(m=cf(c),e.attr("y",m[0]).attr("height",m[1]-m[0]),j(a)),h(a)})}function h(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+e[+/e$/.test(a)][0]+","+e[+/^s/.test(a)][1]+")"})}function i(a){a.select(".extent").attr("x",e[0][0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",e[1][0]-e[0][0])}function j(a){a.select(".extent").attr("y",e[0][1]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",e[1][1]-e[0][1])}function k(){function x(){var a=d3.event.changedTouches;return a?d3.touches(d,a)[0]:d3.mouse(d)}function y(){d3.event.keyCode==32&&(q||(r=null,s[0]-=e[1][0],s[1]-=e[1][1],q=2),Y())}function z(){d3.event.keyCode==32&&q==2&&(s[0]+=e[1][0],s[1]+=e[1][1],q=0,Y())}function A(){var a=x(),d=!1;t&&(a[0]+=t[0],a[1]+=t[1]),q||(d3.event.altKey?(r||(r=[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]),s[0]=e[+(a[0]0?e=c:e=0:c>0&&(b.start({type:"start",alpha:e=c}),d3.timer(a.tick)),a):e},a.start=function(){function p(a,c){var d=t(b),e=-1,f=d.length,g;while(++ee&&(e=h),d.push(h)}for(g=0;g0){f=-1;while(++f=i[0]&&o<=i[1]&&(k=g[d3.bisect(j,o,1,m)-1],k.y+=n,k.push(e[f]))}return g}var a=!0,b=Number,c=ed,d=eb;return e.value=function(a){return arguments.length?(b=a,e):b},e.range=function(a){return arguments.length?(c=p(a),e):c},e.bins=function(a){return arguments.length?(d=typeof a=="number"?function(b){return ec(b,a)}:p(a),e):d},e.frequency=function(b){return arguments.length?(a=!!b,e):a},e},d3.layout.hierarchy=function(){function d(e,g,h){var i=b.call(f,e,g),j=ej?e:{data:e};j.depth=g,h.push(j);if(i&&(l=i.length)){var k=-1,l,m=j.children=[],n=0,o=g+1,p;while(++k0&&(eH(eI(g,a,d),a,m),i+=m,j+=m),k+=g._tree.mod,i+=e._tree.mod,l+=h._tree.mod,j+=f._tree.mod;g&&!eA(f)&&(f._tree.thread=g,f._tree.mod+=k-j),e&&!ez(h)&&(h._tree.thread=e,h._tree.mod+=i-l,d=a)}return d}var f=a.call(this,d,e),g=f[0];eF(g,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}}),h(g),i(g,-g._tree.prelim);var k=eB(g,eD),l=eB(g,eC),m=eB(g,eE),n=k.x-b(k,l)/2,o=l.x+b(l,k)/2,p=m.depth||1;return eF(g,function(a){a.x=(a.x-n)/(o-n)*c[0],a.y=a.depth/p*c[1],delete a._tree}),f}var a=d3.layout.hierarchy().sort(null).value(null),b=ey,c=[1,1];return d.separation=function(a){return arguments.length?(b=a,d):b},d.size=function(a){return arguments.length?(c=a,d):c},ee(d,a)},d3.layout.treemap=function(){function i(a,b){var c=-1,d=a.length,e,f;while(++c0)d.push(g=f[o-1]),d.area+=g.area,(k=l(d,n))<=h?(f.pop(),h=k):(d.area-=d.pop().area,m(d,n,c,!1),n=Math.min(c.dx,c.dy),d.length=d.area=0,h=Infinity);d.length&&(m(d,n,c,!0),d.length=d.area=0),b.forEach(j)}}function k(a){var b=a.children;if(b&&b.length){var c=e(a),d=b.slice(),f,g=[];i(d,c.dx*c.dy/a.value),g.area=0;while(f=d.pop())g.push(f),g.area+=f.area,f.z!=null&&(m(g,f.z?c.dx:c.dy,c,!d.length),g.length=g.area=0);b.forEach(k)}}function l(a,b){var c=a.area,d,e=0,f=Infinity,g=-1,i=a.length;while(++ge&&(e=d)}return c*=c,b*=b,c?Math.max(b*e*h/c,c/(b*f*h)):Infinity}function m(a,c,d,e){var f=-1,g=a.length,h=d.x,i=d.y,j=c?b(a.area/c):0,k;if(c==d.dx){if(e||j>d.dy)j=d.dy;while(++fd.dx)j=d.dx;while(++f=a.length)return d;if(i)return i=!1,c;var b=f.lastIndex;if(a.charCodeAt(b)===34){var e=b;while(e++50?b:f<-140?c:g<21?d:a)(e)}var a=d3.geo.albers(),b=d3.geo.albers().origin([-160,60]).parallels([55,65]),c=d3.geo.albers().origin([-160,20]).parallels([8,18]),d=d3.geo.albers().origin([-60,10]).parallels([8,18]);return e.scale=function(f){return arguments.length?(a.scale(f),b.scale(f*.6),c.scale(f),d.scale(f*1.5),e.translate(a.translate())):a.scale()},e.translate=function(f){if(!arguments.length)return a.translate();var g=a.scale()/1e3,h=f[0],i=f[1];return a.translate(f),b.translate([h-400*g,i+170*g]),c.translate([h-190*g,i+200*g]),d.translate([h+580*g,i+430*g]),e},e.scale(a.scale())},d3.geo.bonne=function(){function g(g){var h=g[0]*eN-c,i=g[1]*eN-d;if(e){var j=f+e-i,k=h*Math.cos(i)/j;h=j*Math.sin(k),i=j*Math.cos(k)-f}else h*=Math.cos(i),i*=-1;return[a*h+b[0],a*i+b[1]]}var a=200,b=[480,250],c,d,e,f;return g.invert=function(d){var g=(d[0]-b[0])/a,h=(d[1]-b[1])/a;if(e){var i=f+h,j=Math.sqrt(g*g+i*i);h=f+e-j,g=c+j*Math.atan2(g,i)/Math.cos(h)}else h*=-1,g/=Math.cos(h);return[g/eN,h/eN]},g.parallel=function(a){return arguments.length?(f=1/Math.tan(e=a*eN),g):e/eN},g.origin=function(a){return arguments.length?(c=a[0]*eN,d=a[1]*eN,g):[c/eN,d/eN]},g.scale=function(b){return arguments.length?(a=+b,g):a},g.translate=function(a){return arguments.length?(b=[+a[0],+a[1]],g):b},g.origin([0,0]).parallel(45)},d3.geo.equirectangular=function(){function c(c){var d=c[0]/360,e=-c[1]/360;return[a*d+b[0],a*e+b[1]]}var a=500,b=[480,250];return c.invert=function(c){var d=(c[0]-b[0])/a,e=(c[1]-b[1])/a;return[360*d,-360*e]},c.scale=function(b){return arguments.length?(a=+b,c):a},c.translate=function(a){return arguments.length?(b=[+a[0],+a[1]],c):b},c},d3.geo.mercator=function(){function c(c){var d=c[0]/360,e=-(Math.log(Math.tan(Math.PI/4+c[1]*eN/2))/eN)/360;return[a*d+b[0],a*Math.max(-0.5,Math.min(.5,e))+b[1]]}var a=500,b=[480,250];return c.invert=function(c){var d=(c[0]-b[0])/a,e=(c[1]-b[1])/a;return[360*d,2*Math.atan(Math.exp(-360*e*eN))/eN-90]},c.scale=function(b){return arguments.length?(a=+b,c):a},c.translate=function(a){return arguments.length?(b=[+a[0],+a[1]],c):b},c},d3.geo.path=function(){function e(c,e){typeof a=="function"&&(b=eP(a.apply(this,arguments))),g(c);var f=d.length?d.join(""):null;return d=[],f}function f(a){return c(a).join(",")}function i(a){var b=l(a[0]),c=0,d=a.length;while(++c0){d.push("M");while(++h0){d.push("M");while(++kd&&(d=a),fe&&(e=f)}),[[b,c],[d,e]]};var eR={Feature:eS,FeatureCollection:eT,GeometryCollection:eU,LineString:eV,MultiLineString:eW,MultiPoint:eV,MultiPolygon:eX,Point:eY,Polygon:eZ};d3.geo.circle=function(){function e(){}function f(a){return d.distance(a)=k*k+l*l?d[f].index=-1:(d[m].index=-1,o=d[f].angle,m=f,n=g)):(o=d[f].angle,m=f,n=g);e.push(h);for(f=0,g=0;f<2;++g)d[g].index!==-1&&(e.push(d[g].index),f++);p=e.length;for(;g=0?(c=a.ep.r,d=a.ep.l):(c=a.ep.l,d=a.ep.r),a.a===1?(g=c?c.y:-1e6,e=a.c-a.b*g,h=d?d.y:1e6,f=a.c-a.b*h):(e=c?c.x:-1e6,g=a.c-a.a*e,f=d?d.x:1e6,h=a.c-a.a*f);var i=[e,g],j=[f,h];b[a.region.l.index].push(i,j),b[a.region.r.index].push(i,j)}),b.map(function(b,c){var d=a[c][0],e=a[c][1];return b.forEach(function(a){a.angle=Math.atan2(a[0]-d,a[1]-e)}),b.sort(function(a,b){return a.angle-b.angle}).filter(function(a,c){return!c||a.angle-b[c-1].angle>1e-10})})};var fi={l:"r",r:"l"};d3.geom.delaunay=function(a){var b=a.map(function(){return[]}),c=[];return fj(a,function(c){b[c.region.l.index].push(a[c.region.r.index])}),b.forEach(function(b,d){var e=a[d],f=e[0],g=e[1];b.forEach(function(a){a.angle=Math.atan2(a[0]-f,a[1]-g)}),b.sort(function(a,b){return a.angle-b.angle});for(var h=0,i=b.length-1;h=g,j=b.y>=h,l=(j<<1)+i;a.leaf=!1,a=a.nodes[l]||(a.nodes[l]=fk()),i?c=g:e=g,j?d=h:f=h,k(a,b,c,d,e,f)}var f,g=-1,h=a.length;h&&isNaN(a[0].x)&&(a=a.map(fm));if(arguments.length<5)if(arguments.length===3)e=d=c,c=b;else{b=c=Infinity,d=e=-Infinity;while(++gd&&(d=f.x),f.y>e&&(e=f.y);var i=d-b,j=e-c;i>j?e=c+i:d=b+j}var m=fk();return m.add=function(a){k(m,a,b,c,d,e)},m.visit=function(a){fl(a,m,b,c,d,e)},a.forEach(m.add),m},d3.time={};var fn=Date;fo.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){fp.setUTCDate.apply(this._,arguments)},setDay:function(){fp.setUTCDay.apply(this._,arguments)},setFullYear:function(){fp.setUTCFullYear.apply(this._,arguments)},setHours:function(){fp.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){fp.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){fp.setUTCMinutes.apply(this._,arguments)},setMonth:function(){fp.setUTCMonth.apply(this._,arguments)},setSeconds:function(){fp.setUTCSeconds.apply(this._,arguments)},setTime:function(){fp.setTime.apply(this._,arguments)}};var fp=Date.prototype;d3.time.format=function(a){function c(c){var d=[],e=-1,f=0,g,h;while(++e=12?"PM":"AM"},S:function(a){return fr(a.getSeconds())},U:function(a){return fr(d3.time.sundayOfYear(a))},w:function(a){return a.getDay()},W:function(a){return fr(d3.time.mondayOfYear(a))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(a){return fr(a.getFullYear()%100)},Y:function(a){return ft(a.getFullYear()%1e4)},Z:fX,"%":function(a){return"%"}},fw={a:fx,A:fy,b:fC,B:fE,c:fI,d:fP,e:fP,H:fQ,I:fQ,L:fT,m:fO,M:fR,p:fV,S:fS,x:fJ,X:fK,y:fM,Y:fL},fz=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,fA=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i,fB=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fD=d3.map({jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11}),fF=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig,fG=d3.map({january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11}),fH=["January","February","March","April","May","June","July","August","September","October","November","December"],fU=/\s*\d+/,fW=d3.map({am:0,pm:1});d3.time.format.utc=function(a){function c(a){try{fn=fo;var c=new fn;return c._=a,b(c)}finally{fn=Date}}var b=d3.time.format(a);return c.parse=function(a){try{fn=fo;var c=b.parse(a);return c&&c._}finally{fn=Date}},c.toString=b.toString,c};var fY=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?fZ:fY,fZ.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},fZ.toString=fY.toString,d3.time.second=f$(function(a){return new fn(Math.floor(a/1e3)*1e3)},function(a,b){a.setTime(a.getTime()+Math.floor(b)*1e3)},function(a){return a.getSeconds()}),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=f$(function(a){return new fn(Math.floor(a/6e4)*6e4)},function(a,b){a.setTime(a.getTime()+Math.floor(b)*6e4)},function(a){return a.getMinutes()}),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=f$(function(a){var b=a.getTimezoneOffset()/60;return new fn((Math.floor(a/36e5-b)+b)*36e5)},function(a,b){a.setTime(a.getTime()+Math.floor(b)*36e5)},function(a){return a.getHours()}),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=f$(function(a){return new fn(a.getFullYear(),a.getMonth(),a.getDate())},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(a){var b=d3.time.year(a);return Math.floor((a-b)/864e5-(a.getTimezoneOffset()-b.getTimezoneOffset())/1440)},fB.forEach(function(a,b){a=a.toLowerCase(),b=7-b;var c=d3.time[a]=f$(function(a){return(a=d3.time.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+Math.floor(b)*7)},function(a){var c=d3.time.year(a).getDay();return Math.floor((d3.time.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});d3.time[a+"s"]=c.range,d3.time[a+"s"].utc=c.utc.range,d3.time[a+"OfYear"]=function(a){var c=d3.time.year(a).getDay();return Math.floor((d3.time.dayOfYear(a)+(c+b)%7)/7)}}),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=f$(function(a){return new fn(a.getFullYear(),a.getMonth(),1)},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=f$(function(a){return new fn(a.getFullYear(),0,1)},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var gg=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],gh=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],gi=[[d3.time.format("%Y"),function(a){return!0}],[d3.time.format("%B"),function(a){return a.getMonth()}],[d3.time.format("%b %d"),function(a){return a.getDate()!=1}],[d3.time.format("%a %d"),function(a){return a.getDay()&&a.getDate()!=1}],[d3.time.format("%I %p"),function(a){return a.getHours()}],[d3.time.format("%I:%M"),function(a){return a.getMinutes()}],[d3.time.format(":%S"),function(a){return a.getSeconds()}],[d3.time.format(".%L"),function(a){return a.getMilliseconds()}]],gj=d3.scale.linear(),gk=gd(gi);gh.year=function(a,b){return gj.domain(a.map(gf)).ticks(b).map(ge)},d3.time.scale=function(){return ga(d3.scale.linear(),gh,gk)};var gl=gh.map(function(a){return[a[0].utc,a[1]]}),gm=[[d3.time.format.utc("%Y"),function(a){return!0}],[d3.time.format.utc("%B"),function(a){return a.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(a){return a.getUTCDate()!=1}],[d3.time.format.utc("%a %d"),function(a){return a.getUTCDay()&&a.getUTCDate()!=1}],[d3.time.format.utc("%I %p"),function(a){return a.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(a){return a.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(a){return a.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(a){return a.getUTCMilliseconds()}]],gn=gd(gm);gl.year=function(a,b){return gj.domain(a.map(gp)).ticks(b).map(go)},d3.time.scale.utc=function(){return ga(d3.scale.linear(),gl,gn)}})(); \ No newline at end of file diff --git a/thirdparty/dat.gui.min.js b/thirdparty/dat.gui.min.js deleted file mode 100755 index 17e4a3c..0000000 --- a/thirdparty/dat.gui.min.js +++ /dev/null @@ -1,94 +0,0 @@ -/** - * dat-gui JavaScript Controller Library - * http://code.google.com/p/dat-gui - * - * Copyright 2011 Data Arts Team, Google Creative Lab - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ -var dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(e,a){var a=a||document,c=a.createElement("link");c.type="text/css";c.rel="stylesheet";c.href=e;a.getElementsByTagName("head")[0].appendChild(c)},inject:function(e,a){var a=a||document,c=document.createElement("style");c.type="text/css";c.innerHTML=e;a.getElementsByTagName("head")[0].appendChild(c)}}}(); -dat.utils.common=function(){var e=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(a[f])||(c[f]=a[f])},this);return c},defaults:function(c){this.each(a.call(arguments,1),function(a){for(var f in a)this.isUndefined(c[f])&&(c[f]=a[f])},this);return c},compose:function(){var c=a.call(arguments);return function(){for(var d=a.call(arguments),f=c.length-1;f>=0;f--)d=[c[f].apply(this,d)];return d[0]}}, -each:function(a,d,f){if(e&&a.forEach===e)a.forEach(d,f);else if(a.length===a.length+0)for(var b=0,n=a.length;b-1?d.length-d.indexOf(".")-1:0};c.superclass=e;a.extend(c.prototype,e.prototype,{setValue:function(a){if(this.__min!==void 0&&athis.__max)a=this.__max;this.__step!==void 0&&a%this.__step!=0&&(a=Math.round(a/this.__step)*this.__step);return c.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__step=a;return this}});return c}(dat.controllers.Controller,dat.utils.common); -dat.controllers.NumberControllerBox=function(e,a,c){var d=function(f,b,e){function h(){var a=parseFloat(l.__input.value);c.isNaN(a)||l.setValue(a)}function j(a){var b=o-a.clientY;l.setValue(l.getValue()+b*l.__impliedStep);o=a.clientY}function m(){a.unbind(window,"mousemove",j);a.unbind(window,"mouseup",m)}this.__truncationSuspended=false;d.superclass.call(this,f,b,e);var l=this,o;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",h); -a.bind(this.__input,"blur",function(){h();l.__onFinishChange&&l.__onFinishChange.call(l,l.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",j);a.bind(window,"mouseup",m);o=b.clientY});a.bind(this.__input,"keydown",function(a){if(a.keyCode===13)l.__truncationSuspended=true,this.blur(),l.__truncationSuspended=false});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype,e.prototype,{updateDisplay:function(){var a=this.__input, -b;if(this.__truncationSuspended)b=this.getValue();else{b=this.getValue();var c=Math.pow(10,this.__precision);b=Math.round(b*c)/c}a.value=b;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); -dat.controllers.NumberControllerSlider=function(e,a,c,d,f){var b=function(d,c,f,e,l){function o(b){b.preventDefault();var d=a.getOffset(g.__background),c=a.getWidth(g.__background);g.setValue(g.__min+(g.__max-g.__min)*((b.clientX-d.left)/(d.left+c-d.left)));return false}function y(){a.unbind(window,"mousemove",o);a.unbind(window,"mouseup",y);g.__onFinishChange&&g.__onFinishChange.call(g,g.getValue())}b.superclass.call(this,d,c,{min:f,max:e,step:l});var g=this;this.__background=document.createElement("div"); -this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",o);a.bind(window,"mouseup",y);o(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};b.superclass=e;b.useDefaultStyles=function(){c.inject(f)};d.extend(b.prototype,e.prototype,{updateDisplay:function(){this.__foreground.style.width= -(this.getValue()-this.__min)/(this.__max-this.__min)*100+"%";return b.superclass.prototype.updateDisplay.call(this)}});return b}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,".slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); -dat.controllers.FunctionController=function(e,a,c){var d=function(c,b,e){d.superclass.call(this,c,b);var h=this;this.__button=document.createElement("div");this.__button.innerHTML=e===void 0?"Fire":e;a.bind(this.__button,"click",function(a){a.preventDefault();h.fire();return false});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};d.superclass=e;c.extend(d.prototype,e.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.__onFinishChange&&this.__onFinishChange.call(this, -this.getValue());this.getValue().call(this.object)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.controllers.BooleanController=function(e,a,c){var d=function(c,b){d.superclass.call(this,c,b);var e=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){e.setValue(!e.__prev)},false);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};d.superclass=e;c.extend(d.prototype,e.prototype,{setValue:function(a){a=d.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& -this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){this.getValue()===true?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=true):this.__checkbox.checked=false;return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); -dat.color.toString=function(e){return function(a){if(a.a==1||e.isUndefined(a.a)){for(a=a.hex.toString(16);a.length<6;)a="0"+a;return"#"+a}else return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); -dat.color.interpret=function(e,a){var c,d,f=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:e},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return a===null?false:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:e},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); -return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:e},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return a===null?false:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:e}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return a.length!= -3?false:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return a.length!=4?false:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:false},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& -a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:false},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:false},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:false},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){d= -false;var b=arguments.length>1?a.toArray(arguments):arguments[0];a.each(f,function(e){if(e.litmus(b))return a.each(e.conversions,function(e,f){c=e.read(b);if(d===false&&c!==false)return d=c,c.conversionName=f,c.conversion=e,a.BREAK}),a.BREAK});return d}}(dat.color.toString,dat.utils.common); -dat.GUI=dat.gui.GUI=function(e,a,c,d,f,b,n,h,j,m,l,o,y,g,i){function q(a,b,r,c){if(b[r]===void 0)throw Error("Object "+b+' has no property "'+r+'"');c.color?b=new l(b,r):(b=[b,r].concat(c.factoryArgs),b=d.apply(a,b));if(c.before instanceof f)c.before=c.before.__li;t(a,b);g.addClass(b.domElement,"c");r=document.createElement("span");g.addClass(r,"property-name");r.innerHTML=b.property;var e=document.createElement("div");e.appendChild(r);e.appendChild(b.domElement);c=s(a,e,c.before);g.addClass(c,k.CLASS_CONTROLLER_ROW); -g.addClass(c,typeof b.getValue());p(a,c,b);a.__controllers.push(b);return b}function s(a,b,d){var c=document.createElement("li");b&&c.appendChild(b);d?a.__ul.insertBefore(c,params.before):a.__ul.appendChild(c);a.onResize();return c}function p(a,d,c){c.__li=d;c.__gui=a;i.extend(c,{options:function(b){if(arguments.length>1)return c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[i.toArray(arguments)]});if(i.isArray(b)||i.isObject(b))return c.remove(),q(a,c.object,c.property, -{before:c.__li.nextElementSibling,factoryArgs:[b]})},name:function(a){c.__li.firstElementChild.firstElementChild.innerHTML=a;return c},listen:function(){c.__gui.listen(c);return c},remove:function(){c.__gui.remove(c);return c}});if(c instanceof j){var e=new h(c.object,c.property,{min:c.__min,max:c.__max,step:c.__step});i.each(["updateDisplay","onChange","onFinishChange"],function(a){var b=c[a],H=e[a];c[a]=e[a]=function(){var a=Array.prototype.slice.call(arguments);b.apply(c,a);return H.apply(e,a)}}); -g.addClass(d,"has-slider");c.domElement.insertBefore(e.domElement,c.domElement.firstElementChild)}else if(c instanceof h){var f=function(b){return i.isNumber(c.__min)&&i.isNumber(c.__max)?(c.remove(),q(a,c.object,c.property,{before:c.__li.nextElementSibling,factoryArgs:[c.__min,c.__max,c.__step]})):b};c.min=i.compose(f,c.min);c.max=i.compose(f,c.max)}else if(c instanceof b)g.bind(d,"click",function(){g.fakeEvent(c.__checkbox,"click")}),g.bind(c.__checkbox,"click",function(a){a.stopPropagation()}); -else if(c instanceof n)g.bind(d,"click",function(){g.fakeEvent(c.__button,"click")}),g.bind(d,"mouseover",function(){g.addClass(c.__button,"hover")}),g.bind(d,"mouseout",function(){g.removeClass(c.__button,"hover")});else if(c instanceof l)g.addClass(d,"color"),c.updateDisplay=i.compose(function(a){d.style.borderLeftColor=c.__color.toString();return a},c.updateDisplay),c.updateDisplay();c.setValue=i.compose(function(b){a.getRoot().__preset_select&&c.isModified()&&B(a.getRoot(),true);return b},c.setValue)} -function t(a,b){var c=a.getRoot(),d=c.__rememberedObjects.indexOf(b.object);if(d!=-1){var e=c.__rememberedObjectIndecesToControllers[d];e===void 0&&(e={},c.__rememberedObjectIndecesToControllers[d]=e);e[b.property]=b;if(c.load&&c.load.remembered){c=c.load.remembered;if(c[a.preset])c=c[a.preset];else if(c[w])c=c[w];else return;if(c[d]&&c[d][b.property]!==void 0)d=c[d][b.property],b.initialValue=d,b.setValue(d)}}}function I(a){var b=a.__save_row=document.createElement("li");g.addClass(a.domElement, -"has-save");a.__ul.insertBefore(b,a.__ul.firstChild);g.addClass(b,"save-row");var c=document.createElement("span");c.innerHTML=" ";g.addClass(c,"button gears");var d=document.createElement("span");d.innerHTML="Save";g.addClass(d,"button");g.addClass(d,"save");var e=document.createElement("span");e.innerHTML="New";g.addClass(e,"button");g.addClass(e,"save-as");var f=document.createElement("span");f.innerHTML="Revert";g.addClass(f,"button");g.addClass(f,"revert");var m=a.__preset_select=document.createElement("select"); -a.load&&a.load.remembered?i.each(a.load.remembered,function(b,c){C(a,c,c==a.preset)}):C(a,w,false);g.bind(m,"change",function(){for(var b=0;b0){a.preset=this.preset;if(!a.remembered)a.remembered={};a.remembered[this.preset]=z(this)}a.folders={};i.each(this.__folders,function(b, -c){a.folders[c]=b.getSaveObject()});return a},save:function(){if(!this.load.remembered)this.load.remembered={};this.load.remembered[this.preset]=z(this);B(this,false)},saveAs:function(a){if(!this.load.remembered)this.load.remembered={},this.load.remembered[w]=z(this,true);this.load.remembered[a]=z(this);this.preset=a;C(this,a,true)},revert:function(a){i.each(this.__controllers,function(b){this.getRoot().load.remembered?t(a||this.getRoot(),b):b.setValue(b.initialValue)},this);i.each(this.__folders, -function(a){a.revert(a)});a||B(this.getRoot(),false)},listen:function(a){var b=this.__listening.length==0;this.__listening.push(a);b&&E(this.__listening)}});return k}(dat.utils.css,'
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
\n \n
\n\n
', -".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity 0.1s linear;-o-transition:opacity 0.1s linear;-moz-transition:opacity 0.1s linear;transition:opacity 0.1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save ul{margin-top:27px}.dg.a.has-save ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height 0.1s ease-out;-o-transition:height 0.1s ease-out;-moz-transition:height 0.1s ease-out;transition:height 0.1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li > *{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n", -dat.controllers.factory=function(e,a,c,d,f,b,n){return function(h,j,m,l){var o=h[j];if(n.isArray(m)||n.isObject(m))return new e(h,j,m);if(n.isNumber(o))return n.isNumber(m)&&n.isNumber(l)?new c(h,j,m,l):new a(h,j,{min:m,max:l});if(n.isString(o))return new d(h,j);if(n.isFunction(o))return new f(h,j,"");if(n.isBoolean(o))return new b(h,j)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(e,a,c){var d= -function(c,b){function e(){h.setValue(h.__input.value)}d.superclass.call(this,c,b);var h=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",e);a.bind(this.__input,"change",e);a.bind(this.__input,"blur",function(){h.__onFinishChange&&h.__onFinishChange.call(h,h.getValue())});a.bind(this.__input,"keydown",function(a){a.keyCode===13&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};d.superclass=e;c.extend(d.prototype, -e.prototype,{updateDisplay:function(){if(!a.isActive(this.__input))this.__input.value=this.getValue();return d.superclass.prototype.updateDisplay.call(this)}});return d}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, -dat.controllers.ColorController=function(e,a,c,d,f){function b(a,b,c,d){a.style.background="";f.each(j,function(e){a.style.cssText+="background: "+e+"linear-gradient("+b+", "+c+" 0%, "+d+" 100%); "})}function n(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; -a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var h=function(e,l){function o(b){q(b);a.bind(window,"mousemove",q);a.bind(window, -"mouseup",j)}function j(){a.unbind(window,"mousemove",q);a.unbind(window,"mouseup",j)}function g(){var a=d(this.value);a!==false?(p.__color.__state=a,p.setValue(p.__color.toOriginal())):this.value=p.__color.toString()}function i(){a.unbind(window,"mousemove",s);a.unbind(window,"mouseup",i)}function q(b){b.preventDefault();var c=a.getWidth(p.__saturation_field),d=a.getOffset(p.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c,b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b= -1:b<0&&(b=0);e>1?e=1:e<0&&(e=0);p.__color.v=b;p.__color.s=e;p.setValue(p.__color.toOriginal());return false}function s(b){b.preventDefault();var c=a.getHeight(p.__hue_field),d=a.getOffset(p.__hue_field),b=1-(b.clientY-d.top+document.body.scrollTop)/c;b>1?b=1:b<0&&(b=0);p.__color.h=b*360;p.setValue(p.__color.toOriginal());return false}h.superclass.call(this,e,l);this.__color=new c(this.getValue());this.__temp=new c(0);var p=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement, -false);this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input= -document.createElement("input");this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){a.keyCode===13&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(){a.addClass(this,"drag").bind(window,"mouseup",function(){a.removeClass(p.__selector,"drag")})});var t=document.createElement("div");f.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}); -f.extend(this.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(this.__color.v<0.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});f.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});f.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});f.extend(t.style, -{width:"100%",height:"100%",background:"none"});b(t,"top","rgba(0,0,0,0)","#000");f.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});n(this.__hue_field);f.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",o);a.bind(this.__field_knob,"mousedown",o);a.bind(this.__hue_field,"mousedown", -function(b){s(b);a.bind(window,"mousemove",s);a.bind(window,"mouseup",i)});this.__saturation_field.appendChild(t);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};h.superclass=e;f.extend(h.prototype,e.prototype,{updateDisplay:function(){var a=d(this.getValue()); -if(a!==false){var e=false;f.each(c.COMPONENTS,function(b){if(!f.isUndefined(a[b])&&!f.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return e=true,{}},this);e&&f.extend(this.__color.__state,a)}f.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var h=this.__color.v<0.5||this.__color.s>0.5?255:0,j=255-h;f.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toString(),border:this.__field_knob_border+ -"rgb("+h+","+h+","+h+")"});this.__hue_knob.style.marginTop=(1-this.__color.h/360)*100+"px";this.__temp.s=1;this.__temp.v=1;b(this.__saturation_field,"left","#fff",this.__temp.toString());f.extend(this.__input.style,{backgroundColor:this.__input.value=this.__color.toString(),color:"rgb("+h+","+h+","+h+")",textShadow:this.__input_textShadow+"rgba("+j+","+j+","+j+",.7)"})}});var j=["-moz-","-o-","-webkit-","-ms-",""];return h}(dat.controllers.Controller,dat.dom.dom,dat.color.Color=function(e,a,c,d){function f(a, -b,c){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="RGB")return this.__state[b];n(this,b,c);return this.__state[b]},set:function(a){if(this.__state.space!=="RGB")n(this,b,c),this.__state.space="RGB";this.__state[b]=a}})}function b(a,b){Object.defineProperty(a,b,{get:function(){if(this.__state.space==="HSV")return this.__state[b];h(this);return this.__state[b]},set:function(a){if(this.__state.space!=="HSV")h(this),this.__state.space="HSV";this.__state[b]=a}})}function n(b,c,e){if(b.__state.space=== -"HEX")b.__state[c]=a.component_from_hex(b.__state.hex,e);else if(b.__state.space==="HSV")d.extend(b.__state,a.hsv_to_rgb(b.__state.h,b.__state.s,b.__state.v));else throw"Corrupted color state";}function h(b){var c=a.rgb_to_hsv(b.r,b.g,b.b);d.extend(b.__state,{s:c.s,v:c.v});if(d.isNaN(c.h)){if(d.isUndefined(b.__state.h))b.__state.h=0}else b.__state.h=c.h}var j=function(){this.__state=e.apply(this,arguments);if(this.__state===false)throw"Failed to interpret color arguments";this.__state.a=this.__state.a|| -1};j.COMPONENTS="r,g,b,h,s,v,hex,a".split(",");d.extend(j.prototype,{toString:function(){return c(this)},toOriginal:function(){return this.__state.conversion.write(this)}});f(j.prototype,"r",2);f(j.prototype,"g",1);f(j.prototype,"b",0);b(j.prototype,"h");b(j.prototype,"s");b(j.prototype,"v");Object.defineProperty(j.prototype,"a",{get:function(){return this.__state.a},set:function(a){this.__state.a=a}});Object.defineProperty(j.prototype,"hex",{get:function(){if(!this.__state.space!=="HEX")this.__state.hex= -a.rgb_to_hex(this.r,this.g,this.b);return this.__state.hex},set:function(a){this.__state.space="HEX";this.__state.hex=a}});return j}(dat.color.interpret,dat.color.math=function(){var e;return{hsv_to_rgb:function(a,c,d){var e=a/60-Math.floor(a/60),b=d*(1-c),n=d*(1-e*c),c=d*(1-(1-e)*c),a=[[d,c,b],[n,d,b],[b,d,c],[b,n,d],[c,b,d],[d,b,n]][Math.floor(a/60)%6];return{r:a[0]*255,g:a[1]*255,b:a[2]*255}},rgb_to_hsv:function(a,c,d){var e=Math.min(a,c,d),b=Math.max(a,c,d),e=b-e;if(b==0)return{h:NaN,s:0,v:0}; -a=a==b?(c-d)/e:c==b?2+(d-a)/e:4+(a-c)/e;a/=6;a<0&&(a+=1);return{h:a*360,s:e/b,v:b/255}},rgb_to_hex:function(a,c,d){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,c);return a=this.hex_with_component(a,0,d)},component_from_hex:function(a,c){return a>>c*8&255},hex_with_component:function(a,c,d){return d<<(e=c*8)|a&~(255<', '>')); - } else if (nodeType == 1) { // ELEMENT nodes. - // Serialize Element nodes. - output.push('<', node.tagName); - if (node.hasAttributes()) { - var attrMap = node.attributes; - for (var i = 0, len = attrMap.length; i < len; ++i) { - var attrNode = attrMap.item(i); - output.push(' ', attrNode.name, '=\'', attrNode.value, '\''); - } - } - if (node.hasChildNodes()) { - output.push('>'); - var childNodes = node.childNodes; - for (var i = 0, len = childNodes.length; i < len; ++i) { - serializeXML(childNodes.item(i), output); - } - output.push(''); - } else { - output.push('/>'); - } - } else if (nodeType == 8) { - // TODO(codedread): Replace special characters with XML entities? - output.push(''); - } else { - // TODO: Handle CDATA nodes. - // TODO: Handle ENTITY nodes. - // TODO: Handle DOCUMENT nodes. - throw 'Error serializing XML. Unhandled node of type: ' + nodeType; - } -} -// The innerHTML DOM property for SVGElement. -Object.defineProperty(SVGElement.prototype, 'innerHTML', { - get: function() { - var output = []; - var childNode = this.firstChild; - while (childNode) { - serializeXML(childNode, output); - childNode = childNode.nextSibling; - } - return output.join(''); - }, - set: function(markupText) { - // Wipe out the current contents of the element. - while (this.firstChild) { - this.removeChild(this.firstChild); - } - - try { - // Parse the markup into valid nodes. - var dXML = new DOMParser(); - dXML.async = false; - // Wrap the markup into a SVG node to ensure parsing works. - sXML = '' + markupText + ''; - var svgDocElement = dXML.parseFromString(sXML, 'text/xml').documentElement; - - // Now take each node, import it and append to this element. - var childNode = svgDocElement.firstChild; - while(childNode) { - this.appendChild(this.ownerDocument.importNode(childNode, true)); - childNode = childNode.nextSibling; - } - } catch(e) { - throw new Error('Error parsing XML string'); - }; - } -}); - -// The innerSVG DOM property for SVGElement. -Object.defineProperty(SVGElement.prototype, 'innerSVG', { - get: function() { - return this.innerHTML; - }, - set: function(markupText) { - this.innerHTML = markupText; - } -}); - -})(); diff --git a/thirdparty/jquery-ui-1.8.21.custom.min.js b/thirdparty/jquery-ui-1.8.21.custom.min.js deleted file mode 100755 index ffc330a..0000000 --- a/thirdparty/jquery-ui-1.8.21.custom.min.js +++ /dev/null @@ -1,25 +0,0 @@ -/*! jQuery UI - v1.8.21 - 2012-06-05 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.core.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.21",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.position.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05 -* https://github.com/jquery/jquery-ui -* Includes: jquery.ui.draggable.js -* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ -(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length").data("item.autocomplete",c).append(a("
").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height() - * @link http://www.phpied.com/rgb-color-parser-in-javascript/ - * @license Use it if you like it - */ -function RGBColor(color_string) -{ - this.ok = false; - - // strip any leading # - if (color_string.charAt(0) == '#') { // remove # if any - color_string = color_string.substr(1,6); - } - - color_string = color_string.replace(/ /g,''); - color_string = color_string.toLowerCase(); - - // before getting into regexps, try simple matches - // and overwrite the input - var simple_colors = { - aliceblue: 'f0f8ff', - antiquewhite: 'faebd7', - aqua: '00ffff', - aquamarine: '7fffd4', - azure: 'f0ffff', - beige: 'f5f5dc', - bisque: 'ffe4c4', - black: '000000', - blanchedalmond: 'ffebcd', - blue: '0000ff', - blueviolet: '8a2be2', - brown: 'a52a2a', - burlywood: 'deb887', - cadetblue: '5f9ea0', - chartreuse: '7fff00', - chocolate: 'd2691e', - coral: 'ff7f50', - cornflowerblue: '6495ed', - cornsilk: 'fff8dc', - crimson: 'dc143c', - cyan: '00ffff', - darkblue: '00008b', - darkcyan: '008b8b', - darkgoldenrod: 'b8860b', - darkgray: 'a9a9a9', - darkgreen: '006400', - darkkhaki: 'bdb76b', - darkmagenta: '8b008b', - darkolivegreen: '556b2f', - darkorange: 'ff8c00', - darkorchid: '9932cc', - darkred: '8b0000', - darksalmon: 'e9967a', - darkseagreen: '8fbc8f', - darkslateblue: '483d8b', - darkslategray: '2f4f4f', - darkturquoise: '00ced1', - darkviolet: '9400d3', - deeppink: 'ff1493', - deepskyblue: '00bfff', - dimgray: '696969', - dodgerblue: '1e90ff', - feldspar: 'd19275', - firebrick: 'b22222', - floralwhite: 'fffaf0', - forestgreen: '228b22', - fuchsia: 'ff00ff', - gainsboro: 'dcdcdc', - ghostwhite: 'f8f8ff', - gold: 'ffd700', - goldenrod: 'daa520', - gray: '808080', - green: '008000', - greenyellow: 'adff2f', - honeydew: 'f0fff0', - hotpink: 'ff69b4', - indianred : 'cd5c5c', - indigo : '4b0082', - ivory: 'fffff0', - khaki: 'f0e68c', - lavender: 'e6e6fa', - lavenderblush: 'fff0f5', - lawngreen: '7cfc00', - lemonchiffon: 'fffacd', - lightblue: 'add8e6', - lightcoral: 'f08080', - lightcyan: 'e0ffff', - lightgoldenrodyellow: 'fafad2', - lightgrey: 'd3d3d3', - lightgreen: '90ee90', - lightpink: 'ffb6c1', - lightsalmon: 'ffa07a', - lightseagreen: '20b2aa', - lightskyblue: '87cefa', - lightslateblue: '8470ff', - lightslategray: '778899', - lightsteelblue: 'b0c4de', - lightyellow: 'ffffe0', - lime: '00ff00', - limegreen: '32cd32', - linen: 'faf0e6', - magenta: 'ff00ff', - maroon: '800000', - mediumaquamarine: '66cdaa', - mediumblue: '0000cd', - mediumorchid: 'ba55d3', - mediumpurple: '9370d8', - mediumseagreen: '3cb371', - mediumslateblue: '7b68ee', - mediumspringgreen: '00fa9a', - mediumturquoise: '48d1cc', - mediumvioletred: 'c71585', - midnightblue: '191970', - mintcream: 'f5fffa', - mistyrose: 'ffe4e1', - moccasin: 'ffe4b5', - navajowhite: 'ffdead', - navy: '000080', - oldlace: 'fdf5e6', - olive: '808000', - olivedrab: '6b8e23', - orange: 'ffa500', - orangered: 'ff4500', - orchid: 'da70d6', - palegoldenrod: 'eee8aa', - palegreen: '98fb98', - paleturquoise: 'afeeee', - palevioletred: 'd87093', - papayawhip: 'ffefd5', - peachpuff: 'ffdab9', - peru: 'cd853f', - pink: 'ffc0cb', - plum: 'dda0dd', - powderblue: 'b0e0e6', - purple: '800080', - red: 'ff0000', - rosybrown: 'bc8f8f', - royalblue: '4169e1', - saddlebrown: '8b4513', - salmon: 'fa8072', - sandybrown: 'f4a460', - seagreen: '2e8b57', - seashell: 'fff5ee', - sienna: 'a0522d', - silver: 'c0c0c0', - skyblue: '87ceeb', - slateblue: '6a5acd', - slategray: '708090', - snow: 'fffafa', - springgreen: '00ff7f', - steelblue: '4682b4', - tan: 'd2b48c', - teal: '008080', - thistle: 'd8bfd8', - tomato: 'ff6347', - turquoise: '40e0d0', - violet: 'ee82ee', - violetred: 'd02090', - wheat: 'f5deb3', - white: 'ffffff', - whitesmoke: 'f5f5f5', - yellow: 'ffff00', - yellowgreen: '9acd32' - }; - for (var key in simple_colors) { - if (color_string == key) { - color_string = simple_colors[key]; - } - } - // emd of simple type-in colors - - // array of color definition objects - var color_defs = [ - { - re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, - example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'], - process: function (bits){ - return [ - parseInt(bits[1]), - parseInt(bits[2]), - parseInt(bits[3]) - ]; - } - }, - { - re: /^(\w{2})(\w{2})(\w{2})$/, - example: ['#00ff00', '336699'], - process: function (bits){ - return [ - parseInt(bits[1], 16), - parseInt(bits[2], 16), - parseInt(bits[3], 16) - ]; - } - }, - { - re: /^(\w{1})(\w{1})(\w{1})$/, - example: ['#fb0', 'f0f'], - process: function (bits){ - return [ - parseInt(bits[1] + bits[1], 16), - parseInt(bits[2] + bits[2], 16), - parseInt(bits[3] + bits[3], 16) - ]; - } - } - ]; - - // search through the definitions to find a match - for (var i = 0; i < color_defs.length; i++) { - var re = color_defs[i].re; - var processor = color_defs[i].process; - var bits = re.exec(color_string); - if (bits) { - channels = processor(bits); - this.r = channels[0]; - this.g = channels[1]; - this.b = channels[2]; - this.ok = true; - } - - } - - // validate/cleanup values - this.r = (this.r < 0 || isNaN(this.r)) ? 0 : ((this.r > 255) ? 255 : this.r); - this.g = (this.g < 0 || isNaN(this.g)) ? 0 : ((this.g > 255) ? 255 : this.g); - this.b = (this.b < 0 || isNaN(this.b)) ? 0 : ((this.b > 255) ? 255 : this.b); - - // some getters - this.toRGB = function () { - return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')'; - } - this.toHex = function () { - var r = this.r.toString(16); - var g = this.g.toString(16); - var b = this.b.toString(16); - if (r.length == 1) r = '0' + r; - if (g.length == 1) g = '0' + g; - if (b.length == 1) b = '0' + b; - return '#' + r + g + b; - } - - // help - this.getHelpXML = function () { - - var examples = new Array(); - // add regexps - for (var i = 0; i < color_defs.length; i++) { - var example = color_defs[i].example; - for (var j = 0; j < example.length; j++) { - examples[examples.length] = example[j]; - } - } - // add type-in colors - for (var sc in simple_colors) { - examples[examples.length] = sc; - } - - var xml = document.createElement('ul'); - xml.setAttribute('id', 'rgbcolor-examples'); - for (var i = 0; i < examples.length; i++) { - try { - var list_item = document.createElement('li'); - var list_color = new RGBColor(examples[i]); - var example_div = document.createElement('div'); - example_div.style.cssText = - 'margin: 3px; ' - + 'border: 1px solid black; ' - + 'background:' + list_color.toHex() + '; ' - + 'color:' + list_color.toHex() - ; - example_div.appendChild(document.createTextNode('test')); - var list_item_value = document.createTextNode( - ' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex() - ); - list_item.appendChild(example_div); - list_item.appendChild(list_item_value); - xml.appendChild(list_item); - - } catch(e){} - } - return xml; - - } - -} - From 89d04004fb6122e755f04398afbe5e3f3b96b67b Mon Sep 17 00:00:00 2001 From: dpetker Date: Thu, 26 Feb 2015 14:15:40 -0500 Subject: [PATCH 058/190] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c9f5aa2..05aa546 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,10 @@ This fork attempts to make the globe data-agnostic so that users can simply prov * ~~Allow particle colour to be set via the data~~ * ~~Clean up sample data to remove unneeded fields~~ * Allow source/destination data to be specified as lat/long, rather than country names +* Refactor JS to allow better modularization with something like RequireJS, Browserify, etc. +* Introduce Grunt or Gulp for bundling, uglifying, etc. + * Idea would be bundle/browserify my JS > bundle with thirdparty > minify and uglify +* Look at re-writing modules using CoffeeScript (would need to be incorporated into the build workflow) ## Notes From daf8e791f36f0195593e5ebd461923fe45fb5c15 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 26 Feb 2015 15:25:27 -0500 Subject: [PATCH 059/190] First checkin of support for Grunt and CoffeeScript --- .gitignore | 2 ++ Gruntfile.coffee | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 25 ++++++++++++++++++++++++ package.json | 7 +++++++ 4 files changed, 83 insertions(+) create mode 100644 Gruntfile.coffee diff --git a/.gitignore b/.gitignore index be5c778..2e2ab67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ .DS_Store app.yaml client +coffeelint.json hostery-files .hostery-config node_modules/ +build/ diff --git a/Gruntfile.coffee b/Gruntfile.coffee new file mode 100644 index 0000000..4db9721 --- /dev/null +++ b/Gruntfile.coffee @@ -0,0 +1,49 @@ +# Gruntfile for building the dataglobe project + +module.exports = ( grunt ) -> + + grunt.initConfig + pkg: grunt.file.readJSON 'package.json' + + coffee: + lib: + files: + 'js/*.js': 'src/**/*.coffee' + + browserify: + options: + debug: true + destFile: 'build/bundle.js' + src: [ 'js/**/*.js' ] + + dev: + src: '<%= browserify.options.src %>' + dest: '<%= browserify.options.destFile %>' + + production: + options: + debug: false + src: '<%= browserify.options.src %>' + dest: '<%= browserify.options.destFile %>' + + uglify: + options: + banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' + + dist: + files: + 'build/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] + + watch: + files: [ + 'Gruntfile.coffee' + 'src/**/*.coffee' + ] + tasks: 'default' + + grunt.loadNpmTasks 'grunt-contrib-coffee' + grunt.loadNpmTasks 'grunt-browserify' + grunt.loadNpmTasks 'grunt-contrib-uglify' + grunt.loadNpmTasks 'grunt-contrib-watch' + + grunt.registerTask 'default', [ 'coffee', 'browserify', 'uglify' ] diff --git a/README.md b/README.md index 05aa546..6c1f893 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,31 @@ A more generic version of https://github.com/dataarts/armsglobe for visualizing This fork attempts to make the globe data-agnostic so that users can simply provide source/destination data and have it graphed. If timestamp information is provided, this globe can act as a semi-real-time visualization. +## Building + +To build this application you'll need an up-to-date copy of [Node.js](http://nodejs.org/), [Grunt CLI](http://gruntjs.com/), and [CoffeeScript](http://coffeescript.org/). Once all these are installed, simply run the following from within the `dataglobe` directory: + +``` +$ npm install +$ grunt +``` +And everything will be built for you. + +## Running + +To run this application, ensure Node.js has been installed along with all the dataglobe dependencies (see "Building"). Once the application has been built, run : + +``` +$ node app.js +``` + +Alternatively, you can run + +``` +$ grunt watch +``` +To have it watch for changes and automatically rebuild. + ## TODOs * ~~Get rid of the memory leak caused by adding new visualized meshes constantly without ever deleting them~~ diff --git a/package.json b/package.json index 30eeb87..75076d6 100644 --- a/package.json +++ b/package.json @@ -13,5 +13,12 @@ "dependencies": { "express": "^4.11.1", "serve-static": "^1.8.1" + }, + "devDependencies": { + "grunt": "^0.4.5", + "grunt-browserify": "^3.4.0", + "grunt-contrib-coffee": "^0.13.0", + "grunt-contrib-uglify": "^0.8.0", + "grunt-contrib-watch": "^0.6.1" } } From 25677745c7ecad46de520e122eb77ad594b0309d Mon Sep 17 00:00:00 2001 From: dpetker Date: Thu, 26 Feb 2015 15:27:29 -0500 Subject: [PATCH 060/190] Update README.md --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c1f893..90f1c74 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,12 @@ And everything will be built for you. ## Running -To run this application, ensure Node.js has been installed along with all the dataglobe dependencies (see "Building"). Once the application has been built, run : +To run this application, ensure Node.js has been installed along with all the dataglobe dependencies (see "Building"). Once the application has been built, run: ``` $ node app.js ``` - -Alternatively, you can run +And it will start a development server for you to view your work. In addition, you can also run ``` $ grunt watch From 281f8517af3cb5678342a1ff9f2c7308212b9fb1 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 27 Feb 2015 08:19:01 -0500 Subject: [PATCH 061/190] Added our CoffeeScript modules and tweaked build a bit. Note that build is still broken at this time. --- Gruntfile.coffee | 21 +++- package.json | 1 + src/dataloading.coffee | 27 +++++ src/geopins.coffee | 27 +++++ src/main.coffee | 197 +++++++++++++++++++++++++++++++++++++ src/mousekeyboard.coffee | 69 +++++++++++++ src/util.coffee | 29 ++++++ src/visualize.coffee | 160 ++++++++++++++++++++++++++++++ src/visualize_lines.coffee | 74 ++++++++++++++ 9 files changed, 600 insertions(+), 5 deletions(-) create mode 100644 src/dataloading.coffee create mode 100644 src/geopins.coffee create mode 100644 src/main.coffee create mode 100644 src/mousekeyboard.coffee create mode 100644 src/util.coffee create mode 100644 src/visualize.coffee create mode 100644 src/visualize_lines.coffee diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 4db9721..67ff984 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -5,16 +5,26 @@ module.exports = ( grunt ) -> grunt.initConfig pkg: grunt.file.readJSON 'package.json' + clean: + [ 'build/tmp', 'build/*.js' ] + coffee: - lib: - files: - 'js/*.js': 'src/**/*.coffee' + options: + bare: true # we don't want the wrapper function or else bad things + # happen with browserify + files: + expand: true + flatten: true + cwd: 'src/' + src: ['**/*.coffee'] + dest: 'build/tmp' + ext: '.js' browserify: options: debug: true destFile: 'build/bundle.js' - src: [ 'js/**/*.js' ] + src: [ 'build/tmp/*.js' ] dev: src: '<%= browserify.options.src %>' @@ -45,5 +55,6 @@ module.exports = ( grunt ) -> grunt.loadNpmTasks 'grunt-browserify' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-watch' + grunt.loadNpmTasks 'grunt-contrib-clean' - grunt.registerTask 'default', [ 'coffee', 'browserify', 'uglify' ] + grunt.registerTask 'default', [ 'clean', 'coffee', 'browserify', 'uglify' ] diff --git a/package.json b/package.json index 75076d6..0da7f42 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "devDependencies": { "grunt": "^0.4.5", "grunt-browserify": "^3.4.0", + "grunt-contrib-clean": "^0.6.0", "grunt-contrib-coffee": "^0.13.0", "grunt-contrib-uglify": "^0.8.0", "grunt-contrib-watch": "^0.6.1" diff --git a/src/dataloading.coffee b/src/dataloading.coffee new file mode 100644 index 0000000..b712579 --- /dev/null +++ b/src/dataloading.coffee @@ -0,0 +1,27 @@ +module.exports = + loadWorldPins: ( latLonFile, callback ) -> _getDataFromServer latLonFile, callback + + loadCountryCodes: ( isoFile, callback ) -> _getDataFromServer isoFile, callback + + loadContentData: ( callback ) -> + filePath = encodeURI "categories/All.json" + _getDataFromServer filePath, callback + +# private helper method +_getDataFromServer = ( path, callback ) -> + # We're going to ask a file for the JSON data. + xhr = new XMLHttpRequest() + + # Where do we get the data? + xhr.open 'GET', path, true + + # What do we do when we have it? + xhr.onreadystatechange -> + # If we've received the data + if xhr.readyState is 4 and xhr.status is 200 + # Parse the JSON + parsedData = JSON.parse xhr.responseText + callback parsedData if callback + + # Begin request + xhr.send null diff --git a/src/geopins.coffee b/src/geopins.coffee new file mode 100644 index 0000000..b6ee93d --- /dev/null +++ b/src/geopins.coffee @@ -0,0 +1,27 @@ +module.exports = + loadGeoData: ( latlonData, countryLookup ) -> + for country, index in latlonData.countries + # save out country name and code info + country.countryCode = index + country.countryName = countryLookup[index] + + # take the lat lon from the data and convert this to 3d globe space + center = convertLatLonToVector country.lat, country.lon + + country.center = center + countryData[country.countryName] = country + + # Convert arbitrary lat/lon to a vector within the globe's space + convertLatLonToVector: ( lat, lon ) -> + rad = 100 + lon -= 90 + + phi = Math.PI/2 - lat * Math.PI / 180 - Math.PI * 0.01 + theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06 + + vec = new THREE.Vector3 + vec.x = Math.sin(phi) * Math.cos(theta) * rad + vec.y = Math.cos(phi) * rad + vec.z = Math.sin(phi) * Math.sin(theta) * rad + + return vec diff --git a/src/main.coffee b/src/main.coffee new file mode 100644 index 0000000..eb544d6 --- /dev/null +++ b/src/main.coffee @@ -0,0 +1,197 @@ +# All our dependencies +dataLoading = require 'dataloading' +mouseKeyboard = require 'mousekeyboard' + +masterContainer = document.getElementById 'visualization' +overlay = document.getElementById 'visualization' +glContainer = document.getElementById 'glContainer' + +# Colour Constants +COLOUR_MAP = + r: new THREE.Color 0xFF1E00 + o: new THREE.Color 0xFF7F00 + b: new THREE.Color 0x008EAF + g: new THREE.Color 0x00CA35 + p: new THREE.Color 0xDC0068 + +# contains a list of country codes with their matching country names +isoFile = 'country_iso3166.json' +latlonFile = 'country_lat_lon.json' + +# Detect WebGL +if not Detector.webgl + Detector.addGetWebGLMessage() +else + # ensure the map images are loaded first!! + mapIndexedImage = new Image() + mapIndexedImage.src = 'images/map_indexed.png' + mapIndexedImage.onload = -> + mapOutlineImage = new Image() + mapOutlineImage.src = 'images/map_outline.png' + mapOutlineImage.onload = -> + dataLoading.loadCountryCodes -> + dataLoading.loadWorldPins -> + dataLoading.loadContentData -> + initScene() + initMeshPool( 100 ) # defined in visualize.js + animate() + startDataPump() + +# used with the data pump +currIndexIntoData = 0 +nextIndexIntoData = 5 + +startDataPump = -> + window.setInterval -> + endIndex = currIndexIntoData + 5 + if endIndex > sampleData.length + endIndex = sampleData.length + + selectVisualization( sampleData.slice( currIndexIntoData, endIndex ) ) + currIndexIntoData = (currIndexIntoData + 5) % sampleData.length + , 500 + +# All the initialization stuff for THREE.js +initScene = -> + scene = new THREE.Scene() + scene.matrixAutoUpdate = false + + light1 = new THREE.SpotLight 0xeeeeee, 3 + light1.position.x = 730 + light1.position.y = 520 + light1.position.z = 626 + light1.castShadow = true + scene.add light1 + + light2 = new THREE.SpotLight 0xeeeeee, 1.5 + light2.position.x = -730 + light2.position.y = 520 + light2.position.z = 626 + light2.castShadow = true + scene.add light2 + + light3 = new THREE.PointLight 0x222222, 14.8 + light3.position.x = 0 + light3.position.y = -750 + light3.position.z = 0 + scene.add light3 + + rotating = new THREE.Object3D() + scene.add rotating + + lookupCanvas = document.createElement 'canvas' + lookupCanvas.width = 256 + lookupCanvas.height = 1 + + lookupTexture = new THREE.Texture lookupCanvas + lookupTexture.magFilter = THREE.NearestFilter + lookupTexture.minFilter = THREE.NearestFilter + lookupTexture.needsUpdate = true + + indexedMapTexture = new THREE.Texture mapIndexedImage + indexedMapTexture.needsUpdate = true + indexedMapTexture.magFilter = THREE.NearestFilter + indexedMapTexture.minFilter = THREE.NearestFilter + + outlinedMapTexture = new THREE.Texture mapOutlineImage + outlinedMapTexture.needsUpdate = true + + uniforms = + 'mapIndex': { type: 't', value: indexedMapTexture } + 'lookup': { type: 't', value: lookupTexture } + 'outline': { type: 't', value: outlinedMapTexture } + 'outlineLevel': {type: 'f', value: 1 } + + shaderMaterial = new THREE.MeshLambertMaterial { map: outlinedMapTexture } + + # Create the backing (sphere) + sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ) + sphere.doubleSided = false + sphere.rotation.x = Math.PI + sphere.rotation.y = -Math.PI/2 + sphere.rotation.z = Math.PI + sphere.id = "base" + rotating.add sphere + + loadGeoData latlonData + buildDataVizGeometries sampleData + + visualizationMesh = new THREE.Object3D() + rotating.add visualizationMesh + + # Set up our renderer + renderer = new THREE.WebGLRenderer {antialias:false, alpha: true} + renderer.setSize window.innerWidth, window.innerHeight + renderer.autoClear = false + + renderer.sortObjects = false + renderer.generateMipmaps = false + + glContainer.appendChild renderer.domElement + + + # Event listeners + document.addEventListener 'mousemove', onDocumentMouseMove, true + document.addEventListener 'mousedown', onDocumentMouseDown, true + document.addEventListener 'mouseup', onDocumentMouseUp, false + + masterContainer.addEventListener 'click', onClick, true + masterContainer.addEventListener 'mousewheel', onMouseWheel, false + + # firefox + masterContainer.addEventListener 'DOMMouseScroll', (e) -> + evt = window.event or e + onMouseWheel evt + , false + + # Setup our camera + camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ) + camera.position.z = 1400 + camera.position.y = 0 + scene.add camera + + windowResize = THREEx.WindowResize renderer, camera + + # Get the globe spinning (defined in mousekeyboard.js) + mouseKeyboard.startAutoRotate() + +animate = -> + if rotateTargetX? and rotateTargetY? + rotateVX += (rotateTargetX - rotateX) * 0.012 + rotateVY += (rotateTargetY - rotateY) * 0.012 + + if Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1 + rotateTargetX = undefined + rotateTargetY = undefined + + rotateX += rotateVX + rotateY += rotateVY + + rotateVX *= 0.98 + rotateVY *= 0.98 + + if dragging or rotateTargetX? + rotateVX *= 0.6 + rotateVY *= 0.6 + + rotateY += controllers.spin * 0.01 + + # constrain the pivot up/down to the poles + # force a bit of bounce back action when hitting the poles + if rotateX < -rotateXMax + rotateX = -rotateXMax + rotateVX *= -0.95 + + if rotateX > rotateXMax + rotateX = rotateXMax + rotateVX *= -0.95 + + rotating.rotation.x = rotateX + rotating.rotation.y = rotateY + + requestAnimationFrame animate + renderer.render scene, camera + + rotating.traverse ( mesh ) -> + if mesh? and mesh.update? + mesh.update() diff --git a/src/mousekeyboard.coffee b/src/mousekeyboard.coffee new file mode 100644 index 0000000..b59931c --- /dev/null +++ b/src/mousekeyboard.coffee @@ -0,0 +1,69 @@ +# Ugly variable declarations +mouseX = 0; mouseY = 0; pmouseX = 0; pmouseY = 0; pressX = 0; pressY = 0 +dragging = false; rotateX = 0; rotateY = 0; rotateVX = 0; rotateVY = 0 +rotateTargetX = 0; rotateTargetY = 0 + +rotateXMax = 90 * Math.PI/180 +_autoRotateId = null + +keyboard = new THREEx.KeyboardState() + +module.exports = + onDocumentMouseMove: ( event ) -> + pmouseX = mouseX + pmouseY = mouseY + + mouseX = event.clientX - window.innerWidth * 0.5 + mouseY = event.clientY - window.innerHeight * 0.5 + + if dragging + if keyboard.pressed "shift" is false + rotateVY += (mouseX - pmouseX) / 2 * Math.PI / 180 * 0.3 + rotateVX += (mouseY - pmouseY) / 2 * Math.PI / 180 * 0.3 + else + camera.position.x -= (mouseX - pmouseX) * 0.5 + camera.position.y += (mouseY - pmouseY) * 0.5 + + onDocumentMouseDown: ( event ) -> + if event.target.className.indexOf 'noMapDrag' isnt -1 + return + + dragging = true + pressX = mouseX + pressY = mouseY + rotateTargetX = undefined + rotateTargetX = undefined + stopAutoRotate() + + onDocumentMouseUp: ( event ) -> + dragging = false + histogramPressed = false + startAutoRotate() + + onClick: ( event ) -> + if Math.abs(pressX - mouseX) > 3 or Math.abs(pressY - mouseY) > 3 + return + + handleMWheel: ( delta ) -> + camera.scale.z += delta * 0.1 + camera.scale.z = constrain camera.scale.z, 0.7, 5.0 + + onMouseWheel: ( event ) -> + delta = 0 + + if event.wheelDelta + delta = event.wheelDelta / 120 + else if event.detail + delta = -event.detail/3 + + if delta? + handleMWheel delta + + event.returnValue = false + + startAutoRotate: -> + _autoRotateId = window.setInterval -> + rotateVY += 0.1 * Math.PI / 180 * 0.3 + , 100 + + stopAutoRotate: -> window.clearInterval _autoRotateId diff --git a/src/util.coffee b/src/util.coffee new file mode 100644 index 0000000..d74a396 --- /dev/null +++ b/src/util.coffee @@ -0,0 +1,29 @@ +THREE.Curve.Utils.createLineGeometry = ( points ) -> + geometry = new THREE.Geometry() + for point in points + geometry.vertices.push point + + return geometry + +module.exports = + wrap: ( value, min, rangeSize ) -> + rangeSize -= min + while value < min + value += rangeSize + + return value % rangeSize + + screenXY: ( vec3, camera ) -> + projector = new THREE.Projector() + vector = projector.projectVector vec3.clone(), camera + result = {} + + windowWidth = window.innerWidth + minWidth = 1280 + if windowWidth < minWidth + windowWidth = minWidth + + result.x = Math.round( vector.x * (windowWidth/2) ) + windowWidth/2 + result.y = Math.round( (0-vector.y) * (window.innerHeight/2) ) + window.innerHeight/2 + + return result diff --git a/src/visualize.coffee b/src/visualize.coffee new file mode 100644 index 0000000..4995020 --- /dev/null +++ b/src/visualize.coffee @@ -0,0 +1,160 @@ +_meshPool = [] + +module.exports = + buildDataVizGeometries: ( linearData, countryData ) -> + loadLayer = document.getElementById 'loading' + count = 0 + + for set in linearData + exporterName = set.src.toUpperCase() + importerName = set.dest.toUpperCase() + + exporter = countryData[exporterName] + importer = countryData[importerName] + + # we couldn't find the country, it wasn't in our list... + if not exporter? or not importer? + continue + + # visualize this event + set.lineGeometry = makeConnectionLineGeometry exporter, importer, set.v, set.wc + + loadLayer.style.display = 'none' + return + + initMeshPool: ( poolSize ) -> + _meshPool.push new ParticleMesh() for i in [0...poolSize] + + getVisualizedMesh: ( linearData, callback ) -> + return null if not linearData.lineGeometry? + + _getMeshFromPool ( meshObj ) -> + # merge it all together + meshObj.linesGeo.merge linearData.lineGeometry + points = linearData.lineGeometry.vertices + point = points[0] + particle = point.clone() + particle.moveIndex = 0 + particle.nextIndex = 1 + particle.lerpN = 0 + particle.path = points + particle.size = meshObj.particleSize + meshObj.particlesGeo.vertices.push particle + + # set the colour + meshObj.setParticleColour linearData.colour + + return callback meshObj.splineOutline + + selectVisualization: ( linearData ) -> + # clear off the country's internally held color data we used from last highlight + for country in countryData + country.exportedAmount = 0 + country.importedAmount = 0 + country.mapColor = 0 + + # build the meshes. One for each entry in our data + for data in linearData + getVisualizedMesh data, _addMeshToViz + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# HELPER METHODS +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +_addMeshToViz = ( mesh ) -> + visualizationMesh.add mesh if mesh? + +_getMeshFromPool = ( callback ) -> + if _meshPool.length > 0 + callback _meshPool.pop() + else + window.setTimeout _getMeshFromPool, 500, callback + +_returnMeshToPool: ( mesh ) -> + # clean up the two geometries + mesh.linesGeo.vertices = [] + mesh.particlesGeo.vertices = [] + mesh.pSystem.systemComplete = false + + # have to remove from the scene or else bad things happen. 'scene' is leaked + # into this scope from main.js + scene.remove mesh.splineOutline + + _meshPool.push mesh + +class ParticleMesh + constructor: -> + this.linesGeo = new THREE.Geometry() + this.particlesGeo = new THREE.Geometry() + this.particleColor = COLOUR_MAP.r + this.particleSize = 150 + + this.lineMat = new THREE.LineBasicMaterial + color: 0xffffff + opacity: 0.0 + blending: THREE.AdditiveBlending + transparent: true + depthWrite: false + vertexColors: false + linewidth: 1 + this.splineOutline = new THREE.Line null, this.lineMat + + this.shaderMaterial = new THREE.PointCloudMaterial + map: THREE.ImageUtils.loadTexture "images/particleB.png" + size: this.particleSize + blending: THREE.AdditiveBlending + depthTest: true + depthWrite: false + transparent: true + color: this.particleColor + this.pSystem = new THREE.PointCloud null, this.shaderMaterial + + this.splineOutline.renderDepth = false + this.pSystem.dynamic = true + this.pSystem.systemComplete = false # So we can know when to re-pool this mesh + this.splineOutline.add this.pSystem + this.splineOutline.geometry = this.linesGeo + this.pSystem.geometry = this.particlesGeo + + this.pSystem.addEventListener( 'ParticleSystemComplete', _returnMeshToPool.bind( this, this ) ) + + # This update method is what actually gets our points moving across the scene. + # Once the point has finished its path, this method will emit a "ParticleSystemComplete" + # event, to allow us to re-pool the mesh. + this.pSystem.update = -> + #Simplified this as our particle geometry will only ever have one point + particle = this.geometry.vertices[0] + + # no point doing all the calculations if the particle is already done + return if this.systemComplete? or not particle + + path = particle.path + moveLength = path.length + + particle.lerpN += 0.15 + if particle.lerpN > 1 + particle.lerpN = 0 + particle.moveIndex = particle.nextIndex + particle.nextIndex++ + if particle.nextIndex >= path.length + particle.moveIndex = 0 + particle.nextIndex = 0 + + this.systemComplete = true + this.dispatchEvent { type: 'ParticleSystemComplete' } + return + + currentPoint = path[particle.moveIndex] + nextPoint = path[particle.nextIndex] + + particle.copy currentPoint + particle.lerp nextPoint, particle.lerpN + + this.geometry.verticesNeedUpdate = true + + setParticleColour: ( colourStr ) -> + colour = COLOUR_MAP[colourStr] + colour = COLOUR_MAP.r if not colour + + this.particleColor = colour + this.shaderMaterial.color = colour diff --git a/src/visualize_lines.coffee b/src/visualize_lines.coffee new file mode 100644 index 0000000..e89c9df --- /dev/null +++ b/src/visualize_lines.coffee @@ -0,0 +1,74 @@ +globeRadius = 1000 +vec3_origin = new THREE.Vector3 0, 0, 0 + +module.exports = + makeConnectionLineGeometry: ( exporter, importer, value, type ) -> + if not exporter.countryName? or not importer.countryName? + return undefined + + distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length() + + # how high we want to shoot the curve upwards + anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.3 + + # start/end of the line + start = exporter.center + end = importer.center + + # midpoint for the curve + mid = start.clone().lerp end, 0.5 + midLength = mid.length() + mid.normalize() + mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.4 ) + + # the normal from start to end + normal = (new THREE.Vector3()).subVectors start, end + normal.normalize() + + # The curve looks like this: + # + # midStartAnchor---- mid ----- midEndAnchor + # / \ + # / \ + # / \ + # start/anchor end/anchor + # + # splineCurveA splineCurveB + + distanceHalf = distanceBetweenCountryCenter * 0.5 + + startAnchor = start + midStartAnchor = mid.clone().add( normal.clone().multiplyScalar( distanceHalf ) ) + midEndAnchor = mid.clone().add( normal.clone().multiplyScalar( -distanceHalf ) ) + endAnchor = end + + # now make a bezier curve out of the above like so in the diagram + splineCurveA = new THREE.CubicBezierCurve3 start, startAnchor, midStartAnchor, mid + splineCurveB = new THREE.CubicBezierCurve3 mid, midEndAnchor, endAnchor, end + + # how many vertices do we want on this guy? this is for *each* side + vertexCountDesired = Math.floor( distanceBetweenCountryCenter * 0.02 + 6 ) * 2 + + # collect the vertices + points = splineCurveA.getPoints vertexCountDesired + + # remove the very last point since it will be duplicated on the next half of the curve + points = points.splice 0, points.length - 1 + points = points.concat( splineCurveB.getPoints( vertexCountDesired ) ) + + # add one final point to the center of the earth + # we need this for drawing multiple arcs, but piled into one geometry buffer + points.push vec3_origin + + # create a line geometry out of these + curveGeometry = THREE.Curve.Utils.createLineGeometry points + + return curveGeometry; + + constrain: (v, min, max) -> + if v < min + v = min + else if v > max + v = max + + return v From 0f6829e3768aee540d4dd9de9f82cacb4211ed10 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 27 Feb 2015 08:26:11 -0500 Subject: [PATCH 062/190] Cleared out finished TODOs from README --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index 90f1c74..2cf5d8b 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,8 @@ To have it watch for changes and automatically rebuild. ## TODOs -* ~~Get rid of the memory leak caused by adding new visualized meshes constantly without ever deleting them~~ -* Highlight the destination country when the particle "hits" it -* ~~Allow particle colour to be set via the data~~ -* ~~Clean up sample data to remove unneeded fields~~ * Allow source/destination data to be specified as lat/long, rather than country names -* Refactor JS to allow better modularization with something like RequireJS, Browserify, etc. -* Introduce Grunt or Gulp for bundling, uglifying, etc. - * Idea would be bundle/browserify my JS > bundle with thirdparty > minify and uglify -* Look at re-writing modules using CoffeeScript (would need to be incorporated into the build workflow) +* Highlight the destination country when the particle "hits" it ## Notes From 7027497fb361b3e4d1c856a3d32c9da9f6c95d90 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 27 Feb 2015 09:19:55 -0500 Subject: [PATCH 063/190] Fixed a lot of the module dependency errors. --- index.html | 6 +-- src/constants.coffee | 8 ++++ src/dataloading.coffee | 2 +- src/geopins.coffee | 3 ++ src/main.coffee | 95 +++++++++++++++++----------------------- src/mousekeyboard.coffee | 37 +++++++++++++++- src/visualize.coffee | 21 ++++----- 7 files changed, 99 insertions(+), 73 deletions(-) create mode 100644 src/constants.coffee diff --git a/index.html b/index.html index 71a30b8..4ab4b16 100755 --- a/index.html +++ b/index.html @@ -54,16 +54,16 @@

Legend

- + - + diff --git a/src/constants.coffee b/src/constants.coffee new file mode 100644 index 0000000..9629e4e --- /dev/null +++ b/src/constants.coffee @@ -0,0 +1,8 @@ +module.exports = + # Colour Constants + COLOUR_MAP: + r: new THREE.Color 0xFF1E00 + o: new THREE.Color 0xFF7F00 + b: new THREE.Color 0x008EAF + g: new THREE.Color 0x00CA35 + p: new THREE.Color 0xDC0068 diff --git a/src/dataloading.coffee b/src/dataloading.coffee index b712579..b5f4160 100644 --- a/src/dataloading.coffee +++ b/src/dataloading.coffee @@ -16,7 +16,7 @@ _getDataFromServer = ( path, callback ) -> xhr.open 'GET', path, true # What do we do when we have it? - xhr.onreadystatechange -> + xhr.onreadystatechange = -> # If we've received the data if xhr.readyState is 4 and xhr.status is 200 # Parse the JSON diff --git a/src/geopins.coffee b/src/geopins.coffee index b6ee93d..bfbe26e 100644 --- a/src/geopins.coffee +++ b/src/geopins.coffee @@ -1,5 +1,6 @@ module.exports = loadGeoData: ( latlonData, countryLookup ) -> + countryData = {} for country, index in latlonData.countries # save out country name and code info country.countryCode = index @@ -11,6 +12,8 @@ module.exports = country.center = center countryData[country.countryName] = country + return countryData + # Convert arbitrary lat/lon to a vector within the globe's space convertLatLonToVector: ( lat, lon ) -> rad = 100 diff --git a/src/main.coffee b/src/main.coffee index eb544d6..1712649 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -1,23 +1,30 @@ # All our dependencies -dataLoading = require 'dataloading' -mouseKeyboard = require 'mousekeyboard' +dataLoading = require './dataloading' +mouseKeyboard = require './mousekeyboard' +visualize = require './visualize' +geopins = require './geopins' masterContainer = document.getElementById 'visualization' overlay = document.getElementById 'visualization' glContainer = document.getElementById 'glContainer' -# Colour Constants -COLOUR_MAP = - r: new THREE.Color 0xFF1E00 - o: new THREE.Color 0xFF7F00 - b: new THREE.Color 0x008EAF - g: new THREE.Color 0x00CA35 - p: new THREE.Color 0xDC0068 +# Visualization components that need to be accessible throughout this module +mapIndexedImage = null +mapOutlineImage = null +rotating = null +renderer = null +scene = null +camera = null # contains a list of country codes with their matching country names isoFile = 'country_iso3166.json' latlonFile = 'country_lat_lon.json' +# Holds all the data we get back from the server +_countryLookup = null +_latLonData = null +_sampleData = null + # Detect WebGL if not Detector.webgl Detector.addGetWebGLMessage() @@ -25,15 +32,20 @@ else # ensure the map images are loaded first!! mapIndexedImage = new Image() mapIndexedImage.src = 'images/map_indexed.png' + mapIndexedImage.onload = -> + mapOutlineImage = new Image() mapOutlineImage.src = 'images/map_outline.png' mapOutlineImage.onload = -> - dataLoading.loadCountryCodes -> - dataLoading.loadWorldPins -> - dataLoading.loadContentData -> + dataLoading.loadCountryCodes isoFile, ( isoData ) -> + _countryLookup = isoData + dataLoading.loadWorldPins latlonFile, ( latLonData ) -> + _latLonData = latLonData + dataLoading.loadContentData ( sampleData ) -> + _sampleData = sampleData initScene() - initMeshPool( 100 ) # defined in visualize.js + visualize.initMeshPool( 100 ) animate() startDataPump() @@ -44,11 +56,11 @@ nextIndexIntoData = 5 startDataPump = -> window.setInterval -> endIndex = currIndexIntoData + 5 - if endIndex > sampleData.length - endIndex = sampleData.length + if endIndex > _sampleData.length + endIndex = _sampleData.length - selectVisualization( sampleData.slice( currIndexIntoData, endIndex ) ) - currIndexIntoData = (currIndexIntoData + 5) % sampleData.length + visualize.selectVisualization( _sampleData.slice( currIndexIntoData, endIndex ) ) + currIndexIntoData = (currIndexIntoData + 5) % _sampleData.length , 500 # All the initialization stuff for THREE.js @@ -113,8 +125,8 @@ initScene = -> sphere.id = "base" rotating.add sphere - loadGeoData latlonData - buildDataVizGeometries sampleData + countryData = geopins.loadGeoData _latLonData, _countryLookup + visualize.buildDataVizGeometries _sampleData, countryData visualizationMesh = new THREE.Object3D() rotating.add visualizationMesh @@ -129,14 +141,13 @@ initScene = -> glContainer.appendChild renderer.domElement - # Event listeners - document.addEventListener 'mousemove', onDocumentMouseMove, true - document.addEventListener 'mousedown', onDocumentMouseDown, true - document.addEventListener 'mouseup', onDocumentMouseUp, false + document.addEventListener 'mousemove', mouseKeyboard.onDocumentMouseMove, true + document.addEventListener 'mousedown', mouseKeyboard.onDocumentMouseDown, true + document.addEventListener 'mouseup', mouseKeyboard.onDocumentMouseUp, false - masterContainer.addEventListener 'click', onClick, true - masterContainer.addEventListener 'mousewheel', onMouseWheel, false + masterContainer.addEventListener 'click', mouseKeyboard.onClick, true + masterContainer.addEventListener 'mousewheel', mouseKeyboard.onMouseWheel, false # firefox masterContainer.addEventListener 'DOMMouseScroll', (e) -> @@ -156,38 +167,10 @@ initScene = -> mouseKeyboard.startAutoRotate() animate = -> - if rotateTargetX? and rotateTargetY? - rotateVX += (rotateTargetX - rotateX) * 0.012 - rotateVY += (rotateTargetY - rotateY) * 0.012 - - if Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1 - rotateTargetX = undefined - rotateTargetY = undefined - - rotateX += rotateVX - rotateY += rotateVY - - rotateVX *= 0.98 - rotateVY *= 0.98 - - if dragging or rotateTargetX? - rotateVX *= 0.6 - rotateVY *= 0.6 - - rotateY += controllers.spin * 0.01 - - # constrain the pivot up/down to the poles - # force a bit of bounce back action when hitting the poles - if rotateX < -rotateXMax - rotateX = -rotateXMax - rotateVX *= -0.95 - - if rotateX > rotateXMax - rotateX = rotateXMax - rotateVX *= -0.95 + mouseKeyboard.updateRotation() - rotating.rotation.x = rotateX - rotating.rotation.y = rotateY + rotating.rotation.x = mouseKeyboard.rotateX + rotating.rotation.y = mouseKeyboard.rotateY requestAnimationFrame animate renderer.render scene, camera diff --git a/src/mousekeyboard.coffee b/src/mousekeyboard.coffee index b59931c..0fb630a 100644 --- a/src/mousekeyboard.coffee +++ b/src/mousekeyboard.coffee @@ -1,6 +1,6 @@ # Ugly variable declarations mouseX = 0; mouseY = 0; pmouseX = 0; pmouseY = 0; pressX = 0; pressY = 0 -dragging = false; rotateX = 0; rotateY = 0; rotateVX = 0; rotateVY = 0 +dragging = false; rotateVX = 0; rotateVY = 0 rotateTargetX = 0; rotateTargetY = 0 rotateXMax = 90 * Math.PI/180 @@ -9,6 +9,41 @@ _autoRotateId = null keyboard = new THREEx.KeyboardState() module.exports = + + rotateX: 0 + rotateY: 0 + + updateRotation: -> + if rotateTargetX? and rotateTargetY? + rotateVX += (rotateTargetX - this.rotateX) * 0.012 + rotateVY += (rotateTargetY - this.rotateY) * 0.012 + + if Math.abs(rotateTargetX - this.rotateX) < 0.1 && Math.abs(rotateTargetY - this.rotateY) < 0.1 + rotateTargetX = undefined + rotateTargetY = undefined + + this.rotateX += rotateVX + this.rotateY += rotateVY + + rotateVX *= 0.98 + rotateVY *= 0.98 + + if dragging or rotateTargetX? + rotateVX *= 0.6 + rotateVY *= 0.6 + + this.rotateY += controllers.spin * 0.01 + + # constrain the pivot up/down to the poles + # force a bit of bounce back action when hitting the poles + if this.rotateX < -rotateXMax + this.rotateX = -rotateXMax + rotateVX *= -0.95 + + if this.rotateX > rotateXMax + this.rotateX = rotateXMax + rotateVX *= -0.95 + onDocumentMouseMove: ( event ) -> pmouseX = mouseX pmouseY = mouseY diff --git a/src/visualize.coffee b/src/visualize.coffee index 4995020..1e5c258 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -1,3 +1,6 @@ +constants = require './constants' +vizLines = require './visualize_lines' + _meshPool = [] module.exports = @@ -17,7 +20,7 @@ module.exports = continue # visualize this event - set.lineGeometry = makeConnectionLineGeometry exporter, importer, set.v, set.wc + set.lineGeometry = vizLines.makeConnectionLineGeometry exporter, importer, set.v, set.wc loadLayer.style.display = 'none' return @@ -47,15 +50,9 @@ module.exports = return callback meshObj.splineOutline selectVisualization: ( linearData ) -> - # clear off the country's internally held color data we used from last highlight - for country in countryData - country.exportedAmount = 0 - country.importedAmount = 0 - country.mapColor = 0 - # build the meshes. One for each entry in our data for data in linearData - getVisualizedMesh data, _addMeshToViz + this.getVisualizedMesh data, _addMeshToViz # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # HELPER METHODS @@ -70,7 +67,7 @@ _getMeshFromPool = ( callback ) -> else window.setTimeout _getMeshFromPool, 500, callback -_returnMeshToPool: ( mesh ) -> +_returnMeshToPool = ( mesh ) -> # clean up the two geometries mesh.linesGeo.vertices = [] mesh.particlesGeo.vertices = [] @@ -86,7 +83,7 @@ class ParticleMesh constructor: -> this.linesGeo = new THREE.Geometry() this.particlesGeo = new THREE.Geometry() - this.particleColor = COLOUR_MAP.r + this.particleColor = constants.COLOUR_MAP.r this.particleSize = 150 this.lineMat = new THREE.LineBasicMaterial @@ -153,8 +150,8 @@ class ParticleMesh this.geometry.verticesNeedUpdate = true setParticleColour: ( colourStr ) -> - colour = COLOUR_MAP[colourStr] - colour = COLOUR_MAP.r if not colour + colour = constants.COLOUR_MAP[colourStr] + colour = constants.COLOUR_MAP.r if not colour this.particleColor = colour this.shaderMaterial.color = colour From e6b16f1928a47eee250c329e0c3bae103626488a Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 27 Feb 2015 10:25:30 -0500 Subject: [PATCH 064/190] Globe now displays and mouse events work as expected. --- src/main.coffee | 6 ++++-- src/mousekeyboard.coffee | 22 ++++++++++++---------- src/visualize.coffee | 20 +++++++++++++------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/main.coffee b/src/main.coffee index 1712649..f28e2f4 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -15,6 +15,7 @@ rotating = null renderer = null scene = null camera = null +visualizationMesh = null # contains a list of country codes with their matching country names isoFile = 'country_iso3166.json' @@ -45,6 +46,7 @@ else dataLoading.loadContentData ( sampleData ) -> _sampleData = sampleData initScene() + visualize.init( scene ) visualize.initMeshPool( 100 ) animate() startDataPump() @@ -59,7 +61,7 @@ startDataPump = -> if endIndex > _sampleData.length endIndex = _sampleData.length - visualize.selectVisualization( _sampleData.slice( currIndexIntoData, endIndex ) ) + visualize.selectVisualization( _sampleData.slice( currIndexIntoData, endIndex ), visualizationMesh ) currIndexIntoData = (currIndexIntoData + 5) % _sampleData.length , 500 @@ -152,7 +154,7 @@ initScene = -> # firefox masterContainer.addEventListener 'DOMMouseScroll', (e) -> evt = window.event or e - onMouseWheel evt + mouseKeyboard.onMouseWheel evt, camera , false # Setup our camera diff --git a/src/mousekeyboard.coffee b/src/mousekeyboard.coffee index 0fb630a..8169a73 100644 --- a/src/mousekeyboard.coffee +++ b/src/mousekeyboard.coffee @@ -1,3 +1,5 @@ +vizLines = require './visualize_lines' + # Ugly variable declarations mouseX = 0; mouseY = 0; pmouseX = 0; pmouseY = 0; pressX = 0; pressY = 0 dragging = false; rotateVX = 0; rotateVY = 0 @@ -32,8 +34,6 @@ module.exports = rotateVX *= 0.6 rotateVY *= 0.6 - this.rotateY += controllers.spin * 0.01 - # constrain the pivot up/down to the poles # force a bit of bounce back action when hitting the poles if this.rotateX < -rotateXMax @@ -52,7 +52,7 @@ module.exports = mouseY = event.clientY - window.innerHeight * 0.5 if dragging - if keyboard.pressed "shift" is false + if keyboard.pressed( "shift" ) is false rotateVY += (mouseX - pmouseX) / 2 * Math.PI / 180 * 0.3 rotateVX += (mouseY - pmouseY) / 2 * Math.PI / 180 * 0.3 else @@ -60,7 +60,7 @@ module.exports = camera.position.y += (mouseY - pmouseY) * 0.5 onDocumentMouseDown: ( event ) -> - if event.target.className.indexOf 'noMapDrag' isnt -1 + if event.target.className.indexOf( 'noMapDrag' ) isnt -1 return dragging = true @@ -68,22 +68,24 @@ module.exports = pressY = mouseY rotateTargetX = undefined rotateTargetX = undefined - stopAutoRotate() + module.exports.stopAutoRotate() + return onDocumentMouseUp: ( event ) -> dragging = false histogramPressed = false - startAutoRotate() + module.exports.startAutoRotate() + return onClick: ( event ) -> if Math.abs(pressX - mouseX) > 3 or Math.abs(pressY - mouseY) > 3 return - handleMWheel: ( delta ) -> + handleMWheel: ( delta, camera ) -> camera.scale.z += delta * 0.1 - camera.scale.z = constrain camera.scale.z, 0.7, 5.0 + camera.scale.z = vizLines.constrain camera.scale.z, 0.7, 5.0 - onMouseWheel: ( event ) -> + onMouseWheel: ( event, camera ) -> delta = 0 if event.wheelDelta @@ -92,7 +94,7 @@ module.exports = delta = -event.detail/3 if delta? - handleMWheel delta + module.exports.handleMWheel delta, camera event.returnValue = false diff --git a/src/visualize.coffee b/src/visualize.coffee index 1e5c258..2bc78a5 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -3,7 +3,14 @@ vizLines = require './visualize_lines' _meshPool = [] +# Local copy of the main scene which we need for memory management. +# Injected from main.coffee via init() +_scene = null + module.exports = + init: ( scene ) -> + _scnene = scene + buildDataVizGeometries: ( linearData, countryData ) -> loadLayer = document.getElementById 'loading' count = 0 @@ -49,17 +56,17 @@ module.exports = return callback meshObj.splineOutline - selectVisualization: ( linearData ) -> + selectVisualization: ( linearData, visualizationMesh ) -> # build the meshes. One for each entry in our data for data in linearData - this.getVisualizedMesh data, _addMeshToViz + this.getVisualizedMesh data, _addMeshToViz.bind( this, visualizationMesh ) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # HELPER METHODS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -_addMeshToViz = ( mesh ) -> - visualizationMesh.add mesh if mesh? +_addMeshToViz = ( viz, mesh ) -> + viz.add mesh if mesh? _getMeshFromPool = ( callback ) -> if _meshPool.length > 0 @@ -73,9 +80,8 @@ _returnMeshToPool = ( mesh ) -> mesh.particlesGeo.vertices = [] mesh.pSystem.systemComplete = false - # have to remove from the scene or else bad things happen. 'scene' is leaked - # into this scope from main.js - scene.remove mesh.splineOutline + # have to remove from the scene or else bad things happen + _scene.remove mesh.splineOutline _meshPool.push mesh From dd5ac5b7656e01c90ccc6cbb78faf94f282f1bd9 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 27 Feb 2015 11:05:27 -0500 Subject: [PATCH 065/190] Particles now work properly --- src/geopins.coffee | 4 ++-- src/visualize.coffee | 8 ++++---- src/visualize_lines.coffee | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/geopins.coffee b/src/geopins.coffee index bfbe26e..dad1eb7 100644 --- a/src/geopins.coffee +++ b/src/geopins.coffee @@ -1,13 +1,13 @@ module.exports = loadGeoData: ( latlonData, countryLookup ) -> countryData = {} - for country, index in latlonData.countries + for index, country of latlonData.countries # save out country name and code info country.countryCode = index country.countryName = countryLookup[index] # take the lat lon from the data and convert this to 3d globe space - center = convertLatLonToVector country.lat, country.lon + center = module.exports.convertLatLonToVector country.lat, country.lon country.center = center countryData[country.countryName] = country diff --git a/src/visualize.coffee b/src/visualize.coffee index 2bc78a5..4ef95cf 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -9,7 +9,7 @@ _scene = null module.exports = init: ( scene ) -> - _scnene = scene + _scene = scene buildDataVizGeometries: ( linearData, countryData ) -> loadLayer = document.getElementById 'loading' @@ -27,7 +27,7 @@ module.exports = continue # visualize this event - set.lineGeometry = vizLines.makeConnectionLineGeometry exporter, importer, set.v, set.wc + set.lineGeometry = vizLines.makeConnectionLineGeometry exporter, importer loadLayer.style.display = 'none' return @@ -59,7 +59,7 @@ module.exports = selectVisualization: ( linearData, visualizationMesh ) -> # build the meshes. One for each entry in our data for data in linearData - this.getVisualizedMesh data, _addMeshToViz.bind( this, visualizationMesh ) + module.exports.getVisualizedMesh data, _addMeshToViz.bind( null, visualizationMesh ) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # HELPER METHODS @@ -129,7 +129,7 @@ class ParticleMesh particle = this.geometry.vertices[0] # no point doing all the calculations if the particle is already done - return if this.systemComplete? or not particle + return if this.systemComplete or not particle path = particle.path moveLength = path.length diff --git a/src/visualize_lines.coffee b/src/visualize_lines.coffee index e89c9df..5c9a3ab 100644 --- a/src/visualize_lines.coffee +++ b/src/visualize_lines.coffee @@ -2,7 +2,7 @@ globeRadius = 1000 vec3_origin = new THREE.Vector3 0, 0, 0 module.exports = - makeConnectionLineGeometry: ( exporter, importer, value, type ) -> + makeConnectionLineGeometry: ( exporter, importer ) -> if not exporter.countryName? or not importer.countryName? return undefined From ccbfec0c46a9e1f4d059b19bc1fdf7d11ae38744 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 27 Feb 2015 11:07:09 -0500 Subject: [PATCH 066/190] Removed the now unnecessary JS modules and updated index.html to use the minified bundle. --- index.html | 12 +- js/dataloading.js | 55 --------- js/datguicontrol.js | 8 -- js/geopins.js | 50 -------- js/main.js | 272 ------------------------------------------ js/markers.js | 168 -------------------------- js/mousekeyboard.js | 97 --------------- js/util.js | 33 ----- js/visualize.js | 205 ------------------------------- js/visualize_lines.js | 85 ------------- 10 files changed, 1 insertion(+), 984 deletions(-) delete mode 100644 js/dataloading.js delete mode 100644 js/datguicontrol.js delete mode 100644 js/geopins.js delete mode 100644 js/main.js delete mode 100644 js/markers.js delete mode 100644 js/mousekeyboard.js delete mode 100644 js/util.js delete mode 100644 js/visualize.js delete mode 100644 js/visualize_lines.js diff --git a/index.html b/index.html index 4ab4b16..969867a 100755 --- a/index.html +++ b/index.html @@ -54,16 +54,6 @@

Legend

- - - - - + diff --git a/js/dataloading.js b/js/dataloading.js deleted file mode 100644 index 98ff3b3..0000000 --- a/js/dataloading.js +++ /dev/null @@ -1,55 +0,0 @@ -function loadWorldPins( callback ){ - // We're going to ask a file for the JSON data. - xhr = new XMLHttpRequest(); - - // Where do we get the data? - xhr.open( 'GET', latlonFile, true ); - - // What do we do when we have it? - xhr.onreadystatechange = function() { - // If we've received the data - if ( xhr.readyState === 4 && xhr.status === 200 ) { - // Parse the JSON - latlonData = JSON.parse( xhr.responseText ); - if( callback ) - callback(); - } - }; - - // Begin request - xhr.send( null ); -} - -function loadContentData(callback){ - var filePath = "categories/All.json"; - filePath = encodeURI( filePath ); - // console.log(filePath); - - xhr = new XMLHttpRequest(); - xhr.open( 'GET', filePath, true ); - xhr.onreadystatechange = function() { - if ( xhr.readyState === 4 && xhr.status === 200 ) { - sampleData = JSON.parse( xhr.responseText ); - - maxValue = 0; - - if(callback) - callback(); - // console.log("finished read data file"); - } - }; - xhr.send( null ); -} - -function loadCountryCodes( callback ){ - cxhr = new XMLHttpRequest(); - cxhr.open( 'GET', isoFile, true ); - cxhr.onreadystatechange = function() { - if ( cxhr.readyState === 4 && cxhr.status === 200 ) { - countryLookup = JSON.parse( cxhr.responseText ); - // console.log("loaded country codes"); - callback(); - } - }; - cxhr.send( null ); -} diff --git a/js/datguicontrol.js b/js/datguicontrol.js deleted file mode 100644 index 55786d5..0000000 --- a/js/datguicontrol.js +++ /dev/null @@ -1,8 +0,0 @@ -var controllers = { - speed: 3, - multiplier: 0.5, - backgroundColor:"#000000", - zoom: 1, - spin: 0, - transitionTime: 2000, -}; diff --git a/js/geopins.js b/js/geopins.js deleted file mode 100644 index 28fb97a..0000000 --- a/js/geopins.js +++ /dev/null @@ -1,50 +0,0 @@ -function loadGeoData( latlonData ){ - // ----------------------------------------------------------------------------- - // Load the world geo data json, per country - - // iterate through each set of country pins - for ( var i in latlonData.countries ) { - var country = latlonData.countries[i]; - - // can we even find the country in the list? - // if( countryLookup[country.n.toUpperCase()] === undefined ){ - // console.log('could not find country that has country code: ' + country.n) - // continue; - // } - - // save out country name and code info - country.countryCode = i; - country.countryName = countryLookup[i]; - - // take the lat lon from the data and convert this to 3d globe space - var center = convertLatLonToVector( country.lat, country.lon ); - - // save and catalogue - country.center = center; - countryData[country.countryName] = country; - } - - // console.log(countryData); -} - -// Convert arbitrary lat/lon to a vector within the globe's space -function convertLatLonToVector( lat, lon ) { - var rad = 100; - - lon -= 90; - - var phi = Math.PI/2 - lat * Math.PI / 180 - Math.PI * 0.01; - var theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06; - - var vec = new THREE.Vector3(); - vec.x = Math.sin(phi) * Math.cos(theta) * rad; - vec.y = Math.cos(phi) * rad; - vec.z = Math.sin(phi) * Math.sin(theta) * rad; - - return vec; -} - -// convenience function to get the country object by name -function getCountry(name){ - return countryData[name.toUpperCase()] -} diff --git a/js/main.js b/js/main.js deleted file mode 100644 index 56897e5..0000000 --- a/js/main.js +++ /dev/null @@ -1,272 +0,0 @@ -var masterContainer = document.getElementById('visualization'); -var overlay = document.getElementById('visualization'); -var glContainer = document.getElementById( 'glContainer' ); - -/* -Colour Constants -*/ -COLOUR_MAP = { - r: new THREE.Color( 0xFF1E00 ), - o: new THREE.Color( 0xFF7F00 ), - b: new THREE.Color( 0x008EAF ), - g: new THREE.Color( 0x00CA35 ), - p: new THREE.Color( 0xDC0068 ) -}; - -// contains a list of country codes with their matching country names -var isoFile = 'country_iso3166.json'; -var latlonFile = 'country_lat_lon.json'; - -var camera, scene, renderer, controls, - mapIndexedImage, mapOutlineImage, - pinsBase, pinsBaseMat, - lookupCanvas, lookupTexture, backTexture, worldCanvas, - sphere, rotating, visualizationMesh; - -// contains our sample data, loaded from categories/All.json -var sampleData; - -// contains latlon data for each country -var latlonData; - -// contains above but organized as a mapped list via ['countryname'] = countryobject -// each country object has data like center of country in 3d space, lat lon, country name, and country code -var countryData = {}; - -// contains a list of country code to country name for running lookups -var countryLookup; - -// TODO -// use underscore and ".after" to load these in order -// don't look at me I'm ugly -$(function() { - // detect for webgl and reject everything else - if ( ! Detector.webgl ) { - Detector.addGetWebGLMessage(); - } - else{ - // ensure the map images are loaded first!! - mapIndexedImage = new Image(); - mapIndexedImage.src = 'images/map_indexed.png'; - mapIndexedImage.onload = function() { - mapOutlineImage = new Image(); - mapOutlineImage.src = 'images/map_outline.png'; - mapOutlineImage.onload = function(){ - loadCountryCodes( - function(){ - loadWorldPins( - function(){ - loadContentData( - function(){ - initScene(); - initMeshPool( 100 ); // defined in visualize.js - animate(); - startDataPump(); - } - ); - } - ); - } - ); - }; - }; - } -}); - -var currIndexIntoData = 0; -var nextIndexIntoData = 5; -function startDataPump() { - window.setInterval( function() { - var endIndex = currIndexIntoData + 5; - if( endIndex > sampleData.length ) { - endIndex = sampleData.length; - } - selectVisualization( sampleData.slice( currIndexIntoData, endIndex ) ); - currIndexIntoData = (currIndexIntoData + 5) % sampleData.length; - }, 500 ); -} - -// ----------------------------------------------------------------------------- -// All the initialization stuff for THREE -function initScene() { - - // ----------------------------------------------------------------------------- - // Let's make a scene - scene = new THREE.Scene(); - scene.matrixAutoUpdate = false; - - var light1 = new THREE.SpotLight( 0xeeeeee, 3 ); - light1.position.x = 730; - light1.position.y = 520; - light1.position.z = 626; - light1.castShadow = true; - scene.add( light1 ); - - var light3 = new THREE.SpotLight( 0xeeeeee, 1.5 ); - light3.position.x = -730; - light3.position.y = 520; - light3.position.z = 626; - light3.castShadow = true; - scene.add( light3 ); - - var light2 = new THREE.PointLight( 0x222222, 14.8 ); - light2.position.x = 0; - light2.position.y = -750; - light2.position.z = 0; - scene.add( light2 ); - - rotating = new THREE.Object3D(); - scene.add(rotating); - - lookupCanvas = document.createElement('canvas'); - lookupCanvas.width = 256; - lookupCanvas.height = 1; - - lookupTexture = new THREE.Texture( lookupCanvas ); - lookupTexture.magFilter = THREE.NearestFilter; - lookupTexture.minFilter = THREE.NearestFilter; - lookupTexture.needsUpdate = true; - - var indexedMapTexture = new THREE.Texture( mapIndexedImage ); - //THREE.ImageUtils.loadTexture( 'images/map_indexed.png' ); - indexedMapTexture.needsUpdate = true; - indexedMapTexture.magFilter = THREE.NearestFilter; - indexedMapTexture.minFilter = THREE.NearestFilter; - - var outlinedMapTexture = new THREE.Texture( mapOutlineImage ); - outlinedMapTexture.needsUpdate = true; - // outlinedMapTexture.magFilter = THREE.NearestFilter; - // outlinedMapTexture.minFilter = THREE.NearestFilter; - - var uniforms = { - 'mapIndex': { type: 't', value: indexedMapTexture }, - 'lookup': { type: 't', value: lookupTexture }, - 'outline': { type: 't', value: outlinedMapTexture }, - 'outlineLevel': {type: 'f', value: 1 }, - }; - - var shaderMaterial = new THREE.MeshLambertMaterial( { map: outlinedMapTexture } );/*new THREE.ShaderMaterial( { - uniforms: uniforms, - vertexShader: document.getElementById( 'globeVertexShader' ).textContent, - fragmentShader: document.getElementById( 'globeFragmentShader' ).textContent - });*/ - - // ----------------------------------------------------------------------------- - // Create the backing (sphere) - sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); - sphere.doubleSided = false; - sphere.rotation.x = Math.PI; - sphere.rotation.y = -Math.PI/2; - sphere.rotation.z = Math.PI; - sphere.id = "base"; - rotating.add( sphere ); - - loadGeoData( latlonData ); - buildDataVizGeometries(sampleData); - - visualizationMesh = new THREE.Object3D(); - rotating.add(visualizationMesh); - - // ----------------------------------------------------------------------------- - // Setup our renderer - renderer = new THREE.WebGLRenderer({antialias:false, alpha: true}); - renderer.setSize( window.innerWidth, window.innerHeight ); - renderer.autoClear = false; - - renderer.sortObjects = false; - renderer.generateMipmaps = false; - - glContainer.appendChild( renderer.domElement ); - - - // ----------------------------------------------------------------------------- - // Event listeners - document.addEventListener( 'mousemove', onDocumentMouseMove, true ); - document.addEventListener( 'windowResize', onDocumentResize, false ); - - document.addEventListener( 'mousedown', onDocumentMouseDown, true ); - document.addEventListener( 'mouseup', onDocumentMouseUp, false ); - - masterContainer.addEventListener( 'click', onClick, true ); - masterContainer.addEventListener( 'mousewheel', onMouseWheel, false ); - - // firefox - masterContainer.addEventListener( 'DOMMouseScroll', function(e){ - var evt=window.event || e; //equalize event object - onMouseWheel(evt); - }, false ); - - document.addEventListener( 'keydown', onKeyDown, false); - - // ----------------------------------------------------------------------------- - // Setup our camera - camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ); - camera.position.z = 1400; - camera.position.y = 0; - scene.add( camera ); - - var windowResize = THREEx.WindowResize(renderer, camera); - - // Get the globe spinning (defined in mousekeyboard.js) - startAutoRotate(); -} - - -function animate() { - - if( rotateTargetX !== undefined && rotateTargetY !== undefined ){ - - rotateVX += (rotateTargetX - rotateX) * 0.012; - rotateVY += (rotateTargetY - rotateY) * 0.012; - - if( Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1 ){ - rotateTargetX = undefined; - rotateTargetY = undefined; - } - } - - rotateX += rotateVX; - rotateY += rotateVY; - - rotateVX *= 0.98; - rotateVY *= 0.98; - - if(dragging || rotateTargetX !== undefined ){ - rotateVX *= 0.6; - rotateVY *= 0.6; - } - - rotateY += controllers.spin * 0.01; - - // constrain the pivot up/down to the poles - // force a bit of bounce back action when hitting the poles - if(rotateX < -rotateXMax){ - rotateX = -rotateXMax; - rotateVX *= -0.95; - } - if(rotateX > rotateXMax){ - rotateX = rotateXMax; - rotateVX *= -0.95; - } - - rotating.rotation.x = rotateX; - rotating.rotation.y = rotateY; - - requestAnimationFrame( animate ); - // renderer.clear(); - renderer.render( scene, camera ); - - rotating.traverse( - function(mesh) { - if( mesh && mesh.update !== undefined) { - mesh.update(); - } - } - ); - - /* Removing markers until I decide what to do with them */ - // for( var i in markers ){ - // var marker = markers[i]; - // marker.update(); - // } -} diff --git a/js/markers.js b/js/markers.js deleted file mode 100644 index b92368b..0000000 --- a/js/markers.js +++ /dev/null @@ -1,168 +0,0 @@ -var markers = []; - -function onMarkerHover( event ){ - var hx = event.clientX - window.innerWidth * 0.5; - var hy = event.clientY - window.innerHeight * 0.5; - var dx = mouseX - hx; - var dy = mouseY - hy; - var d = Math.sqrt( dx * dx + dy * dy ); - // if( event.target.style.visibility == 'visible' ) - // console.log('clicked on something!!'); -} - -function attachMarkerToCountry( countryName, importance ){ - // look up the name to mesh - countryName = countryName.toUpperCase(); - var country = countryData[countryName]; - if( country === undefined ) - return; - - var container = document.getElementById( 'visualization' ); - var template = document.getElementById( 'marker_template' ); - var marker = template.cloneNode(true); - - country.marker = marker; - container.appendChild( marker ); - - marker.countryName = countryName; - - marker.importance = importance; - marker.selected = false; - marker.hover = false; - if( countryName === selectedCountry.countryName.toUpperCase() ) - marker.selected = true; - - marker.setPosition = function(x,y,z){ - this.style.left = x + 'px'; - this.style.top = y + 'px'; - this.style.zIndex = z; - } - - marker.setVisible = function( vis ){ - if( ! vis ) - this.style.display = 'none'; - else{ - this.style.display = 'inline'; - } - } - var countryLayer = marker.querySelector( '#countryText'); - marker.countryLayer = countryLayer; - var detailLayer = marker.querySelector( '#detailText' ); - marker.detailLayer = detailLayer; - marker.jquery = $(marker); - marker.setSize = function( s ){ - var detailSize = Math.floor(2 + s * 0.5); - this.detailLayer.style.fontSize = detailSize + 'pt'; - var totalHeight = detailSize * 2; - this.style.fontSize = totalHeight * 1.125 + 'pt'; - if(detailSize <= 8) { - this.countryLayer.style.marginTop = "0px"; - } else { - this.countryLayer.style.marginTop = "-1px"; - } - } - - marker.update = function(){ - var matrix = rotating.matrixWorld; - var abspos = matrix.multiplyVector3( country.center.clone() ); - var screenPos = screenXY(abspos); - - var s = 0.3 + camera.scale.z * 1; - var importanceScale = this.importance / 5000000; - importanceScale = constrain( importanceScale, 0, 18 ); - s += importanceScale; - - if( this.tiny ) - s *= 0.75; - - if( this.selected ) - s = 30; - - if( this.hover ) - s = 15; - - this.setSize( s ); - - // if( this.selected ) - // this.setVisible( true ) - // else - this.setVisible( ( abspos.z > 60 ) && s > 3 ); - - var zIndex = Math.floor( 1000 - abspos.z + s ); - if( this.selected || this.hover ) - zIndex = 10000; - - this.setPosition( screenPos.x, screenPos.y, zIndex ); - } - - var nameLayer = marker.querySelector( '#countryText' ); - - // right now, something arbitrary like 10 mil dollars or more to be highlighted - var tiny = (importance < 20000000) && (!marker.selected); - marker.tiny = tiny; - - // if( tiny ) - // nameLayer.innerHTML = country.countryCode; - // else - nameLayer.innerHTML = countryName.replace(' ',' '); - - // marker.nameLayer = nameLayer; - // marker.nameLayerText = countryName; - // marker.nameLayerShorten = country.countryCode;; - - var importExportText = ""; - if(country.exportedAmount > 0 && country.importedAmount > 0) { - importExportText += "imported: $" + numberWithCommas(country.importedAmount) + "
" + - "exported: $"+numberWithCommas(country.exportedAmount); - } else if(country.exportedAmount > 0 && country.importedAmount == 0) { - importExportText += "exported: $"+numberWithCommas(country.exportedAmount)+"
 "; - } else if(country.exportedAmount == 0 && country.importedAmount > 0) { - importExportText += "imported: $"+numberWithCommas(country.importedAmount)+"
 "; - } - - marker.importExportText = importExportText; - - - var markerOver = function(e){ - this.detailLayer.innerHTML = importExportText; - this.hover = true; - } - - var markerOut = function(e){ - this.detailLayer.innerHTML = ""; - this.hover = false; - } - - if( !tiny ) { - detailLayer.innerHTML = importExportText; - } - else{ - marker.addEventListener( 'mouseover', markerOver, false ); - marker.addEventListener( 'mouseout', markerOut, false ); - } - - - var markerSelect = function(e){ - var selection = selectionData; - // selectVisualization( sampleData ); - }; - marker.addEventListener('click', markerSelect, true); - - markers.push( marker ); -} - -function removeMarkerFromCountry( countryName ){ - countryName = countryName.toUpperCase(); - var country = countryData[countryName]; - if( country === undefined ) - return; - if( country.marker === undefined ) - return; - - var index = markers.indexOf(country.marker); - if( index >= 0 ) - markers.splice( index, 1 ); - var container = document.getElementById( 'visualization' ); - container.removeChild( country.marker ); - country.marker = undefined; -} diff --git a/js/mousekeyboard.js b/js/mousekeyboard.js deleted file mode 100644 index ed461b3..0000000 --- a/js/mousekeyboard.js +++ /dev/null @@ -1,97 +0,0 @@ -var mouseX = 0, mouseY = 0, pmouseX = 0, pmouseY = 0; -var pressX = 0, pressY = 0; - -var dragging = false; - -var rotateX = 0, rotateY = 0; -var rotateVX = 0, rotateVY = 0; -var rotateXMax = 90 * Math.PI/180; - -var rotateTargetX; -var rotateTargetY; - -var _autoRotateId; - -var keyboard = new THREEx.KeyboardState(); - -function onDocumentMouseMove( event ) { - - pmouseX = mouseX; - pmouseY = mouseY; - - mouseX = event.clientX - window.innerWidth * 0.5; - mouseY = event.clientY - window.innerHeight * 0.5; - - if(dragging){ - if(keyboard.pressed("shift") === false){ - rotateVY += (mouseX - pmouseX) / 2 * Math.PI / 180 * 0.3; - rotateVX += (mouseY - pmouseY) / 2 * Math.PI / 180 * 0.3; - } - else{ - camera.position.x -= (mouseX - pmouseX) * 0.5; - camera.position.y += (mouseY - pmouseY) * 0.5; - } - } -} - -function onDocumentMouseDown( event ) { - if(event.target.className.indexOf('noMapDrag') !== -1) { - return; - } - dragging = true; - pressX = mouseX; - pressY = mouseY; - rotateTargetX = undefined; - rotateTargetX = undefined; - stopAutoRotate(); -} - -function onDocumentMouseUp( event ){ - dragging = false; - histogramPressed = false; - startAutoRotate(); -} - -function onClick( event ){ - // make the rest not work if the event was actually a drag style click - if( Math.abs(pressX - mouseX) > 3 || Math.abs(pressY - mouseY) > 3 ) - return; -} - -function onKeyDown( event ){ -} - -function handleMWheel( delta ) { - camera.scale.z += delta * 0.1; - camera.scale.z = constrain( camera.scale.z, 0.7, 5.0 ); -} - -function onMouseWheel( event ){ - var delta = 0; - - if (event.wheelDelta) { /* IE/Opera. */ - delta = event.wheelDelta/120; - } - // firefox - else if( event.detail ){ - delta = -event.detail/3; - } - - if (delta) - handleMWheel(delta); - - event.returnValue = false; -} - -function onDocumentResize(e){ -} - -function startAutoRotate() { - _autoRotateId = window.setInterval( function() { - rotateVY += 0.1 * Math.PI / 180 * 0.3; - }, 100 ); -} - -function stopAutoRotate() { - window.clearInterval( _autoRotateId ); -} diff --git a/js/util.js b/js/util.js deleted file mode 100644 index 383fcfd..0000000 --- a/js/util.js +++ /dev/null @@ -1,33 +0,0 @@ -function wrap(value, min, rangeSize) { - rangeSize-=min; - while (value < min) { - value += rangeSize; - } - return value % rangeSize; -} - -THREE.Curve.Utils.createLineGeometry = function( points ) { - var geometry = new THREE.Geometry(); - for( var i = 0; i < points.length; i ++ ) { - geometry.vertices.push( points[i] ); - } - return geometry; -}; - -function screenXY(vec3){ - var projector = new THREE.Projector(); - var vector = projector.projectVector( vec3.clone(), camera ); - var result = new Object(); - var windowWidth = window.innerWidth; - var minWidth = 1280; - if(windowWidth < minWidth) { - windowWidth = minWidth; - } - result.x = Math.round( vector.x * (windowWidth/2) ) + windowWidth/2; - result.y = Math.round( (0-vector.y) * (window.innerHeight/2) ) + window.innerHeight/2; - return result; -} - - function numberWithCommas(x) { - return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); -} diff --git a/js/visualize.js b/js/visualize.js deleted file mode 100644 index 9707420..0000000 --- a/js/visualize.js +++ /dev/null @@ -1,205 +0,0 @@ -function buildDataVizGeometries( linearData ){ - - var loadLayer = document.getElementById('loading'); - - var count = 0; - for( var i in linearData ){ - var set = linearData[i]; - - var exporterName = set.src.toUpperCase(); - var importerName = set.dest.toUpperCase(); - - exporter = countryData[exporterName]; - importer = countryData[importerName]; - - // we couldn't find the country, it wasn't in our list... - if( exporter === undefined || importer === undefined ) - continue; - - // visualize this event - set.lineGeometry = makeConnectionLineGeometry( exporter, importer, set.v, set.wc ); - - // if( s % 1000 == 0 ) - // console.log( 'calculating ' + s + ' of ' + yearBin.length + ' in year ' + year); - } - - loadLayer.style.display = 'none'; -} - -var _meshPool = []; -function initMeshPool( poolSize ) { - for( var i = 0; i < poolSize; i++ ) { - _meshPool.push( new ParticleMesh() ); - } -} - -function _getMeshFromPool( callback ) { - if( _meshPool.length > 0 ) { - callback( _meshPool.pop() ); - } else { - window.setTimeout( _getMeshFromPool, 500, callback ); - } -} - -function _returnMeshToPool( mesh ) { - // clean up the two geometries - mesh.linesGeo.vertices = []; - mesh.particlesGeo.vertices = []; - mesh.pSystem.systemComplete = false; - - // have to remove from the scene or else bad things happen. 'scene' is leaked - // into this scope from main.js - scene.remove( mesh.splineOutline ); - - _meshPool.push( mesh ); -} - -function getVisualizedMesh( linearData, callback ){ - if( !linearData.lineGeometry ) { - return null; - } - - _getMeshFromPool( function( meshObj ) { - // merge it all together - meshObj.linesGeo.merge( linearData.lineGeometry ); - var points = linearData.lineGeometry.vertices; - var point = points[0]; - var particle = point.clone(); - particle.moveIndex = 0; - particle.nextIndex = 1; - particle.lerpN = 0; - particle.path = points; - particle.size = meshObj.particleSize; - meshObj.particlesGeo.vertices.push( particle ); - - // set the colour - meshObj.setParticleColour( linearData.colour ); - - return callback( meshObj.splineOutline ); - }); -} - -function selectVisualization( linearData ){ - // clear off the country's internally held color data we used from last highlight - for( var i in countryData ){ - var country = countryData[i]; - country.exportedAmount = 0; - country.importedAmount = 0; - country.mapColor = 0; - } - - /* Removing markers for now until I decide how to use them */ - // clear markers - // for( var i in selectableCountries ){ - // removeMarkerFromCountry( selectableCountries[i] ); - // } - - // build the meshes. One for each entry in our data - for( i in linearData ) { - getVisualizedMesh( linearData[i], _addMeshToViz ); - } - - /* Removing markers for now until I decide how to use them */ - // for( var i in mesh.affectedCountries ){ - // var countryName = mesh.affectedCountries[i]; - // var country = countryData[countryName]; - // attachMarkerToCountry( countryName, country.mapColor ); - // } -} - -function _addMeshToViz( mesh ) { - if( mesh !== null ) { - visualizationMesh.add( mesh ); - } -} - -function ParticleMesh() { - this.linesGeo = new THREE.Geometry(); - this.particlesGeo = new THREE.Geometry(); - this.particleColor = COLOUR_MAP.r; - this.particleSize = 150; - - this.lineMat = new THREE.LineBasicMaterial({ - color: 0xffffff, - opacity: 0.0, - blending: THREE.AdditiveBlending, - transparent: true, - depthWrite: false, - vertexColors: false, - linewidth: 1 - }); - this.splineOutline = new THREE.Line( null, this.lineMat ); - - this.shaderMaterial = new THREE.PointCloudMaterial({ - map: THREE.ImageUtils.loadTexture( "images/particleB.png" ), - size: this.particleSize, - blending: THREE.AdditiveBlending, - depthTest: true, - depthWrite: false, - transparent: true, - color: this.particleColor - }); - this.pSystem = new THREE.PointCloud( null, this.shaderMaterial ); - - this.splineOutline.renderDepth = false; - this.pSystem.dynamic = true; - this.pSystem.systemComplete = false; // So we can know when to re-pool this mesh - this.splineOutline.add( this.pSystem ); - this.splineOutline.geometry = this.linesGeo; - this.pSystem.geometry = this.particlesGeo; - - this.pSystem.addEventListener( 'ParticleSystemComplete', _returnMeshToPool.bind( this, this ) ); - - /* - This update method is what actually gets our points moving across the scene. - Once the point has finished its path, this method will emit a "ParticleSystemComplete" - event, to allow us to re-pool the mesh. - */ - this.pSystem.update = function(){ - /* - Simplified this as our particle geometry will only ever have one point - */ - var particle = this.geometry.vertices[0]; - - // no point doing all the calculations if the particle is already done - if( this.systemComplete || !particle ) { - return; - } - - var path = particle.path; - var moveLength = path.length; - - particle.lerpN += 0.15; - if(particle.lerpN > 1){ - particle.lerpN = 0; - particle.moveIndex = particle.nextIndex; - particle.nextIndex++; - if( particle.nextIndex >= path.length ){ - particle.moveIndex = 0; - particle.nextIndex = 0; - - this.systemComplete = true; - this.dispatchEvent( { type: 'ParticleSystemComplete' } ); - return; - } - } - - var currentPoint = path[particle.moveIndex]; - var nextPoint = path[particle.nextIndex]; - - particle.copy( currentPoint ); - particle.lerp( nextPoint, particle.lerpN ); - - this.geometry.verticesNeedUpdate = true; - }; -} - -ParticleMesh.prototype.setParticleColour = function( colourStr ) { - var colour = COLOUR_MAP[colourStr]; - if( !colour ) { - colour = COLOUR_MAP.r; - } - - this.particleColor = colour; - this.shaderMaterial.color = colour; -}; diff --git a/js/visualize_lines.js b/js/visualize_lines.js deleted file mode 100644 index 154e962..0000000 --- a/js/visualize_lines.js +++ /dev/null @@ -1,85 +0,0 @@ -var globeRadius = 1000; -var vec3_origin = new THREE.Vector3(0,0,0); - -function makeConnectionLineGeometry( exporter, importer, value, type ){ - if( exporter.countryName === undefined || importer.countryName === undefined ) - return undefined; - - // console.log("making connection between " + exporter.countryName + " and " + importer.countryName + " with code " + type ); - - var distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length(); - - // how high we want to shoot the curve upwards - var anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.3; - - // start of the line - var start = exporter.center; - - // end of the line - var end = importer.center; - - // midpoint for the curve - var mid = start.clone().lerp(end,0.5); - var midLength = mid.length(); - mid.normalize(); - mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.4 ); - - // the normal from start to end - var normal = (new THREE.Vector3()).subVectors(start,end); - normal.normalize(); - - /* - The curve looks like this: - - midStartAnchor---- mid ----- midEndAnchor - / \ - / \ - / \ - start/anchor end/anchor - - splineCurveA splineCurveB - */ - - var distanceHalf = distanceBetweenCountryCenter * 0.5; - - var startAnchor = start; - var midStartAnchor = mid.clone().add( normal.clone().multiplyScalar( distanceHalf ) ); - var midEndAnchor = mid.clone().add( normal.clone().multiplyScalar( -distanceHalf ) ); - var endAnchor = end; - - // now make a bezier curve out of the above like so in the diagram - var splineCurveA = new THREE.CubicBezierCurve3( start, startAnchor, midStartAnchor, mid); - // splineCurveA.updateArcLengths(); - - var splineCurveB = new THREE.CubicBezierCurve3( mid, midEndAnchor, endAnchor, end); - // splineCurveB.updateArcLengths(); - - // how many vertices do we want on this guy? this is for *each* side - var vertexCountDesired = Math.floor( /*splineCurveA.getLength()*/ distanceBetweenCountryCenter * 0.02 + 6 ) * 2; - - // collect the vertices - var points = splineCurveA.getPoints( vertexCountDesired ); - - // remove the very last point since it will be duplicated on the next half of the curve - points = points.splice(0,points.length-1); - - points = points.concat( splineCurveB.getPoints( vertexCountDesired ) ); - - // add one final point to the center of the earth - // we need this for drawing multiple arcs, but piled into one geometry buffer - points.push( vec3_origin ); - - // create a line geometry out of these - var curveGeometry = THREE.Curve.Utils.createLineGeometry( points ); - - return curveGeometry; -} - -function constrain(v, min, max){ - if( v < min ) - v = min; - else - if( v > max ) - v = max; - return v; -} From 2074aaf9e864d534d2e0a0ecfee6e8131c55ce08 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 2 Mar 2015 13:37:32 -0500 Subject: [PATCH 067/190] Added attribution footer --- index.html | 4 ++++ style.css | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 969867a..c381818 100755 --- a/index.html +++ b/index.html @@ -45,6 +45,10 @@

Legend

  • - Purple
  • + + diff --git a/style.css b/style.css index bead23a..8460919 100755 --- a/style.css +++ b/style.css @@ -60,8 +60,8 @@ /* Main Styles */ body { color:#000000; font-family:'Roboto'; font-size:14px; height:768px; min-width: 1280px; min-height: 860px; overflow: hidden;} -a { color:#ffffff; text-decoration:none; text-transform:uppercase; } -a:hover { color:#8eb423; } +a { color:#ffffff; text-decoration:none; font-weight: bold } +a:hover { color:#008EAF; } h1 { font-family:'RopaSans'; font-weight:normal; } h2 { font-family:'RopaSans'; font-weight:normal; } li { list-style-type:none; } @@ -250,3 +250,12 @@ Elements to control the title and country selector .purple-back { background-color: #dc0068; } + +footer { + position: absolute; + right: 30px; + bottom: 20px; + color: #fff; + font-family: 'RopaSans'; + padding: 10px; +} From 510544aaf8f48d463ae3a941981599f759a4c732 Mon Sep 17 00:00:00 2001 From: dpetker Date: Mon, 2 Mar 2015 15:48:51 -0500 Subject: [PATCH 068/190] Update LICENSE --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 97ce044..ebe991d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ Copyright 2015 Google Data Arts Team +Portions Copyright 2015 dpetker Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 80dd3daf2affae2dafd441512bd0a1d2222ce41b Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 6 Mar 2015 11:35:18 -0500 Subject: [PATCH 069/190] Updated initial rotation so that we're not looking directly at the equator on load --- src/mousekeyboard.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mousekeyboard.coffee b/src/mousekeyboard.coffee index 8169a73..7faf2ba 100644 --- a/src/mousekeyboard.coffee +++ b/src/mousekeyboard.coffee @@ -2,9 +2,10 @@ vizLines = require './visualize_lines' # Ugly variable declarations mouseX = 0; mouseY = 0; pmouseX = 0; pmouseY = 0; pressX = 0; pressY = 0 -dragging = false; rotateVX = 0; rotateVY = 0 +dragging = false; rotateVY = 0 rotateTargetX = 0; rotateTargetY = 0 +rotateVX = 0.35 * Math.PI/180 rotateXMax = 90 * Math.PI/180 _autoRotateId = null From 882b6aa31ae093e83db3b6313bf618157d20c865 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 11 Mar 2015 10:50:33 -0400 Subject: [PATCH 070/190] First checkin of React-based interactive legend --- Gruntfile.coffee | 20 +++++++-- index.html | 9 +--- package.json | 1 + src/components/legend-item.cjsx | 80 +++++++++++++++++++++++++++++++++ src/components/legend.cjsx | 33 ++++++++++++++ src/main.coffee | 10 +++++ style.css | 43 ------------------ thirdparty/react-0.12.2.min.js | 16 +++++++ 8 files changed, 158 insertions(+), 54 deletions(-) create mode 100644 src/components/legend-item.cjsx create mode 100644 src/components/legend.cjsx create mode 100644 thirdparty/react-0.12.2.min.js diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 67ff984..b494846 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -6,7 +6,19 @@ module.exports = ( grunt ) -> pkg: grunt.file.readJSON 'package.json' clean: - [ 'build/tmp', 'build/*.js' ] + [ 'build/tmp/components', 'build/tmp', 'build/*.js' ] + + cjsx: + options: + bare: true + + files: + expand: true + flatten: true + cwd: 'src/components/' + src: ['*.cjsx'] + dest: 'build/tmp/components' + ext: '.js' coffee: options: @@ -24,7 +36,7 @@ module.exports = ( grunt ) -> options: debug: true destFile: 'build/bundle.js' - src: [ 'build/tmp/*.js' ] + src: [ 'build/tmp/**/*.js' ] dev: src: '<%= browserify.options.src %>' @@ -48,13 +60,15 @@ module.exports = ( grunt ) -> files: [ 'Gruntfile.coffee' 'src/**/*.coffee' + 'src/**/*.cjsx' ] tasks: 'default' + grunt.loadNpmTasks 'grunt-coffee-react' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-browserify' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-clean' - grunt.registerTask 'default', [ 'clean', 'coffee', 'browserify', 'uglify' ] + grunt.registerTask 'default', [ 'clean', 'cjsx', 'coffee', 'browserify', 'uglify' ] diff --git a/index.html b/index.html index c381818..129df74 100755 --- a/index.html +++ b/index.html @@ -36,14 +36,6 @@

    Data Visualization Globe
    -

    Legend

    -
      -
    • - Red
    • -
    • - Orange
    • -
    • - Blue
    • -
    • - Green
    • -
    • - Purple
    • -
    @@ -57,6 +49,7 @@

    Legend

    + diff --git a/package.json b/package.json index 0da7f42..83fe55c 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "devDependencies": { "grunt": "^0.4.5", "grunt-browserify": "^3.4.0", + "grunt-coffee-react": "^2.4.1", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-coffee": "^0.13.0", "grunt-contrib-uglify": "^0.8.0", diff --git a/src/components/legend-item.cjsx b/src/components/legend-item.cjsx new file mode 100644 index 0000000..bd8b07a --- /dev/null +++ b/src/components/legend-item.cjsx @@ -0,0 +1,80 @@ +# Component representing an individual legend item + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Component definition +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +module.exports = React.createClass + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Styles + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + legendItemStyle: + height: 20 + paddingBottom: 5 + + toggleLinkStyle: + textDecoration: 'none' + fontWeight: 'normal' + # Transition for when we become inactive + WebkitTransition: 'color 500ms ease-out' + MozTransition: 'color 500ms ease-out' + OTransition: 'color 500ms ease-out' + transition: 'color 500ms ease-out' + + circleStyle: + display: 'inline-block' + width: 15 + height: 15 + borderRadius: '50%' + # This is what lets us get the text centered + marginTop: 3 + marginBottom: -2 + # Transition for when we become inactive + WebkitTransition: 'background-color 500ms ease-out' + MozTransition: 'background-color 500ms ease-out' + OTransition: 'background-color 500ms ease-out' + transition: 'background-color 500ms ease-out' + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Behaviours + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + getInitialState: -> + return { active: true } + + handleLinkClick: -> + @setState { active: !@state.active } + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Final Render + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + #
  • - Red
  • + render: -> + itemText = '' + + switch @props.type + when "r" + itemText = 'Red' + @circleStyle.backgroundColor = '#ff1e00' + when "o" + itemText = 'Orange' + @circleStyle.backgroundColor = '#ff7f00' + when "g" + itemText = 'Green' + @circleStyle.backgroundColor = '#008eaf' + when "b" + itemText = 'Blue' + @circleStyle.backgroundColor = '#00ca35' + when "p" + itemText = 'Purple' + @circleStyle.backgroundColor = '#dc0068' + + if !@state.active + @toggleLinkStyle.color = '#555' + @circleStyle.backgroundColor = '#555' + else + @toggleLinkStyle.color = '#ddd' + +
  • + +
    - {itemText} +
    +
  • diff --git a/src/components/legend.cjsx b/src/components/legend.cjsx new file mode 100644 index 0000000..8c0e13b --- /dev/null +++ b/src/components/legend.cjsx @@ -0,0 +1,33 @@ +# Main component for the interactive legend +LegendItem = require './legend-item' + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# component definition +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +module.exports = React.createClass + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Styles + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + headerStyle: + fontSize: 18 + marginTop: 0 + + listStyle: + listStyleType: 'none' + margin: 0 + padding: 0 + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Final Render + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render: -> +
    +

    Legend

    +
      + + + + + +
    +
    diff --git a/src/main.coffee b/src/main.coffee index f28e2f4..f0aa00f 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -4,6 +4,9 @@ mouseKeyboard = require './mousekeyboard' visualize = require './visualize' geopins = require './geopins' +# React components +Legend = require './components/legend' + masterContainer = document.getElementById 'visualization' overlay = document.getElementById 'visualization' glContainer = document.getElementById 'glContainer' @@ -48,6 +51,13 @@ else initScene() visualize.init( scene ) visualize.initMeshPool( 100 ) + + # Render our interactive legend + React.render( + React.createElement( Legend, null ), + document.getElementById 'legend' + ) + animate() startDataPump() diff --git a/style.css b/style.css index 8460919..09825bc 100755 --- a/style.css +++ b/style.css @@ -208,49 +208,6 @@ Elements to control the title and country selector padding: 10px; } -#legend h2 { - font-size: 18px; - margin-top: 0; -} - -#legend ul { - list-style-type: none; - padding: 0; - margin: 0; -} - -#legend li { - height: 20px; - padding-bottom: 5px; - color: #ddd; -} - -.circle { - display: inline-block; - width: 15px; - height: 15px; - border-radius: 50%; - /* This is what lets us get the text centered */ - margin-top: 3px; - margin-bottom: -2px; -} - -.red-back { - background-color: #ff1e00; -} -.orange-back { - background-color: #ff7f00; -} -.blue-back { - background-color: #008eaf; -} -.green-back { - background-color: #00ca35; -} -.purple-back { - background-color: #dc0068; -} - footer { position: absolute; right: 30px; diff --git a/thirdparty/react-0.12.2.min.js b/thirdparty/react-0.12.2.min.js new file mode 100644 index 0000000..c6559bd --- /dev/null +++ b/thirdparty/react-0.12.2.min.js @@ -0,0 +1,16 @@ +/** + * React v0.12.2 + * + * Copyright 2013-2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.React=e()}}(function(){return function e(t,n,r){function o(i,s){if(!n[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[i]={exports:{}};t[i][0].call(l.exports,function(e){var n=t[i][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;in;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{"./Object.assign":27,"./PooledClass":28,"./invariant":124}],7:[function(e,t){"use strict";function n(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function r(e){var t=M.getPooled(P.change,w,e);E.accumulateTwoPhaseDispatches(t),R.batchedUpdates(o,t)}function o(e){y.enqueueEvents(e),y.processEventQueue()}function a(e,t){_=e,w=t,_.attachEvent("onchange",r)}function i(){_&&(_.detachEvent("onchange",r),_=null,w=null)}function s(e,t,n){return e===x.topChange?n:void 0}function u(e,t,n){e===x.topFocus?(i(),a(t,n)):e===x.topBlur&&i()}function c(e,t){_=e,w=t,T=e.value,N=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(_,"value",k),_.attachEvent("onpropertychange",p)}function l(){_&&(delete _.value,_.detachEvent("onpropertychange",p),_=null,w=null,T=null,N=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==T&&(T=t,r(e))}}function d(e,t,n){return e===x.topInput?n:void 0}function f(e,t,n){e===x.topFocus?(l(),c(t,n)):e===x.topBlur&&l()}function h(e){return e!==x.topSelectionChange&&e!==x.topKeyUp&&e!==x.topKeyDown||!_||_.value===T?void 0:(T=_.value,w)}function m(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===x.topClick?n:void 0}var g=e("./EventConstants"),y=e("./EventPluginHub"),E=e("./EventPropagators"),C=e("./ExecutionEnvironment"),R=e("./ReactUpdates"),M=e("./SyntheticEvent"),b=e("./isEventSupported"),O=e("./isTextInputElement"),D=e("./keyOf"),x=g.topLevelTypes,P={change:{phasedRegistrationNames:{bubbled:D({onChange:null}),captured:D({onChangeCapture:null})},dependencies:[x.topBlur,x.topChange,x.topClick,x.topFocus,x.topInput,x.topKeyDown,x.topKeyUp,x.topSelectionChange]}},_=null,w=null,T=null,N=null,I=!1;C.canUseDOM&&(I=b("change")&&(!("documentMode"in document)||document.documentMode>8));var S=!1;C.canUseDOM&&(S=b("input")&&(!("documentMode"in document)||document.documentMode>9));var k={get:function(){return N.get.call(this)},set:function(e){T=""+e,N.set.call(this,e)}},A={eventTypes:P,extractEvents:function(e,t,r,o){var a,i;if(n(t)?I?a=s:i=u:O(t)?S?a=d:(a=h,i=f):m(t)&&(a=v),a){var c=a(e,t,r);if(c){var l=M.getPooled(P.change,c,o);return E.accumulateTwoPhaseDispatches(l),l}}i&&i(e,t,r)}};t.exports=A},{"./EventConstants":16,"./EventPluginHub":18,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactUpdates":77,"./SyntheticEvent":85,"./isEventSupported":125,"./isTextInputElement":127,"./keyOf":131}],8:[function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};t.exports=r},{}],9:[function(e,t){"use strict";function n(e){switch(e){case g.topCompositionStart:return E.compositionStart;case g.topCompositionEnd:return E.compositionEnd;case g.topCompositionUpdate:return E.compositionUpdate}}function r(e,t){return e===g.topKeyDown&&t.keyCode===h}function o(e,t){switch(e){case g.topKeyUp:return-1!==f.indexOf(t.keyCode);case g.topKeyDown:return t.keyCode!==h;case g.topKeyPress:case g.topMouseDown:case g.topBlur:return!0;default:return!1}}function a(e){this.root=e,this.startSelection=c.getSelection(e),this.startValue=this.getText()}var i=e("./EventConstants"),s=e("./EventPropagators"),u=e("./ExecutionEnvironment"),c=e("./ReactInputSelection"),l=e("./SyntheticCompositionEvent"),p=e("./getTextContentAccessor"),d=e("./keyOf"),f=[9,13,27,32],h=229,m=u.canUseDOM&&"CompositionEvent"in window,v=!m||"documentMode"in document&&document.documentMode>8&&document.documentMode<=11,g=i.topLevelTypes,y=null,E={compositionEnd:{phasedRegistrationNames:{bubbled:d({onCompositionEnd:null}),captured:d({onCompositionEndCapture:null})},dependencies:[g.topBlur,g.topCompositionEnd,g.topKeyDown,g.topKeyPress,g.topKeyUp,g.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:d({onCompositionStart:null}),captured:d({onCompositionStartCapture:null})},dependencies:[g.topBlur,g.topCompositionStart,g.topKeyDown,g.topKeyPress,g.topKeyUp,g.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:d({onCompositionUpdate:null}),captured:d({onCompositionUpdateCapture:null})},dependencies:[g.topBlur,g.topCompositionUpdate,g.topKeyDown,g.topKeyPress,g.topKeyUp,g.topMouseDown]}};a.prototype.getText=function(){return this.root.value||this.root[p()]},a.prototype.getData=function(){var e=this.getText(),t=this.startSelection.start,n=this.startValue.length-this.startSelection.end;return e.substr(t,e.length-n-t)};var C={eventTypes:E,extractEvents:function(e,t,i,u){var c,p;if(m?c=n(e):y?o(e,u)&&(c=E.compositionEnd):r(e,u)&&(c=E.compositionStart),v&&(y||c!==E.compositionStart?c===E.compositionEnd&&y&&(p=y.getData(),y=null):y=new a(t)),c){var d=l.getPooled(c,i,u);return p&&(d.data=p),s.accumulateTwoPhaseDispatches(d),d}}};t.exports=C},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactInputSelection":57,"./SyntheticCompositionEvent":83,"./getTextContentAccessor":119,"./keyOf":131}],10:[function(e,t){"use strict";function n(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var r,o=e("./Danger"),a=e("./ReactMultiChildUpdateTypes"),i=e("./getTextContentAccessor"),s=e("./invariant"),u=i();r="textContent"===u?function(e,t){e.textContent=t}:function(e,t){for(;e.firstChild;)e.removeChild(e.firstChild);if(t){var n=e.ownerDocument||document;e.appendChild(n.createTextNode(t))}};var c={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,updateTextContent:r,processUpdates:function(e,t){for(var i,u=null,c=null,l=0;i=e[l];l++)if(i.type===a.MOVE_EXISTING||i.type===a.REMOVE_NODE){var p=i.fromIndex,d=i.parentNode.childNodes[p],f=i.parentID;s(d),u=u||{},u[f]=u[f]||[],u[f][p]=d,c=c||[],c.push(d)}var h=o.dangerouslyRenderMarkup(t);if(c)for(var m=0;mt||r.hasOverloadedBooleanValue[e]&&t===!1}var r=e("./DOMProperty"),o=e("./escapeTextForBrowser"),a=e("./memoizeStringOnly"),i=(e("./warning"),a(function(e){return o(e)+'="'})),s={createMarkupForID:function(e){return i(r.ID_ATTRIBUTE_NAME)+o(e)+'"'},createMarkupForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(e)&&r.isStandardName[e]){if(n(e,t))return"";var a=r.getAttributeName[e];return r.hasBooleanValue[e]||r.hasOverloadedBooleanValue[e]&&t===!0?o(a):i(a)+o(t)+'"'}return r.isCustomAttribute(e)?null==t?"":i(e)+o(t)+'"':null},setValueForProperty:function(e,t,o){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var a=r.getMutationMethod[t];if(a)a(e,o);else if(n(t,o))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute[t])e.setAttribute(r.getAttributeName[t],""+o);else{var i=r.getPropertyName[t];r.hasSideEffects[t]&&""+e[i]==""+o||(e[i]=o)}}else r.isCustomAttribute(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o))},deleteValueForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var n=r.getMutationMethod[t];if(n)n(e,void 0);else if(r.mustUseAttribute[t])e.removeAttribute(r.getAttributeName[t]);else{var o=r.getPropertyName[t],a=r.getDefaultValueForProperty(e.nodeName,o);r.hasSideEffects[t]&&""+e[o]===a||(e[o]=a)}}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};t.exports=s},{"./DOMProperty":11,"./escapeTextForBrowser":107,"./memoizeStringOnly":133,"./warning":141}],13:[function(e,t){"use strict";function n(e){return e.substring(1,e.indexOf(" "))}var r=e("./ExecutionEnvironment"),o=e("./createNodesFromMarkup"),a=e("./emptyFunction"),i=e("./getMarkupWrap"),s=e("./invariant"),u=/^(<[^ \/>]+)/,c="data-danger-index",l={dangerouslyRenderMarkup:function(e){s(r.canUseDOM);for(var t,l={},p=0;pu;u++){var l=s[u];if(l){var p=l.extractEvents(e,t,r,a);p&&(i=o(i,p))}}return i},enqueueEvents:function(e){e&&(u=o(u,e))},processEventQueue:function(){var e=u;u=null,a(e,c),i(!u)},__purge:function(){s={}},__getListenerBank:function(){return s}};t.exports=p},{"./EventPluginRegistry":19,"./EventPluginUtils":20,"./accumulateInto":95,"./forEachAccumulated":110,"./invariant":124}],19:[function(e,t){"use strict";function n(){if(i)for(var e in s){var t=s[e],n=i.indexOf(e);if(a(n>-1),!u.plugins[n]){a(t.extractEvents),u.plugins[n]=t;var o=t.eventTypes;for(var c in o)a(r(o[c],t,c))}}}function r(e,t,n){a(!u.eventNameDispatchConfigs.hasOwnProperty(n)),u.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];o(s,t,n)}return!0}return e.registrationName?(o(e.registrationName,t,n),!0):!1}function o(e,t,n){a(!u.registrationNameModules[e]),u.registrationNameModules[e]=t,u.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=e("./invariant"),i=null,s={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){a(!i),i=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];s.hasOwnProperty(r)&&s[r]===o||(a(!s[r]),s[r]=o,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return u.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){i=null;for(var e in s)s.hasOwnProperty(e)&&delete s[e];u.plugins.length=0;var t=u.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=u.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=u},{"./invariant":124}],20:[function(e,t){"use strict";function n(e){return e===m.topMouseUp||e===m.topTouchEnd||e===m.topTouchCancel}function r(e){return e===m.topMouseMove||e===m.topTouchMove}function o(e){return e===m.topMouseDown||e===m.topTouchStart}function a(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var o=0;ol;l++){var d=s[l];i.hasOwnProperty(d)&&i[d]||(d===u.topWheel?c("wheel")?m.ReactEventListener.trapBubbledEvent(u.topWheel,"wheel",o):c("mousewheel")?m.ReactEventListener.trapBubbledEvent(u.topWheel,"mousewheel",o):m.ReactEventListener.trapBubbledEvent(u.topWheel,"DOMMouseScroll",o):d===u.topScroll?c("scroll",!0)?m.ReactEventListener.trapCapturedEvent(u.topScroll,"scroll",o):m.ReactEventListener.trapBubbledEvent(u.topScroll,"scroll",m.ReactEventListener.WINDOW_HANDLE):d===u.topFocus||d===u.topBlur?(c("focus",!0)?(m.ReactEventListener.trapCapturedEvent(u.topFocus,"focus",o),m.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",o)):c("focusin")&&(m.ReactEventListener.trapBubbledEvent(u.topFocus,"focusin",o),m.ReactEventListener.trapBubbledEvent(u.topBlur,"focusout",o)),i[u.topBlur]=!0,i[u.topFocus]=!0):f.hasOwnProperty(d)&&m.ReactEventListener.trapBubbledEvent(d,f[d],o),i[d]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!p){var e=s.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),p=!0}},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:o.putListener,getListener:o.getListener,deleteListener:o.deleteListener,deleteAllListeners:o.deleteAllListeners});t.exports=m},{"./EventConstants":16,"./EventPluginHub":18,"./EventPluginRegistry":19,"./Object.assign":27,"./ReactEventEmitterMixin":54,"./ViewportMetrics":94,"./isEventSupported":125}],31:[function(e,t){"use strict";function n(e,t){this.forEachFunction=e,this.forEachContext=t}function r(e,t,n,r){var o=e;o.forEachFunction.call(o.forEachContext,t,r)}function o(e,t,o){if(null==e)return e;var a=n.getPooled(t,o);p(e,r,a),n.release(a)}function a(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function i(e,t,n,r){var o=e,a=o.mapResult,i=!a.hasOwnProperty(n);if(i){var s=o.mapFunction.call(o.mapContext,t,r);a[n]=s}}function s(e,t,n){if(null==e)return e;var r={},o=a.getPooled(r,t,n);return p(e,i,o),a.release(o),r}function u(){return null}function c(e){return p(e,u,null)}var l=e("./PooledClass"),p=e("./traverseAllChildren"),d=(e("./warning"),l.twoArgumentPooler),f=l.threeArgumentPooler;l.addPoolingTo(n,d),l.addPoolingTo(a,f);var h={forEach:o,map:s,count:c};t.exports=h},{"./PooledClass":28,"./traverseAllChildren":140,"./warning":141}],32:[function(e,t){"use strict";var n=e("./ReactElement"),r=e("./ReactOwner"),o=e("./ReactUpdates"),a=e("./Object.assign"),i=e("./invariant"),s=e("./keyMirror"),u=s({MOUNTED:null,UNMOUNTED:null}),c=!1,l=null,p=null,d={injection:{injectEnvironment:function(e){i(!c),p=e.mountImageIntoNode,l=e.unmountIDFromEnvironment,d.BackendIDOperations=e.BackendIDOperations,c=!0}},LifeCycle:u,BackendIDOperations:null,Mixin:{isMounted:function(){return this._lifeCycleState===u.MOUNTED},setProps:function(e,t){var n=this._pendingElement||this._currentElement;this.replaceProps(a({},n.props,e),t)},replaceProps:function(e,t){i(this.isMounted()),i(0===this._mountDepth),this._pendingElement=n.cloneAndReplaceProps(this._pendingElement||this._currentElement,e),o.enqueueUpdate(this,t)},_setPropsInternal:function(e,t){var r=this._pendingElement||this._currentElement;this._pendingElement=n.cloneAndReplaceProps(r,a({},r.props,e)),o.enqueueUpdate(this,t)},construct:function(e){this.props=e.props,this._owner=e._owner,this._lifeCycleState=u.UNMOUNTED,this._pendingCallbacks=null,this._currentElement=e,this._pendingElement=null},mountComponent:function(e,t,n){i(!this.isMounted());var o=this._currentElement.ref;if(null!=o){var a=this._currentElement._owner;r.addComponentAsRefTo(this,o,a)}this._rootNodeID=e,this._lifeCycleState=u.MOUNTED,this._mountDepth=n},unmountComponent:function(){i(this.isMounted());var e=this._currentElement.ref;null!=e&&r.removeComponentAsRefFrom(this,e,this._owner),l(this._rootNodeID),this._rootNodeID=null,this._lifeCycleState=u.UNMOUNTED},receiveComponent:function(e,t){i(this.isMounted()),this._pendingElement=e,this.performUpdateIfNecessary(t)},performUpdateIfNecessary:function(e){if(null!=this._pendingElement){var t=this._currentElement,n=this._pendingElement;this._currentElement=n,this.props=n.props,this._owner=n._owner,this._pendingElement=null,this.updateComponent(e,t)}},updateComponent:function(e,t){var n=this._currentElement;(n._owner!==t._owner||n.ref!==t.ref)&&(null!=t.ref&&r.removeComponentAsRefFrom(this,t.ref,t._owner),null!=n.ref&&r.addComponentAsRefTo(this,n.ref,n._owner))},mountComponentIntoNode:function(e,t,n){var r=o.ReactReconcileTransaction.getPooled();r.perform(this._mountComponentIntoNode,this,e,t,r,n),o.ReactReconcileTransaction.release(r)},_mountComponentIntoNode:function(e,t,n,r){var o=this.mountComponent(e,n,0);p(o,t,r)},isOwnedBy:function(e){return this._owner===e},getSiblingByRef:function(e){var t=this._owner;return t&&t.refs?t.refs[e]:null}}};t.exports=d},{"./Object.assign":27,"./ReactElement":50,"./ReactOwner":65,"./ReactUpdates":77,"./invariant":124,"./keyMirror":130}],33:[function(e,t){"use strict";var n=e("./ReactDOMIDOperations"),r=e("./ReactMarkupChecksum"),o=e("./ReactMount"),a=e("./ReactPerf"),i=e("./ReactReconcileTransaction"),s=e("./getReactRootElementInContainer"),u=e("./invariant"),c=e("./setInnerHTML"),l=1,p=9,d={ReactReconcileTransaction:i,BackendIDOperations:n,unmountIDFromEnvironment:function(e){o.purgeID(e)},mountImageIntoNode:a.measure("ReactComponentBrowserEnvironment","mountImageIntoNode",function(e,t,n){if(u(t&&(t.nodeType===l||t.nodeType===p)),n){if(r.canReuseMarkup(e,s(t)))return;u(t.nodeType!==p)}u(t.nodeType!==p),c(t,e)})};t.exports=d},{"./ReactDOMIDOperations":41,"./ReactMarkupChecksum":60,"./ReactMount":61,"./ReactPerf":66,"./ReactReconcileTransaction":72,"./getReactRootElementInContainer":118,"./invariant":124,"./setInnerHTML":136}],34:[function(e,t){"use strict";function n(e){var t=e._owner||null;return t&&t.constructor&&t.constructor.displayName?" Check the render method of `"+t.constructor.displayName+"`.":""}function r(e,t){for(var n in t)t.hasOwnProperty(n)&&D("function"==typeof t[n])}function o(e,t){var n=S.hasOwnProperty(t)?S[t]:null;L.hasOwnProperty(t)&&D(n===N.OVERRIDE_BASE),e.hasOwnProperty(t)&&D(n===N.DEFINE_MANY||n===N.DEFINE_MANY_MERGED)}function a(e){var t=e._compositeLifeCycleState;D(e.isMounted()||t===A.MOUNTING),D(null==f.current),D(t!==A.UNMOUNTING)}function i(e,t){if(t){D(!g.isValidFactory(t)),D(!h.isValidElement(t));var n=e.prototype;t.hasOwnProperty(T)&&k.mixins(e,t.mixins);for(var r in t)if(t.hasOwnProperty(r)&&r!==T){var a=t[r];if(o(n,r),k.hasOwnProperty(r))k[r](e,a);else{var i=S.hasOwnProperty(r),s=n.hasOwnProperty(r),u=a&&a.__reactDontBind,p="function"==typeof a,d=p&&!i&&!s&&!u;if(d)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[r]=a,n[r]=a;else if(s){var f=S[r];D(i&&(f===N.DEFINE_MANY_MERGED||f===N.DEFINE_MANY)),f===N.DEFINE_MANY_MERGED?n[r]=c(n[r],a):f===N.DEFINE_MANY&&(n[r]=l(n[r],a))}else n[r]=a}}}}function s(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in k;D(!o);var a=n in e;D(!a),e[n]=r}}}function u(e,t){return D(e&&t&&"object"==typeof e&&"object"==typeof t),_(t,function(t,n){D(void 0===e[n]),e[n]=t}),e}function c(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);return null==n?r:null==r?n:u(n,r)}}function l(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}var p=e("./ReactComponent"),d=e("./ReactContext"),f=e("./ReactCurrentOwner"),h=e("./ReactElement"),m=(e("./ReactElementValidator"),e("./ReactEmptyComponent")),v=e("./ReactErrorUtils"),g=e("./ReactLegacyElement"),y=e("./ReactOwner"),E=e("./ReactPerf"),C=e("./ReactPropTransferer"),R=e("./ReactPropTypeLocations"),M=(e("./ReactPropTypeLocationNames"),e("./ReactUpdates")),b=e("./Object.assign"),O=e("./instantiateReactComponent"),D=e("./invariant"),x=e("./keyMirror"),P=e("./keyOf"),_=(e("./monitorCodeUse"),e("./mapObject")),w=e("./shouldUpdateReactComponent"),T=(e("./warning"),P({mixins:null})),N=x({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),I=[],S={mixins:N.DEFINE_MANY,statics:N.DEFINE_MANY,propTypes:N.DEFINE_MANY,contextTypes:N.DEFINE_MANY,childContextTypes:N.DEFINE_MANY,getDefaultProps:N.DEFINE_MANY_MERGED,getInitialState:N.DEFINE_MANY_MERGED,getChildContext:N.DEFINE_MANY_MERGED,render:N.DEFINE_ONCE,componentWillMount:N.DEFINE_MANY,componentDidMount:N.DEFINE_MANY,componentWillReceiveProps:N.DEFINE_MANY,shouldComponentUpdate:N.DEFINE_ONCE,componentWillUpdate:N.DEFINE_MANY,componentDidUpdate:N.DEFINE_MANY,componentWillUnmount:N.DEFINE_MANY,updateComponent:N.OVERRIDE_BASE},k={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t)+o}),_createOpenTagMarkupAndPutListeners:function(e){var t=this.props,n="<"+this._tag;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];if(null!=a)if(R.hasOwnProperty(o))r(this._rootNodeID,o,a,e);else{o===b&&(a&&(a=t.style=m({},t.style)),a=i.createMarkupForStyles(a));var s=u.createMarkupForProperty(o,a);s&&(n+=" "+s)}}if(e.renderToStaticMarkup)return n+">";var c=u.createMarkupForID(this._rootNodeID);return n+" "+c+">"},_createContentMarkup:function(e){var t=this.props.dangerouslySetInnerHTML;if(null!=t){if(null!=t.__html)return t.__html}else{var n=M[typeof this.props.children]?this.props.children:null,r=null!=n?null:this.props.children;if(null!=n)return v(n);if(null!=r){var o=this.mountChildren(r,e);return o.join("")}}return""},receiveComponent:function(e,t){(e!==this._currentElement||null==e._owner)&&l.Mixin.receiveComponent.call(this,e,t)},updateComponent:h.measure("ReactDOMComponent","updateComponent",function(e,t){n(this._currentElement.props),l.Mixin.updateComponent.call(this,e,t),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e)}),_updateDOMProperties:function(e,t){var n,o,a,i=this.props;for(n in e)if(!i.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===b){var u=e[n];for(o in u)u.hasOwnProperty(o)&&(a=a||{},a[o]="")}else R.hasOwnProperty(n)?E(this._rootNodeID,n):(s.isStandardName[n]||s.isCustomAttribute(n))&&l.BackendIDOperations.deletePropertyByID(this._rootNodeID,n);for(n in i){var c=i[n],p=e[n];if(i.hasOwnProperty(n)&&c!==p)if(n===b)if(c&&(c=i.style=m({},c)),p){for(o in p)!p.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(a=a||{},a[o]="");for(o in c)c.hasOwnProperty(o)&&p[o]!==c[o]&&(a=a||{},a[o]=c[o])}else a=c;else R.hasOwnProperty(n)?r(this._rootNodeID,n,c,t):(s.isStandardName[n]||s.isCustomAttribute(n))&&l.BackendIDOperations.updatePropertyByID(this._rootNodeID,n,c)}a&&l.BackendIDOperations.updateStylesByID(this._rootNodeID,a)},_updateDOMChildren:function(e,t){var n=this.props,r=M[typeof e.children]?e.children:null,o=M[typeof n.children]?n.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,i=n.dangerouslySetInnerHTML&&n.dangerouslySetInnerHTML.__html,s=null!=r?null:e.children,u=null!=o?null:n.children,c=null!=r||null!=a,p=null!=o||null!=i;null!=s&&null==u?this.updateChildren(null,t):c&&!p&&this.updateTextContent(""),null!=o?r!==o&&this.updateTextContent(""+o):null!=i?a!==i&&l.BackendIDOperations.updateInnerHTMLByID(this._rootNodeID,i):null!=u&&this.updateChildren(u,t)},unmountComponent:function(){this.unmountChildren(),p.deleteAllListeners(this._rootNodeID),l.Mixin.unmountComponent.call(this)}},m(a.prototype,l.Mixin,a.Mixin,f.Mixin,c),t.exports=a},{"./CSSPropertyOperations":5,"./DOMProperty":11,"./DOMPropertyOperations":12,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactBrowserEventEmitter":30,"./ReactComponent":32,"./ReactMount":61,"./ReactMultiChild":62,"./ReactPerf":66,"./escapeTextForBrowser":107,"./invariant":124,"./isEventSupported":125,"./keyOf":131,"./monitorCodeUse":134}],40:[function(e,t){"use strict";var n=e("./EventConstants"),r=e("./LocalEventTrapMixin"),o=e("./ReactBrowserComponentMixin"),a=e("./ReactCompositeComponent"),i=e("./ReactElement"),s=e("./ReactDOM"),u=i.createFactory(s.form.type),c=a.createClass({displayName:"ReactDOMForm",mixins:[o,r],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(n.topLevelTypes.topSubmit,"submit")}});t.exports=c},{"./EventConstants":16,"./LocalEventTrapMixin":25,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50}],41:[function(e,t){"use strict";var n=e("./CSSPropertyOperations"),r=e("./DOMChildrenOperations"),o=e("./DOMPropertyOperations"),a=e("./ReactMount"),i=e("./ReactPerf"),s=e("./invariant"),u=e("./setInnerHTML"),c={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},l={updatePropertyByID:i.measure("ReactDOMIDOperations","updatePropertyByID",function(e,t,n){var r=a.getNode(e);s(!c.hasOwnProperty(t)),null!=n?o.setValueForProperty(r,t,n):o.deleteValueForProperty(r,t)}),deletePropertyByID:i.measure("ReactDOMIDOperations","deletePropertyByID",function(e,t,n){var r=a.getNode(e);s(!c.hasOwnProperty(t)),o.deleteValueForProperty(r,t,n)}),updateStylesByID:i.measure("ReactDOMIDOperations","updateStylesByID",function(e,t){var r=a.getNode(e);n.setValueForStyles(r,t)}),updateInnerHTMLByID:i.measure("ReactDOMIDOperations","updateInnerHTMLByID",function(e,t){var n=a.getNode(e);u(n,t)}),updateTextContentByID:i.measure("ReactDOMIDOperations","updateTextContentByID",function(e,t){var n=a.getNode(e);r.updateTextContent(n,t)}),dangerouslyReplaceNodeWithMarkupByID:i.measure("ReactDOMIDOperations","dangerouslyReplaceNodeWithMarkupByID",function(e,t){var n=a.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)}),dangerouslyProcessChildrenUpdates:i.measure("ReactDOMIDOperations","dangerouslyProcessChildrenUpdates",function(e,t){for(var n=0;nc;c++){var h=u[c];if(h!==i&&h.form===i.form){var v=l.getID(h);f(v);var g=m[v];f(g),p.asap(n,g)}}}return t}});t.exports=v},{"./AutoFocusMixin":2,"./DOMPropertyOperations":12,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./ReactMount":61,"./ReactUpdates":77,"./invariant":124}],44:[function(e,t){"use strict";var n=e("./ReactBrowserComponentMixin"),r=e("./ReactCompositeComponent"),o=e("./ReactElement"),a=e("./ReactDOM"),i=(e("./warning"),o.createFactory(a.option.type)),s=r.createClass({displayName:"ReactDOMOption",mixins:[n],componentWillMount:function(){},render:function(){return i(this.props,this.props.children)}});t.exports=s},{"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./warning":141}],45:[function(e,t){"use strict";function n(){this.isMounted()&&(this.setState({value:this._pendingValue}),this._pendingValue=0)}function r(e,t){if(null!=e[t])if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to must be a scalar value if `multiple` is false.")}function o(e,t){var n,r,o,a=e.props.multiple,i=null!=t?t:e.state.value,s=e.getDOMNode().options;if(a)for(n={},r=0,o=i.length;o>r;++r)n[""+i[r]]=!0;else n=""+i;for(r=0,o=s.length;o>r;r++){var u=a?n.hasOwnProperty(s[r].value):s[r].value===n;u!==s[r].selected&&(s[r].selected=u)}}var a=e("./AutoFocusMixin"),i=e("./LinkedValueUtils"),s=e("./ReactBrowserComponentMixin"),u=e("./ReactCompositeComponent"),c=e("./ReactElement"),l=e("./ReactDOM"),p=e("./ReactUpdates"),d=e("./Object.assign"),f=c.createFactory(l.select.type),h=u.createClass({displayName:"ReactDOMSelect",mixins:[a,i.Mixin,s],propTypes:{defaultValue:r,value:r},getInitialState:function(){return{value:this.props.defaultValue||(this.props.multiple?[]:"")}},componentWillMount:function(){this._pendingValue=null},componentWillReceiveProps:function(e){!this.props.multiple&&e.multiple?this.setState({value:[this.state.value]}):this.props.multiple&&!e.multiple&&this.setState({value:this.state.value[0]}) +},render:function(){var e=d({},this.props);return e.onChange=this._handleChange,e.value=null,f(e,this.props.children)},componentDidMount:function(){o(this,i.getValue(this))},componentDidUpdate:function(e){var t=i.getValue(this),n=!!e.multiple,r=!!this.props.multiple;(null!=t||n!==r)&&o(this,t)},_handleChange:function(e){var t,r=i.getOnChange(this);r&&(t=r.call(this,e));var o;if(this.props.multiple){o=[];for(var a=e.target.options,s=0,u=a.length;u>s;s++)a[s].selected&&o.push(a[s].value)}else o=e.target.value;return this._pendingValue=o,p.asap(n,this),t}});t.exports=h},{"./AutoFocusMixin":2,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./ReactUpdates":77}],46:[function(e,t){"use strict";function n(e,t,n,r){return e===n&&t===r}function r(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var a=o.text.length,i=a+r;return{start:a,end:i}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var r=t.anchorNode,o=t.anchorOffset,a=t.focusNode,i=t.focusOffset,s=t.getRangeAt(0),u=n(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),c=u?0:s.toString().length,l=s.cloneRange();l.selectNodeContents(e),l.setEnd(s.startContainer,s.startOffset);var p=n(l.startContainer,l.startOffset,l.endContainer,l.endOffset),d=p?0:l.toString().length,f=d+c,h=document.createRange();h.setStart(r,o),h.setEnd(a,i);var m=h.collapsed;return{start:m?f:d,end:m?d:f}}function a(e,t){var n,r,o=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function i(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),a="undefined"==typeof t.end?o:Math.min(t.end,r);if(!n.extend&&o>a){var i=a;a=o,o=i}var s=u(e,o),l=u(e,a);if(s&&l){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>a?(n.addRange(p),n.extend(l.node,l.offset)):(p.setEnd(l.node,l.offset),n.addRange(p))}}}var s=e("./ExecutionEnvironment"),u=e("./getNodeForCharacterOffset"),c=e("./getTextContentAccessor"),l=s.canUseDOM&&document.selection,p={getOffsets:l?r:o,setOffsets:l?a:i};t.exports=p},{"./ExecutionEnvironment":22,"./getNodeForCharacterOffset":117,"./getTextContentAccessor":119}],47:[function(e,t){"use strict";function n(){this.isMounted()&&this.forceUpdate()}var r=e("./AutoFocusMixin"),o=e("./DOMPropertyOperations"),a=e("./LinkedValueUtils"),i=e("./ReactBrowserComponentMixin"),s=e("./ReactCompositeComponent"),u=e("./ReactElement"),c=e("./ReactDOM"),l=e("./ReactUpdates"),p=e("./Object.assign"),d=e("./invariant"),f=(e("./warning"),u.createFactory(c.textarea.type)),h=s.createClass({displayName:"ReactDOMTextarea",mixins:[r,a.Mixin,i],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(d(null==e),Array.isArray(t)&&(d(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var n=a.getValue(this);return{initialValue:""+(null!=n?n:e)}},render:function(){var e=p({},this.props);return d(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,f(e,this.state.initialValue)},componentDidUpdate:function(){var e=a.getValue(this);if(null!=e){var t=this.getDOMNode();o.setValueForProperty(t,"value",""+e)}},_handleChange:function(e){var t,r=a.getOnChange(this);return r&&(t=r.call(this,e)),l.asap(n,this),t}});t.exports=h},{"./AutoFocusMixin":2,"./DOMPropertyOperations":12,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./ReactUpdates":77,"./invariant":124,"./warning":141}],48:[function(e,t){"use strict";function n(){this.reinitializeTransaction()}var r=e("./ReactUpdates"),o=e("./Transaction"),a=e("./Object.assign"),i=e("./emptyFunction"),s={initialize:i,close:function(){p.isBatchingUpdates=!1}},u={initialize:i,close:r.flushBatchedUpdates.bind(r)},c=[u,s];a(n.prototype,o.Mixin,{getTransactionWrappers:function(){return c}});var l=new n,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n){var r=p.isBatchingUpdates;p.isBatchingUpdates=!0,r?e(t,n):l.perform(e,null,t,n)}};t.exports=p},{"./Object.assign":27,"./ReactUpdates":77,"./Transaction":93,"./emptyFunction":105}],49:[function(e,t){"use strict";function n(){O.EventEmitter.injectReactEventListener(b),O.EventPluginHub.injectEventPluginOrder(s),O.EventPluginHub.injectInstanceHandle(D),O.EventPluginHub.injectMount(x),O.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:o,CompositionEventPlugin:i,MobileSafariClickEventPlugin:p,SelectEventPlugin:P,BeforeInputEventPlugin:r}),O.NativeComponent.injectGenericComponentClass(m),O.NativeComponent.injectComponentClasses({button:v,form:g,img:y,input:E,option:C,select:R,textarea:M,html:N("html"),head:N("head"),body:N("body")}),O.CompositeComponent.injectMixin(d),O.DOMProperty.injectDOMPropertyConfig(l),O.DOMProperty.injectDOMPropertyConfig(T),O.EmptyComponent.injectEmptyComponent("noscript"),O.Updates.injectReconcileTransaction(f.ReactReconcileTransaction),O.Updates.injectBatchingStrategy(h),O.RootIndex.injectCreateReactRootIndex(c.canUseDOM?a.createReactRootIndex:_.createReactRootIndex),O.Component.injectEnvironment(f)}var r=e("./BeforeInputEventPlugin"),o=e("./ChangeEventPlugin"),a=e("./ClientReactRootIndex"),i=e("./CompositionEventPlugin"),s=e("./DefaultEventPluginOrder"),u=e("./EnterLeaveEventPlugin"),c=e("./ExecutionEnvironment"),l=e("./HTMLDOMPropertyConfig"),p=e("./MobileSafariClickEventPlugin"),d=e("./ReactBrowserComponentMixin"),f=e("./ReactComponentBrowserEnvironment"),h=e("./ReactDefaultBatchingStrategy"),m=e("./ReactDOMComponent"),v=e("./ReactDOMButton"),g=e("./ReactDOMForm"),y=e("./ReactDOMImg"),E=e("./ReactDOMInput"),C=e("./ReactDOMOption"),R=e("./ReactDOMSelect"),M=e("./ReactDOMTextarea"),b=e("./ReactEventListener"),O=e("./ReactInjection"),D=e("./ReactInstanceHandles"),x=e("./ReactMount"),P=e("./SelectEventPlugin"),_=e("./ServerReactRootIndex"),w=e("./SimpleEventPlugin"),T=e("./SVGDOMPropertyConfig"),N=e("./createFullPageComponent");t.exports={inject:n}},{"./BeforeInputEventPlugin":3,"./ChangeEventPlugin":7,"./ClientReactRootIndex":8,"./CompositionEventPlugin":9,"./DefaultEventPluginOrder":14,"./EnterLeaveEventPlugin":15,"./ExecutionEnvironment":22,"./HTMLDOMPropertyConfig":23,"./MobileSafariClickEventPlugin":26,"./ReactBrowserComponentMixin":29,"./ReactComponentBrowserEnvironment":33,"./ReactDOMButton":38,"./ReactDOMComponent":39,"./ReactDOMForm":40,"./ReactDOMImg":42,"./ReactDOMInput":43,"./ReactDOMOption":44,"./ReactDOMSelect":45,"./ReactDOMTextarea":47,"./ReactDefaultBatchingStrategy":48,"./ReactEventListener":55,"./ReactInjection":56,"./ReactInstanceHandles":58,"./ReactMount":61,"./SVGDOMPropertyConfig":78,"./SelectEventPlugin":79,"./ServerReactRootIndex":80,"./SimpleEventPlugin":81,"./createFullPageComponent":101}],50:[function(e,t){"use strict";var n=e("./ReactContext"),r=e("./ReactCurrentOwner"),o=(e("./warning"),{key:!0,ref:!0}),a=function(e,t,n,r,o,a){this.type=e,this.key=t,this.ref=n,this._owner=r,this._context=o,this.props=a};a.prototype={_isReactElement:!0},a.createElement=function(e,t,i){var s,u={},c=null,l=null;if(null!=t){l=void 0===t.ref?null:t.ref,c=null==t.key?null:""+t.key;for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(u[s]=t[s])}var p=arguments.length-2;if(1===p)u.children=i;else if(p>1){for(var d=Array(p),f=0;p>f;f++)d[f]=arguments[f+2];u.children=d}if(e&&e.defaultProps){var h=e.defaultProps;for(s in h)"undefined"==typeof u[s]&&(u[s]=h[s])}return new a(e,c,l,r.current,n.current,u)},a.createFactory=function(e){var t=a.createElement.bind(null,e);return t.type=e,t},a.cloneAndReplaceProps=function(e,t){var n=new a(e.type,e.key,e.ref,e._owner,e._context,t);return n},a.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},t.exports=a},{"./ReactContext":35,"./ReactCurrentOwner":36,"./warning":141}],51:[function(e,t){"use strict";function n(){var e=p.current;return e&&e.constructor.displayName||void 0}function r(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,a("react_key_warning",'Each child in an array should have a unique "key" prop.',e,t))}function o(e,t,n){v.test(e)&&a("react_numeric_key_warning","Child objects should have non-numeric keys so ordering is preserved.",t,n)}function a(e,t,r,o){var a=n(),i=o.displayName,s=a||i,u=f[e];if(!u.hasOwnProperty(s)){u[s]=!0,t+=a?" Check the render method of "+a+".":" Check the renderComponent call using <"+i+">.";var c=null;r._owner&&r._owner!==p.current&&(c=r._owner.constructor.displayName,t+=" It was passed a child from "+c+"."),t+=" See http://fb.me/react-warning-keys for more information.",d(e,{component:s,componentOwner:c}),console.warn(t)}}function i(){var e=n()||"";h.hasOwnProperty(e)||(h[e]=!0,d("react_object_map_children"))}function s(e,t){if(Array.isArray(e))for(var n=0;no;o++){t=e.ancestors[o];var i=l.getID(t)||"";m._handleTopLevel(e.topLevelType,t,i,e.nativeEvent)}}function a(e){var t=h(window);e(t)}var i=e("./EventListener"),s=e("./ExecutionEnvironment"),u=e("./PooledClass"),c=e("./ReactInstanceHandles"),l=e("./ReactMount"),p=e("./ReactUpdates"),d=e("./Object.assign"),f=e("./getEventTarget"),h=e("./getUnboundedScrollPosition");d(r.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),u.addPoolingTo(r,u.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:s.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?i.listen(r,t,m.dispatchEvent.bind(null,e)):void 0},trapCapturedEvent:function(e,t,n){var r=n;return r?i.capture(r,t,m.dispatchEvent.bind(null,e)):void 0},monitorScrollValue:function(e){var t=a.bind(null,e);i.listen(window,"scroll",t),i.listen(window,"resize",t)},dispatchEvent:function(e,t){if(m._enabled){var n=r.getPooled(e,t);try{p.batchedUpdates(o,n)}finally{r.release(n)}}}};t.exports=m},{"./EventListener":17,"./ExecutionEnvironment":22,"./Object.assign":27,"./PooledClass":28,"./ReactInstanceHandles":58,"./ReactMount":61,"./ReactUpdates":77,"./getEventTarget":115,"./getUnboundedScrollPosition":120}],56:[function(e,t){"use strict";var n=e("./DOMProperty"),r=e("./EventPluginHub"),o=e("./ReactComponent"),a=e("./ReactCompositeComponent"),i=e("./ReactEmptyComponent"),s=e("./ReactBrowserEventEmitter"),u=e("./ReactNativeComponent"),c=e("./ReactPerf"),l=e("./ReactRootIndex"),p=e("./ReactUpdates"),d={Component:o.injection,CompositeComponent:a.injection,DOMProperty:n.injection,EmptyComponent:i.injection,EventPluginHub:r.injection,EventEmitter:s.injection,NativeComponent:u.injection,Perf:c.injection,RootIndex:l.injection,Updates:p.injection};t.exports=d},{"./DOMProperty":11,"./EventPluginHub":18,"./ReactBrowserEventEmitter":30,"./ReactComponent":32,"./ReactCompositeComponent":34,"./ReactEmptyComponent":52,"./ReactNativeComponent":64,"./ReactPerf":66,"./ReactRootIndex":73,"./ReactUpdates":77}],57:[function(e,t){"use strict";function n(e){return o(document.documentElement,e)}var r=e("./ReactDOMSelection"),o=e("./containsNode"),a=e("./focusNode"),i=e("./getActiveElement"),s={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=i();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t=i(),r=e.focusedElem,o=e.selectionRange;t!==r&&n(r)&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,o),a(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if("undefined"==typeof o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var a=e.createTextRange();a.collapse(!0),a.moveStart("character",n),a.moveEnd("character",o-n),a.select()}else r.setOffsets(e,t)}};t.exports=s},{"./ReactDOMSelection":46,"./containsNode":99,"./focusNode":109,"./getActiveElement":111}],58:[function(e,t){"use strict";function n(e){return d+e.toString(36)}function r(e,t){return e.charAt(t)===d||t===e.length}function o(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function a(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function i(e){return e?e.substr(0,e.lastIndexOf(d)):""}function s(e,t){if(p(o(e)&&o(t)),p(a(e,t)),e===t)return e;for(var n=e.length+f,i=n;i=i;i++)if(r(e,i)&&r(t,i))a=i;else if(e.charAt(i)!==t.charAt(i))break;var s=e.substr(0,a);return p(o(s)),s}function c(e,t,n,r,o,u){e=e||"",t=t||"",p(e!==t);var c=a(t,e);p(c||a(e,t));for(var l=0,d=c?i:s,f=e;;f=d(f,t)){var m;if(o&&f===e||u&&f===t||(m=n(f,c,r)),m===!1||f===t)break;p(l++1){var t=e.indexOf(d,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var a=u(e,t);a!==e&&c(e,a,n,r,!1,!0),a!==t&&c(a,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},_getFirstCommonAncestorID:u,_getNextDescendantID:s,isAncestorIDOf:a,SEPARATOR:d};t.exports=m},{"./ReactRootIndex":73,"./invariant":124}],59:[function(e,t){"use strict";function n(e,t){if("function"==typeof t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if("function"==typeof r){var o=r.bind(t);for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);e[n]=o}else e[n]=r}}var r=(e("./ReactCurrentOwner"),e("./invariant")),o=(e("./monitorCodeUse"),e("./warning"),{}),a={},i={};i.wrapCreateFactory=function(e){var t=function(t){return"function"!=typeof t?e(t):t.isReactNonLegacyFactory?e(t.type):t.isReactLegacyFactory?e(t.type):t};return t},i.wrapCreateElement=function(e){var t=function(t){if("function"!=typeof t)return e.apply(this,arguments);var n;return t.isReactNonLegacyFactory?(n=Array.prototype.slice.call(arguments,0),n[0]=t.type,e.apply(this,n)):t.isReactLegacyFactory?(t._isMockFunction&&(t.type._mockedReactClassConstructor=t),n=Array.prototype.slice.call(arguments,0),n[0]=t.type,e.apply(this,n)):t.apply(null,Array.prototype.slice.call(arguments,1))};return t},i.wrapFactory=function(e){r("function"==typeof e);var t=function(){return e.apply(this,arguments)};return n(t,e.type),t.isReactLegacyFactory=o,t.type=e.type,t},i.markNonLegacyFactory=function(e){return e.isReactNonLegacyFactory=a,e},i.isValidFactory=function(e){return"function"==typeof e&&e.isReactLegacyFactory===o},i.isValidClass=function(e){return i.isValidFactory(e)},i._isLegacyCallWarningEnabled=!0,t.exports=i},{"./ReactCurrentOwner":36,"./invariant":124,"./monitorCodeUse":134,"./warning":141}],60:[function(e,t){"use strict";var n=e("./adler32"),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var o=t.getAttribute(r.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var a=n(e);return a===o}};t.exports=r},{"./adler32":96}],61:[function(e,t){"use strict";function n(e){var t=E(e);return t&&S.getID(t)}function r(e){var t=o(e);if(t)if(x.hasOwnProperty(t)){var n=x[t];n!==e&&(R(!s(n,t)),x[t]=e)}else x[t]=e;return t}function o(e){return e&&e.getAttribute&&e.getAttribute(D)||""}function a(e,t){var n=o(e);n!==t&&delete x[n],e.setAttribute(D,t),x[t]=e}function i(e){return x.hasOwnProperty(e)&&s(x[e],e)||(x[e]=S.findReactNodeByID(e)),x[e]}function s(e,t){if(e){R(o(e)===t);var n=S.findReactContainerForID(t);if(n&&g(n,e))return!0}return!1}function u(e){delete x[e]}function c(e){var t=x[e];return t&&s(t,e)?void(I=t):!1}function l(e){I=null,m.traverseAncestors(e,c);var t=I;return I=null,t}var p=e("./DOMProperty"),d=e("./ReactBrowserEventEmitter"),f=(e("./ReactCurrentOwner"),e("./ReactElement")),h=e("./ReactLegacyElement"),m=e("./ReactInstanceHandles"),v=e("./ReactPerf"),g=e("./containsNode"),y=e("./deprecated"),E=e("./getReactRootElementInContainer"),C=e("./instantiateReactComponent"),R=e("./invariant"),M=e("./shouldUpdateReactComponent"),b=(e("./warning"),h.wrapCreateElement(f.createElement)),O=m.SEPARATOR,D=p.ID_ATTRIBUTE_NAME,x={},P=1,_=9,w={},T={},N=[],I=null,S={_instancesByReactRootID:w,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){var o=t.props;return S.scrollMonitor(n,function(){e.replaceProps(o,r)}),e},_registerComponent:function(e,t){R(t&&(t.nodeType===P||t.nodeType===_)),d.ensureScrollValueMonitoring();var n=S.registerContainer(t);return w[n]=e,n},_renderNewRootComponent:v.measure("ReactMount","_renderNewRootComponent",function(e,t,n){var r=C(e,null),o=S._registerComponent(r,t);return r.mountComponentIntoNode(o,t,n),r}),render:function(e,t,r){R(f.isValidElement(e));var o=w[n(t)];if(o){var a=o._currentElement;if(M(a,e))return S._updateRootComponent(o,e,t,r);S.unmountComponentAtNode(t)}var i=E(t),s=i&&S.isRenderedByReact(i),u=s&&!o,c=S._renderNewRootComponent(e,t,u);return r&&r.call(c),c},constructAndRenderComponent:function(e,t,n){var r=b(e,t);return S.render(r,n)},constructAndRenderComponentByID:function(e,t,n){var r=document.getElementById(n);return R(r),S.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=n(e);return t&&(t=m.getReactRootIDFromNodeID(t)),t||(t=m.createReactRootID()),T[t]=e,t},unmountComponentAtNode:function(e){var t=n(e),r=w[t];return r?(S.unmountComponentFromNode(r,e),delete w[t],delete T[t],!0):!1},unmountComponentFromNode:function(e,t){for(e.unmountComponent(),t.nodeType===_&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=m.getReactRootIDFromNodeID(e),n=T[t];return n},findReactNodeByID:function(e){var t=S.findReactContainerForID(e);return S.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=S.getID(e);return t?t.charAt(0)===O:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(S.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=N,r=0,o=l(t)||e;for(n[0]=o.firstChild,n.length=1;r>",R=i(),M=p(),b={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:o(),arrayOf:a,element:R,instanceOf:s,node:M,objectOf:c,oneOf:u,oneOfType:l,shape:d,component:y("React.PropTypes","component","element",this,R),renderable:y("React.PropTypes","renderable","node",this,M)};t.exports=b},{"./ReactElement":50,"./ReactPropTypeLocationNames":68,"./deprecated":104,"./emptyFunction":105}],71:[function(e,t){"use strict";function n(){this.listenersToPut=[]}var r=e("./PooledClass"),o=e("./ReactBrowserEventEmitter"),a=e("./Object.assign");a(n.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e"+a+""},receiveComponent:function(e){var t=e.props;t!==this.props&&(this.props=t,r.BackendIDOperations.updateTextContentByID(this._rootNodeID,t))}});var u=function(e){return new o(s,null,null,null,null,e)};u.type=s,t.exports=u},{"./DOMPropertyOperations":12,"./Object.assign":27,"./ReactComponent":32,"./ReactElement":50,"./escapeTextForBrowser":107}],77:[function(e,t){"use strict";function n(){h(O.ReactReconcileTransaction&&y)}function r(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=O.ReactReconcileTransaction.getPooled()}function o(e,t,r){n(),y.batchedUpdates(e,t,r)}function a(e,t){return e._mountDepth-t._mountDepth}function i(e){var t=e.dirtyComponentsLength;h(t===m.length),m.sort(a);for(var n=0;t>n;n++){var r=m[n];if(r.isMounted()){var o=r._pendingCallbacks;if(r._pendingCallbacks=null,r.performUpdateIfNecessary(e.reconcileTransaction),o)for(var i=0;i":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;t.exports=r},{}],108:[function(e,t){"use strict";function n(e,t,n){var r=e,a=!r.hasOwnProperty(n);if(a&&null!=t){var i,s=typeof t;i="string"===s?o(t):"number"===s?o(""+t):t,r[n]=i}}function r(e){if(null==e)return e;var t={};return a(e,n,t),t}{var o=e("./ReactTextComponent"),a=e("./traverseAllChildren");e("./warning")}t.exports=r},{"./ReactTextComponent":76,"./traverseAllChildren":140,"./warning":141}],109:[function(e,t){"use strict";function n(e){try{e.focus()}catch(t){}}t.exports=n},{}],110:[function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=n},{}],111:[function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],112:[function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=n},{}],113:[function(e,t){"use strict";function n(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var r=e("./getEventCharCode"),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=n},{"./getEventCharCode":112}],114:[function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function r(){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],115:[function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=n},{}],116:[function(e,t){function n(e){return o(!!a),p.hasOwnProperty(e)||(e="*"),i.hasOwnProperty(e)||(a.innerHTML="*"===e?"":"<"+e+">",i[e]=!a.firstChild),i[e]?p[e]:null}var r=e("./ExecutionEnvironment"),o=e("./invariant"),a=r.canUseDOM?document.createElement("div"):null,i={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},s=[1,'"],u=[1,"","
    "],c=[3,"","
    "],l=[1,"",""],p={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c,circle:l,defs:l,ellipse:l,g:l,line:l,linearGradient:l,path:l,polygon:l,polyline:l,radialGradient:l,rect:l,stop:l,text:l};t.exports=n},{"./ExecutionEnvironment":22,"./invariant":124}],117:[function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var o=n(e),a=0,i=0;o;){if(3==o.nodeType){if(i=a+o.textContent.length,t>=a&&i>=t)return{node:o,offset:t-a};a=i}o=n(r(o))}}t.exports=o},{}],118:[function(e,t){"use strict";function n(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;t.exports=n},{}],119:[function(e,t){"use strict";function n(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var r=e("./ExecutionEnvironment"),o=null;t.exports=n},{"./ExecutionEnvironment":22}],120:[function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],121:[function(e,t){function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=n},{}],122:[function(e,t){"use strict";function n(e){return r(e).replace(o,"-ms-")}var r=e("./hyphenate"),o=/^ms-/;t.exports=n},{"./hyphenate":121}],123:[function(e,t){"use strict";function n(e,t){var n;return n="string"==typeof e.type?r.createInstanceForTag(e.type,e.props,t):new e.type(e.props),n.construct(e),n}{var r=(e("./warning"),e("./ReactElement"),e("./ReactLegacyElement"),e("./ReactNativeComponent"));e("./ReactEmptyComponent")}t.exports=n},{"./ReactElement":50,"./ReactEmptyComponent":52,"./ReactLegacyElement":59,"./ReactNativeComponent":64,"./warning":141}],124:[function(e,t){"use strict";var n=function(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],l=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[l++]}))}throw u.framesToPop=1,u}};t.exports=n},{}],125:[function(e,t){"use strict";function n(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,a=n in document;if(!a){var i=document.createElement("div");i.setAttribute(n,"return;"),a="function"==typeof i[n]}return!a&&r&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}var r,o=e("./ExecutionEnvironment");o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=n},{"./ExecutionEnvironment":22}],126:[function(e,t){function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],127:[function(e,t){"use strict";function n(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=n},{}],128:[function(e,t){function n(e){return r(e)&&3==e.nodeType}var r=e("./isNode");t.exports=n},{"./isNode":126}],129:[function(e,t){"use strict";function n(e){e||(e="");var t,n=arguments.length;if(n>1)for(var r=1;n>r;r++)t=arguments[r],t&&(e=(e?e+" ":"")+t);return e}t.exports=n},{}],130:[function(e,t){"use strict";var n=e("./invariant"),r=function(e){var t,r={};n(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};t.exports=r},{"./invariant":124}],131:[function(e,t){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=n},{}],132:[function(e,t){"use strict";function n(e,t,n){if(!e)return null;var o={};for(var a in e)r.call(e,a)&&(o[a]=t.call(n,e[a],a,e));return o}var r=Object.prototype.hasOwnProperty;t.exports=n},{}],133:[function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)?t[n]:t[n]=e.call(this,n)}}t.exports=n},{}],134:[function(e,t){"use strict";function n(e){r(e&&!/[^a-z0-9_]/.test(e))}var r=e("./invariant");t.exports=n},{"./invariant":124}],135:[function(e,t){"use strict";function n(e){return o(r.isValidElement(e)),e}var r=e("./ReactElement"),o=e("./invariant");t.exports=n},{"./ReactElement":50,"./invariant":124}],136:[function(e,t){"use strict";var n=e("./ExecutionEnvironment"),r=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if(n.canUseDOM){var i=document.createElement("div");i.innerHTML=" ",""===i.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),r.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=""+t; +var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=a},{"./ExecutionEnvironment":22}],137:[function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=n},{}],138:[function(e,t){"use strict";function n(e,t){return e&&t&&e.type===t.type&&e.key===t.key&&e._owner===t._owner?!0:!1}t.exports=n},{}],139:[function(e,t){function n(e){var t=e.length;if(r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),r("number"==typeof t),r(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var o=Array(t),a=0;t>a;a++)o[a]=e[a];return o}var r=e("./invariant");t.exports=n},{"./invariant":124}],140:[function(e,t){"use strict";function n(e){return d[e]}function r(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function o(e){return(""+e).replace(f,n)}function a(e){return"$"+o(e)}function i(e,t,n){return null==e?0:h(e,"",0,t,n)}var s=e("./ReactElement"),u=e("./ReactInstanceHandles"),c=e("./invariant"),l=u.SEPARATOR,p=":",d={"=":"=0",".":"=1",":":"=2"},f=/[=.:]/g,h=function(e,t,n,o,i){var u,d,f=0;if(Array.isArray(e))for(var m=0;m Date: Wed, 11 Mar 2015 11:09:36 -0400 Subject: [PATCH 071/190] Removed unnecessary comment --- src/components/legend-item.cjsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/legend-item.cjsx b/src/components/legend-item.cjsx index bd8b07a..f9cd7e0 100644 --- a/src/components/legend-item.cjsx +++ b/src/components/legend-item.cjsx @@ -46,7 +46,6 @@ module.exports = React.createClass #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Final Render #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - #
  • - Red
  • render: -> itemText = '' From bd7df1b4499de6a66a346f693603bad7c1438897 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 11 Mar 2015 11:24:15 -0400 Subject: [PATCH 072/190] Legend now gets its list of colours dynamically --- src/components/legend-item.cjsx | 4 ++-- src/components/legend.cjsx | 11 ++++++----- src/constants.coffee | 2 ++ src/main.coffee | 3 ++- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/legend-item.cjsx b/src/components/legend-item.cjsx index f9cd7e0..d1e78bf 100644 --- a/src/components/legend-item.cjsx +++ b/src/components/legend-item.cjsx @@ -58,10 +58,10 @@ module.exports = React.createClass @circleStyle.backgroundColor = '#ff7f00' when "g" itemText = 'Green' - @circleStyle.backgroundColor = '#008eaf' + @circleStyle.backgroundColor = '#00ca35' when "b" itemText = 'Blue' - @circleStyle.backgroundColor = '#00ca35' + @circleStyle.backgroundColor = '#008eaf' when "p" itemText = 'Purple' @circleStyle.backgroundColor = '#dc0068' diff --git a/src/components/legend.cjsx b/src/components/legend.cjsx index 8c0e13b..d434bd2 100644 --- a/src/components/legend.cjsx +++ b/src/components/legend.cjsx @@ -21,13 +21,14 @@ module.exports = React.createClass # Final Render #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ render: -> + legendItems = @props.types.map ( type )-> + return ( + + ) +

    Legend

      - - - - - + {legendItems}
    diff --git a/src/constants.coffee b/src/constants.coffee index 9629e4e..ee885d1 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -6,3 +6,5 @@ module.exports = b: new THREE.Color 0x008EAF g: new THREE.Color 0x00CA35 p: new THREE.Color 0xDC0068 + + COLOUR_TYPES: [ 'r', 'o','b', 'g', 'p' ] diff --git a/src/main.coffee b/src/main.coffee index f0aa00f..88c3135 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -3,6 +3,7 @@ dataLoading = require './dataloading' mouseKeyboard = require './mousekeyboard' visualize = require './visualize' geopins = require './geopins' +constants = require './constants' # React components Legend = require './components/legend' @@ -54,7 +55,7 @@ else # Render our interactive legend React.render( - React.createElement( Legend, null ), + React.createElement( Legend, { types: constants.COLOUR_TYPES } ), document.getElementById 'legend' ) From 2907e03d8ea14a0a09f0b5877526124b60d19948 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 11 Mar 2015 11:58:13 -0400 Subject: [PATCH 073/190] Can now toggle types on/off from the legend --- src/components/legend-item.cjsx | 4 +++- src/components/legend.cjsx | 3 ++- src/main.coffee | 2 +- src/visualize.coffee | 10 ++++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/legend-item.cjsx b/src/components/legend-item.cjsx index d1e78bf..2de6e99 100644 --- a/src/components/legend-item.cjsx +++ b/src/components/legend-item.cjsx @@ -41,7 +41,9 @@ module.exports = React.createClass return { active: true } handleLinkClick: -> - @setState { active: !@state.active } + newActive = !@state.active + @setState { active: newActive } + @props.clickCallback( @props.type, newActive ) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Final Render diff --git a/src/components/legend.cjsx b/src/components/legend.cjsx index d434bd2..33b1478 100644 --- a/src/components/legend.cjsx +++ b/src/components/legend.cjsx @@ -21,9 +21,10 @@ module.exports = React.createClass # Final Render #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ render: -> + callback = @props.clickCallback legendItems = @props.types.map ( type )-> return ( - + )
    diff --git a/src/main.coffee b/src/main.coffee index 88c3135..122fcd7 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -55,7 +55,7 @@ else # Render our interactive legend React.render( - React.createElement( Legend, { types: constants.COLOUR_TYPES } ), + React.createElement( Legend, { types: constants.COLOUR_TYPES, clickCallback: visualize.toggleVisualizationType } ), document.getElementById 'legend' ) diff --git a/src/visualize.coffee b/src/visualize.coffee index 4ef95cf..c099ca0 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -7,6 +7,11 @@ _meshPool = [] # Injected from main.coffee via init() _scene = null +# Used to keep track of which types we're not currently displaying +_typeStatus = {} +for type in constants.COLOUR_TYPES + _typeStatus[ type ] = true + module.exports = init: ( scene ) -> _scene = scene @@ -37,6 +42,8 @@ module.exports = getVisualizedMesh: ( linearData, callback ) -> return null if not linearData.lineGeometry? + # Don't display if we've toggled this type off + return null if not _typeStatus[ linearData.colour ] _getMeshFromPool ( meshObj ) -> # merge it all together @@ -61,6 +68,9 @@ module.exports = for data in linearData module.exports.getVisualizedMesh data, _addMeshToViz.bind( null, visualizationMesh ) + toggleVisualizationType: ( type, active ) -> + _typeStatus[ type ] = active + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # HELPER METHODS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From ceed44f4782ef027dd4073f156fc9e9a93be1bb2 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 11 Mar 2015 12:10:26 -0400 Subject: [PATCH 074/190] Fixed issue where clicking on the legend would cause the globe to pause --- src/components/legend-item.cjsx | 4 +++- src/main.coffee | 22 +++++++++++----------- src/mousekeyboard.coffee | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/components/legend-item.cjsx b/src/components/legend-item.cjsx index 2de6e99..cec7b0d 100644 --- a/src/components/legend-item.cjsx +++ b/src/components/legend-item.cjsx @@ -40,10 +40,12 @@ module.exports = React.createClass getInitialState: -> return { active: true } - handleLinkClick: -> + handleLinkClick: (e) -> + e.preventDefault() newActive = !@state.active @setState { active: newActive } @props.clickCallback( @props.type, newActive ) + return false #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Final Render diff --git a/src/main.coffee b/src/main.coffee index 122fcd7..59a745c 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -154,26 +154,26 @@ initScene = -> glContainer.appendChild renderer.domElement + # Setup our camera + camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ) + camera.position.z = 1400 + camera.position.y = 0 + scene.add camera + # Event listeners - document.addEventListener 'mousemove', mouseKeyboard.onDocumentMouseMove, true - document.addEventListener 'mousedown', mouseKeyboard.onDocumentMouseDown, true - document.addEventListener 'mouseup', mouseKeyboard.onDocumentMouseUp, false + masterContainer.addEventListener 'mousemove', mouseKeyboard.onDocumentMouseMove, true + masterContainer.addEventListener 'mousedown', mouseKeyboard.onDocumentMouseDown, true + masterContainer.addEventListener 'mouseup', mouseKeyboard.onDocumentMouseUp, false masterContainer.addEventListener 'click', mouseKeyboard.onClick, true - masterContainer.addEventListener 'mousewheel', mouseKeyboard.onMouseWheel, false + masterContainer.addEventListener 'mousewheel', mouseKeyboard.onMouseWheel.bind( null, camera ), false # firefox masterContainer.addEventListener 'DOMMouseScroll', (e) -> evt = window.event or e - mouseKeyboard.onMouseWheel evt, camera + mouseKeyboard.onMouseWheel camera, evt , false - # Setup our camera - camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ) - camera.position.z = 1400 - camera.position.y = 0 - scene.add camera - windowResize = THREEx.WindowResize renderer, camera # Get the globe spinning (defined in mousekeyboard.js) diff --git a/src/mousekeyboard.coffee b/src/mousekeyboard.coffee index 7faf2ba..37a5724 100644 --- a/src/mousekeyboard.coffee +++ b/src/mousekeyboard.coffee @@ -86,7 +86,7 @@ module.exports = camera.scale.z += delta * 0.1 camera.scale.z = vizLines.constrain camera.scale.z, 0.7, 5.0 - onMouseWheel: ( event, camera ) -> + onMouseWheel: ( camera, event ) -> delta = 0 if event.wheelDelta From f3fa3bd31cabfc2290f364c02d2542470af23e42 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 11 Mar 2015 15:33:22 -0400 Subject: [PATCH 075/190] Fixed linting errors --- src/main.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.coffee b/src/main.coffee index 59a745c..570f8c6 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -55,7 +55,10 @@ else # Render our interactive legend React.render( - React.createElement( Legend, { types: constants.COLOUR_TYPES, clickCallback: visualize.toggleVisualizationType } ), + React.createElement( Legend, + types: constants.COLOUR_TYPES + clickCallback: visualize.toggleVisualizationType + ) document.getElementById 'legend' ) From 019945034b4ead865af253badab8a743115493be Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 09:07:10 -0400 Subject: [PATCH 076/190] Removed some unnecessary HTML/CSS --- index.html | 7 ------- style.css | 17 ----------------- 2 files changed, 24 deletions(-) diff --git a/index.html b/index.html index 129df74..82ca541 100755 --- a/index.html +++ b/index.html @@ -13,13 +13,6 @@

    Loading Data. Please wait...

    -
    -
    - -
    -
    -
    diff --git a/style.css b/style.css index 09825bc..0e485b6 100755 --- a/style.css +++ b/style.css @@ -91,23 +91,6 @@ li { list-style-type:none; } pointer-events: none; } -.marker { - position: absolute; - display: inline-block; - background-color: rgba(0,0,0,.87); - color: #ffffff; - font-size: 4pt; - font-family: 'RopaSans'; - -moz-user-select: -moz-none; - -khtml-user-select: none; - -webkit-user-select: none; - margin: 0px; - border: 0px; - padding: 10px; - overflow: hidden; - cursor: pointer; -} - .country { margin-right: 10px; } From 063842720ae6caa9726725663103569342d570ff Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 11:15:07 -0400 Subject: [PATCH 077/190] Updated React and cleaned up some component code --- index.html | 5 ++++- src/components/legend.cjsx | 8 +++----- src/main.coffee | 30 ++++++++++++++++++++++-------- style.css | 6 ++++++ thirdparty/react-0.12.2.min.js | 16 ---------------- thirdparty/react-0.13.0.min.js | 15 +++++++++++++++ 6 files changed, 50 insertions(+), 30 deletions(-) delete mode 100644 thirdparty/react-0.12.2.min.js create mode 100644 thirdparty/react-0.13.0.min.js diff --git a/index.html b/index.html index 82ca541..bdba969 100755 --- a/index.html +++ b/index.html @@ -31,6 +31,9 @@

    Data Visualization Globe
    +
    +
    + @@ -42,7 +45,7 @@

    Data Visualization Globe - + diff --git a/src/components/legend.cjsx b/src/components/legend.cjsx index 33b1478..0e91623 100644 --- a/src/components/legend.cjsx +++ b/src/components/legend.cjsx @@ -22,14 +22,12 @@ module.exports = React.createClass #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ render: -> callback = @props.clickCallback - legendItems = @props.types.map ( type )-> - return ( - - )

    Legend

      - {legendItems} + { @props.types.map ( type )-> + return + }
    diff --git a/src/main.coffee b/src/main.coffee index 570f8c6..8f45667 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -7,6 +7,7 @@ constants = require './constants' # React components Legend = require './components/legend' +#Progress = require './components/progress' masterContainer = document.getElementById 'visualization' overlay = document.getElementById 'visualization' @@ -53,14 +54,8 @@ else visualize.init( scene ) visualize.initMeshPool( 100 ) - # Render our interactive legend - React.render( - React.createElement( Legend, - types: constants.COLOUR_TYPES - clickCallback: visualize.toggleVisualizationType - ) - document.getElementById 'legend' - ) + # Render our React components + reactInit() animate() startDataPump() @@ -194,3 +189,22 @@ animate = -> rotating.traverse ( mesh ) -> if mesh? and mesh.update? mesh.update() + +# Loads our React components into the scene +reactInit = -> + # Legend + React.render( + React.createElement( Legend, + types: constants.COLOUR_TYPES + clickCallback: visualize.toggleVisualizationType + ) + document.getElementById 'legend' + ) + + # ... and our progress bar + # React.render( + # React.createElement( Progress, + # currVal: 0.5 + # ) + # document.getElementById 'progress' + # ) diff --git a/style.css b/style.css index 0e485b6..66f886d 100755 --- a/style.css +++ b/style.css @@ -199,3 +199,9 @@ footer { font-family: 'RopaSans'; padding: 10px; } + +#progress { + position: absolute; + right: 30px; + top: 20px; +} diff --git a/thirdparty/react-0.12.2.min.js b/thirdparty/react-0.12.2.min.js deleted file mode 100644 index c6559bd..0000000 --- a/thirdparty/react-0.12.2.min.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * React v0.12.2 - * - * Copyright 2013-2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.React=e()}}(function(){return function e(t,n,r){function o(i,s){if(!n[i]){if(!t[i]){var u="function"==typeof require&&require;if(!s&&u)return u(i,!0);if(a)return a(i,!0);var c=new Error("Cannot find module '"+i+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[i]={exports:{}};t[i][0].call(l.exports,function(e){var n=t[i][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[i].exports}for(var a="function"==typeof require&&require,i=0;in;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{"./Object.assign":27,"./PooledClass":28,"./invariant":124}],7:[function(e,t){"use strict";function n(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function r(e){var t=M.getPooled(P.change,w,e);E.accumulateTwoPhaseDispatches(t),R.batchedUpdates(o,t)}function o(e){y.enqueueEvents(e),y.processEventQueue()}function a(e,t){_=e,w=t,_.attachEvent("onchange",r)}function i(){_&&(_.detachEvent("onchange",r),_=null,w=null)}function s(e,t,n){return e===x.topChange?n:void 0}function u(e,t,n){e===x.topFocus?(i(),a(t,n)):e===x.topBlur&&i()}function c(e,t){_=e,w=t,T=e.value,N=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(_,"value",k),_.attachEvent("onpropertychange",p)}function l(){_&&(delete _.value,_.detachEvent("onpropertychange",p),_=null,w=null,T=null,N=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==T&&(T=t,r(e))}}function d(e,t,n){return e===x.topInput?n:void 0}function f(e,t,n){e===x.topFocus?(l(),c(t,n)):e===x.topBlur&&l()}function h(e){return e!==x.topSelectionChange&&e!==x.topKeyUp&&e!==x.topKeyDown||!_||_.value===T?void 0:(T=_.value,w)}function m(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===x.topClick?n:void 0}var g=e("./EventConstants"),y=e("./EventPluginHub"),E=e("./EventPropagators"),C=e("./ExecutionEnvironment"),R=e("./ReactUpdates"),M=e("./SyntheticEvent"),b=e("./isEventSupported"),O=e("./isTextInputElement"),D=e("./keyOf"),x=g.topLevelTypes,P={change:{phasedRegistrationNames:{bubbled:D({onChange:null}),captured:D({onChangeCapture:null})},dependencies:[x.topBlur,x.topChange,x.topClick,x.topFocus,x.topInput,x.topKeyDown,x.topKeyUp,x.topSelectionChange]}},_=null,w=null,T=null,N=null,I=!1;C.canUseDOM&&(I=b("change")&&(!("documentMode"in document)||document.documentMode>8));var S=!1;C.canUseDOM&&(S=b("input")&&(!("documentMode"in document)||document.documentMode>9));var k={get:function(){return N.get.call(this)},set:function(e){T=""+e,N.set.call(this,e)}},A={eventTypes:P,extractEvents:function(e,t,r,o){var a,i;if(n(t)?I?a=s:i=u:O(t)?S?a=d:(a=h,i=f):m(t)&&(a=v),a){var c=a(e,t,r);if(c){var l=M.getPooled(P.change,c,o);return E.accumulateTwoPhaseDispatches(l),l}}i&&i(e,t,r)}};t.exports=A},{"./EventConstants":16,"./EventPluginHub":18,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactUpdates":77,"./SyntheticEvent":85,"./isEventSupported":125,"./isTextInputElement":127,"./keyOf":131}],8:[function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};t.exports=r},{}],9:[function(e,t){"use strict";function n(e){switch(e){case g.topCompositionStart:return E.compositionStart;case g.topCompositionEnd:return E.compositionEnd;case g.topCompositionUpdate:return E.compositionUpdate}}function r(e,t){return e===g.topKeyDown&&t.keyCode===h}function o(e,t){switch(e){case g.topKeyUp:return-1!==f.indexOf(t.keyCode);case g.topKeyDown:return t.keyCode!==h;case g.topKeyPress:case g.topMouseDown:case g.topBlur:return!0;default:return!1}}function a(e){this.root=e,this.startSelection=c.getSelection(e),this.startValue=this.getText()}var i=e("./EventConstants"),s=e("./EventPropagators"),u=e("./ExecutionEnvironment"),c=e("./ReactInputSelection"),l=e("./SyntheticCompositionEvent"),p=e("./getTextContentAccessor"),d=e("./keyOf"),f=[9,13,27,32],h=229,m=u.canUseDOM&&"CompositionEvent"in window,v=!m||"documentMode"in document&&document.documentMode>8&&document.documentMode<=11,g=i.topLevelTypes,y=null,E={compositionEnd:{phasedRegistrationNames:{bubbled:d({onCompositionEnd:null}),captured:d({onCompositionEndCapture:null})},dependencies:[g.topBlur,g.topCompositionEnd,g.topKeyDown,g.topKeyPress,g.topKeyUp,g.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:d({onCompositionStart:null}),captured:d({onCompositionStartCapture:null})},dependencies:[g.topBlur,g.topCompositionStart,g.topKeyDown,g.topKeyPress,g.topKeyUp,g.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:d({onCompositionUpdate:null}),captured:d({onCompositionUpdateCapture:null})},dependencies:[g.topBlur,g.topCompositionUpdate,g.topKeyDown,g.topKeyPress,g.topKeyUp,g.topMouseDown]}};a.prototype.getText=function(){return this.root.value||this.root[p()]},a.prototype.getData=function(){var e=this.getText(),t=this.startSelection.start,n=this.startValue.length-this.startSelection.end;return e.substr(t,e.length-n-t)};var C={eventTypes:E,extractEvents:function(e,t,i,u){var c,p;if(m?c=n(e):y?o(e,u)&&(c=E.compositionEnd):r(e,u)&&(c=E.compositionStart),v&&(y||c!==E.compositionStart?c===E.compositionEnd&&y&&(p=y.getData(),y=null):y=new a(t)),c){var d=l.getPooled(c,i,u);return p&&(d.data=p),s.accumulateTwoPhaseDispatches(d),d}}};t.exports=C},{"./EventConstants":16,"./EventPropagators":21,"./ExecutionEnvironment":22,"./ReactInputSelection":57,"./SyntheticCompositionEvent":83,"./getTextContentAccessor":119,"./keyOf":131}],10:[function(e,t){"use strict";function n(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var r,o=e("./Danger"),a=e("./ReactMultiChildUpdateTypes"),i=e("./getTextContentAccessor"),s=e("./invariant"),u=i();r="textContent"===u?function(e,t){e.textContent=t}:function(e,t){for(;e.firstChild;)e.removeChild(e.firstChild);if(t){var n=e.ownerDocument||document;e.appendChild(n.createTextNode(t))}};var c={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,updateTextContent:r,processUpdates:function(e,t){for(var i,u=null,c=null,l=0;i=e[l];l++)if(i.type===a.MOVE_EXISTING||i.type===a.REMOVE_NODE){var p=i.fromIndex,d=i.parentNode.childNodes[p],f=i.parentID;s(d),u=u||{},u[f]=u[f]||[],u[f][p]=d,c=c||[],c.push(d)}var h=o.dangerouslyRenderMarkup(t);if(c)for(var m=0;mt||r.hasOverloadedBooleanValue[e]&&t===!1}var r=e("./DOMProperty"),o=e("./escapeTextForBrowser"),a=e("./memoizeStringOnly"),i=(e("./warning"),a(function(e){return o(e)+'="'})),s={createMarkupForID:function(e){return i(r.ID_ATTRIBUTE_NAME)+o(e)+'"'},createMarkupForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(e)&&r.isStandardName[e]){if(n(e,t))return"";var a=r.getAttributeName[e];return r.hasBooleanValue[e]||r.hasOverloadedBooleanValue[e]&&t===!0?o(a):i(a)+o(t)+'"'}return r.isCustomAttribute(e)?null==t?"":i(e)+o(t)+'"':null},setValueForProperty:function(e,t,o){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var a=r.getMutationMethod[t];if(a)a(e,o);else if(n(t,o))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute[t])e.setAttribute(r.getAttributeName[t],""+o);else{var i=r.getPropertyName[t];r.hasSideEffects[t]&&""+e[i]==""+o||(e[i]=o)}}else r.isCustomAttribute(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o))},deleteValueForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var n=r.getMutationMethod[t];if(n)n(e,void 0);else if(r.mustUseAttribute[t])e.removeAttribute(r.getAttributeName[t]);else{var o=r.getPropertyName[t],a=r.getDefaultValueForProperty(e.nodeName,o);r.hasSideEffects[t]&&""+e[o]===a||(e[o]=a)}}else r.isCustomAttribute(t)&&e.removeAttribute(t)}};t.exports=s},{"./DOMProperty":11,"./escapeTextForBrowser":107,"./memoizeStringOnly":133,"./warning":141}],13:[function(e,t){"use strict";function n(e){return e.substring(1,e.indexOf(" "))}var r=e("./ExecutionEnvironment"),o=e("./createNodesFromMarkup"),a=e("./emptyFunction"),i=e("./getMarkupWrap"),s=e("./invariant"),u=/^(<[^ \/>]+)/,c="data-danger-index",l={dangerouslyRenderMarkup:function(e){s(r.canUseDOM);for(var t,l={},p=0;pu;u++){var l=s[u];if(l){var p=l.extractEvents(e,t,r,a);p&&(i=o(i,p))}}return i},enqueueEvents:function(e){e&&(u=o(u,e))},processEventQueue:function(){var e=u;u=null,a(e,c),i(!u)},__purge:function(){s={}},__getListenerBank:function(){return s}};t.exports=p},{"./EventPluginRegistry":19,"./EventPluginUtils":20,"./accumulateInto":95,"./forEachAccumulated":110,"./invariant":124}],19:[function(e,t){"use strict";function n(){if(i)for(var e in s){var t=s[e],n=i.indexOf(e);if(a(n>-1),!u.plugins[n]){a(t.extractEvents),u.plugins[n]=t;var o=t.eventTypes;for(var c in o)a(r(o[c],t,c))}}}function r(e,t,n){a(!u.eventNameDispatchConfigs.hasOwnProperty(n)),u.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];o(s,t,n)}return!0}return e.registrationName?(o(e.registrationName,t,n),!0):!1}function o(e,t,n){a(!u.registrationNameModules[e]),u.registrationNameModules[e]=t,u.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=e("./invariant"),i=null,s={},u={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){a(!i),i=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];s.hasOwnProperty(r)&&s[r]===o||(a(!s[r]),s[r]=o,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return u.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=u.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){i=null;for(var e in s)s.hasOwnProperty(e)&&delete s[e];u.plugins.length=0;var t=u.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=u.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=u},{"./invariant":124}],20:[function(e,t){"use strict";function n(e){return e===m.topMouseUp||e===m.topTouchEnd||e===m.topTouchCancel}function r(e){return e===m.topMouseMove||e===m.topTouchMove}function o(e){return e===m.topMouseDown||e===m.topTouchStart}function a(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var o=0;ol;l++){var d=s[l];i.hasOwnProperty(d)&&i[d]||(d===u.topWheel?c("wheel")?m.ReactEventListener.trapBubbledEvent(u.topWheel,"wheel",o):c("mousewheel")?m.ReactEventListener.trapBubbledEvent(u.topWheel,"mousewheel",o):m.ReactEventListener.trapBubbledEvent(u.topWheel,"DOMMouseScroll",o):d===u.topScroll?c("scroll",!0)?m.ReactEventListener.trapCapturedEvent(u.topScroll,"scroll",o):m.ReactEventListener.trapBubbledEvent(u.topScroll,"scroll",m.ReactEventListener.WINDOW_HANDLE):d===u.topFocus||d===u.topBlur?(c("focus",!0)?(m.ReactEventListener.trapCapturedEvent(u.topFocus,"focus",o),m.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",o)):c("focusin")&&(m.ReactEventListener.trapBubbledEvent(u.topFocus,"focusin",o),m.ReactEventListener.trapBubbledEvent(u.topBlur,"focusout",o)),i[u.topBlur]=!0,i[u.topFocus]=!0):f.hasOwnProperty(d)&&m.ReactEventListener.trapBubbledEvent(d,f[d],o),i[d]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!p){var e=s.refreshScrollValues;m.ReactEventListener.monitorScrollValue(e),p=!0}},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:o.putListener,getListener:o.getListener,deleteListener:o.deleteListener,deleteAllListeners:o.deleteAllListeners});t.exports=m},{"./EventConstants":16,"./EventPluginHub":18,"./EventPluginRegistry":19,"./Object.assign":27,"./ReactEventEmitterMixin":54,"./ViewportMetrics":94,"./isEventSupported":125}],31:[function(e,t){"use strict";function n(e,t){this.forEachFunction=e,this.forEachContext=t}function r(e,t,n,r){var o=e;o.forEachFunction.call(o.forEachContext,t,r)}function o(e,t,o){if(null==e)return e;var a=n.getPooled(t,o);p(e,r,a),n.release(a)}function a(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function i(e,t,n,r){var o=e,a=o.mapResult,i=!a.hasOwnProperty(n);if(i){var s=o.mapFunction.call(o.mapContext,t,r);a[n]=s}}function s(e,t,n){if(null==e)return e;var r={},o=a.getPooled(r,t,n);return p(e,i,o),a.release(o),r}function u(){return null}function c(e){return p(e,u,null)}var l=e("./PooledClass"),p=e("./traverseAllChildren"),d=(e("./warning"),l.twoArgumentPooler),f=l.threeArgumentPooler;l.addPoolingTo(n,d),l.addPoolingTo(a,f);var h={forEach:o,map:s,count:c};t.exports=h},{"./PooledClass":28,"./traverseAllChildren":140,"./warning":141}],32:[function(e,t){"use strict";var n=e("./ReactElement"),r=e("./ReactOwner"),o=e("./ReactUpdates"),a=e("./Object.assign"),i=e("./invariant"),s=e("./keyMirror"),u=s({MOUNTED:null,UNMOUNTED:null}),c=!1,l=null,p=null,d={injection:{injectEnvironment:function(e){i(!c),p=e.mountImageIntoNode,l=e.unmountIDFromEnvironment,d.BackendIDOperations=e.BackendIDOperations,c=!0}},LifeCycle:u,BackendIDOperations:null,Mixin:{isMounted:function(){return this._lifeCycleState===u.MOUNTED},setProps:function(e,t){var n=this._pendingElement||this._currentElement;this.replaceProps(a({},n.props,e),t)},replaceProps:function(e,t){i(this.isMounted()),i(0===this._mountDepth),this._pendingElement=n.cloneAndReplaceProps(this._pendingElement||this._currentElement,e),o.enqueueUpdate(this,t)},_setPropsInternal:function(e,t){var r=this._pendingElement||this._currentElement;this._pendingElement=n.cloneAndReplaceProps(r,a({},r.props,e)),o.enqueueUpdate(this,t)},construct:function(e){this.props=e.props,this._owner=e._owner,this._lifeCycleState=u.UNMOUNTED,this._pendingCallbacks=null,this._currentElement=e,this._pendingElement=null},mountComponent:function(e,t,n){i(!this.isMounted());var o=this._currentElement.ref;if(null!=o){var a=this._currentElement._owner;r.addComponentAsRefTo(this,o,a)}this._rootNodeID=e,this._lifeCycleState=u.MOUNTED,this._mountDepth=n},unmountComponent:function(){i(this.isMounted());var e=this._currentElement.ref;null!=e&&r.removeComponentAsRefFrom(this,e,this._owner),l(this._rootNodeID),this._rootNodeID=null,this._lifeCycleState=u.UNMOUNTED},receiveComponent:function(e,t){i(this.isMounted()),this._pendingElement=e,this.performUpdateIfNecessary(t)},performUpdateIfNecessary:function(e){if(null!=this._pendingElement){var t=this._currentElement,n=this._pendingElement;this._currentElement=n,this.props=n.props,this._owner=n._owner,this._pendingElement=null,this.updateComponent(e,t)}},updateComponent:function(e,t){var n=this._currentElement;(n._owner!==t._owner||n.ref!==t.ref)&&(null!=t.ref&&r.removeComponentAsRefFrom(this,t.ref,t._owner),null!=n.ref&&r.addComponentAsRefTo(this,n.ref,n._owner))},mountComponentIntoNode:function(e,t,n){var r=o.ReactReconcileTransaction.getPooled();r.perform(this._mountComponentIntoNode,this,e,t,r,n),o.ReactReconcileTransaction.release(r)},_mountComponentIntoNode:function(e,t,n,r){var o=this.mountComponent(e,n,0);p(o,t,r)},isOwnedBy:function(e){return this._owner===e},getSiblingByRef:function(e){var t=this._owner;return t&&t.refs?t.refs[e]:null}}};t.exports=d},{"./Object.assign":27,"./ReactElement":50,"./ReactOwner":65,"./ReactUpdates":77,"./invariant":124,"./keyMirror":130}],33:[function(e,t){"use strict";var n=e("./ReactDOMIDOperations"),r=e("./ReactMarkupChecksum"),o=e("./ReactMount"),a=e("./ReactPerf"),i=e("./ReactReconcileTransaction"),s=e("./getReactRootElementInContainer"),u=e("./invariant"),c=e("./setInnerHTML"),l=1,p=9,d={ReactReconcileTransaction:i,BackendIDOperations:n,unmountIDFromEnvironment:function(e){o.purgeID(e)},mountImageIntoNode:a.measure("ReactComponentBrowserEnvironment","mountImageIntoNode",function(e,t,n){if(u(t&&(t.nodeType===l||t.nodeType===p)),n){if(r.canReuseMarkup(e,s(t)))return;u(t.nodeType!==p)}u(t.nodeType!==p),c(t,e)})};t.exports=d},{"./ReactDOMIDOperations":41,"./ReactMarkupChecksum":60,"./ReactMount":61,"./ReactPerf":66,"./ReactReconcileTransaction":72,"./getReactRootElementInContainer":118,"./invariant":124,"./setInnerHTML":136}],34:[function(e,t){"use strict";function n(e){var t=e._owner||null;return t&&t.constructor&&t.constructor.displayName?" Check the render method of `"+t.constructor.displayName+"`.":""}function r(e,t){for(var n in t)t.hasOwnProperty(n)&&D("function"==typeof t[n])}function o(e,t){var n=S.hasOwnProperty(t)?S[t]:null;L.hasOwnProperty(t)&&D(n===N.OVERRIDE_BASE),e.hasOwnProperty(t)&&D(n===N.DEFINE_MANY||n===N.DEFINE_MANY_MERGED)}function a(e){var t=e._compositeLifeCycleState;D(e.isMounted()||t===A.MOUNTING),D(null==f.current),D(t!==A.UNMOUNTING)}function i(e,t){if(t){D(!g.isValidFactory(t)),D(!h.isValidElement(t));var n=e.prototype;t.hasOwnProperty(T)&&k.mixins(e,t.mixins);for(var r in t)if(t.hasOwnProperty(r)&&r!==T){var a=t[r];if(o(n,r),k.hasOwnProperty(r))k[r](e,a);else{var i=S.hasOwnProperty(r),s=n.hasOwnProperty(r),u=a&&a.__reactDontBind,p="function"==typeof a,d=p&&!i&&!s&&!u;if(d)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[r]=a,n[r]=a;else if(s){var f=S[r];D(i&&(f===N.DEFINE_MANY_MERGED||f===N.DEFINE_MANY)),f===N.DEFINE_MANY_MERGED?n[r]=c(n[r],a):f===N.DEFINE_MANY&&(n[r]=l(n[r],a))}else n[r]=a}}}}function s(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in k;D(!o);var a=n in e;D(!a),e[n]=r}}}function u(e,t){return D(e&&t&&"object"==typeof e&&"object"==typeof t),_(t,function(t,n){D(void 0===e[n]),e[n]=t}),e}function c(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);return null==n?r:null==r?n:u(n,r)}}function l(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}var p=e("./ReactComponent"),d=e("./ReactContext"),f=e("./ReactCurrentOwner"),h=e("./ReactElement"),m=(e("./ReactElementValidator"),e("./ReactEmptyComponent")),v=e("./ReactErrorUtils"),g=e("./ReactLegacyElement"),y=e("./ReactOwner"),E=e("./ReactPerf"),C=e("./ReactPropTransferer"),R=e("./ReactPropTypeLocations"),M=(e("./ReactPropTypeLocationNames"),e("./ReactUpdates")),b=e("./Object.assign"),O=e("./instantiateReactComponent"),D=e("./invariant"),x=e("./keyMirror"),P=e("./keyOf"),_=(e("./monitorCodeUse"),e("./mapObject")),w=e("./shouldUpdateReactComponent"),T=(e("./warning"),P({mixins:null})),N=x({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),I=[],S={mixins:N.DEFINE_MANY,statics:N.DEFINE_MANY,propTypes:N.DEFINE_MANY,contextTypes:N.DEFINE_MANY,childContextTypes:N.DEFINE_MANY,getDefaultProps:N.DEFINE_MANY_MERGED,getInitialState:N.DEFINE_MANY_MERGED,getChildContext:N.DEFINE_MANY_MERGED,render:N.DEFINE_ONCE,componentWillMount:N.DEFINE_MANY,componentDidMount:N.DEFINE_MANY,componentWillReceiveProps:N.DEFINE_MANY,shouldComponentUpdate:N.DEFINE_ONCE,componentWillUpdate:N.DEFINE_MANY,componentDidUpdate:N.DEFINE_MANY,componentWillUnmount:N.DEFINE_MANY,updateComponent:N.OVERRIDE_BASE},k={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t)+o}),_createOpenTagMarkupAndPutListeners:function(e){var t=this.props,n="<"+this._tag;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];if(null!=a)if(R.hasOwnProperty(o))r(this._rootNodeID,o,a,e);else{o===b&&(a&&(a=t.style=m({},t.style)),a=i.createMarkupForStyles(a));var s=u.createMarkupForProperty(o,a);s&&(n+=" "+s)}}if(e.renderToStaticMarkup)return n+">";var c=u.createMarkupForID(this._rootNodeID);return n+" "+c+">"},_createContentMarkup:function(e){var t=this.props.dangerouslySetInnerHTML;if(null!=t){if(null!=t.__html)return t.__html}else{var n=M[typeof this.props.children]?this.props.children:null,r=null!=n?null:this.props.children;if(null!=n)return v(n);if(null!=r){var o=this.mountChildren(r,e);return o.join("")}}return""},receiveComponent:function(e,t){(e!==this._currentElement||null==e._owner)&&l.Mixin.receiveComponent.call(this,e,t)},updateComponent:h.measure("ReactDOMComponent","updateComponent",function(e,t){n(this._currentElement.props),l.Mixin.updateComponent.call(this,e,t),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e)}),_updateDOMProperties:function(e,t){var n,o,a,i=this.props;for(n in e)if(!i.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===b){var u=e[n];for(o in u)u.hasOwnProperty(o)&&(a=a||{},a[o]="")}else R.hasOwnProperty(n)?E(this._rootNodeID,n):(s.isStandardName[n]||s.isCustomAttribute(n))&&l.BackendIDOperations.deletePropertyByID(this._rootNodeID,n);for(n in i){var c=i[n],p=e[n];if(i.hasOwnProperty(n)&&c!==p)if(n===b)if(c&&(c=i.style=m({},c)),p){for(o in p)!p.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(a=a||{},a[o]="");for(o in c)c.hasOwnProperty(o)&&p[o]!==c[o]&&(a=a||{},a[o]=c[o])}else a=c;else R.hasOwnProperty(n)?r(this._rootNodeID,n,c,t):(s.isStandardName[n]||s.isCustomAttribute(n))&&l.BackendIDOperations.updatePropertyByID(this._rootNodeID,n,c)}a&&l.BackendIDOperations.updateStylesByID(this._rootNodeID,a)},_updateDOMChildren:function(e,t){var n=this.props,r=M[typeof e.children]?e.children:null,o=M[typeof n.children]?n.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,i=n.dangerouslySetInnerHTML&&n.dangerouslySetInnerHTML.__html,s=null!=r?null:e.children,u=null!=o?null:n.children,c=null!=r||null!=a,p=null!=o||null!=i;null!=s&&null==u?this.updateChildren(null,t):c&&!p&&this.updateTextContent(""),null!=o?r!==o&&this.updateTextContent(""+o):null!=i?a!==i&&l.BackendIDOperations.updateInnerHTMLByID(this._rootNodeID,i):null!=u&&this.updateChildren(u,t)},unmountComponent:function(){this.unmountChildren(),p.deleteAllListeners(this._rootNodeID),l.Mixin.unmountComponent.call(this)}},m(a.prototype,l.Mixin,a.Mixin,f.Mixin,c),t.exports=a},{"./CSSPropertyOperations":5,"./DOMProperty":11,"./DOMPropertyOperations":12,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactBrowserEventEmitter":30,"./ReactComponent":32,"./ReactMount":61,"./ReactMultiChild":62,"./ReactPerf":66,"./escapeTextForBrowser":107,"./invariant":124,"./isEventSupported":125,"./keyOf":131,"./monitorCodeUse":134}],40:[function(e,t){"use strict";var n=e("./EventConstants"),r=e("./LocalEventTrapMixin"),o=e("./ReactBrowserComponentMixin"),a=e("./ReactCompositeComponent"),i=e("./ReactElement"),s=e("./ReactDOM"),u=i.createFactory(s.form.type),c=a.createClass({displayName:"ReactDOMForm",mixins:[o,r],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(n.topLevelTypes.topSubmit,"submit")}});t.exports=c},{"./EventConstants":16,"./LocalEventTrapMixin":25,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50}],41:[function(e,t){"use strict";var n=e("./CSSPropertyOperations"),r=e("./DOMChildrenOperations"),o=e("./DOMPropertyOperations"),a=e("./ReactMount"),i=e("./ReactPerf"),s=e("./invariant"),u=e("./setInnerHTML"),c={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},l={updatePropertyByID:i.measure("ReactDOMIDOperations","updatePropertyByID",function(e,t,n){var r=a.getNode(e);s(!c.hasOwnProperty(t)),null!=n?o.setValueForProperty(r,t,n):o.deleteValueForProperty(r,t)}),deletePropertyByID:i.measure("ReactDOMIDOperations","deletePropertyByID",function(e,t,n){var r=a.getNode(e);s(!c.hasOwnProperty(t)),o.deleteValueForProperty(r,t,n)}),updateStylesByID:i.measure("ReactDOMIDOperations","updateStylesByID",function(e,t){var r=a.getNode(e);n.setValueForStyles(r,t)}),updateInnerHTMLByID:i.measure("ReactDOMIDOperations","updateInnerHTMLByID",function(e,t){var n=a.getNode(e);u(n,t)}),updateTextContentByID:i.measure("ReactDOMIDOperations","updateTextContentByID",function(e,t){var n=a.getNode(e);r.updateTextContent(n,t)}),dangerouslyReplaceNodeWithMarkupByID:i.measure("ReactDOMIDOperations","dangerouslyReplaceNodeWithMarkupByID",function(e,t){var n=a.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)}),dangerouslyProcessChildrenUpdates:i.measure("ReactDOMIDOperations","dangerouslyProcessChildrenUpdates",function(e,t){for(var n=0;nc;c++){var h=u[c];if(h!==i&&h.form===i.form){var v=l.getID(h);f(v);var g=m[v];f(g),p.asap(n,g)}}}return t}});t.exports=v},{"./AutoFocusMixin":2,"./DOMPropertyOperations":12,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./ReactMount":61,"./ReactUpdates":77,"./invariant":124}],44:[function(e,t){"use strict";var n=e("./ReactBrowserComponentMixin"),r=e("./ReactCompositeComponent"),o=e("./ReactElement"),a=e("./ReactDOM"),i=(e("./warning"),o.createFactory(a.option.type)),s=r.createClass({displayName:"ReactDOMOption",mixins:[n],componentWillMount:function(){},render:function(){return i(this.props,this.props.children)}});t.exports=s},{"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./warning":141}],45:[function(e,t){"use strict";function n(){this.isMounted()&&(this.setState({value:this._pendingValue}),this._pendingValue=0)}function r(e,t){if(null!=e[t])if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to must be a scalar value if `multiple` is false.")}function o(e,t){var n,r,o,a=e.props.multiple,i=null!=t?t:e.state.value,s=e.getDOMNode().options;if(a)for(n={},r=0,o=i.length;o>r;++r)n[""+i[r]]=!0;else n=""+i;for(r=0,o=s.length;o>r;r++){var u=a?n.hasOwnProperty(s[r].value):s[r].value===n;u!==s[r].selected&&(s[r].selected=u)}}var a=e("./AutoFocusMixin"),i=e("./LinkedValueUtils"),s=e("./ReactBrowserComponentMixin"),u=e("./ReactCompositeComponent"),c=e("./ReactElement"),l=e("./ReactDOM"),p=e("./ReactUpdates"),d=e("./Object.assign"),f=c.createFactory(l.select.type),h=u.createClass({displayName:"ReactDOMSelect",mixins:[a,i.Mixin,s],propTypes:{defaultValue:r,value:r},getInitialState:function(){return{value:this.props.defaultValue||(this.props.multiple?[]:"")}},componentWillMount:function(){this._pendingValue=null},componentWillReceiveProps:function(e){!this.props.multiple&&e.multiple?this.setState({value:[this.state.value]}):this.props.multiple&&!e.multiple&&this.setState({value:this.state.value[0]}) -},render:function(){var e=d({},this.props);return e.onChange=this._handleChange,e.value=null,f(e,this.props.children)},componentDidMount:function(){o(this,i.getValue(this))},componentDidUpdate:function(e){var t=i.getValue(this),n=!!e.multiple,r=!!this.props.multiple;(null!=t||n!==r)&&o(this,t)},_handleChange:function(e){var t,r=i.getOnChange(this);r&&(t=r.call(this,e));var o;if(this.props.multiple){o=[];for(var a=e.target.options,s=0,u=a.length;u>s;s++)a[s].selected&&o.push(a[s].value)}else o=e.target.value;return this._pendingValue=o,p.asap(n,this),t}});t.exports=h},{"./AutoFocusMixin":2,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./ReactUpdates":77}],46:[function(e,t){"use strict";function n(e,t,n,r){return e===n&&t===r}function r(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var a=o.text.length,i=a+r;return{start:a,end:i}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var r=t.anchorNode,o=t.anchorOffset,a=t.focusNode,i=t.focusOffset,s=t.getRangeAt(0),u=n(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),c=u?0:s.toString().length,l=s.cloneRange();l.selectNodeContents(e),l.setEnd(s.startContainer,s.startOffset);var p=n(l.startContainer,l.startOffset,l.endContainer,l.endOffset),d=p?0:l.toString().length,f=d+c,h=document.createRange();h.setStart(r,o),h.setEnd(a,i);var m=h.collapsed;return{start:m?f:d,end:m?d:f}}function a(e,t){var n,r,o=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function i(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),a="undefined"==typeof t.end?o:Math.min(t.end,r);if(!n.extend&&o>a){var i=a;a=o,o=i}var s=u(e,o),l=u(e,a);if(s&&l){var p=document.createRange();p.setStart(s.node,s.offset),n.removeAllRanges(),o>a?(n.addRange(p),n.extend(l.node,l.offset)):(p.setEnd(l.node,l.offset),n.addRange(p))}}}var s=e("./ExecutionEnvironment"),u=e("./getNodeForCharacterOffset"),c=e("./getTextContentAccessor"),l=s.canUseDOM&&document.selection,p={getOffsets:l?r:o,setOffsets:l?a:i};t.exports=p},{"./ExecutionEnvironment":22,"./getNodeForCharacterOffset":117,"./getTextContentAccessor":119}],47:[function(e,t){"use strict";function n(){this.isMounted()&&this.forceUpdate()}var r=e("./AutoFocusMixin"),o=e("./DOMPropertyOperations"),a=e("./LinkedValueUtils"),i=e("./ReactBrowserComponentMixin"),s=e("./ReactCompositeComponent"),u=e("./ReactElement"),c=e("./ReactDOM"),l=e("./ReactUpdates"),p=e("./Object.assign"),d=e("./invariant"),f=(e("./warning"),u.createFactory(c.textarea.type)),h=s.createClass({displayName:"ReactDOMTextarea",mixins:[r,a.Mixin,i],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(d(null==e),Array.isArray(t)&&(d(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var n=a.getValue(this);return{initialValue:""+(null!=n?n:e)}},render:function(){var e=p({},this.props);return d(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,f(e,this.state.initialValue)},componentDidUpdate:function(){var e=a.getValue(this);if(null!=e){var t=this.getDOMNode();o.setValueForProperty(t,"value",""+e)}},_handleChange:function(e){var t,r=a.getOnChange(this);return r&&(t=r.call(this,e)),l.asap(n,this),t}});t.exports=h},{"./AutoFocusMixin":2,"./DOMPropertyOperations":12,"./LinkedValueUtils":24,"./Object.assign":27,"./ReactBrowserComponentMixin":29,"./ReactCompositeComponent":34,"./ReactDOM":37,"./ReactElement":50,"./ReactUpdates":77,"./invariant":124,"./warning":141}],48:[function(e,t){"use strict";function n(){this.reinitializeTransaction()}var r=e("./ReactUpdates"),o=e("./Transaction"),a=e("./Object.assign"),i=e("./emptyFunction"),s={initialize:i,close:function(){p.isBatchingUpdates=!1}},u={initialize:i,close:r.flushBatchedUpdates.bind(r)},c=[u,s];a(n.prototype,o.Mixin,{getTransactionWrappers:function(){return c}});var l=new n,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n){var r=p.isBatchingUpdates;p.isBatchingUpdates=!0,r?e(t,n):l.perform(e,null,t,n)}};t.exports=p},{"./Object.assign":27,"./ReactUpdates":77,"./Transaction":93,"./emptyFunction":105}],49:[function(e,t){"use strict";function n(){O.EventEmitter.injectReactEventListener(b),O.EventPluginHub.injectEventPluginOrder(s),O.EventPluginHub.injectInstanceHandle(D),O.EventPluginHub.injectMount(x),O.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:w,EnterLeaveEventPlugin:u,ChangeEventPlugin:o,CompositionEventPlugin:i,MobileSafariClickEventPlugin:p,SelectEventPlugin:P,BeforeInputEventPlugin:r}),O.NativeComponent.injectGenericComponentClass(m),O.NativeComponent.injectComponentClasses({button:v,form:g,img:y,input:E,option:C,select:R,textarea:M,html:N("html"),head:N("head"),body:N("body")}),O.CompositeComponent.injectMixin(d),O.DOMProperty.injectDOMPropertyConfig(l),O.DOMProperty.injectDOMPropertyConfig(T),O.EmptyComponent.injectEmptyComponent("noscript"),O.Updates.injectReconcileTransaction(f.ReactReconcileTransaction),O.Updates.injectBatchingStrategy(h),O.RootIndex.injectCreateReactRootIndex(c.canUseDOM?a.createReactRootIndex:_.createReactRootIndex),O.Component.injectEnvironment(f)}var r=e("./BeforeInputEventPlugin"),o=e("./ChangeEventPlugin"),a=e("./ClientReactRootIndex"),i=e("./CompositionEventPlugin"),s=e("./DefaultEventPluginOrder"),u=e("./EnterLeaveEventPlugin"),c=e("./ExecutionEnvironment"),l=e("./HTMLDOMPropertyConfig"),p=e("./MobileSafariClickEventPlugin"),d=e("./ReactBrowserComponentMixin"),f=e("./ReactComponentBrowserEnvironment"),h=e("./ReactDefaultBatchingStrategy"),m=e("./ReactDOMComponent"),v=e("./ReactDOMButton"),g=e("./ReactDOMForm"),y=e("./ReactDOMImg"),E=e("./ReactDOMInput"),C=e("./ReactDOMOption"),R=e("./ReactDOMSelect"),M=e("./ReactDOMTextarea"),b=e("./ReactEventListener"),O=e("./ReactInjection"),D=e("./ReactInstanceHandles"),x=e("./ReactMount"),P=e("./SelectEventPlugin"),_=e("./ServerReactRootIndex"),w=e("./SimpleEventPlugin"),T=e("./SVGDOMPropertyConfig"),N=e("./createFullPageComponent");t.exports={inject:n}},{"./BeforeInputEventPlugin":3,"./ChangeEventPlugin":7,"./ClientReactRootIndex":8,"./CompositionEventPlugin":9,"./DefaultEventPluginOrder":14,"./EnterLeaveEventPlugin":15,"./ExecutionEnvironment":22,"./HTMLDOMPropertyConfig":23,"./MobileSafariClickEventPlugin":26,"./ReactBrowserComponentMixin":29,"./ReactComponentBrowserEnvironment":33,"./ReactDOMButton":38,"./ReactDOMComponent":39,"./ReactDOMForm":40,"./ReactDOMImg":42,"./ReactDOMInput":43,"./ReactDOMOption":44,"./ReactDOMSelect":45,"./ReactDOMTextarea":47,"./ReactDefaultBatchingStrategy":48,"./ReactEventListener":55,"./ReactInjection":56,"./ReactInstanceHandles":58,"./ReactMount":61,"./SVGDOMPropertyConfig":78,"./SelectEventPlugin":79,"./ServerReactRootIndex":80,"./SimpleEventPlugin":81,"./createFullPageComponent":101}],50:[function(e,t){"use strict";var n=e("./ReactContext"),r=e("./ReactCurrentOwner"),o=(e("./warning"),{key:!0,ref:!0}),a=function(e,t,n,r,o,a){this.type=e,this.key=t,this.ref=n,this._owner=r,this._context=o,this.props=a};a.prototype={_isReactElement:!0},a.createElement=function(e,t,i){var s,u={},c=null,l=null;if(null!=t){l=void 0===t.ref?null:t.ref,c=null==t.key?null:""+t.key;for(s in t)t.hasOwnProperty(s)&&!o.hasOwnProperty(s)&&(u[s]=t[s])}var p=arguments.length-2;if(1===p)u.children=i;else if(p>1){for(var d=Array(p),f=0;p>f;f++)d[f]=arguments[f+2];u.children=d}if(e&&e.defaultProps){var h=e.defaultProps;for(s in h)"undefined"==typeof u[s]&&(u[s]=h[s])}return new a(e,c,l,r.current,n.current,u)},a.createFactory=function(e){var t=a.createElement.bind(null,e);return t.type=e,t},a.cloneAndReplaceProps=function(e,t){var n=new a(e.type,e.key,e.ref,e._owner,e._context,t);return n},a.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},t.exports=a},{"./ReactContext":35,"./ReactCurrentOwner":36,"./warning":141}],51:[function(e,t){"use strict";function n(){var e=p.current;return e&&e.constructor.displayName||void 0}function r(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,a("react_key_warning",'Each child in an array should have a unique "key" prop.',e,t))}function o(e,t,n){v.test(e)&&a("react_numeric_key_warning","Child objects should have non-numeric keys so ordering is preserved.",t,n)}function a(e,t,r,o){var a=n(),i=o.displayName,s=a||i,u=f[e];if(!u.hasOwnProperty(s)){u[s]=!0,t+=a?" Check the render method of "+a+".":" Check the renderComponent call using <"+i+">.";var c=null;r._owner&&r._owner!==p.current&&(c=r._owner.constructor.displayName,t+=" It was passed a child from "+c+"."),t+=" See http://fb.me/react-warning-keys for more information.",d(e,{component:s,componentOwner:c}),console.warn(t)}}function i(){var e=n()||"";h.hasOwnProperty(e)||(h[e]=!0,d("react_object_map_children"))}function s(e,t){if(Array.isArray(e))for(var n=0;no;o++){t=e.ancestors[o];var i=l.getID(t)||"";m._handleTopLevel(e.topLevelType,t,i,e.nativeEvent)}}function a(e){var t=h(window);e(t)}var i=e("./EventListener"),s=e("./ExecutionEnvironment"),u=e("./PooledClass"),c=e("./ReactInstanceHandles"),l=e("./ReactMount"),p=e("./ReactUpdates"),d=e("./Object.assign"),f=e("./getEventTarget"),h=e("./getUnboundedScrollPosition");d(r.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),u.addPoolingTo(r,u.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:s.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?i.listen(r,t,m.dispatchEvent.bind(null,e)):void 0},trapCapturedEvent:function(e,t,n){var r=n;return r?i.capture(r,t,m.dispatchEvent.bind(null,e)):void 0},monitorScrollValue:function(e){var t=a.bind(null,e);i.listen(window,"scroll",t),i.listen(window,"resize",t)},dispatchEvent:function(e,t){if(m._enabled){var n=r.getPooled(e,t);try{p.batchedUpdates(o,n)}finally{r.release(n)}}}};t.exports=m},{"./EventListener":17,"./ExecutionEnvironment":22,"./Object.assign":27,"./PooledClass":28,"./ReactInstanceHandles":58,"./ReactMount":61,"./ReactUpdates":77,"./getEventTarget":115,"./getUnboundedScrollPosition":120}],56:[function(e,t){"use strict";var n=e("./DOMProperty"),r=e("./EventPluginHub"),o=e("./ReactComponent"),a=e("./ReactCompositeComponent"),i=e("./ReactEmptyComponent"),s=e("./ReactBrowserEventEmitter"),u=e("./ReactNativeComponent"),c=e("./ReactPerf"),l=e("./ReactRootIndex"),p=e("./ReactUpdates"),d={Component:o.injection,CompositeComponent:a.injection,DOMProperty:n.injection,EmptyComponent:i.injection,EventPluginHub:r.injection,EventEmitter:s.injection,NativeComponent:u.injection,Perf:c.injection,RootIndex:l.injection,Updates:p.injection};t.exports=d},{"./DOMProperty":11,"./EventPluginHub":18,"./ReactBrowserEventEmitter":30,"./ReactComponent":32,"./ReactCompositeComponent":34,"./ReactEmptyComponent":52,"./ReactNativeComponent":64,"./ReactPerf":66,"./ReactRootIndex":73,"./ReactUpdates":77}],57:[function(e,t){"use strict";function n(e){return o(document.documentElement,e)}var r=e("./ReactDOMSelection"),o=e("./containsNode"),a=e("./focusNode"),i=e("./getActiveElement"),s={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=i();return{focusedElem:e,selectionRange:s.hasSelectionCapabilities(e)?s.getSelection(e):null}},restoreSelection:function(e){var t=i(),r=e.focusedElem,o=e.selectionRange;t!==r&&n(r)&&(s.hasSelectionCapabilities(r)&&s.setSelection(r,o),a(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if("undefined"==typeof o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var a=e.createTextRange();a.collapse(!0),a.moveStart("character",n),a.moveEnd("character",o-n),a.select()}else r.setOffsets(e,t)}};t.exports=s},{"./ReactDOMSelection":46,"./containsNode":99,"./focusNode":109,"./getActiveElement":111}],58:[function(e,t){"use strict";function n(e){return d+e.toString(36)}function r(e,t){return e.charAt(t)===d||t===e.length}function o(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function a(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function i(e){return e?e.substr(0,e.lastIndexOf(d)):""}function s(e,t){if(p(o(e)&&o(t)),p(a(e,t)),e===t)return e;for(var n=e.length+f,i=n;i=i;i++)if(r(e,i)&&r(t,i))a=i;else if(e.charAt(i)!==t.charAt(i))break;var s=e.substr(0,a);return p(o(s)),s}function c(e,t,n,r,o,u){e=e||"",t=t||"",p(e!==t);var c=a(t,e);p(c||a(e,t));for(var l=0,d=c?i:s,f=e;;f=d(f,t)){var m;if(o&&f===e||u&&f===t||(m=n(f,c,r)),m===!1||f===t)break;p(l++1){var t=e.indexOf(d,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var a=u(e,t);a!==e&&c(e,a,n,r,!1,!0),a!==t&&c(a,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},_getFirstCommonAncestorID:u,_getNextDescendantID:s,isAncestorIDOf:a,SEPARATOR:d};t.exports=m},{"./ReactRootIndex":73,"./invariant":124}],59:[function(e,t){"use strict";function n(e,t){if("function"==typeof t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if("function"==typeof r){var o=r.bind(t);for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);e[n]=o}else e[n]=r}}var r=(e("./ReactCurrentOwner"),e("./invariant")),o=(e("./monitorCodeUse"),e("./warning"),{}),a={},i={};i.wrapCreateFactory=function(e){var t=function(t){return"function"!=typeof t?e(t):t.isReactNonLegacyFactory?e(t.type):t.isReactLegacyFactory?e(t.type):t};return t},i.wrapCreateElement=function(e){var t=function(t){if("function"!=typeof t)return e.apply(this,arguments);var n;return t.isReactNonLegacyFactory?(n=Array.prototype.slice.call(arguments,0),n[0]=t.type,e.apply(this,n)):t.isReactLegacyFactory?(t._isMockFunction&&(t.type._mockedReactClassConstructor=t),n=Array.prototype.slice.call(arguments,0),n[0]=t.type,e.apply(this,n)):t.apply(null,Array.prototype.slice.call(arguments,1))};return t},i.wrapFactory=function(e){r("function"==typeof e);var t=function(){return e.apply(this,arguments)};return n(t,e.type),t.isReactLegacyFactory=o,t.type=e.type,t},i.markNonLegacyFactory=function(e){return e.isReactNonLegacyFactory=a,e},i.isValidFactory=function(e){return"function"==typeof e&&e.isReactLegacyFactory===o},i.isValidClass=function(e){return i.isValidFactory(e)},i._isLegacyCallWarningEnabled=!0,t.exports=i},{"./ReactCurrentOwner":36,"./invariant":124,"./monitorCodeUse":134,"./warning":141}],60:[function(e,t){"use strict";var n=e("./adler32"),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var o=t.getAttribute(r.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var a=n(e);return a===o}};t.exports=r},{"./adler32":96}],61:[function(e,t){"use strict";function n(e){var t=E(e);return t&&S.getID(t)}function r(e){var t=o(e);if(t)if(x.hasOwnProperty(t)){var n=x[t];n!==e&&(R(!s(n,t)),x[t]=e)}else x[t]=e;return t}function o(e){return e&&e.getAttribute&&e.getAttribute(D)||""}function a(e,t){var n=o(e);n!==t&&delete x[n],e.setAttribute(D,t),x[t]=e}function i(e){return x.hasOwnProperty(e)&&s(x[e],e)||(x[e]=S.findReactNodeByID(e)),x[e]}function s(e,t){if(e){R(o(e)===t);var n=S.findReactContainerForID(t);if(n&&g(n,e))return!0}return!1}function u(e){delete x[e]}function c(e){var t=x[e];return t&&s(t,e)?void(I=t):!1}function l(e){I=null,m.traverseAncestors(e,c);var t=I;return I=null,t}var p=e("./DOMProperty"),d=e("./ReactBrowserEventEmitter"),f=(e("./ReactCurrentOwner"),e("./ReactElement")),h=e("./ReactLegacyElement"),m=e("./ReactInstanceHandles"),v=e("./ReactPerf"),g=e("./containsNode"),y=e("./deprecated"),E=e("./getReactRootElementInContainer"),C=e("./instantiateReactComponent"),R=e("./invariant"),M=e("./shouldUpdateReactComponent"),b=(e("./warning"),h.wrapCreateElement(f.createElement)),O=m.SEPARATOR,D=p.ID_ATTRIBUTE_NAME,x={},P=1,_=9,w={},T={},N=[],I=null,S={_instancesByReactRootID:w,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){var o=t.props;return S.scrollMonitor(n,function(){e.replaceProps(o,r)}),e},_registerComponent:function(e,t){R(t&&(t.nodeType===P||t.nodeType===_)),d.ensureScrollValueMonitoring();var n=S.registerContainer(t);return w[n]=e,n},_renderNewRootComponent:v.measure("ReactMount","_renderNewRootComponent",function(e,t,n){var r=C(e,null),o=S._registerComponent(r,t);return r.mountComponentIntoNode(o,t,n),r}),render:function(e,t,r){R(f.isValidElement(e));var o=w[n(t)];if(o){var a=o._currentElement;if(M(a,e))return S._updateRootComponent(o,e,t,r);S.unmountComponentAtNode(t)}var i=E(t),s=i&&S.isRenderedByReact(i),u=s&&!o,c=S._renderNewRootComponent(e,t,u);return r&&r.call(c),c},constructAndRenderComponent:function(e,t,n){var r=b(e,t);return S.render(r,n)},constructAndRenderComponentByID:function(e,t,n){var r=document.getElementById(n);return R(r),S.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=n(e);return t&&(t=m.getReactRootIDFromNodeID(t)),t||(t=m.createReactRootID()),T[t]=e,t},unmountComponentAtNode:function(e){var t=n(e),r=w[t];return r?(S.unmountComponentFromNode(r,e),delete w[t],delete T[t],!0):!1},unmountComponentFromNode:function(e,t){for(e.unmountComponent(),t.nodeType===_&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=m.getReactRootIDFromNodeID(e),n=T[t];return n},findReactNodeByID:function(e){var t=S.findReactContainerForID(e);return S.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=S.getID(e);return t?t.charAt(0)===O:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(S.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=N,r=0,o=l(t)||e;for(n[0]=o.firstChild,n.length=1;r>",R=i(),M=p(),b={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:o(),arrayOf:a,element:R,instanceOf:s,node:M,objectOf:c,oneOf:u,oneOfType:l,shape:d,component:y("React.PropTypes","component","element",this,R),renderable:y("React.PropTypes","renderable","node",this,M)};t.exports=b},{"./ReactElement":50,"./ReactPropTypeLocationNames":68,"./deprecated":104,"./emptyFunction":105}],71:[function(e,t){"use strict";function n(){this.listenersToPut=[]}var r=e("./PooledClass"),o=e("./ReactBrowserEventEmitter"),a=e("./Object.assign");a(n.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;e"+a+""},receiveComponent:function(e){var t=e.props;t!==this.props&&(this.props=t,r.BackendIDOperations.updateTextContentByID(this._rootNodeID,t))}});var u=function(e){return new o(s,null,null,null,null,e)};u.type=s,t.exports=u},{"./DOMPropertyOperations":12,"./Object.assign":27,"./ReactComponent":32,"./ReactElement":50,"./escapeTextForBrowser":107}],77:[function(e,t){"use strict";function n(){h(O.ReactReconcileTransaction&&y)}function r(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=O.ReactReconcileTransaction.getPooled()}function o(e,t,r){n(),y.batchedUpdates(e,t,r)}function a(e,t){return e._mountDepth-t._mountDepth}function i(e){var t=e.dirtyComponentsLength;h(t===m.length),m.sort(a);for(var n=0;t>n;n++){var r=m[n];if(r.isMounted()){var o=r._pendingCallbacks;if(r._pendingCallbacks=null,r.performUpdateIfNecessary(e.reconcileTransaction),o)for(var i=0;i":">","<":"<",'"':""","'":"'"},a=/[&><"']/g;t.exports=r},{}],108:[function(e,t){"use strict";function n(e,t,n){var r=e,a=!r.hasOwnProperty(n);if(a&&null!=t){var i,s=typeof t;i="string"===s?o(t):"number"===s?o(""+t):t,r[n]=i}}function r(e){if(null==e)return e;var t={};return a(e,n,t),t}{var o=e("./ReactTextComponent"),a=e("./traverseAllChildren");e("./warning")}t.exports=r},{"./ReactTextComponent":76,"./traverseAllChildren":140,"./warning":141}],109:[function(e,t){"use strict";function n(e){try{e.focus()}catch(t){}}t.exports=n},{}],110:[function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=n},{}],111:[function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],112:[function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=n},{}],113:[function(e,t){"use strict";function n(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var r=e("./getEventCharCode"),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=n},{"./getEventCharCode":112}],114:[function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function r(){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],115:[function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=n},{}],116:[function(e,t){function n(e){return o(!!a),p.hasOwnProperty(e)||(e="*"),i.hasOwnProperty(e)||(a.innerHTML="*"===e?"":"<"+e+">",i[e]=!a.firstChild),i[e]?p[e]:null}var r=e("./ExecutionEnvironment"),o=e("./invariant"),a=r.canUseDOM?document.createElement("div"):null,i={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},s=[1,'"],u=[1,"","
    "],c=[3,"","
    "],l=[1,"",""],p={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:s,option:s,caption:u,colgroup:u,tbody:u,tfoot:u,thead:u,td:c,th:c,circle:l,defs:l,ellipse:l,g:l,line:l,linearGradient:l,path:l,polygon:l,polyline:l,radialGradient:l,rect:l,stop:l,text:l};t.exports=n},{"./ExecutionEnvironment":22,"./invariant":124}],117:[function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var o=n(e),a=0,i=0;o;){if(3==o.nodeType){if(i=a+o.textContent.length,t>=a&&i>=t)return{node:o,offset:t-a};a=i}o=n(r(o))}}t.exports=o},{}],118:[function(e,t){"use strict";function n(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;t.exports=n},{}],119:[function(e,t){"use strict";function n(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var r=e("./ExecutionEnvironment"),o=null;t.exports=n},{"./ExecutionEnvironment":22}],120:[function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],121:[function(e,t){function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=n},{}],122:[function(e,t){"use strict";function n(e){return r(e).replace(o,"-ms-")}var r=e("./hyphenate"),o=/^ms-/;t.exports=n},{"./hyphenate":121}],123:[function(e,t){"use strict";function n(e,t){var n;return n="string"==typeof e.type?r.createInstanceForTag(e.type,e.props,t):new e.type(e.props),n.construct(e),n}{var r=(e("./warning"),e("./ReactElement"),e("./ReactLegacyElement"),e("./ReactNativeComponent"));e("./ReactEmptyComponent")}t.exports=n},{"./ReactElement":50,"./ReactEmptyComponent":52,"./ReactLegacyElement":59,"./ReactNativeComponent":64,"./warning":141}],124:[function(e,t){"use strict";var n=function(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,a,i,s],l=0;u=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return c[l++]}))}throw u.framesToPop=1,u}};t.exports=n},{}],125:[function(e,t){"use strict";function n(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,a=n in document;if(!a){var i=document.createElement("div");i.setAttribute(n,"return;"),a="function"==typeof i[n]}return!a&&r&&"wheel"===e&&(a=document.implementation.hasFeature("Events.wheel","3.0")),a}var r,o=e("./ExecutionEnvironment");o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=n},{"./ExecutionEnvironment":22}],126:[function(e,t){function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],127:[function(e,t){"use strict";function n(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=n},{}],128:[function(e,t){function n(e){return r(e)&&3==e.nodeType}var r=e("./isNode");t.exports=n},{"./isNode":126}],129:[function(e,t){"use strict";function n(e){e||(e="");var t,n=arguments.length;if(n>1)for(var r=1;n>r;r++)t=arguments[r],t&&(e=(e?e+" ":"")+t);return e}t.exports=n},{}],130:[function(e,t){"use strict";var n=e("./invariant"),r=function(e){var t,r={};n(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};t.exports=r},{"./invariant":124}],131:[function(e,t){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=n},{}],132:[function(e,t){"use strict";function n(e,t,n){if(!e)return null;var o={};for(var a in e)r.call(e,a)&&(o[a]=t.call(n,e[a],a,e));return o}var r=Object.prototype.hasOwnProperty;t.exports=n},{}],133:[function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)?t[n]:t[n]=e.call(this,n)}}t.exports=n},{}],134:[function(e,t){"use strict";function n(e){r(e&&!/[^a-z0-9_]/.test(e))}var r=e("./invariant");t.exports=n},{"./invariant":124}],135:[function(e,t){"use strict";function n(e){return o(r.isValidElement(e)),e}var r=e("./ReactElement"),o=e("./invariant");t.exports=n},{"./ReactElement":50,"./invariant":124}],136:[function(e,t){"use strict";var n=e("./ExecutionEnvironment"),r=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if(n.canUseDOM){var i=document.createElement("div");i.innerHTML=" ",""===i.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),r.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=""+t; -var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=a},{"./ExecutionEnvironment":22}],137:[function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=n},{}],138:[function(e,t){"use strict";function n(e,t){return e&&t&&e.type===t.type&&e.key===t.key&&e._owner===t._owner?!0:!1}t.exports=n},{}],139:[function(e,t){function n(e){var t=e.length;if(r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),r("number"==typeof t),r(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var o=Array(t),a=0;t>a;a++)o[a]=e[a];return o}var r=e("./invariant");t.exports=n},{"./invariant":124}],140:[function(e,t){"use strict";function n(e){return d[e]}function r(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function o(e){return(""+e).replace(f,n)}function a(e){return"$"+o(e)}function i(e,t,n){return null==e?0:h(e,"",0,t,n)}var s=e("./ReactElement"),u=e("./ReactInstanceHandles"),c=e("./invariant"),l=u.SEPARATOR,p=":",d={"=":"=0",".":"=1",":":"=2"},f=/[=.:]/g,h=function(e,t,n,o,i){var u,d,f=0;if(Array.isArray(e))for(var m=0;m8&&11>=_),M=32,N=String.fromCharCode(M),I=d.topLevelTypes,T={beforeInput:{phasedRegistrationNames:{bubbled:y({onBeforeInput:null}),captured:y({onBeforeInputCapture:null})},dependencies:[I.topCompositionEnd,I.topKeyPress,I.topTextInput,I.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:y({onCompositionEnd:null}),captured:y({onCompositionEndCapture:null})},dependencies:[I.topBlur,I.topCompositionEnd,I.topKeyDown,I.topKeyPress,I.topKeyUp,I.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:y({onCompositionStart:null}),captured:y({onCompositionStartCapture:null})},dependencies:[I.topBlur,I.topCompositionStart,I.topKeyDown,I.topKeyPress,I.topKeyUp,I.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:y({onCompositionUpdate:null}),captured:y({onCompositionUpdateCapture:null})},dependencies:[I.topBlur,I.topCompositionUpdate,I.topKeyDown,I.topKeyPress,I.topKeyUp,I.topMouseDown]}},R=!1,P=null,w={eventTypes:T,extractEvents:function(e,t,n,r){return[s(e,t,n,r),p(e,t,n,r)]}};t.exports=w},{139:139,15:15,20:20,21:21,22:22,91:91,95:95}],4:[function(e,t){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var r={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[n(t,e)]=r[e]})});var i={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},a={isUnitlessNumber:r,shorthandPropertyExpansions:i};t.exports=a},{}],5:[function(e,t){"use strict";var n=e(4),r=e(21),o=(e(106),e(111)),i=e(131),a=e(141),u=(e(150),a(function(e){return i(e)})),s="cssFloat";r.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(s="styleFloat");var l={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=u(n)+":",t+=o(n,r)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var i in t)if(t.hasOwnProperty(i)){var a=o(i,t[i]);if("float"===i&&(i=s),a)r[i]=a;else{var u=n.shorthandPropertyExpansions[i];if(u)for(var l in u)r[l]="";else r[i]=""}}}};t.exports=l},{106:106,111:111,131:131,141:141,150:150,21:21,4:4}],6:[function(e,t){"use strict";function n(){this._callbacks=null,this._contexts=null}var r=e(28),o=e(27),i=e(133);o(n.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){i(e.length===t.length),this._callbacks=null,this._contexts=null;for(var n=0,r=e.length;r>n;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{133:133,27:27,28:28}],7:[function(e,t){"use strict";function n(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function r(e){var t=_.getPooled(I.change,R,e);C.accumulateTwoPhaseDispatches(t),b.batchedUpdates(o,t)}function o(e){y.enqueueEvents(e),y.processEventQueue()}function i(e,t){T=e,R=t,T.attachEvent("onchange",r)}function a(){T&&(T.detachEvent("onchange",r),T=null,R=null)}function u(e,t,n){return e===N.topChange?n:void 0}function s(e,t,n){e===N.topFocus?(a(),i(t,n)):e===N.topBlur&&a()}function l(e,t){T=e,R=t,P=e.value,w=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(T,"value",A),T.attachEvent("onpropertychange",p)}function c(){T&&(delete T.value,T.detachEvent("onpropertychange",p),T=null,R=null,P=null,w=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==P&&(P=t,r(e))}}function d(e,t,n){return e===N.topInput?n:void 0}function f(e,t,n){e===N.topFocus?(c(),l(t,n)):e===N.topBlur&&c()}function h(e){return e!==N.topSelectionChange&&e!==N.topKeyUp&&e!==N.topKeyDown||!T||T.value===P?void 0:(P=T.value,R)}function m(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===N.topClick?n:void 0}var g=e(15),y=e(17),C=e(20),E=e(21),b=e(85),_=e(93),x=e(134),D=e(136),M=e(139),N=g.topLevelTypes,I={change:{phasedRegistrationNames:{bubbled:M({onChange:null}),captured:M({onChangeCapture:null})},dependencies:[N.topBlur,N.topChange,N.topClick,N.topFocus,N.topInput,N.topKeyDown,N.topKeyUp,N.topSelectionChange]}},T=null,R=null,P=null,w=null,O=!1;E.canUseDOM&&(O=x("change")&&(!("documentMode"in document)||document.documentMode>8));var S=!1;E.canUseDOM&&(S=x("input")&&(!("documentMode"in document)||document.documentMode>9));var A={get:function(){return w.get.call(this)},set:function(e){P=""+e,w.set.call(this,e)}},k={eventTypes:I,extractEvents:function(e,t,r,o){var i,a;if(n(t)?O?i=u:a=s:D(t)?S?i=d:(i=h,a=f):m(t)&&(i=v),i){var l=i(e,t,r);if(l){var c=_.getPooled(I.change,l,o);return C.accumulateTwoPhaseDispatches(c),c}}a&&a(e,t,r)}};t.exports=k},{134:134,136:136,139:139,15:15,17:17,20:20,21:21,85:85,93:93}],8:[function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};t.exports=r},{}],9:[function(e,t){"use strict";function n(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var r=e(12),o=e(70),i=e(145),a=e(133),u={dangerouslyReplaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup,updateTextContent:i,processUpdates:function(e,t){for(var u,s=null,l=null,c=0;ct||r.hasOverloadedBooleanValue[e]&&t===!1}var r=e(10),o=e(143),i=(e(150),{createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+o(e)},createMarkupForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(e)&&r.isStandardName[e]){if(n(e,t))return"";var i=r.getAttributeName[e];return r.hasBooleanValue[e]||r.hasOverloadedBooleanValue[e]&&t===!0?i:i+"="+o(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+o(t):null},setValueForProperty:function(e,t,o){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var i=r.getMutationMethod[t];if(i)i(e,o);else if(n(t,o))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute[t])e.setAttribute(r.getAttributeName[t],""+o);else{var a=r.getPropertyName[t];r.hasSideEffects[t]&&""+e[a]==""+o||(e[a]=o)}}else r.isCustomAttribute(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o))},deleteValueForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var n=r.getMutationMethod[t];if(n)n(e,void 0);else if(r.mustUseAttribute[t])e.removeAttribute(r.getAttributeName[t]);else{var o=r.getPropertyName[t],i=r.getDefaultValueForProperty(e.nodeName,o);r.hasSideEffects[t]&&""+e[o]===i||(e[o]=i)}}else r.isCustomAttribute(t)&&e.removeAttribute(t)}});t.exports=i},{10:10,143:143,150:150}],12:[function(e,t){"use strict";function n(e){return e.substring(1,e.indexOf(" "))}var r=e(21),o=e(110),i=e(112),a=e(125),u=e(133),s=/^(<[^ \/>]+)/,l="data-danger-index",c={dangerouslyRenderMarkup:function(e){u(r.canUseDOM);for(var t,c={},p=0;ps;s++){var c=u[s];if(c){var p=c.extractEvents(e,t,r,i);p&&(a=o(a,p))}}return a},enqueueEvents:function(e){e&&(s=o(s,e))},processEventQueue:function(){var e=s;s=null,i(e,l),a(!s)},__purge:function(){u={}},__getListenerBank:function(){return u}};t.exports=p},{103:103,118:118,133:133,18:18,19:19}],18:[function(e,t){"use strict";function n(){if(a)for(var e in u){var t=u[e],n=a.indexOf(e);if(i(n>-1),!s.plugins[n]){i(t.extractEvents),s.plugins[n]=t;var o=t.eventTypes;for(var l in o)i(r(o[l],t,l))}}}function r(e,t,n){i(!s.eventNameDispatchConfigs.hasOwnProperty(n)),s.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var a in r)if(r.hasOwnProperty(a)){var u=r[a];o(u,t,n)}return!0}return e.registrationName?(o(e.registrationName,t,n),!0):!1}function o(e,t,n){i(!s.registrationNameModules[e]),s.registrationNameModules[e]=t,s.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var i=e(133),a=null,u={},s={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){i(!a),a=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];u.hasOwnProperty(r)&&u[r]===o||(i(!u[r]),u[r]=o,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return s.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=s.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){a=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];s.plugins.length=0;var t=s.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=s.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=s},{133:133}],19:[function(e,t){"use strict";function n(e){return e===m.topMouseUp||e===m.topTouchEnd||e===m.topTouchCancel}function r(e){return e===m.topMouseMove||e===m.topTouchMove}function o(e){return e===m.topMouseDown||e===m.topTouchStart}function i(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var o=0;oe&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var u=t>1?1-t:void 0;return this._fallbackText=o.slice(e,u),this._fallbackText}}),r.addPoolingTo(n),t.exports=n},{128:128,27:27,28:28}],23:[function(e,t){"use strict";var n,r=e(10),o=e(21),i=r.injection.MUST_USE_ATTRIBUTE,a=r.injection.MUST_USE_PROPERTY,u=r.injection.HAS_BOOLEAN_VALUE,s=r.injection.HAS_SIDE_EFFECTS,l=r.injection.HAS_NUMERIC_VALUE,c=r.injection.HAS_POSITIVE_NUMERIC_VALUE,p=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(o.canUseDOM){var d=document.implementation;n=d&&d.hasFeature&&d.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var f={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:i|u,allowTransparency:i,alt:null,async:u,autoComplete:null,autoPlay:u,cellPadding:null,cellSpacing:null,charSet:i,checked:a|u,classID:i,className:n?i:a,cols:i|c,colSpan:null,content:null,contentEditable:null,contextMenu:i,controls:a|u,coords:null,crossOrigin:null,data:null,dateTime:i,defer:u,dir:null,disabled:i|u,download:p,draggable:null,encType:null,form:i,formAction:i,formEncType:i,formMethod:i,formNoValidate:u,formTarget:i,frameBorder:i,headers:null,height:i,hidden:i|u,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:a,label:null,lang:null,list:i,loop:a|u,manifest:i,marginHeight:null,marginWidth:null,max:null,maxLength:i,media:i,mediaGroup:null,method:null,min:null,multiple:a|u,muted:a|u,name:null,noValidate:u,open:u,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:a|u,rel:null,required:u,role:i,rows:i|c,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:i|u,selected:a|u,shape:null,size:i|c,sizes:i,span:c,spellCheck:null,src:null,srcDoc:a,srcSet:i,start:l,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:a|s,width:i,wmode:i,autoCapitalize:null,autoCorrect:null,itemProp:i,itemScope:i|u,itemType:i,itemID:i,itemRef:i,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=f},{10:10,21:21}],24:[function(e,t){"use strict";function n(e){s(null==e.props.checkedLink||null==e.props.valueLink)}function r(e){n(e),s(null==e.props.value&&null==e.props.onChange)}function o(e){n(e),s(null==e.props.checked&&null==e.props.onChange)}function i(e){this.props.valueLink.requestChange(e.target.value)}function a(e){this.props.checkedLink.requestChange(e.target.checked)}var u=e(76),s=e(133),l={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},c={Mixin:{propTypes:{value:function(e,t){return!e[t]||l[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:u.func}},getValue:function(e){return e.props.valueLink?(r(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(o(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(r(e),i):e.props.checkedLink?(o(e),a):e.props.onChange}};t.exports=c},{133:133,76:76}],25:[function(e,t){"use strict";function n(e){e.remove()}var r=e(30),o=e(103),i=e(118),a=e(133),u={trapBubbledEvent:function(e,t){a(this.isMounted());var n=this.getDOMNode();a(n);var i=r.trapBubbledEvent(e,t,n);this._localEventListeners=o(this._localEventListeners,i)},componentWillUnmount:function(){this._localEventListeners&&i(this._localEventListeners,n)}};t.exports=u},{103:103,118:118,133:133,30:30}],26:[function(e,t){"use strict";var n=e(15),r=e(112),o=n.topLevelTypes,i={eventTypes:null,extractEvents:function(e,t,n,i){if(e===o.topTouchStart){var a=i.target;a&&!a.onclick&&(a.onclick=r)}}};t.exports=i},{112:112,15:15}],27:[function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var t=Object(e),n=Object.prototype.hasOwnProperty,r=1;rc;c++){var d=u[c];a.hasOwnProperty(d)&&a[d]||(d===s.topWheel?l("wheel")?m.ReactEventListener.trapBubbledEvent(s.topWheel,"wheel",o):l("mousewheel")?m.ReactEventListener.trapBubbledEvent(s.topWheel,"mousewheel",o):m.ReactEventListener.trapBubbledEvent(s.topWheel,"DOMMouseScroll",o):d===s.topScroll?l("scroll",!0)?m.ReactEventListener.trapCapturedEvent(s.topScroll,"scroll",o):m.ReactEventListener.trapBubbledEvent(s.topScroll,"scroll",m.ReactEventListener.WINDOW_HANDLE):d===s.topFocus||d===s.topBlur?(l("focus",!0)?(m.ReactEventListener.trapCapturedEvent(s.topFocus,"focus",o),m.ReactEventListener.trapCapturedEvent(s.topBlur,"blur",o)):l("focusin")&&(m.ReactEventListener.trapBubbledEvent(s.topFocus,"focusin",o),m.ReactEventListener.trapBubbledEvent(s.topBlur,"focusout",o)),a[s.topBlur]=!0,a[s.topFocus]=!0):f.hasOwnProperty(d)&&m.ReactEventListener.trapBubbledEvent(d,f[d],o),a[d]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!p){var e=u.refreshScrollValues; +m.ReactEventListener.monitorScrollValue(e),p=!0}},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:o.putListener,getListener:o.getListener,deleteListener:o.deleteListener,deleteAllListeners:o.deleteAllListeners});t.exports=m},{102:102,134:134,15:15,17:17,18:18,27:27,59:59}],31:[function(e,t){"use strict";var n=e(79),r=e(116),o=e(132),i=e(147),a={instantiateChildren:function(e){var t=r(e);for(var n in t)if(t.hasOwnProperty(n)){var i=t[n],a=o(i,null);t[n]=a}return t},updateChildren:function(e,t,a,u){var s=r(t);if(!s&&!e)return null;var l;for(l in s)if(s.hasOwnProperty(l)){var c=e&&e[l],p=c&&c._currentElement,d=s[l];if(i(p,d))n.receiveComponent(c,d,a,u),s[l]=c;else{c&&n.unmountComponent(c,l);var f=o(d,null);s[l]=f}}for(l in e)!e.hasOwnProperty(l)||s&&s.hasOwnProperty(l)||n.unmountComponent(e[l]);return s},unmountChildren:function(e){for(var t in e){var r=e[t];n.unmountComponent(r)}}};t.exports=a},{116:116,132:132,147:147,79:79}],32:[function(e,t){"use strict";function n(e,t){this.forEachFunction=e,this.forEachContext=t}function r(e,t,n,r){var o=e;o.forEachFunction.call(o.forEachContext,t,r)}function o(e,t,o){if(null==e)return e;var i=n.getPooled(t,o);d(e,r,i),n.release(i)}function i(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function a(e,t,n,r){var o=e,i=o.mapResult,a=!i.hasOwnProperty(n);if(a){var u=o.mapFunction.call(o.mapContext,t,r);i[n]=u}}function u(e,t,n){if(null==e)return e;var r={},o=i.getPooled(r,t,n);return d(e,a,o),i.release(o),p.create(r)}function s(){return null}function l(e){return d(e,s,null)}var c=e(28),p=e(61),d=e(149),f=(e(150),c.twoArgumentPooler),h=c.threeArgumentPooler;c.addPoolingTo(n,f),c.addPoolingTo(i,h);var m={forEach:o,map:u,count:l};t.exports=m},{149:149,150:150,28:28,61:61}],33:[function(e,t){"use strict";function n(e,t){var n=x.hasOwnProperty(t)?x[t]:null;M.hasOwnProperty(t)&&g(n===b.OVERRIDE_BASE),e.hasOwnProperty(t)&&g(n===b.DEFINE_MANY||n===b.DEFINE_MANY_MERGED)}function r(e,t){if(t){g("function"!=typeof t),g(!p.isValidElement(t));var r=e.prototype;t.hasOwnProperty(E)&&D.mixins(e,t.mixins);for(var o in t)if(t.hasOwnProperty(o)&&o!==E){var i=t[o];if(n(r,o),D.hasOwnProperty(o))D[o](e,i);else{var s=x.hasOwnProperty(o),l=r.hasOwnProperty(o),c=i&&i.__reactDontBind,d="function"==typeof i,f=d&&!s&&!l&&!c;if(f)r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[o]=i,r[o]=i;else if(l){var h=x[o];g(s&&(h===b.DEFINE_MANY_MERGED||h===b.DEFINE_MANY)),h===b.DEFINE_MANY_MERGED?r[o]=a(r[o],i):h===b.DEFINE_MANY&&(r[o]=u(r[o],i))}else r[o]=i}}}}function o(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in D;g(!o);var i=n in e;g(!i),e[n]=r}}}function i(e,t){g(e&&t&&"object"==typeof e&&"object"==typeof t);for(var n in t)t.hasOwnProperty(n)&&(g(void 0===e[n]),e[n]=t[n]);return e}function a(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return i(o,n),i(o,r),o}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function s(e,t){var n=t.bind(e);return n}function l(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=s(e,d.guard(n,e.constructor.displayName+"."+t))}}var c=e(34),p=(e(39),e(55)),d=e(58),f=e(65),h=e(66),m=(e(75),e(74),e(84)),v=e(27),g=e(133),y=e(138),C=e(139),E=(e(150),C({mixins:null})),b=y({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),_=[],x={mixins:b.DEFINE_MANY,statics:b.DEFINE_MANY,propTypes:b.DEFINE_MANY,contextTypes:b.DEFINE_MANY,childContextTypes:b.DEFINE_MANY,getDefaultProps:b.DEFINE_MANY_MERGED,getInitialState:b.DEFINE_MANY_MERGED,getChildContext:b.DEFINE_MANY_MERGED,render:b.DEFINE_ONCE,componentWillMount:b.DEFINE_MANY,componentDidMount:b.DEFINE_MANY,componentWillReceiveProps:b.DEFINE_MANY,shouldComponentUpdate:b.DEFINE_ONCE,componentWillUpdate:b.DEFINE_MANY,componentDidUpdate:b.DEFINE_MANY,componentWillUnmount:b.DEFINE_MANY,updateComponent:b.OVERRIDE_BASE},D={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,r)+o},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];if(null!=i)if(E.hasOwnProperty(o))r(this._rootNodeID,o,i,e);else{o===_&&(i&&(i=this._previousStyleCopy=h({},t.style)),i=a.createMarkupForStyles(i));var u=s.createMarkupForProperty(o,i);u&&(n+=" "+u)}}if(e.renderToStaticMarkup)return n+">";var l=s.createMarkupForID(this._rootNodeID);return n+" "+l+">"},_createContentMarkup:function(e,t){var n="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(n="\n");var r=this._currentElement.props,o=r.dangerouslySetInnerHTML;if(null!=o){if(null!=o.__html)return n+o.__html}else{var i=b[typeof r.children]?r.children:null,a=null!=i?null:r.children;if(null!=i)return n+m(i);if(null!=a){var u=this.mountChildren(a,e,t);return n+u.join("")}}return n},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,r,o){n(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,o)},_updateDOMProperties:function(e,t){var n,o,i,a=this._currentElement.props;for(n in e)if(!a.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===_){var s=this._previousStyleCopy;for(o in s)s.hasOwnProperty(o)&&(i=i||{},i[o]="")}else E.hasOwnProperty(n)?y(this._rootNodeID,n):(u.isStandardName[n]||u.isCustomAttribute(n))&&D.deletePropertyByID(this._rootNodeID,n);for(n in a){var l=a[n],c=n===_?this._previousStyleCopy:e[n];if(a.hasOwnProperty(n)&&l!==c)if(n===_)if(l&&(l=this._previousStyleCopy=h({},l)),c){for(o in c)!c.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(i=i||{},i[o]="");for(o in l)l.hasOwnProperty(o)&&c[o]!==l[o]&&(i=i||{},i[o]=l[o])}else i=l;else E.hasOwnProperty(n)?r(this._rootNodeID,n,l,t):(u.isStandardName[n]||u.isCustomAttribute(n))&&D.updatePropertyByID(this._rootNodeID,n,l)}i&&D.updateStylesByID(this._rootNodeID,i)},_updateDOMChildren:function(e,t,n){var r=this._currentElement.props,o=b[typeof e.children]?e.children:null,i=b[typeof r.children]?r.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,u=r.dangerouslySetInnerHTML&&r.dangerouslySetInnerHTML.__html,s=null!=o?null:e.children,l=null!=i?null:r.children,c=null!=o||null!=a,p=null!=i||null!=u;null!=s&&null==l?this.updateChildren(null,t,n):c&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=u?a!==u&&D.updateInnerHTMLByID(this._rootNodeID,u):null!=l&&this.updateChildren(l,t,n)},unmountComponent:function(){this.unmountChildren(),l.deleteAllListeners(this._rootNodeID),c.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},f.measureMethods(i,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),h(i.prototype,i.Mixin,d.Mixin),i.injection={injectIDOperations:function(e){i.BackendIDOperations=D=e}},t.exports=i},{10:10,11:11,114:114,133:133,134:134,139:139,150:150,27:27,30:30,35:35,5:5,68:68,69:69,73:73}],43:[function(e,t){"use strict";var n=e(15),r=e(25),o=e(29),i=e(33),a=e(55),u=a.createFactory("form"),s=i.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[o,r],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(n.topLevelTypes.topSubmit,"submit")}});t.exports=s},{15:15,25:25,29:29,33:33,55:55}],44:[function(e,t){"use strict";var n=e(5),r=e(9),o=e(11),i=e(68),a=e(73),u=e(133),s=e(144),l={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},c={updatePropertyByID:function(e,t,n){var r=i.getNode(e);u(!l.hasOwnProperty(t)),null!=n?o.setValueForProperty(r,t,n):o.deleteValueForProperty(r,t)},deletePropertyByID:function(e,t,n){var r=i.getNode(e);u(!l.hasOwnProperty(t)),o.deleteValueForProperty(r,t,n)},updateStylesByID:function(e,t){var r=i.getNode(e);n.setValueForStyles(r,t)},updateInnerHTMLByID:function(e,t){var n=i.getNode(e);s(n,t)},updateTextContentByID:function(e,t){var n=i.getNode(e);r.updateTextContent(n,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=i.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;np;p++){var m=s[p];if(m!==a&&m.form===a.form){var v=l.getID(m);d(v);var g=h[v];d(g),c.asap(n,g)}}}return t}});t.exports=m},{11:11,133:133,2:2,24:24,27:27,29:29,33:33,55:55,68:68,85:85}],48:[function(e,t){"use strict";var n=e(29),r=e(33),o=e(55),i=(e(150),o.createFactory("option")),a=r.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[n],componentWillMount:function(){},render:function(){return i(this.props,this.props.children)}});t.exports=a},{150:150,29:29,33:33,55:55}],49:[function(e,t){"use strict";function n(){if(this._pendingUpdate){this._pendingUpdate=!1;var e=a.getValue(this);null!=e&&this.isMounted()&&o(this,e)}}function r(e,t){if(null==e[t])return null;if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to must be a scalar value if `multiple` is false.")}function o(e,t){var n,r,o,i=e.getDOMNode().options;if(e.props.multiple){for(n={},r=0,o=t.length;o>r;r++)n[""+t[r]]=!0;for(r=0,o=i.length;o>r;r++){var a=n.hasOwnProperty(i[r].value);i[r].selected!==a&&(i[r].selected=a)}}else{for(n=""+t,r=0,o=i.length;o>r;r++)if(i[r].value===n)return void(i[r].selected=!0);i[0].selected=!0}}var i=e(2),a=e(24),u=e(29),s=e(33),l=e(55),c=e(85),p=e(27),d=l.createFactory("select"),f=s.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[i,a.Mixin,u],propTypes:{defaultValue:r,value:r},render:function(){var e=p({},this.props);return e.onChange=this._handleChange,e.value=null,d(e,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var e=a.getValue(this);null!=e?o(this,e):null!=this.props.defaultValue&&o(this,this.props.defaultValue)},componentDidUpdate:function(e){var t=a.getValue(this);null!=t?(this._pendingUpdate=!1,o(this,t)):!e.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?o(this,this.props.defaultValue):o(this,this.props.multiple?[]:""))},_handleChange:function(e){var t,r=a.getOnChange(this);return r&&(t=r.call(this,e)),this._pendingUpdate=!0,c.asap(n,this),t}});t.exports=f},{2:2,24:24,27:27,29:29,33:33,55:55,85:85}],50:[function(e,t){"use strict";function n(e,t,n,r){return e===n&&t===r}function r(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var i=o.text.length,a=i+r;return{start:i,end:a}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var r=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,u=t.getRangeAt(0),s=n(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=s?0:u.toString().length,c=u.cloneRange();c.selectNodeContents(e),c.setEnd(u.startContainer,u.startOffset);var p=n(c.startContainer,c.startOffset,c.endContainer,c.endOffset),d=p?0:c.toString().length,f=d+l,h=document.createRange();h.setStart(r,o),h.setEnd(i,a);var m=h.collapsed;return{start:m?f:d,end:m?d:f}}function i(e,t){var n,r,o=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function a(e,t){if(window.getSelection){var n=window.getSelection(),r=e[l()].length,o=Math.min(t.start,r),i="undefined"==typeof t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var u=s(e,o),c=s(e,i);if(u&&c){var p=document.createRange();p.setStart(u.node,u.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(c.node,c.offset)):(p.setEnd(c.node,c.offset),n.addRange(p))}}}var u=e(21),s=e(126),l=e(128),c=u.canUseDOM&&"selection"in document&&!("getSelection"in window),p={getOffsets:c?r:o,setOffsets:c?i:a};t.exports=p},{126:126,128:128,21:21}],51:[function(e,t){"use strict";var n=e(11),r=e(35),o=e(42),i=e(27),a=e(114),u=function(){};i(u.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t){this._rootNodeID=e;var r=a(this._stringText);return t.renderToStaticMarkup?r:""+r+""},receiveComponent:function(e){if(e!==this._currentElement){this._currentElement=e;var t=""+e;t!==this._stringText&&(this._stringText=t,o.BackendIDOperations.updateTextContentByID(this._rootNodeID,t))}},unmountComponent:function(){r.unmountIDFromEnvironment(this._rootNodeID)}}),t.exports=u},{11:11,114:114,27:27,35:35,42:42}],52:[function(e,t){"use strict";function n(){this.isMounted()&&this.forceUpdate()}var r=e(2),o=e(11),i=e(24),a=e(29),u=e(33),s=e(55),l=e(85),c=e(27),p=e(133),d=(e(150),s.createFactory("textarea")),f=u.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[r,i.Mixin,a],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(p(null==e),Array.isArray(t)&&(p(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var n=i.getValue(this);return{initialValue:""+(null!=n?n:e)}},render:function(){var e=c({},this.props);return p(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,d(e,this.state.initialValue)},componentDidUpdate:function(){var e=i.getValue(this);if(null!=e){var t=this.getDOMNode();o.setValueForProperty(t,"value",""+e)}},_handleChange:function(e){var t,r=i.getOnChange(this);return r&&(t=r.call(this,e)),l.asap(n,this),t}});t.exports=f},{11:11,133:133,150:150,2:2,24:24,27:27,29:29,33:33,55:55,85:85}],53:[function(e,t){"use strict";function n(){this.reinitializeTransaction()}var r=e(85),o=e(101),i=e(27),a=e(112),u={initialize:a,close:function(){p.isBatchingUpdates=!1}},s={initialize:a,close:r.flushBatchedUpdates.bind(r)},l=[s,u];i(n.prototype,o.Mixin,{getTransactionWrappers:function(){return l}});var c=new n,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o){var i=p.isBatchingUpdates;p.isBatchingUpdates=!0,i?e(t,n,r,o):c.perform(e,null,t,n,r,o)}};t.exports=p},{101:101,112:112,27:27,85:85}],54:[function(e,t){"use strict";function n(e){return f.createClass({tagName:e.toUpperCase(),render:function(){return new I(e,null,null,null,null,this.props)}})}function r(){R.EventEmitter.injectReactEventListener(T),R.EventPluginHub.injectEventPluginOrder(u),R.EventPluginHub.injectInstanceHandle(P),R.EventPluginHub.injectMount(w),R.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:k,EnterLeaveEventPlugin:s,ChangeEventPlugin:i,MobileSafariClickEventPlugin:p,SelectEventPlugin:S,BeforeInputEventPlugin:o}),R.NativeComponent.injectGenericComponentClass(v),R.NativeComponent.injectTextComponentClass(N),R.NativeComponent.injectAutoWrapper(n),R.Class.injectMixin(d),R.NativeComponent.injectComponentClasses({button:g,form:y,iframe:b,img:C,input:_,option:x,select:D,textarea:M,html:U("html"),head:U("head"),body:U("body")}),R.DOMProperty.injectDOMPropertyConfig(c),R.DOMProperty.injectDOMPropertyConfig(L),R.EmptyComponent.injectEmptyComponent("noscript"),R.Updates.injectReconcileTransaction(O),R.Updates.injectBatchingStrategy(m),R.RootIndex.injectCreateReactRootIndex(l.canUseDOM?a.createReactRootIndex:A.createReactRootIndex),R.Component.injectEnvironment(h),R.DOMComponent.injectIDOperations(E)}var o=e(3),i=e(7),a=e(8),u=e(13),s=e(14),l=e(21),c=e(23),p=e(26),d=e(29),f=e(33),h=e(35),m=e(53),v=e(42),g=e(41),y=e(43),C=e(46),E=e(44),b=e(45),_=e(47),x=e(48),D=e(49),M=e(52),N=e(51),I=e(55),T=e(60),R=e(62),P=e(64),w=e(68),O=e(78),S=e(87),A=e(88),k=e(89),L=e(86),U=e(109);t.exports={inject:r}},{109:109,13:13,14:14,21:21,23:23,26:26,29:29,3:3,33:33,35:35,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,51:51,52:52,53:53,55:55,60:60,62:62,64:64,68:68,7:7,78:78,8:8,86:86,87:87,88:88,89:89}],55:[function(e,t){"use strict";var n=e(38),r=e(39),o=e(27),i=(e(150),{key:!0,ref:!0}),a=function(e,t,n,r,o,i){this.type=e,this.key=t,this.ref=n,this._owner=r,this._context=o,this.props=i};a.prototype={_isReactElement:!0},a.createElement=function(e,t,o){var u,s={},l=null,c=null;if(null!=t){c=void 0===t.ref?null:t.ref,l=void 0===t.key?null:""+t.key;for(u in t)t.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(s[u]=t[u]) +}var p=arguments.length-2;if(1===p)s.children=o;else if(p>1){for(var d=Array(p),f=0;p>f;f++)d[f]=arguments[f+2];s.children=d}if(e&&e.defaultProps){var h=e.defaultProps;for(u in h)"undefined"==typeof s[u]&&(s[u]=h[u])}return new a(e,l,c,r.current,n.current,s)},a.createFactory=function(e){var t=a.createElement.bind(null,e);return t.type=e,t},a.cloneAndReplaceProps=function(e,t){var n=new a(e.type,e.key,e.ref,e._owner,e._context,t);return n},a.cloneElement=function(e,t,n){var u,s=o({},e.props),l=e.key,c=e.ref,p=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,p=r.current),void 0!==t.key&&(l=""+t.key);for(u in t)t.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(s[u]=t[u])}var d=arguments.length-2;if(1===d)s.children=n;else if(d>1){for(var f=Array(d),h=0;d>h;h++)f[h]=arguments[h+2];s.children=f}return new a(e.type,l,c,p,e._context,s)},a.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},t.exports=a},{150:150,27:27,38:38,39:39}],56:[function(e,t){"use strict";function n(){if(g.current){var e=g.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function r(e){var t=e&&e.getPublicInstance();if(!t)return void 0;var n=t.constructor;return n?n.displayName||n.name||void 0:void 0}function o(){var e=g.current;return e&&r(e)||void 0}function i(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,u('Each child in an array or iterator should have a unique "key" prop.',e,t))}function a(e,t,n){x.test(e)&&u("Child objects should have non-numeric keys so ordering is preserved.",t,n)}function u(e,t,n){var i=o(),a="string"==typeof n?n:n.displayName||n.name,u=i||a,s=b[e]||(b[e]={});if(!s.hasOwnProperty(u)){s[u]=!0;var l="";if(t&&t._owner&&t._owner!==g.current){var c=r(t._owner);l=" It was passed a child from "+c+"."}}}function s(e,t){if(Array.isArray(e))for(var n=0;n");var u="";o&&(u=" The element was created by "+o+".")}}function p(e,t){return e!==e?t!==t:0===e&&0===t?1/e===1/t:e===t}function d(e){if(e._store){var t=e._store.originalProps,n=e.props;for(var r in n)n.hasOwnProperty(r)&&(t.hasOwnProperty(r)&&p(t[r],n[r])||(c(r,e),t[r]=n[r]))}}function f(e){if(null!=e.type){var t=y.getComponentClassForElement(e),n=t.displayName||t.name;t.propTypes&&l(n,t.propTypes,e.props,v.prop),"function"==typeof t.getDefaultProps}}var h=e(55),m=e(61),v=e(75),g=(e(74),e(39)),y=e(71),C=e(124),E=e(133),b=(e(150),{}),_={},x=/^\d+$/,D={},M={checkAndWarnForMutatedProps:d,createElement:function(e){var t=h.createElement.apply(this,arguments);if(null==t)return t;for(var n=2;no;o++){t=e.ancestors[o];var a=c.getID(t)||"";m._handleTopLevel(e.topLevelType,t,a,e.nativeEvent)}}function i(e){var t=h(window);e(t)}var a=e(16),u=e(21),s=e(28),l=e(64),c=e(68),p=e(85),d=e(27),f=e(123),h=e(129);d(r.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),s.addPoolingTo(r,s.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:u.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?a.listen(r,t,m.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){var r=n;return r?a.capture(r,t,m.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=i.bind(null,e);a.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(m._enabled){var n=r.getPooled(e,t);try{p.batchedUpdates(o,n)}finally{r.release(n)}}}};t.exports=m},{123:123,129:129,16:16,21:21,27:27,28:28,64:64,68:68,85:85}],61:[function(e,t){"use strict";var n=(e(55),e(150),{create:function(e){return e},extract:function(e){return e},extractIfFragment:function(e){return e}});t.exports=n},{150:150,55:55}],62:[function(e,t){"use strict";var n=e(10),r=e(17),o=e(36),i=e(33),a=e(57),u=e(30),s=e(71),l=e(42),c=e(73),p=e(81),d=e(85),f={Component:o.injection,Class:i.injection,DOMComponent:l.injection,DOMProperty:n.injection,EmptyComponent:a.injection,EventPluginHub:r.injection,EventEmitter:u.injection,NativeComponent:s.injection,Perf:c.injection,RootIndex:p.injection,Updates:d.injection};t.exports=f},{10:10,17:17,30:30,33:33,36:36,42:42,57:57,71:71,73:73,81:81,85:85}],63:[function(e,t){"use strict";function n(e){return o(document.documentElement,e)}var r=e(50),o=e(107),i=e(117),a=e(119),u={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=a(),r=e.focusedElem,o=e.selectionRange;t!==r&&n(r)&&(u.hasSelectionCapabilities(r)&&u.setSelection(r,o),i(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if("undefined"==typeof o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(e,t)}};t.exports=u},{107:107,117:117,119:119,50:50}],64:[function(e,t){"use strict";function n(e){return d+e.toString(36)}function r(e,t){return e.charAt(t)===d||t===e.length}function o(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function i(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function a(e){return e?e.substr(0,e.lastIndexOf(d)):""}function u(e,t){if(p(o(e)&&o(t)),p(i(e,t)),e===t)return e;var n,a=e.length+f;for(n=a;n=a;a++)if(r(e,a)&&r(t,a))i=a;else if(e.charAt(a)!==t.charAt(a))break;var u=e.substr(0,i);return p(o(u)),u}function l(e,t,n,r,o,s){e=e||"",t=t||"",p(e!==t);var l=i(t,e);p(l||i(e,t));for(var c=0,d=l?a:u,f=e;;f=d(f,t)){var m;if(o&&f===e||s&&f===t||(m=n(f,l,r)),m===!1||f===t)break;p(c++1){var t=e.indexOf(d,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var i=s(e,t);i!==e&&l(e,i,n,r,!1,!0),i!==t&&l(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},_getFirstCommonAncestorID:s,_getNextDescendantID:u,isAncestorIDOf:i,SEPARATOR:d};t.exports=m},{133:133,81:81}],65:[function(e,t){"use strict";var n={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};t.exports=n},{}],66:[function(e,t){"use strict";var n={currentlyMountingInstance:null,currentlyUnmountingInstance:null};t.exports=n},{}],67:[function(e,t){"use strict";var n=e(104),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var o=t.getAttribute(r.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var i=n(e);return i===o}};t.exports=r},{104:104}],68:[function(e,t){"use strict";function n(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function r(e){var t=T(e);return t&&K.getID(t)}function o(e){var t=i(e);if(t)if(k.hasOwnProperty(t)){var n=k[t];n!==e&&(P(!l(n,t)),k[t]=e)}else k[t]=e;return t}function i(e){return e&&e.getAttribute&&e.getAttribute(A)||""}function a(e,t){var n=i(e);n!==t&&delete k[n],e.setAttribute(A,t),k[t]=e}function u(e){return k.hasOwnProperty(e)&&l(k[e],e)||(k[e]=K.findReactNodeByID(e)),k[e]}function s(e){var t=E.get(e)._rootNodeID;return y.isNullComponentID(t)?null:(k.hasOwnProperty(t)&&l(k[t],t)||(k[t]=K.findReactNodeByID(t)),k[t])}function l(e,t){if(e){P(i(e)===t);var n=K.findReactContainerForID(t);if(n&&I(n,e))return!0}return!1}function c(e){delete k[e]}function p(e){var t=k[e];return t&&l(t,e)?void(j=t):!1}function d(e){j=null,C.traverseAncestors(e,p);var t=j;return j=null,t}function f(e,t,n,r,o){var i=x.mountComponent(e,t,r,N);e._isTopLevel=!0,K._mountImageIntoNode(i,n,o)}function h(e,t,n,r){var o=M.ReactReconcileTransaction.getPooled();o.perform(f,null,e,t,n,o,r),M.ReactReconcileTransaction.release(o)}var m=e(10),v=e(30),g=(e(39),e(55)),y=(e(56),e(57)),C=e(64),E=e(65),b=e(67),_=e(73),x=e(79),D=e(84),M=e(85),N=e(113),I=e(107),T=e(127),R=e(132),P=e(133),w=e(144),O=e(147),S=(e(150),C.SEPARATOR),A=m.ID_ATTRIBUTE_NAME,k={},L=1,U=9,F={},B={},V=[],j=null,K={_instancesByReactRootID:F,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return K.scrollMonitor(n,function(){D.enqueueElementInternal(e,t),r&&D.enqueueCallbackInternal(e,r)}),e},_registerComponent:function(e,t){P(t&&(t.nodeType===L||t.nodeType===U)),v.ensureScrollValueMonitoring();var n=K.registerContainer(t);return F[n]=e,n},_renderNewRootComponent:function(e,t,n){var r=R(e,null),o=K._registerComponent(r,t);return M.batchedUpdates(h,r,o,t,n),r},render:function(e,t,n){P(g.isValidElement(e));var o=F[r(t)];if(o){var i=o._currentElement;if(O(i,e))return K._updateRootComponent(o,e,t,n).getPublicInstance();K.unmountComponentAtNode(t)}var a=T(t),u=a&&K.isRenderedByReact(a),s=u&&!o,l=K._renderNewRootComponent(e,t,s).getPublicInstance();return n&&n.call(l),l},constructAndRenderComponent:function(e,t,n){var r=g.createElement(e,t);return K.render(r,n)},constructAndRenderComponentByID:function(e,t,n){var r=document.getElementById(n);return P(r),K.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=r(e);return t&&(t=C.getReactRootIDFromNodeID(t)),t||(t=C.createReactRootID()),B[t]=e,t},unmountComponentAtNode:function(e){P(e&&(e.nodeType===L||e.nodeType===U));var t=r(e),n=F[t];return n?(K.unmountComponentFromNode(n,e),delete F[t],delete B[t],!0):!1},unmountComponentFromNode:function(e,t){for(x.unmountComponent(e),t.nodeType===U&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=C.getReactRootIDFromNodeID(e),n=B[t];return n},findReactNodeByID:function(e){var t=K.findReactContainerForID(e);return K.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=K.getID(e);return t?t.charAt(0)===S:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(K.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=V,r=0,o=d(t)||e;for(n[0]=o.firstChild,n.length=1;r>",b=a(),_=p(),x={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:o(),arrayOf:i,element:b,instanceOf:u,node:_,objectOf:l,oneOf:s,oneOfType:c,shape:d};t.exports=x},{112:112,55:55,61:61,74:74}],77:[function(e,t){"use strict";function n(){this.listenersToPut=[]}var r=e(28),o=e(30),i=e(27);i(n.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;en;n++){var r=v[n],o=r._pendingCallbacks;if(r._pendingCallbacks=null,d.performUpdateIfNecessary(r,e.reconcileTransaction),o)for(var a=0;a":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;t.exports=r},{}],115:[function(e,t){"use strict";function n(e){return null==e?null:a(e)?e:r.has(e)?o.getNodeFromInstance(e):(i(null==e.render||"function"!=typeof e.render),void i(!1))}{var r=(e(39),e(65)),o=e(68),i=e(133),a=e(135);e(150)}t.exports=n},{133:133,135:135,150:150,39:39,65:65,68:68}],116:[function(e,t){"use strict";function n(e,t,n){var r=e,o=!r.hasOwnProperty(n);o&&null!=t&&(r[n]=t)}function r(e){if(null==e)return e;var t={};return o(e,n,t),t}{var o=e(149);e(150)}t.exports=r},{149:149,150:150}],117:[function(e,t){"use strict";function n(e){try{e.focus()}catch(t){}}t.exports=n},{}],118:[function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=n},{}],119:[function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],120:[function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=n},{}],121:[function(e,t){"use strict";function n(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}var r=e(120),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=n},{120:120}],122:[function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function r(){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],123:[function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=n},{}],124:[function(e,t){"use strict";function n(e){var t=e&&(r&&e[r]||e[o]);return"function"==typeof t?t:void 0}var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";t.exports=n},{}],125:[function(e,t){function n(e){return o(!!i),p.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(i.innerHTML="*"===e?"":"<"+e+">",a[e]=!i.firstChild),a[e]?p[e]:null}var r=e(21),o=e(133),i=r.canUseDOM?document.createElement("div"):null,a={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},u=[1,'"],s=[1,"","
    "],l=[3,"","
    "],c=[1,"",""],p={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:u,option:u,caption:s,colgroup:s,tbody:s,tfoot:s,thead:s,td:l,th:l,circle:c,defs:c,ellipse:c,g:c,line:c,linearGradient:c,path:c,polygon:c,polyline:c,radialGradient:c,rect:c,stop:c,text:c};t.exports=n},{133:133,21:21}],126:[function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var o=n(e),i=0,a=0;o;){if(3===o.nodeType){if(a=i+o.textContent.length,t>=i&&a>=t)return{node:o,offset:t-i};i=a}o=n(r(o))}}t.exports=o},{}],127:[function(e,t){"use strict";function n(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;t.exports=n},{}],128:[function(e,t){"use strict";function n(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var r=e(21),o=null;t.exports=n},{21:21}],129:[function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],130:[function(e,t){function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=n},{}],131:[function(e,t){"use strict";function n(e){return r(e).replace(o,"-ms-")}var r=e(130),o=/^ms-/;t.exports=n},{130:130}],132:[function(e,t){"use strict";function n(e){return"function"==typeof e&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function r(e,t){var r;if((null===e||e===!1)&&(e=i.emptyElement),"object"==typeof e){var o=e;r=t===o.type&&"string"==typeof o.type?a.createInternalComponent(o):n(o.type)?new o.type(o):new l}else"string"==typeof e||"number"==typeof e?r=a.createInstanceForText(e):s(!1);return r.construct(e),r._mountIndex=0,r._mountImage=null,r}var o=e(37),i=e(57),a=e(71),u=e(27),s=e(133),l=(e(150),function(){});u(l.prototype,o.Mixin,{_instantiateReactComponent:r}),t.exports=r},{133:133,150:150,27:27,37:37,57:57,71:71}],133:[function(e,t){"use strict";var n=function(e,t,n,r,o,i,a,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,u],c=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw s.framesToPop=1,s}};t.exports=n},{}],134:[function(e,t){"use strict";function n(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var r,o=e(21);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=n},{21:21}],135:[function(e,t){function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],136:[function(e,t){"use strict";function n(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=n},{}],137:[function(e,t){function n(e){return r(e)&&3==e.nodeType}var r=e(135);t.exports=n},{135:135}],138:[function(e,t){"use strict";var n=e(133),r=function(e){var t,r={};n(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};t.exports=r},{133:133}],139:[function(e,t){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=n},{}],140:[function(e,t){"use strict";function n(e,t,n){if(!e)return null;var o={};for(var i in e)r.call(e,i)&&(o[i]=t.call(n,e[i],i,e));return o}var r=Object.prototype.hasOwnProperty;t.exports=n},{}],141:[function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=n},{}],142:[function(e,t){"use strict";function n(e){return o(r.isValidElement(e)),e}var r=e(55),o=e(133);t.exports=n},{133:133,55:55}],143:[function(e,t){"use strict";function n(e){return'"'+r(e)+'"'}var r=e(114);t.exports=n},{114:114}],144:[function(e,t){"use strict";var n=e(21),r=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,i=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(i=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),n.canUseDOM){var a=document.createElement("div");a.innerHTML=" ",""===a.innerHTML&&(i=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),r.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=""+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=i},{21:21}],145:[function(e,t){"use strict";var n=e(21),r=e(114),o=e(144),i=function(e,t){e.textContent=t};n.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){o(e,r(t))})),t.exports=i},{114:114,144:144,21:21}],146:[function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=n},{}],147:[function(e,t){"use strict";function n(e,t){if(null!=e&&null!=t){var n=typeof e,r=typeof t;if("string"===n||"number"===n)return"string"===r||"number"===r;if("object"===r&&e.type===t.type&&e.key===t.key){var o=e._owner===t._owner;return o}}return!1}e(150);t.exports=n},{150:150}],148:[function(e,t){function n(e){var t=e.length;if(r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),r("number"==typeof t),r(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var o=Array(t),i=0;t>i;i++)o[i]=e[i];return o}var r=e(133);t.exports=n},{133:133}],149:[function(e,t){"use strict";function n(e){return m[e]}function r(e,t){return e&&null!=e.key?i(e.key):t.toString(36)}function o(e){return(""+e).replace(v,n)}function i(e){return"$"+o(e)}function a(e,t,n,o,u){var c=typeof e;if(("undefined"===c||"boolean"===c)&&(e=null),null===e||"string"===c||"number"===c||s.isValidElement(e))return o(u,e,""===t?f+r(e,0):t,n),1;var m,v,g,y=0;if(Array.isArray(e))for(var C=0;C Date: Fri, 13 Mar 2015 12:15:30 -0400 Subject: [PATCH 078/190] Initial progress viz implementation. --- src/components/progress.cjsx | 81 ++++++++++++++++++++++++++++++++++++ src/main.coffee | 17 ++++---- style.css | 1 + 3 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 src/components/progress.cjsx diff --git a/src/components/progress.cjsx b/src/components/progress.cjsx new file mode 100644 index 0000000..5907eb7 --- /dev/null +++ b/src/components/progress.cjsx @@ -0,0 +1,81 @@ +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# component definition +# +# This component inspired by: +# http://jsfiddle.net/oskar/Aapn8/ and +# https://github.com/pughpugh/react-countdown-clock +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +module.exports = React.createClass + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Component state definition + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + getInitialState: -> + currVal: 1.0 # start at 1.0 so we have a blank circle + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Styles + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + canvasStyle: + display: 'block' + + strokeStyle: + radius: 50 + width: 5.0 + color: '#99CC33' + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Instance Variables + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + _canvas: null + _context: null + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Component Methods + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + componentDidMount: -> + if @_canvas then return + + @_canvas = @getDOMNode() + @_context = @_canvas.getContext '2d' + + # additional bootstrapping + @_context.beginPath() + @_context.strokeStyle = @strokeStyle.color + @_context.lineCap = 'square' + @_context.closePath() + @_context.fill() + @_context.lineWidth = @strokeStyle.width + + @_updateProgress() + + componentDidUpdate: -> + @_updateProgress() + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Behaviours + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + _updateProgress: -> + if !@_context then return + + # Basic idea: angle has to be between PI * -0.5 (12 o'clock) and PI * 1.5 + # (full circle) - since a circle is 2PI radians + endAngle = (2 * @state.currVal) - 0.5 + + @_context.beginPath() + @_context.arc( + @strokeStyle.radius # x-coordinate of origin + @strokeStyle.radius # y-coordinate of origin + @strokeStyle.radius - @strokeStyle.width # radius of arc (less the stroke width) + Math.PI * 1.5 # starting angle in radians. PI * -0.5 is the 12 o'clock position + Math.PI * endAngle # ending angle in radians + false # stroke counterclockwise? + ) + @_context.stroke() + + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + # Final Render + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + render: -> + diff --git a/src/main.coffee b/src/main.coffee index 8f45667..1d4a377 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -7,7 +7,7 @@ constants = require './constants' # React components Legend = require './components/legend' -#Progress = require './components/progress' +Progress = require './components/progress' masterContainer = document.getElementById 'visualization' overlay = document.getElementById 'visualization' @@ -21,6 +21,7 @@ renderer = null scene = null camera = null visualizationMesh = null +progressViz = null # contains a list of country codes with their matching country names isoFile = 'country_iso3166.json' @@ -71,6 +72,7 @@ startDataPump = -> endIndex = _sampleData.length visualize.selectVisualization( _sampleData.slice( currIndexIntoData, endIndex ), visualizationMesh ) + progressViz.setState( { currVal: endIndex / _sampleData.length } ) currIndexIntoData = (currIndexIntoData + 5) % _sampleData.length , 500 @@ -201,10 +203,9 @@ reactInit = -> document.getElementById 'legend' ) - # ... and our progress bar - # React.render( - # React.createElement( Progress, - # currVal: 0.5 - # ) - # document.getElementById 'progress' - # ) + # ... and our progress bar. We hold on to a ref so we can update its state as + # we cycle through our data + progressViz = React.render( + React.createElement( Progress, null ) + document.getElementById 'progress' + ) diff --git a/style.css b/style.css index 66f886d..128c6c8 100755 --- a/style.css +++ b/style.css @@ -204,4 +204,5 @@ footer { position: absolute; right: 30px; top: 20px; + width: 100px; } From ee59c99540da0d516a050773070e206487d6665f Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 12:33:02 -0400 Subject: [PATCH 079/190] Updated styling for progress viz --- src/components/progress.cjsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/progress.cjsx b/src/components/progress.cjsx index 5907eb7..40ce32c 100644 --- a/src/components/progress.cjsx +++ b/src/components/progress.cjsx @@ -23,7 +23,7 @@ module.exports = React.createClass strokeStyle: radius: 50 width: 5.0 - color: '#99CC33' + color: '#008EAF' #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Instance Variables @@ -47,6 +47,7 @@ module.exports = React.createClass @_context.closePath() @_context.fill() @_context.lineWidth = @strokeStyle.width + @_context.globalAlpha = 0.33 @_updateProgress() @@ -59,6 +60,9 @@ module.exports = React.createClass _updateProgress: -> if !@_context then return + # Clear out our previous strokes + @_context.clearRect 0, 0, @_canvas.width, @_canvas.height + # Basic idea: angle has to be between PI * -0.5 (12 o'clock) and PI * 1.5 # (full circle) - since a circle is 2PI radians endAngle = (2 * @state.currVal) - 0.5 From 8d62152fc21e6307f83dcb42c99db72dff1beacc Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 13:03:36 -0400 Subject: [PATCH 080/190] Progress bar updates are now tweened for a nicer effect --- package.json | 1 + src/components/progress.cjsx | 10 +++++++++- src/main.coffee | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 83fe55c..a37be70 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "homepage": "https://github.com/dpetker/dataglobe.git", "dependencies": { "express": "^4.11.1", + "react-tween-state": "0.0.4", "serve-static": "^1.8.1" }, "devDependencies": { diff --git a/src/components/progress.cjsx b/src/components/progress.cjsx index 40ce32c..dd40b77 100644 --- a/src/components/progress.cjsx +++ b/src/components/progress.cjsx @@ -5,8 +5,10 @@ # http://jsfiddle.net/oskar/Aapn8/ and # https://github.com/pughpugh/react-countdown-clock #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +tween = require 'react-tween-state' module.exports = React.createClass + mixins: [tween.Mixin] #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Component state definition @@ -54,6 +56,12 @@ module.exports = React.createClass componentDidUpdate: -> @_updateProgress() + handleProgressUpdate: (newVal) -> + @tweenState( 'currVal', + duration: 500, + endValue: newVal + ) + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Behaviours #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -65,7 +73,7 @@ module.exports = React.createClass # Basic idea: angle has to be between PI * -0.5 (12 o'clock) and PI * 1.5 # (full circle) - since a circle is 2PI radians - endAngle = (2 * @state.currVal) - 0.5 + endAngle = (2 * @getTweeningValue( 'currVal' )) - 0.5 @_context.beginPath() @_context.arc( diff --git a/src/main.coffee b/src/main.coffee index 1d4a377..b77f75d 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -72,7 +72,7 @@ startDataPump = -> endIndex = _sampleData.length visualize.selectVisualization( _sampleData.slice( currIndexIntoData, endIndex ), visualizationMesh ) - progressViz.setState( { currVal: endIndex / _sampleData.length } ) + progressViz.handleProgressUpdate( endIndex / _sampleData.length ) currIndexIntoData = (currIndexIntoData + 5) % _sampleData.length , 500 From 7a176a5426642ab7b135ddc092b3ce6faba60be4 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 13:39:54 -0400 Subject: [PATCH 081/190] More tweaks to progress viz - styling and tweening --- src/components/progress.cjsx | 20 ++++++++++++++------ style.css | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/components/progress.cjsx b/src/components/progress.cjsx index dd40b77..f1173a6 100644 --- a/src/components/progress.cjsx +++ b/src/components/progress.cjsx @@ -14,7 +14,7 @@ module.exports = React.createClass # Component state definition #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ getInitialState: -> - currVal: 1.0 # start at 1.0 so we have a blank circle + currVal: 0.0 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Styles @@ -23,7 +23,7 @@ module.exports = React.createClass display: 'block' strokeStyle: - radius: 50 + radius: 25 width: 5.0 color: '#008EAF' @@ -51,15 +51,23 @@ module.exports = React.createClass @_context.lineWidth = @strokeStyle.width @_context.globalAlpha = 0.33 - @_updateProgress() - componentDidUpdate: -> @_updateProgress() handleProgressUpdate: (newVal) -> + onEndFunc = undefined + + # Handles weird case where a currVal of 1.0 gives us no circle. Basically + # we tween to a value that will appear to be a full circle and then as soon + # as it's done, tween back to the start value (i.e. empty circle) + if newVal is 1.0 + newVal = 0.99999 + onEndFunc = => + @tweenState( 'currVal', { endValue: 0.0 } ) + @tweenState( 'currVal', - duration: 500, - endValue: newVal + endValue: newVal, + onEnd: onEndFunc ) #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/style.css b/style.css index 128c6c8..7ba8159 100755 --- a/style.css +++ b/style.css @@ -204,5 +204,5 @@ footer { position: absolute; right: 30px; top: 20px; - width: 100px; + width: 50px; } From 2fb2f7b1eb021149d5a4b4b8a9016310a60b07e6 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 13:48:07 -0400 Subject: [PATCH 082/190] Progress size now declared in component, rather than CSS --- src/components/progress.cjsx | 2 +- style.css | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/progress.cjsx b/src/components/progress.cjsx index f1173a6..beb09b9 100644 --- a/src/components/progress.cjsx +++ b/src/components/progress.cjsx @@ -98,4 +98,4 @@ module.exports = React.createClass # Final Render #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ render: -> - + diff --git a/style.css b/style.css index 7ba8159..66f886d 100755 --- a/style.css +++ b/style.css @@ -204,5 +204,4 @@ footer { position: absolute; right: 30px; top: 20px; - width: 50px; } From 69ae529291623179ad42ec7be3f590b5f534af81 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 14:00:36 -0400 Subject: [PATCH 083/190] Updated README with proper tasks --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2cf5d8b..1a68258 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,9 @@ To have it watch for changes and automatically rebuild. ## TODOs -* Allow source/destination data to be specified as lat/long, rather than country names -* Highlight the destination country when the particle "hits" it +* [ ] Allow source/destination data to be specified as lat/long, rather than country names +* [ ] Highlight the destination country when the particle "hits" it +* [ ] Create subtle trail effect for particles ## Notes From deb44a0dc1dd6df22333e354c075a8adde02b030 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 13 Mar 2015 16:03:45 -0400 Subject: [PATCH 084/190] One solution for a trail using a second particle --- src/visualize.coffee | 50 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/visualize.coffee b/src/visualize.coffee index c099ca0..435a21f 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -58,6 +58,14 @@ module.exports = particle.size = meshObj.particleSize meshObj.particlesGeo.vertices.push particle + trail = particle.clone() + trail.moveIndex = 0 + trail.nextIndex = 0 + trail.lerpN = -0.15 + trail.path = points + trail.size = meshObj.particleSize * 0.25 + meshObj.particlesGeo.vertices.push trail + # set the colour meshObj.setParticleColour linearData.colour @@ -135,35 +143,33 @@ class ParticleMesh # Once the point has finished its path, this method will emit a "ParticleSystemComplete" # event, to allow us to re-pool the mesh. this.pSystem.update = -> - #Simplified this as our particle geometry will only ever have one point - particle = this.geometry.vertices[0] - # no point doing all the calculations if the particle is already done - return if this.systemComplete or not particle + return if this.systemComplete - path = particle.path - moveLength = path.length + for particle in @geometry.vertices + path = particle.path + moveLength = path.length - particle.lerpN += 0.15 - if particle.lerpN > 1 - particle.lerpN = 0 - particle.moveIndex = particle.nextIndex - particle.nextIndex++ - if particle.nextIndex >= path.length - particle.moveIndex = 0 - particle.nextIndex = 0 + particle.lerpN += 0.15 + if particle.lerpN > 1 + particle.lerpN = 0 + particle.moveIndex = particle.nextIndex + particle.nextIndex++ + if particle.nextIndex >= path.length + particle.moveIndex = 0 + particle.nextIndex = 0 - this.systemComplete = true - this.dispatchEvent { type: 'ParticleSystemComplete' } - return + this.systemComplete = true + this.dispatchEvent { type: 'ParticleSystemComplete' } + return - currentPoint = path[particle.moveIndex] - nextPoint = path[particle.nextIndex] + currentPoint = path[particle.moveIndex] + nextPoint = path[particle.nextIndex] - particle.copy currentPoint - particle.lerp nextPoint, particle.lerpN + particle.copy currentPoint + particle.lerp nextPoint, particle.lerpN - this.geometry.verticesNeedUpdate = true + this.geometry.verticesNeedUpdate = true setParticleColour: ( colourStr ) -> colour = constants.COLOUR_MAP[colourStr] From 92260318c5ccefa1da8620f597c530d9a56fda64 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 16 Mar 2015 08:59:25 -0400 Subject: [PATCH 085/190] Slightly nicer trail effect --- src/visualize.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/visualize.coffee b/src/visualize.coffee index 435a21f..cf27467 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -60,10 +60,10 @@ module.exports = trail = particle.clone() trail.moveIndex = 0 - trail.nextIndex = 0 + trail.nextIndex = 1 trail.lerpN = -0.15 trail.path = points - trail.size = meshObj.particleSize * 0.25 + trail.size = meshObj.particleSize meshObj.particlesGeo.vertices.push trail # set the colour From b6ee04278d0afe9fd779575545e66f04588297b2 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 16 Mar 2015 09:09:31 -0400 Subject: [PATCH 086/190] Added more particles to the trail --- src/visualize.coffee | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/visualize.coffee b/src/visualize.coffee index cf27467..5d7d5eb 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -58,13 +58,14 @@ module.exports = particle.size = meshObj.particleSize meshObj.particlesGeo.vertices.push particle - trail = particle.clone() - trail.moveIndex = 0 - trail.nextIndex = 1 - trail.lerpN = -0.15 - trail.path = points - trail.size = meshObj.particleSize - meshObj.particlesGeo.vertices.push trail + for num in [1..5] + trail = particle.clone() + trail.moveIndex = 0 + trail.nextIndex = 1 + trail.lerpN = -0.15 * num + trail.path = points + trail.size = meshObj.particleSize + meshObj.particlesGeo.vertices.push trail # set the colour meshObj.setParticleColour linearData.colour From ab02f16f2cd7ca5315afd86877ebbf1c10f3fcaa Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 16 Mar 2015 09:15:04 -0400 Subject: [PATCH 087/190] Added a quick comment for something that might look weird --- src/visualize.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/visualize.coffee b/src/visualize.coffee index 5d7d5eb..b57cd4b 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -160,6 +160,8 @@ class ParticleMesh particle.moveIndex = 0 particle.nextIndex = 0 + # Even though there are multiple particles in the system now, we still + # do things this way as we don't really care if the "trail" has completed this.systemComplete = true this.dispatchEvent { type: 'ParticleSystemComplete' } return From 885e887f0cafd5bf8c799d443566b1669f846427 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 16 Mar 2015 09:44:38 -0400 Subject: [PATCH 088/190] Increase transparency of particles so they look slightly less neon --- README.md | 2 +- src/visualize.coffee | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a68258..2d49a70 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ To have it watch for changes and automatically rebuild. * [ ] Allow source/destination data to be specified as lat/long, rather than country names * [ ] Highlight the destination country when the particle "hits" it -* [ ] Create subtle trail effect for particles +* [x] Create subtle trail effect for particles ## Notes diff --git a/src/visualize.coffee b/src/visualize.coffee index b57cd4b..bfefce2 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -58,6 +58,7 @@ module.exports = particle.size = meshObj.particleSize meshObj.particlesGeo.vertices.push particle + # Create a trail for the particles by adding extra, slightly offset, particles for num in [1..5] trail = particle.clone() trail.moveIndex = 0 @@ -128,6 +129,7 @@ class ParticleMesh depthTest: true depthWrite: false transparent: true + opacity: 0.5 color: this.particleColor this.pSystem = new THREE.PointCloud null, this.shaderMaterial From b1d1994e8106b2e91d6312db0a8d4aec2c04f837 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 16 Mar 2015 10:36:48 -0400 Subject: [PATCH 089/190] Switched over to using '@' shorthand. --- src/visualize.coffee | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/visualize.coffee b/src/visualize.coffee index bfefce2..7e69858 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -107,12 +107,12 @@ _returnMeshToPool = ( mesh ) -> class ParticleMesh constructor: -> - this.linesGeo = new THREE.Geometry() - this.particlesGeo = new THREE.Geometry() - this.particleColor = constants.COLOUR_MAP.r - this.particleSize = 150 + @linesGeo = new THREE.Geometry() + @particlesGeo = new THREE.Geometry() + @particleColor = constants.COLOUR_MAP.r + @particleSize = 150 - this.lineMat = new THREE.LineBasicMaterial + @lineMat = new THREE.LineBasicMaterial color: 0xffffff opacity: 0.0 blending: THREE.AdditiveBlending @@ -120,34 +120,34 @@ class ParticleMesh depthWrite: false vertexColors: false linewidth: 1 - this.splineOutline = new THREE.Line null, this.lineMat + @splineOutline = new THREE.Line null, @lineMat - this.shaderMaterial = new THREE.PointCloudMaterial + @shaderMaterial = new THREE.PointCloudMaterial map: THREE.ImageUtils.loadTexture "images/particleB.png" - size: this.particleSize + size: @particleSize blending: THREE.AdditiveBlending depthTest: true depthWrite: false transparent: true opacity: 0.5 - color: this.particleColor - this.pSystem = new THREE.PointCloud null, this.shaderMaterial + color: @particleColor + @pSystem = new THREE.PointCloud null, @shaderMaterial - this.splineOutline.renderDepth = false - this.pSystem.dynamic = true - this.pSystem.systemComplete = false # So we can know when to re-pool this mesh - this.splineOutline.add this.pSystem - this.splineOutline.geometry = this.linesGeo - this.pSystem.geometry = this.particlesGeo + @splineOutline.renderDepth = false + @pSystem.dynamic = true + @pSystem.systemComplete = false # So we can know when to re-pool this mesh + @splineOutline.add @pSystem + @splineOutline.geometry = @linesGeo + @pSystem.geometry = @particlesGeo - this.pSystem.addEventListener( 'ParticleSystemComplete', _returnMeshToPool.bind( this, this ) ) + @pSystem.addEventListener( 'ParticleSystemComplete', _returnMeshToPool.bind( this, this ) ) # This update method is what actually gets our points moving across the scene. # Once the point has finished its path, this method will emit a "ParticleSystemComplete" # event, to allow us to re-pool the mesh. - this.pSystem.update = -> + @pSystem.update = -> # no point doing all the calculations if the particle is already done - return if this.systemComplete + return if @systemComplete for particle in @geometry.vertices path = particle.path @@ -164,8 +164,8 @@ class ParticleMesh # Even though there are multiple particles in the system now, we still # do things this way as we don't really care if the "trail" has completed - this.systemComplete = true - this.dispatchEvent { type: 'ParticleSystemComplete' } + @systemComplete = true + @dispatchEvent { type: 'ParticleSystemComplete' } return currentPoint = path[particle.moveIndex] @@ -174,11 +174,11 @@ class ParticleMesh particle.copy currentPoint particle.lerp nextPoint, particle.lerpN - this.geometry.verticesNeedUpdate = true + @geometry.verticesNeedUpdate = true setParticleColour: ( colourStr ) -> colour = constants.COLOUR_MAP[colourStr] colour = constants.COLOUR_MAP.r if not colour - this.particleColor = colour - this.shaderMaterial.color = colour + @particleColor = colour + @shaderMaterial.color = colour From 837d0364468f1930661bef3bc44f8fe6f8b36733 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 16 Mar 2015 11:04:56 -0400 Subject: [PATCH 090/190] First checkin of new particle trail that uses alpha for coolness --- index.html | 29 +++++++++++++++++++++++++++++ src/visualize.coffee | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 55 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index bdba969..fbab538 100755 --- a/index.html +++ b/index.html @@ -39,6 +39,35 @@

    Data Visualization Globe

    + + + + + diff --git a/src/visualize.coffee b/src/visualize.coffee index 7e69858..de4e327 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -110,7 +110,8 @@ class ParticleMesh @linesGeo = new THREE.Geometry() @particlesGeo = new THREE.Geometry() @particleColor = constants.COLOUR_MAP.r - @particleSize = 150 + # Particle size now set in custom shader + # @particleSize = 150 @lineMat = new THREE.LineBasicMaterial color: 0xffffff @@ -122,23 +123,31 @@ class ParticleMesh linewidth: 1 @splineOutline = new THREE.Line null, @lineMat - @shaderMaterial = new THREE.PointCloudMaterial - map: THREE.ImageUtils.loadTexture "images/particleB.png" - size: @particleSize - blending: THREE.AdditiveBlending - depthTest: true - depthWrite: false - transparent: true - opacity: 0.5 - color: @particleColor - @pSystem = new THREE.PointCloud null, @shaderMaterial + # Use custom shader to have the trail taper off in transparency + attributes = + alpha: { type: 'f', value: [ 1.0, 0.8, 0.6, 0.4, 0.2, 0.0 ] } + + uniforms = + color: { type: 'c', value: @particleColor } + texture: { type: 't', value: THREE.ImageUtils.loadTexture "images/particleB.png" } + + @shaderMaterial = new THREE.ShaderMaterial + uniforms: uniforms + attributes: attributes + vertexShader: document.getElementById( 'vertexshader' ).textContent + fragmentShader: document.getElementById( 'fragmentshader' ).textContent + blending: THREE.AdditiveBlending + transparent: true + depthTest: true + depthWrite: false + + @pSystem = new THREE.PointCloud @particlesGeo, @shaderMaterial @splineOutline.renderDepth = false @pSystem.dynamic = true @pSystem.systemComplete = false # So we can know when to re-pool this mesh @splineOutline.add @pSystem @splineOutline.geometry = @linesGeo - @pSystem.geometry = @particlesGeo @pSystem.addEventListener( 'ParticleSystemComplete', _returnMeshToPool.bind( this, this ) ) @@ -177,8 +186,8 @@ class ParticleMesh @geometry.verticesNeedUpdate = true setParticleColour: ( colourStr ) -> - colour = constants.COLOUR_MAP[colourStr] - colour = constants.COLOUR_MAP.r if not colour - - @particleColor = colour - @shaderMaterial.color = colour + # colour = constants.COLOUR_MAP[colourStr] + # colour = constants.COLOUR_MAP.r if not colour + # + # @particleColor = colour + # @shaderMaterial.color = colour From 66dc16006c64767a70292d27289e8a06907fbc6e Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 16 Mar 2015 11:23:28 -0400 Subject: [PATCH 091/190] Particles now coloured --- index.html | 12 ++++++++++-- src/visualize.coffee | 36 +++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index fbab538..78b80fc 100755 --- a/index.html +++ b/index.html @@ -47,11 +47,17 @@

    Data Visualization Globe --> @@ -59,10 +65,12 @@

    Data Visualization Globe - + diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js new file mode 100644 index 0000000..5c4b8f3 --- /dev/null +++ b/public/dataglobe.min.js @@ -0,0 +1,2 @@ +/*! dataglobe 20-03-2015 */ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?k>g:g>k;h=k>=0?++g:--g)l=Math.floor(Math.random()*i.length),f=Math.floor(Math.random()*i.length),e=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],l===f&&(f=f===i.length-1?0:f+1),j={},j.src=b[i[l]],j.dest=b[i[f]],j.colour=e,m.push(j);return c(m)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;k=a("./dataloading"),p=a("./mousekeyboard"),z=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,y=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),z.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),y=new THREE.Object3D,v.add(y),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove,!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:z.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),z.initMeshPool(i.MESH_POOL_SIZE,y),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=a,b=l.loadGeoData(e,d),z.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a){return h=f,i=g,f=a.clientX-.5*window.innerWidth,g=a.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(camera.position.x-=.5*(f-h),camera.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.RingGeometry(2,1,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.outerRadius,this.innerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime Date: Fri, 20 Mar 2015 12:40:49 -0400 Subject: [PATCH 122/190] Removed misleading wording from README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 670fd8d..287517a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Data Globe A more generic version of https://github.com/dataarts/armsglobe for visualizing source/destination data. -This fork attempts to make the globe data-agnostic so that users can simply provide source/destination data and have it graphed. If timestamp information is provided, this globe can act as a semi-real-time visualization. +This fork attempts to make the globe data-agnostic so that users can simply provide source/destination data and have it graphed. ## Building From b32e3d2bf8898727e92840f1d81411e786d54695 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Mar 2015 13:08:49 -0400 Subject: [PATCH 123/190] Removed unnecessary jQuery dependency --- index.html | 1 - thirdparty/jquery-1.7.1.min.js | 4 -- thirdparty/jquery.preventMacBackScroll.js | 59 ----------------------- 3 files changed, 64 deletions(-) delete mode 100755 thirdparty/jquery-1.7.1.min.js delete mode 100755 thirdparty/jquery.preventMacBackScroll.js diff --git a/index.html b/index.html index 3df67e7..e46779a 100755 --- a/index.html +++ b/index.html @@ -80,7 +80,6 @@

    Data Visualization Globe - diff --git a/thirdparty/jquery-1.7.1.min.js b/thirdparty/jquery-1.7.1.min.js deleted file mode 100755 index 198b3ff..0000000 --- a/thirdparty/jquery-1.7.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/thirdparty/jquery.preventMacBackScroll.js b/thirdparty/jquery.preventMacBackScroll.js deleted file mode 100755 index 21f6cd2..0000000 --- a/thirdparty/jquery.preventMacBackScroll.js +++ /dev/null @@ -1,59 +0,0 @@ -// -// Prevent horizontal scroll for Back page in Mac 10.7+ -// -// Mac OSX Lion introduces a nasty behavior: when you are scrolling and -// the element (or its parents) are no longer scrollable, then horizontal -// scrolling with two fingers will trigger back page or next page. -// -// For now this plugin provides a way to prevent that behavior for Chrome -// in the case you're scrolling up or left where you can't scroll anymore, -// which triggers back/next page. -// -// Supported browsers: Mac OSX Chrome -// On all other browsers this script won't do anything -// -// Depends on: jquery.mousewheel.js -// -// TODO: Add Mac OSX Safari support -// -// -// by Pablo Villalba for http://teambox.com -// - -(function ($) { - - // This code is only valid for Mac - if (!navigator.userAgent.match(/Macintosh/)) { - return; - } - - // Handle scroll events in Chrome - if (navigator.userAgent.match(/Chrome/)) { - - // TODO: This only prevents scroll when reaching the topmost or leftmost - // positions of a container. It doesn't handle rightmost or bottom, - // and Lion scroll can be triggered by scrolling right (or bottom) and then - // scrolling left without raising your fingers from the scroll position. - $(window).mousewheel(function (e, d, x, y) { - - var prevent_left, prevent_up; - - // If none of the parents can be scrolled left when we try to scroll left - prevent_left = x < 0 && !_($(e.target).parents()).detect(function (el) { - return $(el).scrollLeft() > 0; - }); - - // If none of the parents can be scrolled up when we try to scroll up - prevent_up = y > 0 && !_($(e.target).parents()).detect(function (el) { - return $(el).scrollTop() > 0; - }); - - // Prevent futile scroll, which would trigger the Back/Next page event - if (prevent_left || prevent_up) { - e.preventDefault(); - } - }); - - } - -}(jQuery)); From a3003ead615744e09cbea81bbcbb31bbb4e8b4f1 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Mar 2015 15:34:21 -0400 Subject: [PATCH 124/190] First checkin of optimizing thirdparty libraries. Step 1: use bower components where available --- .gitignore | 1 + Gruntfile.coffee | 17 +- bower.json | 21 + index.html | 3 +- package.json | 4 +- public/thirdparty.min.js | 18 + thirdparty/react-0.13.0.min.js | 15 - thirdparty/three.min.js | 821 --------------------------------- 8 files changed, 59 insertions(+), 841 deletions(-) create mode 100644 bower.json create mode 100644 public/thirdparty.min.js delete mode 100644 thirdparty/react-0.13.0.min.js delete mode 100644 thirdparty/three.min.js diff --git a/.gitignore b/.gitignore index 2e2ab67..502d59a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ hostery-files .hostery-config node_modules/ +bower_components/ build/ diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 1257d47..7532483 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1,4 +1,5 @@ # Gruntfile for building the dataglobe project +us = require 'underscore' module.exports = ( grunt ) -> @@ -6,7 +7,17 @@ module.exports = ( grunt ) -> pkg: grunt.file.readJSON 'package.json' clean: - [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/<%= pkg.name %>.min.js' ] + [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/*.js' ] + + bower_concat: + all: + dest: 'build/bower.js' + # nice little callback to look for/use minified versions when available + callback: ( mainFiles, component ) -> + us.map( mainFiles, ( filepath ) -> + min = filepath.replace( /\.js$/, '.min.js' ) + if grunt.file.exists( min ) then return min else return filepath + ) cjsx: options: @@ -55,6 +66,7 @@ module.exports = ( grunt ) -> dist: files: 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] + 'public/thirdparty.min.js': [ '<%= bower_concat.all.dest %>' ] watch: files: [ @@ -70,5 +82,6 @@ module.exports = ( grunt ) -> grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-clean' + grunt.loadNpmTasks 'grunt-bower-concat' - grunt.registerTask 'default', [ 'clean', 'cjsx', 'coffee', 'browserify', 'uglify' ] + grunt.registerTask 'default', [ 'clean', 'bower_concat', 'cjsx', 'coffee', 'browserify', 'uglify' ] diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..ddf3c98 --- /dev/null +++ b/bower.json @@ -0,0 +1,21 @@ +{ + "name": "dataglobe", + "version": "0.0.0", + "description": "A more generic version of https://github.com/dataarts/armsglobe for visualizing source/destination data, served up via Node.", + "homepage": "https://github.com/dpetker/dataglobe", + "authors": [ + "dpetker" + ], + "private": true, + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ], + "dependencies": { + "react": "^0.13.1", + "threejs": "^0.0.71" + } +} diff --git a/index.html b/index.html index e46779a..2381744 100755 --- a/index.html +++ b/index.html @@ -76,12 +76,11 @@

    Data Visualization Globe } + - - diff --git a/package.json b/package.json index a37be70..8774983 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,13 @@ }, "devDependencies": { "grunt": "^0.4.5", + "grunt-bower-concat": "^0.4.0", "grunt-browserify": "^3.4.0", "grunt-coffee-react": "^2.4.1", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-coffee": "^0.13.0", "grunt-contrib-uglify": "^0.8.0", - "grunt-contrib-watch": "^0.6.1" + "grunt-contrib-watch": "^0.6.1", + "underscore": "^1.8.2" } } diff --git a/public/thirdparty.min.js b/public/thirdparty.min.js new file mode 100644 index 0000000..4b066c8 --- /dev/null +++ b/public/thirdparty.min.js @@ -0,0 +1,18 @@ +/*! dataglobe 20-03-2015 */ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.React=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g8&&11>=w),z=32,A=String.fromCharCode(z),B=m.topLevelTypes,C={beforeInput:{phasedRegistrationNames:{bubbled:s({onBeforeInput:null}),captured:s({onBeforeInputCapture:null})},dependencies:[B.topCompositionEnd,B.topKeyPress,B.topTextInput,B.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:s({onCompositionEnd:null}),captured:s({onCompositionEndCapture:null})},dependencies:[B.topBlur,B.topCompositionEnd,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:s({onCompositionStart:null}),captured:s({onCompositionStartCapture:null})},dependencies:[B.topBlur,B.topCompositionStart,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:s({onCompositionUpdate:null}),captured:s({onCompositionUpdateCapture:null})},dependencies:[B.topBlur,B.topCompositionUpdate,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]}},D=!1,E=null,F={eventTypes:C,extractEvents:function(a,b,c,d){return[i(a,b,c,d),l(a,b,c,d)]}};b.exports=F},{139:139,15:15,20:20,21:21,22:22,91:91,95:95}],4:[function(a,b){"use strict";function c(a,b){return a+b.charAt(0).toUpperCase()+b.substring(1)}var d={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},e=["Webkit","ms","Moz","O"];Object.keys(d).forEach(function(a){e.forEach(function(b){d[c(b,a)]=d[a]})});var f={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},g={isUnitlessNumber:d,shorthandPropertyExpansions:f};b.exports=g},{}],5:[function(a,b){"use strict";var c=a(4),d=a(21),e=(a(106),a(111)),f=a(131),g=a(141),h=(a(150),g(function(a){return f(a)})),i="cssFloat";d.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(i="styleFloat");var j={createMarkupForStyles:function(a){var b="";for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];null!=d&&(b+=h(c)+":",b+=e(c,d)+";")}return b||null},setValueForStyles:function(a,b){var d=a.style;for(var f in b)if(b.hasOwnProperty(f)){var g=e(f,b[f]);if("float"===f&&(f=i),g)d[f]=g;else{var h=c.shorthandPropertyExpansions[f];if(h)for(var j in h)d[j]="";else d[f]=""}}}};b.exports=j},{106:106,111:111,131:131,141:141,150:150,21:21,4:4}],6:[function(a,b){"use strict";function c(){this._callbacks=null,this._contexts=null}var d=a(28),e=a(27),f=a(133);e(c.prototype,{enqueue:function(a,b){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(a),this._contexts.push(b)},notifyAll:function(){var a=this._callbacks,b=this._contexts;if(a){f(a.length===b.length),this._callbacks=null,this._contexts=null;for(var c=0,d=a.length;d>c;c++)a[c].call(b[c]);a.length=0,b.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),d.addPoolingTo(c),b.exports=c},{133:133,27:27,28:28}],7:[function(a,b){"use strict";function c(a){return"SELECT"===a.nodeName||"INPUT"===a.nodeName&&"file"===a.type}function d(a){var b=w.getPooled(B.change,D,a);t.accumulateTwoPhaseDispatches(b),v.batchedUpdates(e,b)}function e(a){s.enqueueEvents(a),s.processEventQueue()}function f(a,b){C=a,D=b,C.attachEvent("onchange",d)}function g(){C&&(C.detachEvent("onchange",d),C=null,D=null)}function h(a,b,c){return a===A.topChange?c:void 0}function i(a,b,c){a===A.topFocus?(g(),f(b,c)):a===A.topBlur&&g()}function j(a,b){C=a,D=b,E=a.value,F=Object.getOwnPropertyDescriptor(a.constructor.prototype,"value"),Object.defineProperty(C,"value",I),C.attachEvent("onpropertychange",l)}function k(){C&&(delete C.value,C.detachEvent("onpropertychange",l),C=null,D=null,E=null,F=null)}function l(a){if("value"===a.propertyName){var b=a.srcElement.value;b!==E&&(E=b,d(a))}}function m(a,b,c){return a===A.topInput?c:void 0}function n(a,b,c){a===A.topFocus?(k(),j(b,c)):a===A.topBlur&&k()}function o(a){return a!==A.topSelectionChange&&a!==A.topKeyUp&&a!==A.topKeyDown||!C||C.value===E?void 0:(E=C.value,D)}function p(a){return"INPUT"===a.nodeName&&("checkbox"===a.type||"radio"===a.type)}function q(a,b,c){return a===A.topClick?c:void 0}var r=a(15),s=a(17),t=a(20),u=a(21),v=a(85),w=a(93),x=a(134),y=a(136),z=a(139),A=r.topLevelTypes,B={change:{phasedRegistrationNames:{bubbled:z({onChange:null}),captured:z({onChangeCapture:null})},dependencies:[A.topBlur,A.topChange,A.topClick,A.topFocus,A.topInput,A.topKeyDown,A.topKeyUp,A.topSelectionChange]}},C=null,D=null,E=null,F=null,G=!1;u.canUseDOM&&(G=x("change")&&(!("documentMode"in document)||document.documentMode>8));var H=!1;u.canUseDOM&&(H=x("input")&&(!("documentMode"in document)||document.documentMode>9));var I={get:function(){return F.get.call(this)},set:function(a){E=""+a,F.set.call(this,a)}},J={eventTypes:B,extractEvents:function(a,b,d,e){var f,g;if(c(b)?G?f=h:g=i:y(b)?H?f=m:(f=o,g=n):p(b)&&(f=q),f){var j=f(a,b,d);if(j){var k=w.getPooled(B.change,j,e);return t.accumulateTwoPhaseDispatches(k),k}}g&&g(a,b,d)}};b.exports=J},{134:134,136:136,139:139,15:15,17:17,20:20,21:21,85:85,93:93}],8:[function(a,b){"use strict";var c=0,d={createReactRootIndex:function(){return c++}};b.exports=d},{}],9:[function(a,b){"use strict";function c(a,b,c){a.insertBefore(b,a.childNodes[c]||null)}var d=a(12),e=a(70),f=a(145),g=a(133),h={dangerouslyReplaceNodeWithMarkup:d.dangerouslyReplaceNodeWithMarkup,updateTextContent:f,processUpdates:function(a,b){for(var h,i=null,j=null,k=0;kb||d.hasOverloadedBooleanValue[a]&&b===!1}var d=a(10),e=a(143),f=(a(150),{createMarkupForID:function(a){return d.ID_ATTRIBUTE_NAME+"="+e(a)},createMarkupForProperty:function(a,b){if(d.isStandardName.hasOwnProperty(a)&&d.isStandardName[a]){if(c(a,b))return"";var f=d.getAttributeName[a];return d.hasBooleanValue[a]||d.hasOverloadedBooleanValue[a]&&b===!0?f:f+"="+e(b)}return d.isCustomAttribute(a)?null==b?"":a+"="+e(b):null},setValueForProperty:function(a,b,e){if(d.isStandardName.hasOwnProperty(b)&&d.isStandardName[b]){var f=d.getMutationMethod[b];if(f)f(a,e);else if(c(b,e))this.deleteValueForProperty(a,b);else if(d.mustUseAttribute[b])a.setAttribute(d.getAttributeName[b],""+e);else{var g=d.getPropertyName[b];d.hasSideEffects[b]&&""+a[g]==""+e||(a[g]=e)}}else d.isCustomAttribute(b)&&(null==e?a.removeAttribute(b):a.setAttribute(b,""+e))},deleteValueForProperty:function(a,b){if(d.isStandardName.hasOwnProperty(b)&&d.isStandardName[b]){var c=d.getMutationMethod[b];if(c)c(a,void 0);else if(d.mustUseAttribute[b])a.removeAttribute(d.getAttributeName[b]);else{var e=d.getPropertyName[b],f=d.getDefaultValueForProperty(a.nodeName,e);d.hasSideEffects[b]&&""+a[e]===f||(a[e]=f)}}else d.isCustomAttribute(b)&&a.removeAttribute(b)}});b.exports=f},{10:10,143:143,150:150}],12:[function(a,b){"use strict";function c(a){return a.substring(1,a.indexOf(" "))}var d=a(21),e=a(110),f=a(112),g=a(125),h=a(133),i=/^(<[^ \/>]+)/,j="data-danger-index",k={dangerouslyRenderMarkup:function(a){h(d.canUseDOM);for(var b,k={},l=0;li;i++){var k=h[i];if(k){var l=k.extractEvents(a,b,d,f);l&&(g=e(g,l))}}return g},enqueueEvents:function(a){a&&(i=e(i,a))},processEventQueue:function(){var a=i;i=null,f(a,j),g(!i)},__purge:function(){h={}},__getListenerBank:function(){return h}};b.exports=l},{103:103,118:118,133:133,18:18,19:19}],18:[function(a,b){"use strict";function c(){if(g)for(var a in h){var b=h[a],c=g.indexOf(a);if(f(c>-1),!i.plugins[c]){f(b.extractEvents),i.plugins[c]=b;var e=b.eventTypes;for(var j in e)f(d(e[j],b,j))}}}function d(a,b,c){f(!i.eventNameDispatchConfigs.hasOwnProperty(c)),i.eventNameDispatchConfigs[c]=a;var d=a.phasedRegistrationNames;if(d){for(var g in d)if(d.hasOwnProperty(g)){var h=d[g];e(h,b,c)}return!0}return a.registrationName?(e(a.registrationName,b,c),!0):!1}function e(a,b,c){f(!i.registrationNameModules[a]),i.registrationNameModules[a]=b,i.registrationNameDependencies[a]=b.eventTypes[c].dependencies}var f=a(133),g=null,h={},i={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(a){f(!g),g=Array.prototype.slice.call(a),c()},injectEventPluginsByName:function(a){var b=!1;for(var d in a)if(a.hasOwnProperty(d)){var e=a[d];h.hasOwnProperty(d)&&h[d]===e||(f(!h[d]),h[d]=e,b=!0)}b&&c()},getPluginModuleForEvent:function(a){var b=a.dispatchConfig;if(b.registrationName)return i.registrationNameModules[b.registrationName]||null;for(var c in b.phasedRegistrationNames)if(b.phasedRegistrationNames.hasOwnProperty(c)){var d=i.registrationNameModules[b.phasedRegistrationNames[c]];if(d)return d}return null},_resetEventPlugins:function(){g=null;for(var a in h)h.hasOwnProperty(a)&&delete h[a];i.plugins.length=0;var b=i.eventNameDispatchConfigs;for(var c in b)b.hasOwnProperty(c)&&delete b[c];var d=i.registrationNameModules;for(var e in d)d.hasOwnProperty(e)&&delete d[e]}};b.exports=i},{133:133}],19:[function(a,b){"use strict";function c(a){return a===p.topMouseUp||a===p.topTouchEnd||a===p.topTouchCancel}function d(a){return a===p.topMouseMove||a===p.topTouchMove}function e(a){return a===p.topMouseDown||a===p.topTouchStart}function f(a,b){var c=a._dispatchListeners,d=a._dispatchIDs;if(Array.isArray(c))for(var e=0;ea&&c[a]===e[a];a++);var g=d-a;for(b=1;g>=b&&c[d-b]===e[f-b];b++);var h=b>1?1-b:void 0;return this._fallbackText=e.slice(a,h),this._fallbackText}}),d.addPoolingTo(c),b.exports=c},{128:128,27:27,28:28}],23:[function(a,b){"use strict";var c,d=a(10),e=a(21),f=d.injection.MUST_USE_ATTRIBUTE,g=d.injection.MUST_USE_PROPERTY,h=d.injection.HAS_BOOLEAN_VALUE,i=d.injection.HAS_SIDE_EFFECTS,j=d.injection.HAS_NUMERIC_VALUE,k=d.injection.HAS_POSITIVE_NUMERIC_VALUE,l=d.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(e.canUseDOM){var m=document.implementation;c=m&&m.hasFeature&&m.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var n={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:f|h,allowTransparency:f,alt:null,async:h,autoComplete:null,autoPlay:h,cellPadding:null,cellSpacing:null,charSet:f,checked:g|h,classID:f,className:c?f:g,cols:f|k,colSpan:null,content:null,contentEditable:null,contextMenu:f,controls:g|h,coords:null,crossOrigin:null,data:null,dateTime:f,defer:h,dir:null,disabled:f|h,download:l,draggable:null,encType:null,form:f,formAction:f,formEncType:f,formMethod:f,formNoValidate:h,formTarget:f,frameBorder:f,headers:null,height:f,hidden:f|h,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:g,label:null,lang:null,list:f,loop:g|h,manifest:f,marginHeight:null,marginWidth:null,max:null,maxLength:f,media:f,mediaGroup:null,method:null,min:null,multiple:g|h,muted:g|h,name:null,noValidate:h,open:h,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:g|h,rel:null,required:h,role:f,rows:f|k,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:f|h,selected:g|h,shape:null,size:f|k,sizes:f,span:k,spellCheck:null,src:null,srcDoc:g,srcSet:f,start:j,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:g|i,width:f,wmode:f,autoCapitalize:null,autoCorrect:null,itemProp:f,itemScope:f|h,itemType:f,itemID:f,itemRef:f,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};b.exports=n},{10:10,21:21}],24:[function(a,b){"use strict";function c(a){i(null==a.props.checkedLink||null==a.props.valueLink)}function d(a){c(a),i(null==a.props.value&&null==a.props.onChange)}function e(a){c(a),i(null==a.props.checked&&null==a.props.onChange)}function f(a){this.props.valueLink.requestChange(a.target.value)}function g(a){this.props.checkedLink.requestChange(a.target.checked)}var h=a(76),i=a(133),j={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},k={Mixin:{propTypes:{value:function(a,b){return!a[b]||j[a.type]||a.onChange||a.readOnly||a.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(a,b){return!a[b]||a.onChange||a.readOnly||a.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:h.func}},getValue:function(a){return a.props.valueLink?(d(a),a.props.valueLink.value):a.props.value},getChecked:function(a){return a.props.checkedLink?(e(a),a.props.checkedLink.value):a.props.checked},getOnChange:function(a){return a.props.valueLink?(d(a),f):a.props.checkedLink?(e(a),g):a.props.onChange}};b.exports=k},{133:133,76:76}],25:[function(a,b){"use strict";function c(a){a.remove()}var d=a(30),e=a(103),f=a(118),g=a(133),h={trapBubbledEvent:function(a,b){g(this.isMounted());var c=this.getDOMNode();g(c);var f=d.trapBubbledEvent(a,b,c);this._localEventListeners=e(this._localEventListeners,f)},componentWillUnmount:function(){this._localEventListeners&&f(this._localEventListeners,c)}};b.exports=h},{103:103,118:118,133:133,30:30}],26:[function(a,b){"use strict";var c=a(15),d=a(112),e=c.topLevelTypes,f={eventTypes:null,extractEvents:function(a,b,c,f){if(a===e.topTouchStart){var g=f.target;g&&!g.onclick&&(g.onclick=d)}}};b.exports=f},{112:112,15:15}],27:[function(a,b){"use strict";function c(a){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var b=Object(a),c=Object.prototype.hasOwnProperty,d=1;dk;k++){var m=h[k];g.hasOwnProperty(m)&&g[m]||(m===i.topWheel?j("wheel")?p.ReactEventListener.trapBubbledEvent(i.topWheel,"wheel",e):j("mousewheel")?p.ReactEventListener.trapBubbledEvent(i.topWheel,"mousewheel",e):p.ReactEventListener.trapBubbledEvent(i.topWheel,"DOMMouseScroll",e):m===i.topScroll?j("scroll",!0)?p.ReactEventListener.trapCapturedEvent(i.topScroll,"scroll",e):p.ReactEventListener.trapBubbledEvent(i.topScroll,"scroll",p.ReactEventListener.WINDOW_HANDLE):m===i.topFocus||m===i.topBlur?(j("focus",!0)?(p.ReactEventListener.trapCapturedEvent(i.topFocus,"focus",e),p.ReactEventListener.trapCapturedEvent(i.topBlur,"blur",e)):j("focusin")&&(p.ReactEventListener.trapBubbledEvent(i.topFocus,"focusin",e),p.ReactEventListener.trapBubbledEvent(i.topBlur,"focusout",e)),g[i.topBlur]=!0,g[i.topFocus]=!0):n.hasOwnProperty(m)&&p.ReactEventListener.trapBubbledEvent(m,n[m],e),g[m]=!0)}},trapBubbledEvent:function(a,b,c){return p.ReactEventListener.trapBubbledEvent(a,b,c)},trapCapturedEvent:function(a,b,c){return p.ReactEventListener.trapCapturedEvent(a,b,c)},ensureScrollValueMonitoring:function(){if(!l){var a=h.refreshScrollValues; +p.ReactEventListener.monitorScrollValue(a),l=!0}},eventNameDispatchConfigs:e.eventNameDispatchConfigs,registrationNameModules:e.registrationNameModules,putListener:e.putListener,getListener:e.getListener,deleteListener:e.deleteListener,deleteAllListeners:e.deleteAllListeners});b.exports=p},{102:102,134:134,15:15,17:17,18:18,27:27,59:59}],31:[function(a,b){"use strict";var c=a(79),d=a(116),e=a(132),f=a(147),g={instantiateChildren:function(a){var b=d(a);for(var c in b)if(b.hasOwnProperty(c)){var f=b[c],g=e(f,null);b[c]=g}return b},updateChildren:function(a,b,g,h){var i=d(b);if(!i&&!a)return null;var j;for(j in i)if(i.hasOwnProperty(j)){var k=a&&a[j],l=k&&k._currentElement,m=i[j];if(f(l,m))c.receiveComponent(k,m,g,h),i[j]=k;else{k&&c.unmountComponent(k,j);var n=e(m,null);i[j]=n}}for(j in a)!a.hasOwnProperty(j)||i&&i.hasOwnProperty(j)||c.unmountComponent(a[j]);return i},unmountChildren:function(a){for(var b in a){var d=a[b];c.unmountComponent(d)}}};b.exports=g},{116:116,132:132,147:147,79:79}],32:[function(a,b){"use strict";function c(a,b){this.forEachFunction=a,this.forEachContext=b}function d(a,b,c,d){var e=a;e.forEachFunction.call(e.forEachContext,b,d)}function e(a,b,e){if(null==a)return a;var f=c.getPooled(b,e);m(a,d,f),c.release(f)}function f(a,b,c){this.mapResult=a,this.mapFunction=b,this.mapContext=c}function g(a,b,c,d){var e=a,f=e.mapResult,g=!f.hasOwnProperty(c);if(g){var h=e.mapFunction.call(e.mapContext,b,d);f[c]=h}}function h(a,b,c){if(null==a)return a;var d={},e=f.getPooled(d,b,c);return m(a,g,e),f.release(e),l.create(d)}function i(){return null}function j(a){return m(a,i,null)}var k=a(28),l=a(61),m=a(149),n=(a(150),k.twoArgumentPooler),o=k.threeArgumentPooler;k.addPoolingTo(c,n),k.addPoolingTo(f,o);var p={forEach:e,map:h,count:j};b.exports=p},{149:149,150:150,28:28,61:61}],33:[function(a,b){"use strict";function c(a,b){var c=x.hasOwnProperty(b)?x[b]:null;z.hasOwnProperty(b)&&r(c===v.OVERRIDE_BASE),a.hasOwnProperty(b)&&r(c===v.DEFINE_MANY||c===v.DEFINE_MANY_MERGED)}function d(a,b){if(b){r("function"!=typeof b),r(!l.isValidElement(b));var d=a.prototype;b.hasOwnProperty(u)&&y.mixins(a,b.mixins);for(var e in b)if(b.hasOwnProperty(e)&&e!==u){var f=b[e];if(c(d,e),y.hasOwnProperty(e))y[e](a,f);else{var i=x.hasOwnProperty(e),j=d.hasOwnProperty(e),k=f&&f.__reactDontBind,m="function"==typeof f,n=m&&!i&&!j&&!k;if(n)d.__reactAutoBindMap||(d.__reactAutoBindMap={}),d.__reactAutoBindMap[e]=f,d[e]=f;else if(j){var o=x[e];r(i&&(o===v.DEFINE_MANY_MERGED||o===v.DEFINE_MANY)),o===v.DEFINE_MANY_MERGED?d[e]=g(d[e],f):o===v.DEFINE_MANY&&(d[e]=h(d[e],f))}else d[e]=f}}}}function e(a,b){if(b)for(var c in b){var d=b[c];if(b.hasOwnProperty(c)){var e=c in y;r(!e);var f=c in a;r(!f),a[c]=d}}}function f(a,b){r(a&&b&&"object"==typeof a&&"object"==typeof b);for(var c in b)b.hasOwnProperty(c)&&(r(void 0===a[c]),a[c]=b[c]);return a}function g(a,b){return function(){var c=a.apply(this,arguments),d=b.apply(this,arguments);if(null==c)return d;if(null==d)return c;var e={};return f(e,c),f(e,d),e}}function h(a,b){return function(){a.apply(this,arguments),b.apply(this,arguments)}}function i(a,b){var c=b.bind(a);return c}function j(a){for(var b in a.__reactAutoBindMap)if(a.__reactAutoBindMap.hasOwnProperty(b)){var c=a.__reactAutoBindMap[b];a[b]=i(a,m.guard(c,a.constructor.displayName+"."+b))}}var k=a(34),l=(a(39),a(55)),m=a(58),n=a(65),o=a(66),p=(a(75),a(74),a(84)),q=a(27),r=a(133),s=a(138),t=a(139),u=(a(150),t({mixins:null})),v=s({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),w=[],x={mixins:v.DEFINE_MANY,statics:v.DEFINE_MANY,propTypes:v.DEFINE_MANY,contextTypes:v.DEFINE_MANY,childContextTypes:v.DEFINE_MANY,getDefaultProps:v.DEFINE_MANY_MERGED,getInitialState:v.DEFINE_MANY_MERGED,getChildContext:v.DEFINE_MANY_MERGED,render:v.DEFINE_ONCE,componentWillMount:v.DEFINE_MANY,componentDidMount:v.DEFINE_MANY,componentWillReceiveProps:v.DEFINE_MANY,shouldComponentUpdate:v.DEFINE_ONCE,componentWillUpdate:v.DEFINE_MANY,componentDidUpdate:v.DEFINE_MANY,componentWillUnmount:v.DEFINE_MANY,updateComponent:v.OVERRIDE_BASE},y={displayName:function(a,b){a.displayName=b},mixins:function(a,b){if(b)for(var c=0;c";return this._createOpenTagMarkupAndPutListeners(b)+this._createContentMarkup(b,d)+e},_createOpenTagMarkupAndPutListeners:function(a){var b=this._currentElement.props,c="<"+this._tag;for(var e in b)if(b.hasOwnProperty(e)){var f=b[e];if(null!=f)if(u.hasOwnProperty(e))d(this._rootNodeID,e,f,a);else{e===w&&(f&&(f=this._previousStyleCopy=o({},b.style)),f=g.createMarkupForStyles(f));var h=i.createMarkupForProperty(e,f);h&&(c+=" "+h)}}if(a.renderToStaticMarkup)return c+">";var j=i.createMarkupForID(this._rootNodeID);return c+" "+j+">"},_createContentMarkup:function(a,b){var c="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(c="\n");var d=this._currentElement.props,e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html)return c+e.__html}else{var f=v[typeof d.children]?d.children:null,g=null!=f?null:d.children;if(null!=f)return c+p(f);if(null!=g){var h=this.mountChildren(g,a,b);return c+h.join("")}}return c},receiveComponent:function(a,b,c){var d=this._currentElement;this._currentElement=a,this.updateComponent(b,d,a,c)},updateComponent:function(a,b,d,e){c(this._currentElement.props),this._updateDOMProperties(b.props,a),this._updateDOMChildren(b.props,a,e)},_updateDOMProperties:function(a,b){var c,e,f,g=this._currentElement.props;for(c in a)if(!g.hasOwnProperty(c)&&a.hasOwnProperty(c))if(c===w){var i=this._previousStyleCopy;for(e in i)i.hasOwnProperty(e)&&(f=f||{},f[e]="");this._previousStyleCopy=null}else u.hasOwnProperty(c)?s(this._rootNodeID,c):(h.isStandardName[c]||h.isCustomAttribute(c))&&y.deletePropertyByID(this._rootNodeID,c);for(c in g){var j=g[c],k=c===w?this._previousStyleCopy:a[c];if(g.hasOwnProperty(c)&&j!==k)if(c===w)if(j&&(j=this._previousStyleCopy=o({},j)),k){for(e in k)!k.hasOwnProperty(e)||j&&j.hasOwnProperty(e)||(f=f||{},f[e]="");for(e in j)j.hasOwnProperty(e)&&k[e]!==j[e]&&(f=f||{},f[e]=j[e])}else f=j;else u.hasOwnProperty(c)?d(this._rootNodeID,c,j,b):(h.isStandardName[c]||h.isCustomAttribute(c))&&y.updatePropertyByID(this._rootNodeID,c,j)}f&&y.updateStylesByID(this._rootNodeID,f)},_updateDOMChildren:function(a,b,c){var d=this._currentElement.props,e=v[typeof a.children]?a.children:null,f=v[typeof d.children]?d.children:null,g=a.dangerouslySetInnerHTML&&a.dangerouslySetInnerHTML.__html,h=d.dangerouslySetInnerHTML&&d.dangerouslySetInnerHTML.__html,i=null!=e?null:a.children,j=null!=f?null:d.children,k=null!=e||null!=g,l=null!=f||null!=h;null!=i&&null==j?this.updateChildren(null,b,c):k&&!l&&this.updateTextContent(""),null!=f?e!==f&&this.updateTextContent(""+f):null!=h?g!==h&&y.updateInnerHTMLByID(this._rootNodeID,h):null!=j&&this.updateChildren(j,b,c)},unmountComponent:function(){this.unmountChildren(),j.deleteAllListeners(this._rootNodeID),k.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},n.measureMethods(f,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),o(f.prototype,f.Mixin,m.Mixin),f.injection={injectIDOperations:function(a){f.BackendIDOperations=y=a}},b.exports=f},{10:10,11:11,114:114,133:133,134:134,139:139,150:150,27:27,30:30,35:35,5:5,68:68,69:69,73:73}],43:[function(a,b){"use strict";var c=a(15),d=a(25),e=a(29),f=a(33),g=a(55),h=g.createFactory("form"),i=f.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[e,d],render:function(){return h(this.props)},componentDidMount:function(){this.trapBubbledEvent(c.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(c.topLevelTypes.topSubmit,"submit")}});b.exports=i},{15:15,25:25,29:29,33:33,55:55}],44:[function(a,b){"use strict";var c=a(5),d=a(9),e=a(11),f=a(68),g=a(73),h=a(133),i=a(144),j={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},k={updatePropertyByID:function(a,b,c){var d=f.getNode(a);h(!j.hasOwnProperty(b)),null!=c?e.setValueForProperty(d,b,c):e.deleteValueForProperty(d,b)},deletePropertyByID:function(a,b,c){var d=f.getNode(a);h(!j.hasOwnProperty(b)),e.deleteValueForProperty(d,b,c)},updateStylesByID:function(a,b){var d=f.getNode(a);c.setValueForStyles(d,b)},updateInnerHTMLByID:function(a,b){var c=f.getNode(a);i(c,b)},updateTextContentByID:function(a,b){var c=f.getNode(a);d.updateTextContent(c,b)},dangerouslyReplaceNodeWithMarkupByID:function(a,b){var c=f.getNode(a);d.dangerouslyReplaceNodeWithMarkup(c,b)},dangerouslyProcessChildrenUpdates:function(a,b){for(var c=0;cl;l++){var p=i[l];if(p!==g&&p.form===g.form){var q=j.getID(p);m(q);var r=o[q];m(r),k.asap(c,r)}}}return b}});b.exports=p},{11:11,133:133,2:2,24:24,27:27,29:29,33:33,55:55,68:68,85:85}],48:[function(a,b){"use strict";var c=a(29),d=a(33),e=a(55),f=(a(150),e.createFactory("option")),g=d.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[c],componentWillMount:function(){},render:function(){return f(this.props,this.props.children)}});b.exports=g},{150:150,29:29,33:33,55:55}],49:[function(a,b){"use strict";function c(){if(this._pendingUpdate){this._pendingUpdate=!1;var a=g.getValue(this);null!=a&&this.isMounted()&&e(this,a)}}function d(a,b){if(null==a[b])return null;if(a.multiple){if(!Array.isArray(a[b]))return new Error("The `"+b+"` prop supplied to must be a scalar value if `multiple` is false.")}function e(a,b){var c,d,e,f=a.getDOMNode().options;if(a.props.multiple){for(c={},d=0,e=b.length;e>d;d++)c[""+b[d]]=!0;for(d=0,e=f.length;e>d;d++){var g=c.hasOwnProperty(f[d].value);f[d].selected!==g&&(f[d].selected=g)}}else{for(c=""+b,d=0,e=f.length;e>d;d++)if(f[d].value===c)return void(f[d].selected=!0);f.length&&(f[0].selected=!0)}}var f=a(2),g=a(24),h=a(29),i=a(33),j=a(55),k=a(85),l=a(27),m=j.createFactory("select"),n=i.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[f,g.Mixin,h],propTypes:{defaultValue:d,value:d},render:function(){var a=l({},this.props);return a.onChange=this._handleChange,a.value=null,m(a,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var a=g.getValue(this);null!=a?e(this,a):null!=this.props.defaultValue&&e(this,this.props.defaultValue)},componentDidUpdate:function(a){var b=g.getValue(this);null!=b?(this._pendingUpdate=!1,e(this,b)):!a.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?e(this,this.props.defaultValue):e(this,this.props.multiple?[]:""))},_handleChange:function(a){var b,d=g.getOnChange(this);return d&&(b=d.call(this,a)),this._pendingUpdate=!0,k.asap(c,this),b}});b.exports=n},{2:2,24:24,27:27,29:29,33:33,55:55,85:85}],50:[function(a,b){"use strict";function c(a,b,c,d){return a===c&&b===d}function d(a){var b=document.selection,c=b.createRange(),d=c.text.length,e=c.duplicate();e.moveToElementText(a),e.setEndPoint("EndToStart",c);var f=e.text.length,g=f+d;return{start:f,end:g}}function e(a){var b=window.getSelection&&window.getSelection();if(!b||0===b.rangeCount)return null;var d=b.anchorNode,e=b.anchorOffset,f=b.focusNode,g=b.focusOffset,h=b.getRangeAt(0),i=c(b.anchorNode,b.anchorOffset,b.focusNode,b.focusOffset),j=i?0:h.toString().length,k=h.cloneRange();k.selectNodeContents(a),k.setEnd(h.startContainer,h.startOffset);var l=c(k.startContainer,k.startOffset,k.endContainer,k.endOffset),m=l?0:k.toString().length,n=m+j,o=document.createRange();o.setStart(d,e),o.setEnd(f,g);var p=o.collapsed;return{start:p?n:m,end:p?m:n}}function f(a,b){var c,d,e=document.selection.createRange().duplicate();"undefined"==typeof b.end?(c=b.start,d=c):b.start>b.end?(c=b.end,d=b.start):(c=b.start,d=b.end),e.moveToElementText(a),e.moveStart("character",c),e.setEndPoint("EndToStart",e),e.moveEnd("character",d-c),e.select()}function g(a,b){if(window.getSelection){var c=window.getSelection(),d=a[j()].length,e=Math.min(b.start,d),f="undefined"==typeof b.end?e:Math.min(b.end,d);if(!c.extend&&e>f){var g=f;f=e,e=g}var h=i(a,e),k=i(a,f);if(h&&k){var l=document.createRange();l.setStart(h.node,h.offset),c.removeAllRanges(),e>f?(c.addRange(l),c.extend(k.node,k.offset)):(l.setEnd(k.node,k.offset),c.addRange(l))}}}var h=a(21),i=a(126),j=a(128),k=h.canUseDOM&&"selection"in document&&!("getSelection"in window),l={getOffsets:k?d:e,setOffsets:k?f:g};b.exports=l},{126:126,128:128,21:21}],51:[function(a,b){"use strict";var c=a(11),d=a(35),e=a(42),f=a(27),g=a(114),h=function(){};f(h.prototype,{construct:function(a){this._currentElement=a,this._stringText=""+a,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(a,b){this._rootNodeID=a;var d=g(this._stringText);return b.renderToStaticMarkup?d:""+d+""},receiveComponent:function(a){if(a!==this._currentElement){this._currentElement=a;var b=""+a;b!==this._stringText&&(this._stringText=b,e.BackendIDOperations.updateTextContentByID(this._rootNodeID,b))}},unmountComponent:function(){d.unmountIDFromEnvironment(this._rootNodeID)}}),b.exports=h},{11:11,114:114,27:27,35:35,42:42}],52:[function(a,b){"use strict";function c(){this.isMounted()&&this.forceUpdate()}var d=a(2),e=a(11),f=a(24),g=a(29),h=a(33),i=a(55),j=a(85),k=a(27),l=a(133),m=(a(150),i.createFactory("textarea")),n=h.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[d,f.Mixin,g],getInitialState:function(){var a=this.props.defaultValue,b=this.props.children;null!=b&&(l(null==a),Array.isArray(b)&&(l(b.length<=1),b=b[0]),a=""+b),null==a&&(a="");var c=f.getValue(this);return{initialValue:""+(null!=c?c:a)}},render:function(){var a=k({},this.props);return l(null==a.dangerouslySetInnerHTML),a.defaultValue=null,a.value=null,a.onChange=this._handleChange,m(a,this.state.initialValue)},componentDidUpdate:function(){var a=f.getValue(this);if(null!=a){var b=this.getDOMNode();e.setValueForProperty(b,"value",""+a)}},_handleChange:function(a){var b,d=f.getOnChange(this);return d&&(b=d.call(this,a)),j.asap(c,this),b}});b.exports=n},{11:11,133:133,150:150,2:2,24:24,27:27,29:29,33:33,55:55,85:85}],53:[function(a,b){"use strict";function c(){this.reinitializeTransaction()}var d=a(85),e=a(101),f=a(27),g=a(112),h={initialize:g,close:function(){l.isBatchingUpdates=!1}},i={initialize:g,close:d.flushBatchedUpdates.bind(d)},j=[i,h];f(c.prototype,e.Mixin,{getTransactionWrappers:function(){return j}});var k=new c,l={isBatchingUpdates:!1,batchedUpdates:function(a,b,c,d,e){var f=l.isBatchingUpdates;l.isBatchingUpdates=!0,f?a(b,c,d,e):k.perform(a,null,b,c,d,e)}};b.exports=l},{101:101,112:112,27:27,85:85}],54:[function(a,b){"use strict";function c(a){return n.createClass({tagName:a.toUpperCase(),render:function(){return new B(a,null,null,null,null,this.props)}})}function d(){D.EventEmitter.injectReactEventListener(C),D.EventPluginHub.injectEventPluginOrder(h),D.EventPluginHub.injectInstanceHandle(E),D.EventPluginHub.injectMount(F),D.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:J,EnterLeaveEventPlugin:i,ChangeEventPlugin:f,MobileSafariClickEventPlugin:l,SelectEventPlugin:H,BeforeInputEventPlugin:e}),D.NativeComponent.injectGenericComponentClass(q),D.NativeComponent.injectTextComponentClass(A),D.NativeComponent.injectAutoWrapper(c),D.Class.injectMixin(m),D.NativeComponent.injectComponentClasses({button:r,form:s,iframe:v,img:t,input:w,option:x,select:y,textarea:z,html:L("html"),head:L("head"),body:L("body")}),D.DOMProperty.injectDOMPropertyConfig(k),D.DOMProperty.injectDOMPropertyConfig(K),D.EmptyComponent.injectEmptyComponent("noscript"),D.Updates.injectReconcileTransaction(G),D.Updates.injectBatchingStrategy(p),D.RootIndex.injectCreateReactRootIndex(j.canUseDOM?g.createReactRootIndex:I.createReactRootIndex),D.Component.injectEnvironment(o),D.DOMComponent.injectIDOperations(u)}var e=a(3),f=a(7),g=a(8),h=a(13),i=a(14),j=a(21),k=a(23),l=a(26),m=a(29),n=a(33),o=a(35),p=a(53),q=a(42),r=a(41),s=a(43),t=a(46),u=a(44),v=a(45),w=a(47),x=a(48),y=a(49),z=a(52),A=a(51),B=a(55),C=a(60),D=a(62),E=a(64),F=a(68),G=a(78),H=a(87),I=a(88),J=a(89),K=a(86),L=a(109);b.exports={inject:d}},{109:109,13:13,14:14,21:21,23:23,26:26,29:29,3:3,33:33,35:35,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,51:51,52:52,53:53,55:55,60:60,62:62,64:64,68:68,7:7,78:78,8:8,86:86,87:87,88:88,89:89}],55:[function(a,b){"use strict";var c=a(38),d=a(39),e=a(27),f=(a(150),{key:!0,ref:!0}),g=function(a,b,c,d,e,f){this.type=a,this.key=b,this.ref=c,this._owner=d,this._context=e,this.props=f};g.prototype={_isReactElement:!0},g.createElement=function(a,b,e){var h,i={},j=null,k=null;if(null!=b){k=void 0===b.ref?null:b.ref,j=void 0===b.key?null:""+b.key;for(h in b)b.hasOwnProperty(h)&&!f.hasOwnProperty(h)&&(i[h]=b[h]) +}var l=arguments.length-2;if(1===l)i.children=e;else if(l>1){for(var m=Array(l),n=0;l>n;n++)m[n]=arguments[n+2];i.children=m}if(a&&a.defaultProps){var o=a.defaultProps;for(h in o)"undefined"==typeof i[h]&&(i[h]=o[h])}return new g(a,j,k,d.current,c.current,i)},g.createFactory=function(a){var b=g.createElement.bind(null,a);return b.type=a,b},g.cloneAndReplaceProps=function(a,b){var c=new g(a.type,a.key,a.ref,a._owner,a._context,b);return c},g.cloneElement=function(a,b,c){var h,i=e({},a.props),j=a.key,k=a.ref,l=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,l=d.current),void 0!==b.key&&(j=""+b.key);for(h in b)b.hasOwnProperty(h)&&!f.hasOwnProperty(h)&&(i[h]=b[h])}var m=arguments.length-2;if(1===m)i.children=c;else if(m>1){for(var n=Array(m),o=0;m>o;o++)n[o]=arguments[o+2];i.children=n}return new g(a.type,j,k,l,a._context,i)},g.isValidElement=function(a){var b=!(!a||!a._isReactElement);return b},b.exports=g},{150:150,27:27,38:38,39:39}],56:[function(a,b){"use strict";function c(){if(r.current){var a=r.current.getName();if(a)return" Check the render method of `"+a+"`."}return""}function d(a){var b=a&&a.getPublicInstance();if(!b)return void 0;var c=b.constructor;return c?c.displayName||c.name||void 0:void 0}function e(){var a=r.current;return a&&d(a)||void 0}function f(a,b){a._store.validated||null!=a.key||(a._store.validated=!0,h('Each child in an array or iterator should have a unique "key" prop.',a,b))}function g(a,b,c){x.test(a)&&h("Child objects should have non-numeric keys so ordering is preserved.",b,c)}function h(a,b,c){var f=e(),g="string"==typeof c?c:c.displayName||c.name,h=f||g,i=v[a]||(v[a]={});if(!i.hasOwnProperty(h)){i[h]=!0;var j="";if(b&&b._owner&&b._owner!==r.current){var k=d(b._owner);j=" It was passed a child from "+k+"."}}}function i(a,b){if(Array.isArray(a))for(var c=0;c");var h="";e&&(h=" The element was created by "+e+".")}}function l(a,b){return a!==a?b!==b:0===a&&0===b?1/a===1/b:a===b}function m(a){if(a._store){var b=a._store.originalProps,c=a.props;for(var d in c)c.hasOwnProperty(d)&&(b.hasOwnProperty(d)&&l(b[d],c[d])||(k(d,a),b[d]=c[d]))}}function n(a){if(null!=a.type){var b=s.getComponentClassForElement(a),c=b.displayName||b.name;b.propTypes&&j(c,b.propTypes,a.props,q.prop),"function"==typeof b.getDefaultProps}}var o=a(55),p=a(61),q=a(75),r=(a(74),a(39)),s=a(71),t=a(124),u=a(133),v=(a(150),{}),w={},x=/^\d+$/,y={},z={checkAndWarnForMutatedProps:m,createElement:function(a){var b=o.createElement.apply(this,arguments);if(null==b)return b;for(var c=2;ce;e++){b=a.ancestors[e];var g=k.getID(b)||"";p._handleTopLevel(a.topLevelType,b,g,a.nativeEvent)}}function f(a){var b=o(window);a(b)}var g=a(16),h=a(21),i=a(28),j=a(64),k=a(68),l=a(85),m=a(27),n=a(123),o=a(129);m(d.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),i.addPoolingTo(d,i.twoArgumentPooler);var p={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:h.canUseDOM?window:null,setHandleTopLevel:function(a){p._handleTopLevel=a},setEnabled:function(a){p._enabled=!!a},isEnabled:function(){return p._enabled},trapBubbledEvent:function(a,b,c){var d=c;return d?g.listen(d,b,p.dispatchEvent.bind(null,a)):null},trapCapturedEvent:function(a,b,c){var d=c;return d?g.capture(d,b,p.dispatchEvent.bind(null,a)):null},monitorScrollValue:function(a){var b=f.bind(null,a);g.listen(window,"scroll",b)},dispatchEvent:function(a,b){if(p._enabled){var c=d.getPooled(a,b);try{l.batchedUpdates(e,c)}finally{d.release(c)}}}};b.exports=p},{123:123,129:129,16:16,21:21,27:27,28:28,64:64,68:68,85:85}],61:[function(a,b){"use strict";var c=(a(55),a(150),{create:function(a){return a},extract:function(a){return a},extractIfFragment:function(a){return a}});b.exports=c},{150:150,55:55}],62:[function(a,b){"use strict";var c=a(10),d=a(17),e=a(36),f=a(33),g=a(57),h=a(30),i=a(71),j=a(42),k=a(73),l=a(81),m=a(85),n={Component:e.injection,Class:f.injection,DOMComponent:j.injection,DOMProperty:c.injection,EmptyComponent:g.injection,EventPluginHub:d.injection,EventEmitter:h.injection,NativeComponent:i.injection,Perf:k.injection,RootIndex:l.injection,Updates:m.injection};b.exports=n},{10:10,17:17,30:30,33:33,36:36,42:42,57:57,71:71,73:73,81:81,85:85}],63:[function(a,b){"use strict";function c(a){return e(document.documentElement,a)}var d=a(50),e=a(107),f=a(117),g=a(119),h={hasSelectionCapabilities:function(a){return a&&("INPUT"===a.nodeName&&"text"===a.type||"TEXTAREA"===a.nodeName||"true"===a.contentEditable)},getSelectionInformation:function(){var a=g();return{focusedElem:a,selectionRange:h.hasSelectionCapabilities(a)?h.getSelection(a):null}},restoreSelection:function(a){var b=g(),d=a.focusedElem,e=a.selectionRange;b!==d&&c(d)&&(h.hasSelectionCapabilities(d)&&h.setSelection(d,e),f(d))},getSelection:function(a){var b;if("selectionStart"in a)b={start:a.selectionStart,end:a.selectionEnd};else if(document.selection&&"INPUT"===a.nodeName){var c=document.selection.createRange();c.parentElement()===a&&(b={start:-c.moveStart("character",-a.value.length),end:-c.moveEnd("character",-a.value.length)})}else b=d.getOffsets(a);return b||{start:0,end:0}},setSelection:function(a,b){var c=b.start,e=b.end;if("undefined"==typeof e&&(e=c),"selectionStart"in a)a.selectionStart=c,a.selectionEnd=Math.min(e,a.value.length);else if(document.selection&&"INPUT"===a.nodeName){var f=a.createTextRange();f.collapse(!0),f.moveStart("character",c),f.moveEnd("character",e-c),f.select()}else d.setOffsets(a,b)}};b.exports=h},{107:107,117:117,119:119,50:50}],64:[function(a,b){"use strict";function c(a){return m+a.toString(36)}function d(a,b){return a.charAt(b)===m||b===a.length}function e(a){return""===a||a.charAt(0)===m&&a.charAt(a.length-1)!==m}function f(a,b){return 0===b.indexOf(a)&&d(b,a.length)}function g(a){return a?a.substr(0,a.lastIndexOf(m)):""}function h(a,b){if(l(e(a)&&e(b)),l(f(a,b)),a===b)return a;var c,g=a.length+n;for(c=g;c=g;g++)if(d(a,g)&&d(b,g))f=g;else if(a.charAt(g)!==b.charAt(g))break;var h=a.substr(0,f);return l(e(h)),h}function j(a,b,c,d,e,i){a=a||"",b=b||"",l(a!==b);var j=f(b,a);l(j||f(a,b));for(var k=0,m=j?g:h,n=a;;n=m(n,b)){var p;if(e&&n===a||i&&n===b||(p=c(n,j,d)),p===!1||n===b)break;l(k++1){var b=a.indexOf(m,1);return b>-1?a.substr(0,b):a}return null},traverseEnterLeave:function(a,b,c,d,e){var f=i(a,b);f!==a&&j(a,f,c,d,!1,!0),f!==b&&j(f,b,c,e,!0,!1)},traverseTwoPhase:function(a,b,c){a&&(j("",a,b,c,!0,!1),j(a,"",b,c,!1,!0))},traverseAncestors:function(a,b,c){j("",a,b,c,!0,!1)},_getFirstCommonAncestorID:i,_getNextDescendantID:h,isAncestorIDOf:f,SEPARATOR:m};b.exports=p},{133:133,81:81}],65:[function(a,b){"use strict";var c={remove:function(a){a._reactInternalInstance=void 0},get:function(a){return a._reactInternalInstance},has:function(a){return void 0!==a._reactInternalInstance},set:function(a,b){a._reactInternalInstance=b}};b.exports=c},{}],66:[function(a,b){"use strict";var c={currentlyMountingInstance:null,currentlyUnmountingInstance:null};b.exports=c},{}],67:[function(a,b){"use strict";var c=a(104),d={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(a){var b=c(a);return a.replace(">"," "+d.CHECKSUM_ATTR_NAME+'="'+b+'">')},canReuseMarkup:function(a,b){var e=b.getAttribute(d.CHECKSUM_ATTR_NAME);e=e&&parseInt(e,10);var f=c(a);return f===e}};b.exports=d},{104:104}],68:[function(a,b){"use strict";function c(a,b){for(var c=Math.min(a.length,b.length),d=0;c>d;d++)if(a.charAt(d)!==b.charAt(d))return d;return a.length===b.length?-1:c}function d(a){var b=C(a);return b&&Q.getID(b)}function e(a){var b=f(a);if(b)if(J.hasOwnProperty(b)){var c=J[b];c!==a&&(E(!j(c,b)),J[b]=a)}else J[b]=a;return b}function f(a){return a&&a.getAttribute&&a.getAttribute(I)||""}function g(a,b){var c=f(a);c!==b&&delete J[c],a.setAttribute(I,b),J[b]=a}function h(a){return J.hasOwnProperty(a)&&j(J[a],a)||(J[a]=Q.findReactNodeByID(a)),J[a]}function i(a){var b=u.get(a)._rootNodeID;return s.isNullComponentID(b)?null:(J.hasOwnProperty(b)&&j(J[b],b)||(J[b]=Q.findReactNodeByID(b)),J[b])}function j(a,b){if(a){E(f(a)===b);var c=Q.findReactContainerForID(b);if(c&&B(c,a))return!0}return!1}function k(a){delete J[a]}function l(a){var b=J[a];return b&&j(b,a)?void(P=b):!1}function m(a){P=null,t.traverseAncestors(a,l);var b=P;return P=null,b}function n(a,b,c,d,e){var f=x.mountComponent(a,b,d,A);a._isTopLevel=!0,Q._mountImageIntoNode(f,c,e)}function o(a,b,c,d){var e=z.ReactReconcileTransaction.getPooled();e.perform(n,null,a,b,c,e,d),z.ReactReconcileTransaction.release(e)}var p=a(10),q=a(30),r=(a(39),a(55)),s=(a(56),a(57)),t=a(64),u=a(65),v=a(67),w=a(73),x=a(79),y=a(84),z=a(85),A=a(113),B=a(107),C=a(127),D=a(132),E=a(133),F=a(144),G=a(147),H=(a(150),t.SEPARATOR),I=p.ID_ATTRIBUTE_NAME,J={},K=1,L=9,M={},N={},O=[],P=null,Q={_instancesByReactRootID:M,scrollMonitor:function(a,b){b()},_updateRootComponent:function(a,b,c,d){return Q.scrollMonitor(c,function(){y.enqueueElementInternal(a,b),d&&y.enqueueCallbackInternal(a,d)}),a},_registerComponent:function(a,b){E(b&&(b.nodeType===K||b.nodeType===L)),q.ensureScrollValueMonitoring();var c=Q.registerContainer(b);return M[c]=a,c},_renderNewRootComponent:function(a,b,c){var d=D(a,null),e=Q._registerComponent(d,b);return z.batchedUpdates(o,d,e,b,c),d},render:function(a,b,c){E(r.isValidElement(a));var e=M[d(b)];if(e){var f=e._currentElement;if(G(f,a))return Q._updateRootComponent(e,a,b,c).getPublicInstance();Q.unmountComponentAtNode(b)}var g=C(b),h=g&&Q.isRenderedByReact(g),i=h&&!e,j=Q._renderNewRootComponent(a,b,i).getPublicInstance();return c&&c.call(j),j},constructAndRenderComponent:function(a,b,c){var d=r.createElement(a,b);return Q.render(d,c)},constructAndRenderComponentByID:function(a,b,c){var d=document.getElementById(c);return E(d),Q.constructAndRenderComponent(a,b,d)},registerContainer:function(a){var b=d(a);return b&&(b=t.getReactRootIDFromNodeID(b)),b||(b=t.createReactRootID()),N[b]=a,b},unmountComponentAtNode:function(a){E(a&&(a.nodeType===K||a.nodeType===L));var b=d(a),c=M[b];return c?(Q.unmountComponentFromNode(c,a),delete M[b],delete N[b],!0):!1},unmountComponentFromNode:function(a,b){for(x.unmountComponent(a),b.nodeType===L&&(b=b.documentElement);b.lastChild;)b.removeChild(b.lastChild)},findReactContainerForID:function(a){var b=t.getReactRootIDFromNodeID(a),c=N[b];return c},findReactNodeByID:function(a){var b=Q.findReactContainerForID(a);return Q.findComponentRoot(b,a)},isRenderedByReact:function(a){if(1!==a.nodeType)return!1;var b=Q.getID(a);return b?b.charAt(0)===H:!1},getFirstReactDOM:function(a){for(var b=a;b&&b.parentNode!==b;){if(Q.isRenderedByReact(b))return b;b=b.parentNode}return null},findComponentRoot:function(a,b){var c=O,d=0,e=m(b)||a;for(c[0]=e.firstChild,c.length=1;d>",v=g(),w=l(),x={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),any:e(),arrayOf:f,element:v,instanceOf:h,node:w,objectOf:j,oneOf:i,oneOfType:k,shape:m};b.exports=x},{112:112,55:55,61:61,74:74}],77:[function(a,b){"use strict";function c(){this.listenersToPut=[]}var d=a(28),e=a(30),f=a(27);f(c.prototype,{enqueuePutListener:function(a,b,c){this.listenersToPut.push({rootNodeID:a,propKey:b,propValue:c})},putListeners:function(){for(var a=0;ac;c++){var d=q[c],e=d._pendingCallbacks;if(d._pendingCallbacks=null,m.performUpdateIfNecessary(d,a.reconcileTransaction),e)for(var g=0;g":">","<":"<",'"':""","'":"'"},f=/[&><"']/g;b.exports=d},{}],115:[function(a,b){"use strict";function c(a){return null==a?null:g(a)?a:d.has(a)?e.getNodeFromInstance(a):(f(null==a.render||"function"!=typeof a.render),void f(!1))}var d=(a(39),a(65)),e=a(68),f=a(133),g=a(135);a(150),b.exports=c},{133:133,135:135,150:150,39:39,65:65,68:68}],116:[function(a,b){"use strict";function c(a,b,c){var d=a,e=!d.hasOwnProperty(c);e&&null!=b&&(d[c]=b)}function d(a){if(null==a)return a;var b={};return e(a,c,b),b}var e=a(149);a(150),b.exports=d},{149:149,150:150}],117:[function(a,b){"use strict";function c(a){try{a.focus()}catch(b){}}b.exports=c},{}],118:[function(a,b){"use strict";var c=function(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)};b.exports=c},{}],119:[function(a,b){function c(){try{return document.activeElement||document.body}catch(a){return document.body}}b.exports=c},{}],120:[function(a,b){"use strict";function c(a){var b,c=a.keyCode;return"charCode"in a?(b=a.charCode,0===b&&13===c&&(b=13)):b=c,b>=32||13===b?b:0}b.exports=c},{}],121:[function(a,b){"use strict";function c(a){if(a.key){var b=e[a.key]||a.key;if("Unidentified"!==b)return b}if("keypress"===a.type){var c=d(a);return 13===c?"Enter":String.fromCharCode(c)}return"keydown"===a.type||"keyup"===a.type?f[a.keyCode]||"Unidentified":""}var d=a(120),e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};b.exports=c},{120:120}],122:[function(a,b){"use strict";function c(a){var b=this,c=b.nativeEvent;if(c.getModifierState)return c.getModifierState(a);var d=e[a];return d?!!c[d]:!1}function d(){return c}var e={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};b.exports=d},{}],123:[function(a,b){"use strict";function c(a){var b=a.target||a.srcElement||window;return 3===b.nodeType?b.parentNode:b}b.exports=c},{}],124:[function(a,b){"use strict";function c(a){var b=a&&(d&&a[d]||a[e]);return"function"==typeof b?b:void 0}var d="function"==typeof Symbol&&Symbol.iterator,e="@@iterator";b.exports=c},{}],125:[function(a,b){function c(a){return e(!!f),l.hasOwnProperty(a)||(a="*"),g.hasOwnProperty(a)||(f.innerHTML="*"===a?"":"<"+a+">",g[a]=!f.firstChild),g[a]?l[a]:null}var d=a(21),e=a(133),f=d.canUseDOM?document.createElement("div"):null,g={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},h=[1,'"],i=[1,"

    ","
    "],j=[3,"","
    "],k=[1,"",""],l={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:h,option:h,caption:i,colgroup:i,tbody:i,tfoot:i,thead:i,td:j,th:j,circle:k,defs:k,ellipse:k,g:k,line:k,linearGradient:k,path:k,polygon:k,polyline:k,radialGradient:k,rect:k,stop:k,text:k};b.exports=c},{133:133,21:21}],126:[function(a,b){"use strict";function c(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function d(a){for(;a;){if(a.nextSibling)return a.nextSibling;a=a.parentNode}}function e(a,b){for(var e=c(a),f=0,g=0;e;){if(3===e.nodeType){if(g=f+e.textContent.length,b>=f&&g>=b)return{node:e,offset:b-f};f=g}e=c(d(e))}}b.exports=e},{}],127:[function(a,b){"use strict";function c(a){return a?a.nodeType===d?a.documentElement:a.firstChild:null}var d=9;b.exports=c},{}],128:[function(a,b){"use strict";function c(){return!e&&d.canUseDOM&&(e="textContent"in document.documentElement?"textContent":"innerText"),e}var d=a(21),e=null;b.exports=c},{21:21}],129:[function(a,b){"use strict";function c(a){return a===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:a.scrollLeft,y:a.scrollTop}}b.exports=c},{}],130:[function(a,b){function c(a){return a.replace(d,"-$1").toLowerCase()}var d=/([A-Z])/g;b.exports=c},{}],131:[function(a,b){"use strict";function c(a){return d(a).replace(e,"-ms-")}var d=a(130),e=/^ms-/;b.exports=c},{130:130}],132:[function(a,b){"use strict";function c(a){return"function"==typeof a&&"function"==typeof a.prototype.mountComponent&&"function"==typeof a.prototype.receiveComponent}function d(a,b){var d;if((null===a||a===!1)&&(a=f.emptyElement),"object"==typeof a){var e=a;d=b===e.type&&"string"==typeof e.type?g.createInternalComponent(e):c(e.type)?new e.type(e):new j}else"string"==typeof a||"number"==typeof a?d=g.createInstanceForText(a):i(!1);return d.construct(a),d._mountIndex=0,d._mountImage=null,d}var e=a(37),f=a(57),g=a(71),h=a(27),i=a(133),j=(a(150),function(){});h(j.prototype,e.Mixin,{_instantiateReactComponent:d}),b.exports=d},{133:133,150:150,27:27,37:37,57:57,71:71}],133:[function(a,b){"use strict";var c=function(a,b,c,d,e,f,g,h){if(!a){var i;if(void 0===b)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var j=[c,d,e,f,g,h],k=0;i=new Error("Invariant Violation: "+b.replace(/%s/g,function(){return j[k++]}))}throw i.framesToPop=1,i}};b.exports=c},{}],134:[function(a,b){"use strict";function c(a,b){if(!e.canUseDOM||b&&!("addEventListener"in document))return!1;var c="on"+a,f=c in document;if(!f){var g=document.createElement("div");g.setAttribute(c,"return;"),f="function"==typeof g[c]}return!f&&d&&"wheel"===a&&(f=document.implementation.hasFeature("Events.wheel","3.0")),f}var d,e=a(21);e.canUseDOM&&(d=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),b.exports=c},{21:21}],135:[function(a,b){function c(a){return!(!a||!("function"==typeof Node?a instanceof Node:"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName))}b.exports=c},{}],136:[function(a,b){"use strict";function c(a){return a&&("INPUT"===a.nodeName&&d[a.type]||"TEXTAREA"===a.nodeName)}var d={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};b.exports=c},{}],137:[function(a,b){function c(a){return d(a)&&3==a.nodeType}var d=a(135);b.exports=c},{135:135}],138:[function(a,b){"use strict";var c=a(133),d=function(a){var b,d={};c(a instanceof Object&&!Array.isArray(a));for(b in a)a.hasOwnProperty(b)&&(d[b]=b);return d};b.exports=d},{133:133}],139:[function(a,b){var c=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return b;return null};b.exports=c},{}],140:[function(a,b){"use strict";function c(a,b,c){if(!a)return null;var e={};for(var f in a)d.call(a,f)&&(e[f]=b.call(c,a[f],f,a));return e}var d=Object.prototype.hasOwnProperty;b.exports=c},{}],141:[function(a,b){"use strict";function c(a){var b={};return function(c){return b.hasOwnProperty(c)||(b[c]=a.call(this,c)),b[c]}}b.exports=c},{}],142:[function(a,b){"use strict";function c(a){return e(d.isValidElement(a)),a}var d=a(55),e=a(133);b.exports=c},{133:133,55:55}],143:[function(a,b){"use strict";function c(a){return'"'+d(a)+'"'}var d=a(114);b.exports=c},{114:114}],144:[function(a,b){"use strict";var c=a(21),d=/^[ \r\n\t\f]/,e=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,f=function(a,b){a.innerHTML=b};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(f=function(a,b){MSApp.execUnsafeLocalFunction(function(){a.innerHTML=b})}),c.canUseDOM){var g=document.createElement("div");g.innerHTML=" ",""===g.innerHTML&&(f=function(a,b){if(a.parentNode&&a.parentNode.replaceChild(a,a),d.test(b)||"<"===b[0]&&e.test(b)){a.innerHTML=""+b;var c=a.firstChild;1===c.data.length?a.removeChild(c):c.deleteData(0,1)}else a.innerHTML=b})}b.exports=f},{21:21}],145:[function(a,b){"use strict";var c=a(21),d=a(114),e=a(144),f=function(a,b){a.textContent=b};c.canUseDOM&&("textContent"in document.documentElement||(f=function(a,b){e(a,d(b))})),b.exports=f},{114:114,144:144,21:21}],146:[function(a,b){"use strict";function c(a,b){if(a===b)return!0;var c;for(c in a)if(a.hasOwnProperty(c)&&(!b.hasOwnProperty(c)||a[c]!==b[c]))return!1;for(c in b)if(b.hasOwnProperty(c)&&!a.hasOwnProperty(c))return!1;return!0}b.exports=c},{}],147:[function(a,b){"use strict";function c(a,b){if(null!=a&&null!=b){var c=typeof a,d=typeof b;if("string"===c||"number"===c)return"string"===d||"number"===d;if("object"===d&&a.type===b.type&&a.key===b.key){var e=a._owner===b._owner;return e}}return!1}a(150),b.exports=c},{150:150}],148:[function(a,b){function c(a){var b=a.length;if(d(!Array.isArray(a)&&("object"==typeof a||"function"==typeof a)),d("number"==typeof b),d(0===b||b-1 in a),a.hasOwnProperty)try{return Array.prototype.slice.call(a)}catch(c){}for(var e=Array(b),f=0;b>f;f++)e[f]=a[f];return e}var d=a(133);b.exports=c},{133:133}],149:[function(a,b){"use strict";function c(a){return p[a]}function d(a,b){return a&&null!=a.key?f(a.key):b.toString(36)}function e(a){return(""+a).replace(q,c)}function f(a){return"$"+e(a)}function g(a,b,c,e,h){var k=typeof a;if(("undefined"===k||"boolean"===k)&&(a=null),null===a||"string"===k||"number"===k||i.isValidElement(a))return e(h,a,""===b?n+d(a,0):b,c),1;var p,q,r,s=0;if(Array.isArray(a))for(var t=0;ta?-1:a>0?1:+a}),THREE.log=function(){console.log.apply(console,arguments)},THREE.warn=function(){console.warn.apply(console,arguments)},THREE.error=function(){console.error.apply(console,arguments)},THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.NoShading=0,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.Projector=function(){THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(a,b){THREE.warn("THREE.Projector: .projectVector() is now vector.project()."),a.project(b)},this.unprojectVector=function(a,b){THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),a.unproject(b)},this.pickingRay=function(){THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){return a instanceof THREE.Color?this.copy(a):"number"==typeof a?this.setHex(a):"string"==typeof a&&this.setStyle(a),this},setHex:function(a){return a=Math.floor(a),this.r=(a>>16&255)/255,this.g=(a>>8&255)/255,this.b=(255&a)/255,this},setRGB:function(a,b,c){return this.r=a,this.g=b,this.b=c,this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b,c=2*c-b,this.r=d(c,b,a+1/3),this.g=d(c,b,a),this.b=d(c,b,a-1/3)}return this},setStyle:function(a){return/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a)?(a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this):/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a)?(a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r=Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this):/^\#([0-9a-f]{6})$/i.test(a)?(a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this):/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a)?(a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this):/^(\w+)$/i.test(a)?(this.setHex(THREE.ColorKeywords[a]),this):void 0},copy:function(a){return this.r=a.r,this.g=a.g,this.b=a.b,this},copyGammaToLinear:function(a,b){return void 0===b&&(b=2),this.r=Math.pow(a.r,b),this.g=Math.pow(a.g,b),this.b=Math.pow(a.b,b),this},copyLinearToGamma:function(a,b){void 0===b&&(b=2);var c=b>0?1/b:1;return this.r=Math.pow(a.r,c),this.g=Math.pow(a.g,c),this.b=Math.pow(a.b,c),this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;return this.r=a*a,this.g=b*b,this.b=c*c,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b,c=this.r,d=this.g,e=this.b,f=Math.max(c,d,e),g=Math.min(c,d,e),h=(g+f)/2;if(g===f)g=b=0;else{var i=f-g,g=.5>=h?i/(f+g):i/(2-f-g);switch(f){case c:b=(d-e)/i+(e>d?6:0);break;case d:b=(e-c)/i+2;break;case e:b=(c-d)/i+4}b/=6}return a.h=b,a.s=g,a.l=h,a},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(a,b,c){var d=this.getHSL();return d.h+=a,d.s+=b,d.l+=c,this.setHSL(d.h,d.s,d.l),this},add:function(a){return this.r+=a.r,this.g+=a.g,this.b+=a.b,this},addColors:function(a,b){return this.r=a.r+b.r,this.g=a.g+b.g,this.b=a.b+b.b,this},addScalar:function(a){return this.r+=a,this.g+=a,this.b+=a,this},multiply:function(a){return this.r*=a.r,this.g*=a.g,this.b*=a.b,this},multiplyScalar:function(a){return this.r*=a,this.g*=a,this.b*=a,this},lerp:function(a,b){return this.r+=(a.r-this.r)*b,this.g+=(a.g-this.g)*b,this.b+=(a.b-this.b)*b,this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a){return this.r=a[0],this.g=a[1],this.b=a[2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.r,a[b+1]=this.g,a[b+2]=this.b,a},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}},THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},THREE.Quaternion=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._w=void 0!==d?d:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get w(){return this._w},set w(a){this._w=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._w=d,this.onChangeCallback(),this},copy:function(a){return this._x=a.x,this._y=a.y,this._z=a.z,this._w=a.w,this.onChangeCallback(),this},setFromEuler:function(a,b){if(!1==a instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);return"XYZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"YXZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"ZXY"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"ZYX"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"YZX"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):"XZY"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h),!1!==b&&this.onChangeCallback(),this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);return this._x=a.x*d,this._y=a.y*d,this._z=a.z*d,this._w=Math.cos(c),this.onChangeCallback(),this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],i=b[6],b=b[10],j=c+f+b;return j>0?(c=.5/Math.sqrt(j+1),this._w=.25/c,this._x=(i-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(i-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+i)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+i)/c,this._z=.25*c),this.onChangeCallback(),this +},setFromUnitVectors:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3),b=c.dot(d)+1,1e-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d),this._x=a.x,this._y=a.y,this._z=a.z,this._w=b,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();return 0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a),this.onChangeCallback(),this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,i=b._z,j=b._w;return this._x=c*j+f*g+d*i-e*h,this._y=d*j+f*h+e*g-c*i,this._z=e*j+f*i+c*h-d*g,this._w=f*j-c*g-d*h-e*i,this.onChangeCallback(),this},multiplyVector3:function(a){return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;if(0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a),g>=1)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),i=Math.sqrt(1-g*g);return.001>Math.abs(i)?(this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this):(g=Math.sin((1-b)*h)/i,h=Math.sin(b*h)/i,this._w=f*g+this._w*h,this._x=c*g+this._x*h,this._y=d*g+this._y*h,this._z=e*g+this._z*h,this.onChangeCallback(),this)},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){return void 0===b&&(b=0),this._x=a[b],this._y=a[b+1],this._z=a[b+2],this._w=a[b+3],this.onChangeCallback(),this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._w,a},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}},THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)},THREE.Vector2=function(a,b){this.x=a||0,this.y=b||0},THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){return this.x=a,this.y=b,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this)},addScalar:function(a){return this.x+=a,this.y+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this)},subScalar:function(a){return this.x-=a,this.y-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this},divide:function(a){return this.x/=a.x,this.y/=a.y,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0,this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2),a.set(c,c),b.set(d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;return a=this.y-a.y,b*b+a*a},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this},clone:function(){return new THREE.Vector2(this.x,this.y)}},THREE.Vector3=function(a,b,c){this.x=a||0,this.y=b||0,this.z=c||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){return this.x=a,this.y=b,this.z=c,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this.z+=a.z,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this.z-=a.z,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b)):(this.x*=a.x,this.y*=a.y,this.z*=a.z,this)},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this},multiplyVectors:function(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this},applyEuler:function(){var a;return function(b){return!1==b instanceof THREE.Euler&&THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromEuler(b)),this}}(),applyAxisAngle:function(){var a;return function(b,c){return void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromAxisAngle(b,c)),this}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[3]*c+a[6]*d,this.y=a[1]*b+a[4]*c+a[7]*d,this.z=a[2]*b+a[5]*c+a[8]*d,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d+a[12],this.y=a[1]*b+a[5]*c+a[9]*d+a[13],this.z=a[2]*b+a[6]*c+a[10]*d+a[14],this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);return this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e,this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e,this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e,this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,i=a*c+g*b-e*d,j=a*d+e*c-f*b,b=-e*b-f*c-g*d;return this.x=h*a+b*-e+i*-g-j*-f,this.y=i*a+b*-f+j*-e-h*-g,this.z=j*a+b*-g+h*-f-i*-e,this},project:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld)),this.applyProjection(a)}}(),unproject:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix)),this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d,this.y=a[1]*b+a[5]*c+a[9]*d,this.z=a[2]*b+a[6]*c+a[10]*d,this.normalize(),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0,this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this.zb.z&&(this.z=b.z),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3),a.set(c,c,c),b.set(d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},cross:function(a,b){if(void 0!==b)return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;return this.x=d*a.z-e*a.y,this.y=e*a.x-c*a.z,this.z=c*a.y-d*a.x,this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;return this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f,this},projectOnVector:function(){var a,b;return function(c){return void 0===a&&(a=new THREE.Vector3),a.copy(c).normalize(),b=this.dot(a),this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),a.copy(this).projectOnVector(b),this.sub(a)}}(),reflect:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){return a=this.dot(a)/(this.length()*a.length()),Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;return a=this.z-a.z,b*b+c*c+a*a},setEulerFromRotationMatrix:function(){THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){return this.x=a.elements[12],this.y=a.elements[13],this.z=a.elements[14],this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();return a=this.set(a.elements[8],a.elements[9],a.elements[10]).length(),this.x=b,this.y=c,this.z=a,this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;return this.x=d[c],this.y=d[c+1],this.z=d[c+2],this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this.z=a[b+2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}},THREE.Vector4=function(a,b,c,d){this.x=a||0,this.y=b||0,this.z=c||0,this.w=void 0!==d?d:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){return this.x=a,this.y=b,this.z=c,this.w=d,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,this},setW:function(a){return this.w=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this.w=void 0!==a.w?a.w:1,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this.z+=a.z,this.w+=a.w,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this.w+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this.z-=a.z,this.w-=a.w,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this.w-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this.w*=a,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e,this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e,this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e,this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1),this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);return 1e-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b),this},setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],i=a[9];c=a[2],b=a[6];var j=a[10];return.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(i-b)?.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(i+b)&&.1>Math.abs(e+h+j-3)?(this.set(1,0,0,0),this):(a=Math.PI,e=(e+1)/2,h=(h+1)/2,j=(j+1)/2,d=(d+g)/4,f=(f+c)/4,i=(i+b)/4,e>h&&e>j?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>j?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),b=d/c,d=i/c):.01>j?(c=b=.707106781,d=0):(d=Math.sqrt(j),b=f/d,c=i/d),this.set(b,c,d,a),this):(a=Math.sqrt((b-i)*(b-i)+(f-c)*(f-c)+(g-d)*(g-d)),.001>Math.abs(a)&&(a=1),this.x=(b-i)/a,this.y=(f-c)/a,this.z=(g-d)/a,this.w=Math.acos((e+h+j-1)/2),this)},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this.w>a.w&&(this.w=a.w),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this.zb.z&&(this.z=b.z),this.wb.w&&(this.w=b.w),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4),a.set(c,c,c,c),b.set(d,d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this.w+=(a.w-this.w)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this.z=a[b+2],this.w=a[b+3],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a[b+3]=this.w,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this.w=a.array[b+3],this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._order=d||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._order=d||this._order,this.onChangeCallback(),this},copy:function(a){return this._x=a._x,this._y=a._y,this._z=a._z,this._order=a._order,this.onChangeCallback(),this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],i=e[5],j=e[9],k=e[2],l=e[6],e=e[10];return b=b||this._order,"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-j,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(l,i),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(j,-1,1)),.99999>Math.abs(j)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,i)):(this._y=Math.atan2(-k,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(-k,e),this._z=Math.atan2(-f,i)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(k,-1,1)),.99999>Math.abs(k)?(this._x=Math.atan2(l,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,i))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-j,i),this._y=Math.atan2(-k,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(l,i),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-j,e),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b),this._order=b,!1!==c&&this.onChangeCallback(),this},setFromQuaternion:function(){var a;return function(b,c,d){return void 0===a&&(a=new THREE.Matrix4),a.makeRotationFromQuaternion(b),this.setFromRotationMatrix(a,c,d),this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this),this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){return this._x=a[0],this._y=a[1],this._z=a[2],void 0!==a[3]&&(this._order=a[3]),this.onChangeCallback(),this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._order,a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3,this.end=void 0!==b?b:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){return this.start.copy(a),this.end.copy(b),this},copy:function(a){return this.start.copy(a.start),this.end.copy(a.end),this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start),b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;return d&&(e=THREE.Math.clamp(e,0,1)),e}}(),closestPointToPoint:function(a,b,c){return a=this.closestPointToPointParameter(a,b),c=c||new THREE.Vector3,this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){return this.start.applyMatrix4(a),this.end.applyMatrix4(a),this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}},THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(1/0,1/0),this.max=void 0!==b?b:new THREE.Vector2(-1/0,-1/0)},THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){return this.min.copy(a),this.max.copy(b),this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;c>b;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector2;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},empty:function(){return this.max.xthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}},THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==b?b:new THREE.Vector3(-1/0,-1/0,-1/0)},THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){return this.min.copy(a),this.max.copy(b),this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;c>b;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector3;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),setFromObject:function(){var a=new THREE.Vector3;return function(b){var c=this;return b.updateMatrixWorld(!0),this.makeEmpty(),b.traverse(function(b){var d=b.geometry;if(void 0!==d)if(d instanceof THREE.Geometry)for(var e=d.vertices,d=0,f=e.length;f>d;d++)a.copy(e[d]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a);else if(d instanceof THREE.BufferGeometry&&void 0!==d.attributes.position)for(e=d.attributes.position.array,d=0,f=e.length;f>d;d+=3)a.set(e[d],e[d+1],e[d+2]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a)}),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return this.max.xthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){return b=b||new THREE.Sphere,b.center=this.center(),b.radius=.5*this.size(a).length(),b}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){return a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b),a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b),a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b),a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b),a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b),a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b),a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b),a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b),this.makeEmpty(),this.setFromPoints(a),this}}(),translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0e;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;return b[0]*=a,b[3]*=a,b[6]*=a,b[1]*=a,b[4]*=a,b[7]*=a,b[2]*=a,b[5]*=a,b[8]*=a,this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],a=a[8];return b*f*a-b*g*i-c*e*a+c*g*h+d*e*i-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;if(d[0]=c[10]*c[5]-c[6]*c[9],d[1]=-c[10]*c[1]+c[2]*c[9],d[2]=c[6]*c[1]-c[2]*c[5],d[3]=-c[10]*c[4]+c[6]*c[8],d[4]=c[10]*c[0]-c[2]*c[8],d[5]=-c[6]*c[0]+c[2]*c[4],d[6]=c[9]*c[4]-c[5]*c[8],d[7]=-c[9]*c[0]+c[1]*c[8],d[8]=c[5]*c[0]-c[1]*c[4],c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6],0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0"); +return THREE.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/c),this},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[3],b[3]=a,a=b[2],b[2]=b[6],b[6]=a,a=b[5],b[5]=b[7],b[7]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a},getNormalMatrix:function(a){return this.getInverse(a).transpose(),this},transposeIntoArray:function(a){var b=this.elements;return a[0]=b[0],a[1]=b[3],a[2]=b[6],a[3]=b[1],a[4]=b[4],a[5]=b[7],a[6]=b[2],a[7]=b[5],a[8]=b[8],this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}},THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0e;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),a.transformDirection(this)},crossVector:function(a){return THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],i=a[13],j=a[2],k=a[6],l=a[10],m=a[14];return a[3]*(+e*h*k-d*i*k-e*g*l+c*i*l+d*g*m-c*h*m)+a[7]*(+b*h*m-b*i*l+e*f*l-d*f*m+d*i*j-e*h*j)+a[11]*(+b*i*k-b*g*m-e*f*k+c*f*m+e*g*j-c*i*j)+a[15]*(-d*g*j-b*h*k+b*g*l+d*f*k-c*f*l+c*h*j)},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[4],b[4]=a,a=b[2],b[2]=b[8],b[8]=a,a=b[6],b[6]=b[9],b[9]=a,a=b[3],b[3]=b[12],b[12]=a,a=b[7],b[7]=b[13],b[13]=a,a=b[11],b[11]=b[14],b[14]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a[b+9]=c[9],a[b+10]=c[10],a[b+11]=c[11],a[b+12]=c[12],a[b+13]=c[13],a[b+14]=c[14],a[b+15]=c[15],a},getPosition:function(){var a=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;return b[12]=a.x,b[13]=a.y,b[14]=a.z,this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],i=d[1],j=d[5],k=d[9],l=d[13],m=d[2],n=d[6],o=d[10],p=d[14],q=d[3],r=d[7],s=d[11],d=d[15];if(c[0]=k*p*r-l*o*r+l*n*s-j*p*s-k*n*d+j*o*d,c[4]=h*o*r-g*p*r-h*n*s+f*p*s+g*n*d-f*o*d,c[8]=g*l*r-h*k*r+h*j*s-f*l*s-g*j*d+f*k*d,c[12]=h*k*n-g*l*n-h*j*o+f*l*o+g*j*p-f*k*p,c[1]=l*o*q-k*p*q-l*m*s+i*p*s+k*m*d-i*o*d,c[5]=g*p*q-h*o*q+h*m*s-e*p*s-g*m*d+e*o*d,c[9]=h*k*q-g*l*q-h*i*s+e*l*s+g*i*d-e*k*d,c[13]=g*l*m-h*k*m+h*i*o-e*l*o-g*i*p+e*k*p,c[2]=j*p*q-l*n*q+l*m*r-i*p*r-j*m*d+i*n*d,c[6]=h*n*q-f*p*q-h*m*r+e*p*r+f*m*d-e*n*d,c[10]=f*l*q-h*j*q+h*i*r-e*l*r-f*i*d+e*j*d,c[14]=h*j*m-f*l*m-h*i*n+e*l*n+f*i*p-e*j*p,c[3]=k*n*q-j*o*q-k*m*r+i*o*r+j*m*s-i*n*s,c[7]=f*o*q-g*n*q+g*m*r-e*o*r-f*m*s+e*n*s,c[11]=g*j*q-f*k*q-g*i*r+e*k*r+f*i*s-e*j*s,c[15]=f*k*m-g*j*m+g*i*n-e*k*n-f*i*o+e*j*o,c=e*c[0]+i*c[4]+m*c[8]+q*c[12],0==c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/c),this},translate:function(){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=this.elements,c=a.x,d=a.y;return a=a.z,b[0]*=c,b[4]*=d,b[8]*=a,b[1]*=c,b[5]*=d,b[9]*=a,b[2]*=c,b[6]*=d,b[10]*=a,b[3]*=c,b[7]*=d,b[11]*=a,this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){return this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1),this},makeRotationX:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1),this},makeRotationY:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1),this},makeRotationZ:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,i=e*f,j=e*g;return this.set(i*f+c,i*g-d*h,i*h+d*g,0,i*g+d*h,j*g+c,j*h-d*f,0,i*h-d*g,j*h+d*f,e*h*h+c,0,0,0,0,1),this},makeScale:function(a,b,c){return this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1),this},compose:function(a,b,c){return this.makeRotationFromQuaternion(b),this.scale(c),this.setPosition(a),this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),i=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g),c.x=f[12],c.y=f[13],c.z=f[14],b.elements.set(this.elements),c=1/g;var f=1/h,j=1/i;return b.elements[0]*=c,b.elements[1]*=c,b.elements[2]*=c,b.elements[4]*=f,b.elements[5]*=f,b.elements[6]*=f,b.elements[8]*=j,b.elements[9]*=j,b.elements[10]*=j,d.setFromRotationMatrix(b),e.x=g,e.y=h,e.z=i,this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;return g[0]=2*e/(b-a),g[4]=0,g[8]=(b+a)/(b-a),g[12]=0,g[1]=0,g[5]=2*e/(d-c),g[9]=(d+c)/(d-c),g[13]=0,g[2]=0,g[6]=0,g[10]=-(f+e)/(f-e),g[14]=-2*f*e/(f-e),g[3]=0,g[7]=0,g[11]=-1,g[15]=0,this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,i=c-d,j=f-e;return g[0]=2/h,g[4]=0,g[8]=0,g[12]=-((b+a)/h),g[1]=0,g[5]=2/i,g[9]=0,g[13]=-((c+d)/i),g[2]=0,g[6]=0,g[10]=-2/j,g[14]=-((f+e)/j),g[3]=0,g[7]=0,g[11]=0,g[15]=1,this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}},THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3,this.direction=void 0!==b?b:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){return this.origin.copy(a),this.direction.copy(b),this},copy:function(a){return this.origin.copy(a.origin),this.direction.copy(a.direction),this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){return this.origin.copy(this.at(b,a)),this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);return 0>c?this.origin.distanceTo(b):(a.copy(this.direction).multiplyScalar(c).add(this.origin),a.distanceTo(b))}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5),b.copy(e).sub(d).normalize(),c.copy(this.origin).sub(a);var h,i=.5*d.distanceTo(e),j=-this.direction.dot(b),k=c.dot(this.direction),l=-c.dot(b),m=c.lengthSq(),n=Math.abs(1-j*j);return n>0?(d=j*l-k,e=j*k-l,h=i*n,d>=0?e>=-h?h>=e?(i=1/n,d*=i,e*=i,j=d*(d+j*e+2*k)+e*(j*d+e+2*l)+m):(e=i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m):(e=-i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m):-h>=e?(d=Math.max(0,-(-j*i+k)),e=d>0?-i:Math.min(Math.max(-i,-l),i),j=-d*d+e*(e+2*l)+m):h>=e?(d=0,e=Math.min(Math.max(-i,-l),i),j=e*(e+2*l)+m):(d=Math.max(0,-(j*i+k)),e=d>0?i:Math.min(Math.max(-i,-l),i),j=-d*d+e*(e+2*l)+m)):(e=j>0?-i:i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m),f&&f.copy(this.direction).multiplyScalar(d).add(this.origin),g&&g.copy(b).multiplyScalar(e).add(a),j}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;return e>f?null:(f=Math.sqrt(f-e),e=d-f,d+=f,0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c))}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);return 0==b?0==a.distanceToPoint(this.origin)?0:null:(a=-(this.origin.dot(a.normal)+a.constant)/b,a>=0?a:null)},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x,f=1/this.direction.y,g=1/this.direction.z;var h=this.origin;return d>=0?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x),f>=0?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y),c>f||e>d?null:((e>c||c!==c)&&(c=e),(d>f||d!==d)&&(d=f),g>=0?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*g,g*=a.min.z-h.z),c>g||e>d?null:((e>c||c!==c)&&(c=e),(d>g||d!==d)&&(d=g),0>d?null:this.at(c>=0?c:d,b)))},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,i){if(b.subVectors(f,e),c.subVectors(g,e),d.crossVectors(b,c),f=this.direction.dot(d),f>0){if(h)return null;h=1}else{if(!(0>f))return null;h=-1,f=-f}return a.subVectors(this.origin,e),e=h*this.direction.dot(c.crossVectors(a,c)),0>e?null:(g=h*this.direction.dot(b.cross(a)),0>g||e+g>f?null:(e=-h*a.dot(d),0>e?null:this.at(e/f,i)))}}(),applyMatrix4:function(a){return this.direction.add(this.origin).applyMatrix4(a),this.origin.applyMatrix4(a),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}},THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3,this.radius=void 0!==b?b:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){return this.center.copy(a),this.radius=b,this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;g>f;f++)e=Math.max(e,d.distanceToSquared(b[f]));return this.radius=Math.sqrt(e),this}}(),copy:function(a){return this.center.copy(a.center),this.radius=a.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;return d.copy(a),c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center)),d},getBoundingBox:function(a){return a=a||new THREE.Box3,a.set(this.center,this.center),a.expandByScalar(this.radius),a},applyMatrix4:function(a){return this.center.applyMatrix4(a),this.radius*=a.getMaxScaleOnAxis(),this},translate:function(a){return this.center.add(a),this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}},THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;return g[0].copy(a),g[1].copy(b),g[2].copy(c),g[3].copy(d),g[4].copy(e),g[5].copy(f),this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],i=c[6],j=c[7],k=c[8],l=c[9],m=c[10],n=c[11],o=c[12],p=c[13],q=c[14],c=c[15];return b[0].setComponents(f-a,j-g,n-k,c-o).normalize(),b[1].setComponents(f+a,j+g,n+k,c+o).normalize(),b[2].setComponents(f+d,j+h,n+l,c+p).normalize(),b[3].setComponents(f-d,j-h,n-l,c-p).normalize(),b[4].setComponents(f-e,j-i,n-m,c-q).normalize(),b[5].setComponents(f+e,j+i,n+m,c+q).normalize(),this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;return null===c.boundingSphere&&c.computeBoundingSphere(),a.copy(c.boundingSphere),a.applyMatrix4(b.matrixWorld),this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}},THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0),this.constant=void 0!==b?b:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){return this.normal.copy(a),this.constant=b,this},setComponents:function(a,b,c,d){return this.normal.set(a,b,c),this.constant=d,this},setFromNormalAndCoplanarPoint:function(a,b){return this.normal.copy(a),this.constant=-b.dot(this.normal),this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){return d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize(),this.setFromNormalAndCoplanarPoint(d,c),this}}(),copy:function(a){return this.normal.copy(a.normal),this.constant=a.constant,this},normalize:function(){var a=1/this.normal.length();return this.normal.multiplyScalar(a),this.constant*=a,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);return a=this.distanceToPoint(a.end),0>b&&a>0||0>a&&b>0},intersectLine:function(){var a=new THREE.Vector3;return function(b,c){var d=c||new THREE.Vector3,e=b.delta(a),f=this.normal.dot(e);return 0!=f?(f=-(b.start.dot(this.normal)+this.constant)/f,0>f||f>1?void 0:d.copy(e).multiplyScalar(f).add(b.start)):0==this.distanceToPoint(b.start)?d.copy(b.start):void 0}}(),coplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),f=a.copy(this.normal).applyMatrix3(f),g=this.coplanarPoint(b);return g.applyMatrix4(d),this.setFromNormalAndCoplanarPoint(f,g),this}}(),translate:function(a){return this.constant-=a.dot(this.normal),this},equals:function(a){return a.normal.equals(this.normal)&&a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}},THREE.Math={generateUUID:function(){var a,b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),c=Array(36),d=0;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?c[e]="-":14==e?c[e]="4":(2>=d&&(d=33554432+16777216*Math.random()|0),a=15&d,d>>=4,c[e]=b[19==e?3&a|8:a]);return c.join("")}}(),clamp:function(a,b,c){return b>a?b:a>c?c:a},clampBottom:function(a,b){return b>a?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*(3-2*a))},smootherstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*a*(a*(6*a-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a}},THREE.Spline=function(a){function b(a,b,c,d,e,f,g){return a=.5*(c-a),d=.5*(d-b),(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c,d,e,f,g,h,i,j,k,l=[],m={x:0,y:0,z:0};this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:d+1,l[3]=d>this.points.length-3?this.points.length-1:d+2,h=this.points[l[0]],i=this.points[l[1]],j=this.points[l[2]],k=this.points[l[3]],f=e*e,g=e*f,m.x=b(h.x,i.x,j.x,k.x,e,f,g),m.y=b(h.y,i.y,j.y,k.y,e,f,g),m.z=b(h.z,i.z,j.z,k.z,e,f,g),m},this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;c>a;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d},this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],i=0;for(h[0]=0,a||(a=100),c=this.points.length*a,f.copy(this.points[0]),a=1;c>a;a++)b=a/c,d=this.getPoint(b),g.copy(d),i+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=i,e=b);return h[h.length]=i,{chunks:h,total:i}},this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],i=new THREE.Vector3,j=this.getLength();for(h.push(i.copy(this.points[0]).clone()),b=1;bc;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(i.copy(d).clone());h.push(i.copy(this.points[b]).clone())}this.points=h}},THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3,this.b=void 0!==b?b:new THREE.Vector3,this.c=void 0!==c?c:new THREE.Vector3},THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){return e=e||new THREE.Vector3,e.subVectors(d,c),a.subVectors(b,c),e.cross(a),b=e.lengthSq(),b>0?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e),b.subVectors(f,e),c.subVectors(d,e),d=a.dot(a),e=a.dot(b),f=a.dot(c);var i=b.dot(b);g=b.dot(c);var j=d*i-e*e;return h=h||new THREE.Vector3,0==j?h.set(-2,-1,-1):(j=1/j,i=(i*f-e*g)*j,d=(d*g-e*f)*j,h.set(1-i-d,d,i))}}(),THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){return b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a),0<=b.x&&0<=b.y&&1>=b.x+b.y}}(),THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this},setFromPointsAndIndices:function(a,b,c,d){return this.a.copy(a[b]),this.b.copy(a[c]),this.c.copy(a[d]),this},copy:function(a){return this.a.copy(a.a),this.b.copy(a.b),this.c.copy(a.c),this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){return a.subVectors(this.c,this.b),b.subVectors(this.a,this.b),.5*a.cross(b).length()}}(),midpoint:function(a){return(a||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},clone:function(){return(new THREE.Triangle).copy(this)}},THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running&&this.start(),this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),a=.001*(b-this.oldTime);this.oldTime=b,this.elapsedTime+=a}return a}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener,a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]),-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;d>e;e++)c[e]=b[e];for(e=0;d>e;e++)c[e].call(this,a)}}}},function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c),this.near=d||0,this.far=e||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=function(a,b){return a.distance-b.distance},c=function(a,b,d,e){if(a.raycast(b,d),!0===e){a=a.children,e=0;for(var f=a.length;f>e;e++)c(a[e],b,d,!0)}};a.Raycaster.prototype={constructor:a.Raycaster,precision:1e-4,linePrecision:1,set:function(a,b){this.ray.set(a,b)},setFromCamera:function(b,c){c instanceof a.PerspectiveCamera?(this.ray.origin.copy(c.position),this.ray.direction.set(b.x,b.y,.5).unproject(c).sub(c.position).normalize()):c instanceof a.OrthographicCamera?(this.ray.origin.set(b.x,b.y,-1).unproject(c),this.ray.direction.set(0,0,-1).transformDirection(c.matrixWorld)):a.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(a,d){var e=[];return c(a,this,e,d),e.sort(b),e},intersectObjects:function(d,e){var f=[];if(!1==d instanceof Array)return a.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),f;for(var g=0,h=d.length;h>g;g++)c(d[g],this,f,e);return f.sort(b),f}}}(THREE),THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)}),c.onChange(function(){b.setFromQuaternion(c,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){return THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(a){THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=a},get useQuaternion(){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){return a.setFromAxisAngle(b,c),this.quaternion.multiply(a),this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){return a.copy(b).applyQuaternion(this.quaternion),this.position.add(a.multiplyScalar(c)),this}}(),translate:function(a,b){return THREE.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0); +return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up),this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1c;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){return a=a||new THREE.Vector3,this.updateMatrixWorld(!0),a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){return c=c||new THREE.Quaternion,this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,c,b),c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Euler,this.getWorldQuaternion(a),b.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;return function(c){return c=c||new THREE.Vector3,this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,b,c),c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Vector3,this.getWorldQuaternion(a),b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;c>b;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;c>b;b++)this.children[b].traverseVisible(a)}},traverseAncestors:function(a){this.parent&&(a(this.parent),this.parent.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix(),(!0===this.matrixWorldNeedsUpdate||!0===a)&&(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0);for(var b=0,c=this.children.length;c>b;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(){var a={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},b={},c={},d=function(b){if(void 0===a.materials&&(a.materials=[]),void 0===c[b.uuid]){var d=b.toJSON();delete d.metadata,c[b.uuid]=d,a.materials.push(d)}return b.uuid},e=function(c){var f={};if(f.uuid=c.uuid,f.type=c.type,""!==c.name&&(f.name=c.name),"{}"!==JSON.stringify(c.userData)&&(f.userData=c.userData),!0!==c.visible&&(f.visible=c.visible),c instanceof THREE.PerspectiveCamera)f.fov=c.fov,f.aspect=c.aspect,f.near=c.near,f.far=c.far;else if(c instanceof THREE.OrthographicCamera)f.left=c.left,f.right=c.right,f.top=c.top,f.bottom=c.bottom,f.near=c.near,f.far=c.far;else if(c instanceof THREE.AmbientLight)f.color=c.color.getHex();else if(c instanceof THREE.DirectionalLight)f.color=c.color.getHex(),f.intensity=c.intensity;else if(c instanceof THREE.PointLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance,f.decay=c.decay;else if(c instanceof THREE.SpotLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance,f.angle=c.angle,f.exponent=c.exponent,f.decay=c.decay;else if(c instanceof THREE.HemisphereLight)f.color=c.color.getHex(),f.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh||c instanceof THREE.Line||c instanceof THREE.PointCloud){var g=c.geometry;if(void 0===a.geometries&&(a.geometries=[]),void 0===b[g.uuid]){var h=g.toJSON();delete h.metadata,b[g.uuid]=h,a.geometries.push(h)}f.geometry=g.uuid,f.material=d(c.material),c instanceof THREE.Line&&(f.mode=c.mode)}else c instanceof THREE.Sprite&&(f.material=d(c.material));if(f.matrix=c.matrix.toArray(),0b;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(b=0,c=this.vertexColors.length;c>b;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(b=0,c=this.vertexTangents.length;c>b;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}},THREE.Face4=function(a,b,c,d,e,f,g){return THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(a,b,c,e,f,g)},THREE.BufferAttribute=function(a,b){this.array=a,this.itemSize=b,this.needsUpdate=!1},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},copyAt:function(a,b,c){a*=this.itemSize,c*=b.itemSize;for(var d=0,e=this.itemSize;e>d;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){return void 0===b&&(b=0),this.array.set(a,b),this},setX:function(a,b){return this.array[a*this.itemSize]=b,this},setY:function(a,b){return this.array[a*this.itemSize+1]=b,this},setZ:function(a,b){return this.array[a*this.itemSize+2]=b,this},setXY:function(a,b,c){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this},setXYZ:function(a,b,c,d){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this},setXYZW:function(a,b,c,d,e){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this.array[a+3]=e,this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},THREE.Int8Attribute=function(a,b){return THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8Attribute=function(a,b){return THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8ClampedAttribute=function(a,b){return THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int16Attribute=function(a,b){return THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint16Attribute=function(a,b){return THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int32Attribute=function(a,b){return THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint32Attribute=function(a,b){return THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float32Attribute=function(a,b){return THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float64Attribute=function(a,b){return THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b),this.updateRange={offset:0,count:-1}},THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute,THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)},THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.offsets=this.drawcalls=[],this.boundingSphere=this.boundingBox=null},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1==b instanceof THREE.BufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0),b=this.attributes.normal,void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(a)),a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0d;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}(void 0===b||0===b.length)&&(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;f>e;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;f>e;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g),isNaN(this.boundingSphere.radius)&&THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;e>d;d++)c[d]=0;var f,g,h,c=a.normal.array,i=new THREE.Vector3,j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var n=a.index.array,o=0p;++p){e=o[p].start,f=o[p].count;for(var r=o[p].index,d=e,e=e+f;e>d;d+=3)f=3*(r+n[d]),g=3*(r+n[d+1]),h=3*(r+n[d+2]),i.fromArray(b,f),j.fromArray(b,g),k.fromArray(b,h),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[f]+=l.x,c[f+1]+=l.y,c[f+2]+=l.z,c[g]+=l.x,c[g+1]+=l.y,c[g+2]+=l.z,c[h]+=l.x,c[h+1]+=l.y,c[h+2]+=l.z}else for(d=0,e=b.length;e>d;d+=9)i.fromArray(b,d),j.fromArray(b,d+3),k.fromArray(b,d+6),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[d]=l.x,c[d+1]=l.y,c[d+2]=l.z,c[d+3]=l.x,c[d+4]=l.y,c[d+5]=l.z,c[d+6]=l.x,c[d+7]=l.y,c[d+8]=l.z;this.normalizeNormals(),a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){B.fromArray(d,3*a),C.fromArray(d,3*b),D.fromArray(d,3*c),E.fromArray(f,2*a),F.fromArray(f,2*b),G.fromArray(f,2*c),l=C.x-B.x,m=D.x-B.x,n=C.y-B.y,o=D.y-B.y,p=C.z-B.z,q=D.z-B.z,r=F.x-E.x,s=G.x-E.x,t=F.y-E.y,u=G.y-E.y,v=1/(r*u-s*t),H.set((u*l-t*m)*v,(u*n-t*o)*v,(u*p-t*q)*v),I.set((r*m-s*l)*v,(r*o-s*n)*v,(r*q-s*p)*v),i[a].add(H),i[b].add(H),i[c].add(H),j[a].add(I),j[b].add(I),j[c].add(I)}function b(a){Q.fromArray(e,3*a),R.copy(Q),M=i[a],O.copy(M),O.sub(Q.multiplyScalar(Q.dot(M))).normalize(),P.crossVectors(R,M),N=P.dot(j[a]),L=0>N?-1:1,h[4*a]=O.x,h[4*a+1]=O.y,h[4*a+2]=O.z,h[4*a+3]=L}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,i=[],j=[],k=0;g>k;k++)i[k]=new THREE.Vector3,j[k]=new THREE.Vector3;var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=new THREE.Vector3,C=new THREE.Vector3,D=new THREE.Vector3,E=new THREE.Vector2,F=new THREE.Vector2,G=new THREE.Vector2,H=new THREE.Vector3,I=new THREE.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var J=this.drawcalls,k=0;for(x=J.length;x>k;++k){w=J[k].start,y=J[k].count;var K=J[k].index,g=w;for(w+=y;w>g;g+=3)y=K+c[g],z=K+c[g+1],A=K+c[g+2],a(y,z,A)}var L,M,N,O=new THREE.Vector3,P=new THREE.Vector3,Q=new THREE.Vector3,R=new THREE.Vector3,k=0;for(x=J.length;x>k;++k)for(w=J[k].start,y=J[k].count,K=J[k].index,g=w,w+=y;w>g;g+=3)y=K+c[g],z=K+c[g+1],A=K+c[g+2],b(y),b(z),b(A)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],i=h[0],j=0,k=0,l=new Int32Array(6),m=new Int32Array(c.length),n=new Int32Array(c.length),o=0;oc;c++){for(var p=k=0;3>p;p++)o=b[3*c+p],-1==m[o]?(l[2*p]=o,l[2*p+1]=-1,k++):m[o]i.index+a)for(i={start:f,count:0,index:g},h.push(i),k=0;6>k;k+=2)p=l[k+1],p>-1&&pk;k+=2)o=l[k],p=l[k+1],-1===p&&(p=g++),m[o]=p,n[p]=o,e[f++]=p-i.index,i.count++}return this.reorderBuffers(e,n,g),this.drawcalls=this.offsets=h},merge:function(a,b){if(!1!=a instanceof THREE.BufferGeometry){void 0===b&&(b=0);var c,d=this.attributes;for(c in d)if(void 0!==a.attributes[c])for(var e=d[c].array,f=a.attributes[c],g=f.array,h=0,f=f.itemSize*b;he;e+=3)a=d[e],b=d[e+1],c=d[e+2],a=1/Math.sqrt(a*a+b*b+c*c),d[e]*=a,d[e+1]*=a,d[e+2]*=a},reorderBuffers:function(a,b,c){var d,e={};for(d in this.attributes)"index"!=d&&(e[d]=new this.attributes[d].array.constructor(this.attributes[d].itemSize*c));for(var f=0;c>f;f++){var g=b[f];for(d in this.attributes)if("index"!=d)for(var h=this.attributes[d].array,i=this.attributes[d].itemSize,j=e[d],k=0;i>k;k++)j[f*i+k]=h[g*i+k]}this.attributes.index.array=a;for(d in this.attributes)"index"!=d&&(this.attributes[d].array=e[d],this.attributes[d].numItems=this.attributes[d].itemSize*c)},toJSON:function(){var a,b={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},c=this.attributes,d=this.offsets,e=this.boundingSphere;for(a in c){var f=c[a],g=Array.prototype.slice.call(f.array);b.data.attributes[a]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}return 0a;a++){var d=this.offsets[a];b.offsets.push({start:d.start,index:d.index,count:d.count})}return b},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.hasTangents=!1,this.dynamic=!0,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;d>c;c++)this.vertices[c].applyMatrix4(a);for(c=0,d=this.faces.length;d>c;c++){a=this.faces[c],a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;f>e;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,i=[],j=[],k=c=0;ck;k+=3)l(o+e[k],o+e[k+1],o+e[k+2]);else for(c=0;cc;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g),b.subVectors(f,g),a.cross(b),a.normalize(),e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;for(d=Array(this.vertices.length),b=0,c=this.vertices.length;c>b;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,i=new THREE.Vector3;for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),i.subVectors(e,f),h.cross(i),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);for(b=0,c=this.vertices.length;c>b;b++)d[b].normalize();for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;for(c=0,d=this.faces.length;d>c;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;b>a;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;for(f.faces=this.faces,a=0,b=this.morphTargets.length;b>a;a++){if(!this.morphNormals[a]){this.morphNormals[a]={},this.morphNormals[a].faceNormals=[],this.morphNormals[a].vertexNormals=[],e=this.morphNormals[a].faceNormals;var g,h,i=this.morphNormals[a].vertexNormals;for(c=0,d=this.faces.length;d>c;c++)g=new THREE.Vector3,h={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(g),i.push(h)}for(i=this.morphNormals[a],f.vertices=this.morphTargets[a].vertices,f.computeFaceNormals(),f.computeVertexNormals(),c=0,d=this.faces.length;d>c;c++)e=this.faces[c],g=i.faceNormals[c],h=i.vertexNormals[c],g.copy(e.normal),h.a.copy(e.vertexNormals[0]),h.b.copy(e.vertexNormals[1]),h.c.copy(e.vertexNormals[2])}for(c=0,d=this.faces.length;d>c;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=[],s=[];c=new THREE.Vector3;var t=new THREE.Vector3,u=new THREE.Vector3,v=new THREE.Vector3,w=new THREE.Vector3;for(a=0,b=this.vertices.length;b>a;a++)r[a]=new THREE.Vector3,s[a]=new THREE.Vector3;for(a=0,b=this.faces.length;b>a;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,q=e.b,e=e.c,g=this.vertices[d],h=this.vertices[q],i=this.vertices[e],j=f[0],k=f[1],l=f[2],f=h.x-g.x,m=i.x-g.x,n=h.y-g.y,o=i.y-g.y,h=h.z-g.z,g=i.z-g.z,i=k.x-j.x,p=l.x-j.x,k=k.y-j.y,j=l.y-j.y,l=1/(i*j-p*k),c.set((j*f-k*m)*l,(j*n-k*o)*l,(j*h-k*g)*l),t.set((i*m-p*f)*l,(i*o-p*n)*l,(i*g-p*h)*l),r[d].add(c),r[q].add(c),r[e].add(c),s[d].add(t),s[q].add(t),s[e].add(t);for(t=["a","b","c","d"],a=0,b=this.faces.length;b>a;a++)for(e=this.faces[a],c=0;cd?-1:1,e.vertexTangents[c]=new THREE.Vector4(u.x,u.y,u.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;d>c;c++)c>0&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1==a instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,i=a.faces,j=this.faceVertexUvs[0];a=a.faceVertexUvs[0],void 0===c&&(c=0),void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var k=0,l=g.length;l>k;k++){var m=g[k].clone();void 0!==b&&m.applyMatrix4(b),f.push(m)}for(k=0,l=i.length;l>k;k++){var n,g=i[k],o=g.vertexNormals,p=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);for(m.normal.copy(g.normal),void 0!==d&&m.normal.applyMatrix3(d).normalize(),b=0,f=o.length;f>b;b++)n=o[b].clone(),void 0!==d&&n.applyMatrix3(d).normalize(),m.vertexNormals.push(n);for(m.color.copy(g.color),b=0,f=p.length;f>b;b++)n=p[b],m.vertexColors.push(n.clone());m.materialIndex=g.materialIndex+c,h.push(m)}for(k=0,l=a.length;l>k;k++)if(c=a[k],d=[],void 0!==c){for(b=0,f=c.length;f>b;b++)d.push(c[b].clone());j.push(d)}}},mergeMesh:function(a){!1==a instanceof THREE.Mesh?THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a,b,c,d={},e=[],f=[],g=Math.pow(10,4);for(b=0,c=this.vertices.length;c>b;b++)a=this.vertices[b],a=Math.round(a.x*g)+"_"+Math.round(a.y*g)+"_"+Math.round(a.z*g),void 0===d[a]?(d[a]=b,e.push(this.vertices[b]),f[b]=e.length-1):f[b]=f[d[a]];for(d=[],b=0,c=this.faces.length;c>b;b++)for(g=this.faces[b],g.a=f[g.a],g.b=f[g.b],g.c=f[g.c],g=[g.a,g.b,g.c],a=0;3>a;a++)if(g[a]==g[(a+1)%3]){d.push(b);break}for(b=d.length-1;b>=0;b--)for(g=d[b],this.faces.splice(g,1),f=0,c=this.faceVertexUvs.length;c>f;f++)this.faceVertexUvs[f].splice(g,1);return b=this.vertices.length-e.length,this.vertices=e,b},toJSON:function(){function a(a,b,c){return c?a|1<c;c++)a.vertices.push(b[c].clone());for(b=this.faces,c=0,d=b.length;d>c;c++)a.faces.push(b[c].clone());for(c=0,d=this.faceVertexUvs.length;d>c;c++){b=this.faceVertexUvs[c],void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;f>e;e++){for(var g=b[e],h=[],i=0,j=g.length;j>i;i++)h.push(g[i].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Vector3,this.getWorldQuaternion(a),b.set(0,0,-1).applyQuaternion(a)}}(),THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up),this.quaternion.setFromRotationMatrix(a)}}(),THREE.Camera.prototype.clone=function(a){return void 0===a&&(a=new THREE.Camera),THREE.Object3D.prototype.clone.call(this,a),a.matrixWorldInverse.copy(this.matrixWorldInverse),a.projectionMatrix.copy(this.projectionMatrix),a},THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this),this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0),d.lookAt(new THREE.Vector3(1,0,0)),this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0),e.lookAt(new THREE.Vector3(-1,0,0)),this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1),f.lookAt(new THREE.Vector3(0,1,0)),this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1),g.lookAt(new THREE.Vector3(0,-1,0)),this.add(g);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0),h.lookAt(new THREE.Vector3(0,0,1)),this.add(h);var i=new THREE.PerspectiveCamera(90,1,a,b);i.up.set(0,-1,0),i.lookAt(new THREE.Vector3(0,0,-1)),this.add(i),this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(a,b){var c=this.renderTarget,j=c.generateMipmaps;c.generateMipmaps=!1,c.activeCubeFace=0,a.render(b,d,c),c.activeCubeFace=1,a.render(b,e,c),c.activeCubeFace=2,a.render(b,f,c),c.activeCubeFace=3,a.render(b,g,c),c.activeCubeFace=4,a.render(b,h,c),c.generateMipmaps=j,c.activeCubeFace=5,a.render(b,i,c)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=a,this.right=b,this.top=c,this.bottom=d,this.near=void 0!==e?e:.1,this.far=void 0!==f?f:2e3,this.updateProjectionMatrix() +},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)},THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.left=this.left,a.right=this.right,a.top=this.top,a.bottom=this.bottom,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==a?a:50,this.aspect=void 0!==b?b:1,this.near=void 0!==c?c:.1,this.far=void 0!==d?d:2e3,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24),this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a))),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a,this.fullHeight=b,this.x=c,this.y=d,this.width=e,this.height=f,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var a=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var b=this.fullWidth/this.fullHeight,a=Math.tan(THREE.Math.degToRad(.5*a))*this.near,c=-a,d=b*c,b=Math.abs(b*a-d),c=Math.abs(a-c);this.projectionMatrix.makeFrustum(d+this.x*b/this.fullWidth,d+(this.x+this.width)*b/this.fullWidth,a-(this.y+this.height)*c/this.fullHeight,a-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(a,this.aspect,this.near,this.far)},THREE.PerspectiveCamera.prototype.clone=function(){var a=new THREE.PerspectiveCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.fov=this.fov,a.aspect=this.aspect,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.Light=function(a){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(a)},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.clone=function(a){return void 0===a&&(a=new THREE.Light),THREE.Object3D.prototype.clone.call(this,a),a.color.copy(this.color),a},THREE.AmbientLight=function(a){THREE.Light.call(this,a),this.type="AmbientLight"},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;return THREE.Light.prototype.clone.call(this,a),a},THREE.AreaLight=function(a,b){THREE.Light.call(this,a),this.type="AreaLight",this.normal=new THREE.Vector3(0,-1,0),this.right=new THREE.Vector3(1,0,0),this.intensity=void 0!==b?b:1,this.height=this.width=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},THREE.AreaLight.prototype=Object.create(THREE.Light.prototype),THREE.AreaLight.prototype.constructor=THREE.AreaLight,THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraTop=this.shadowCameraRight=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowCascade=!1,this.shadowCascadeOffset=new THREE.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraLeft=this.shadowCameraLeft,a.shadowCameraRight=this.shadowCameraRight,a.shadowCameraTop=this.shadowCameraTop,a.shadowCameraBottom=this.shadowCameraBottom,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a.shadowCascade=this.shadowCascade,a.shadowCascadeOffset.copy(this.shadowCascadeOffset),a.shadowCascadeCount=this.shadowCascadeCount,a.shadowCascadeBias=this.shadowCascadeBias.slice(0),a.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),a.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),a.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),a.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),a},THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new THREE.Color(b),this.intensity=void 0!==c?c:1},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.clone=function(){var a=new THREE.HemisphereLight;return THREE.Light.prototype.clone.call(this,a),a.groundColor.copy(this.groundColor),a.intensity=this.intensity,a},THREE.PointLight=function(a,b,c,d){THREE.Light.call(this,a),this.type="PointLight",this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.decay=void 0!==d?d:1},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,THREE.PointLight.prototype.clone=function(){var a=new THREE.PointLight;return THREE.Light.prototype.clone.call(this,a),a.intensity=this.intensity,a.distance=this.distance,a.decay=this.decay,a},THREE.SpotLight=function(a,b,c,d,e,f){THREE.Light.call(this,a),this.type="SpotLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.angle=void 0!==d?d:Math.PI/3,this.exponent=void 0!==e?e:10,this.decay=void 0!==f?f:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.distance=this.distance,a.angle=this.angle,a.exponent=this.exponent,a.decay=this.decay,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraFov=this.shadowCameraFov,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a},THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null,this.imageLoader=new THREE.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");return a.style.position="absolute",a.style.right="0px",a.style.top="0px",a.style.fontSize="0.8em",a.style.textAlign="left",a.style.background="rgba(0,0,0,0.25)",a.style.color="#fff",a.style.width="120px",a.style.padding="0.5em 0.5em 0.5em 0.5em",a.style.zIndex=1e3,a.innerHTML="Loading ...",a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+"%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){return a=a.split("/"),1===a.length?"./":(a.pop(),a.join("/")+"/")},initMaterials:function(a,b){for(var c=[],d=0;db;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){return a=Math.log(a)/Math.LN2,Math.pow(2,Math.round(a))}function d(a,d,e,g,h,i,j){var k,l=b+e,m=THREE.Loader.Handlers.get(l);null!==m?k=m.load(l):(k=new THREE.Texture,m=f.imageLoader,m.crossOrigin=f.crossOrigin,m.load(l,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b,e.height=d,e.getContext("2d").drawImage(a,0,0,b,d),k.image=e}else k.image=a;k.needsUpdate=!0})),k.sourceFile=e,g&&(k.repeat.set(g[0],g[1]),1!==g[0]&&(k.wrapS=THREE.RepeatWrapping),1!==g[1]&&(k.wrapT=THREE.RepeatWrapping)),h&&k.offset.set(h[0],h[1]),i&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[i[0]]&&(k.wrapS=e[i[0]]),void 0!==e[i[1]]&&(k.wrapT=e[i[1]])),j&&(k.anisotropy=j),a[d]=k}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var i=a.shading.toLowerCase();"phong"===i?g="MeshPhongMaterial":"basic"===i&&(g="MeshBasicMaterial")}return void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]),void 0!==a.transparent&&(h.transparent=a.transparent),void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0),void 0!==a.depthTest&&(h.depthTest=a.depthTest),void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite),void 0!==a.visible&&(h.visible=a.visible),void 0!==a.flipSided&&(h.side=THREE.BackSide),void 0!==a.doubleSided&&(h.side=THREE.DoubleSide),void 0!==a.wireframe&&(h.wireframe=a.wireframe),void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors)),a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor),a.colorSpecular&&(h.specular=e(a.colorSpecular)),a.colorEmissive&&(h.emissive=e(a.colorEmissive)),void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency),void 0!==a.opacity&&(h.opacity=a.opacity),a.specularCoef&&(h.shininess=a.specularCoef),a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy),a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy),a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy),a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy),a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy),a.mapAlpha&&b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy),a.mapBumpScale&&(h.bumpScale=a.mapBumpScale),a.mapNormalFactor&&(h.normalScale=new THREE.Vector2(a.mapNormalFactor,a.mapNormalFactor)),g=new THREE[g](h),void 0!==a.DbgName&&(g.name=a.DbgName),g}},THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;c>b;b+=2){var d=this.handlers[b+1];if(this.handlers[b].test(a))return d}return null}},THREE.XHRLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);void 0!==f?b&&b(f):(f=new XMLHttpRequest,f.open("GET",a,!0),f.addEventListener("load",function(){THREE.Cache.add(a,this.response),b&&b(this.response),e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&f.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(f.responseType=this.responseType),f.send(null),e.manager.itemStart(a))},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.ImageLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);return void 0===f?(f=document.createElement("img"),f.addEventListener("load",function(){THREE.Cache.add(a,this),b&&b(this),e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&f.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),f.src=a,e.manager.itemStart(a),f):void b(f)},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.JSONLoader=function(a){THREE.Loader.call(this,a),this.withCredentials=!1},THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype),THREE.JSONLoader.prototype.constructor=THREE.JSONLoader,THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"==typeof c?c:this.extractUrlBase(a),this.onLoadStart(),this.loadAjaxJSON(this,a,b,c)},THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),i=h.metadata;if(void 0!==i){if("object"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");if("scene"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.")}h=a.parse(h,d),c(h.geometry,h.materials)}else THREE.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))},f.open("GET",b,!0),f.withCredentials=this.withCredentials,f.send(null)},THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;return function(b){var d,e,f,g,h,i,j,k,l,m,n,o,p,q=a.faces;i=a.vertices;var r=a.normals,s=a.colors,t=0;if(void 0!==a.uvs){for(d=0;dd;d++)c.faceVertexUvs[d]=[]}for(g=0,h=i.length;h>g;)d=new THREE.Vector3,d.x=i[g++]*b,d.y=i[g++]*b,d.z=i[g++]*b,c.vertices.push(d);for(g=0,h=q.length;h>g;)if(b=q[g++],l=1&b,f=2&b,d=8&b,j=16&b,m=32&b,i=64&b,b&=128,l){if(l=new THREE.Face3,l.a=q[g],l.b=q[g+1],l.c=q[g+3],n=new THREE.Face3,n.a=q[g+1],n.b=q[g+2],n.c=q[g+3],g+=4,f&&(f=q[g++],l.materialIndex=f,n.materialIndex=f),f=c.faces.length,d)for(d=0;t>d;d++)for(o=a.uvs[d],c.faceVertexUvs[d][f]=[],c.faceVertexUvs[d][f+1]=[],e=0;4>e;e++)k=q[g++],p=o[2*k],k=o[2*k+1],p=new THREE.Vector2(p,k),2!==e&&c.faceVertexUvs[d][f].push(p),0!==e&&c.faceVertexUvs[d][f+1].push(p);if(j&&(j=3*q[g++],l.normal.set(r[j++],r[j++],r[j]),n.normal.copy(l.normal)),m)for(d=0;4>d;d++)j=3*q[g++],m=new THREE.Vector3(r[j++],r[j++],r[j]),2!==d&&l.vertexNormals.push(m),0!==d&&n.vertexNormals.push(m);if(i&&(i=q[g++],i=s[i],l.color.setHex(i),n.color.setHex(i)),b)for(d=0;4>d;d++)i=q[g++],i=s[i],2!==d&&l.vertexColors.push(new THREE.Color(i)),0!==d&&n.vertexColors.push(new THREE.Color(i));c.faces.push(l),c.faces.push(n)}else{if(l=new THREE.Face3,l.a=q[g++],l.b=q[g++],l.c=q[g++],f&&(f=q[g++],l.materialIndex=f),f=c.faces.length,d)for(d=0;t>d;d++)for(o=a.uvs[d],c.faceVertexUvs[d][f]=[],e=0;3>e;e++)k=q[g++],p=o[2*k],k=o[2*k+1],p=new THREE.Vector2(p,k),c.faceVertexUvs[d][f].push(p);if(j&&(j=3*q[g++],l.normal.set(r[j++],r[j++],r[j])),m)for(d=0;3>d;d++)j=3*q[g++],m=new THREE.Vector3(r[j++],r[j++],r[j]),l.vertexNormals.push(m);if(i&&(i=q[g++],l.color.setHex(s[i])),b)for(d=0;3>d;d++)i=q[g++],l.vertexColors.push(new THREE.Color(s[i]));c.faces.push(l)}}(d),function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,e=a.skinWeights.length;e>d;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],b>1?a.skinWeights[d+1]:0,b>2?a.skinWeights[d+2]:0,b>3?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,e=a.skinIndices.length;e>d;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],b>1?a.skinIndices[d+1]:0,b>2?a.skinIndices[d+2]:0,b>3?a.skinIndices[d+3]:0));c.bones=a.bones,c.bones&&0d;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],h=c.morphTargets[d].vertices,i=a.morphTargets[d].vertices,f=0,g=i.length;g>f;f+=3){var j=new THREE.Vector3;j.x=i[f]*b,j.y=i[f+1]*b,j.z=i[f+2]*b,h.push(j)}}if(void 0!==a.morphColors)for(d=0,e=a.morphColors.length;e>d;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],g=c.morphColors[d].colors,h=a.morphColors[d].colors,b=0,f=h.length;f>b;b+=3)i=new THREE.Color(16755200),i.setRGB(h[b],h[b+1],h[b+2]),g.push(i)}(d),c.computeFaceNormals(),c.computeBoundingSphere(),void 0===a.materials||0===a.materials.length?{geometry:c}:(d=this.initMaterials(a.materials,b),this.needsTangents(d)&&c.computeTangents(),{geometry:c,materials:d})},THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a,this.onProgress=b,this.onError=c,this.itemStart=function(){f++},this.itemEnd=function(a){e++,void 0!==d.onProgress&&d.onProgress(a,e,f),e===f&&void 0!==d.onLoad&&d.onLoad()}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b,c=new THREE.BufferGeometry,d=a.data.attributes;for(b in d){var e=d[b],f=new self[e.type](e.array);c.addAttribute(b,new THREE.BufferAttribute(f,e.itemSize))}return d=a.data.offsets,void 0!==d&&(c.offsets=JSON.parse(JSON.stringify(d))),a=a.data.boundingSphere,void 0!==a&&(d=new THREE.Vector3,void 0!==a.center&&d.fromArray(a.center),c.boundingSphere=new THREE.Sphere(d,a.radius)),c}},THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];if(void 0!==a.color&&b.color.setHex(a.color),void 0!==a.emissive&&b.emissive.setHex(a.emissive),void 0!==a.specular&&b.specular.setHex(a.specular),void 0!==a.shininess&&(b.shininess=a.shininess),void 0!==a.uniforms&&(b.uniforms=a.uniforms),void 0!==a.vertexShader&&(b.vertexShader=a.vertexShader),void 0!==a.fragmentShader&&(b.fragmentShader=a.fragmentShader),void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors),void 0!==a.shading&&(b.shading=a.shading),void 0!==a.blending&&(b.blending=a.blending),void 0!==a.side&&(b.side=a.side),void 0!==a.opacity&&(b.opacity=a.opacity),void 0!==a.transparent&&(b.transparent=a.transparent),void 0!==a.wireframe&&(b.wireframe=a.wireframe),void 0!==a.size&&(b.size=a.size),void 0!==a.sizeAttenuation&&(b.sizeAttenuation=a.sizeAttenuation),void 0!==a.materials)for(var c=0,d=a.materials.length;d>c;c++)b.materials.push(this.parse(a.materials[c]));return b}},THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(a,b,c,d){""===this.texturePath&&(this.texturePath=a.substring(0,a.lastIndexOf("/")+1));var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){e.parse(JSON.parse(a),b)},c,d)},setTexturePath:function(a){this.texturePath=a},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a,b){var c=this.parseGeometries(a.geometries),d=this.parseImages(a.images,function(){void 0!==b&&b(e)}),d=this.parseTextures(a.textures,d),d=this.parseMaterials(a.materials,d),e=this.parseObject(a.object,c,d);return void 0!==a.images&&0!==a.images.length||void 0===b||b(e),e},parseGeometries:function(a){var b={};if(void 0!==a)for(var c=new THREE.JSONLoader,d=new THREE.BufferGeometryLoader,e=0,f=a.length;f>e;e++){var g,h=a[e];switch(h.type){case"PlaneGeometry":case"PlaneBufferGeometry":g=new THREE[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case"BoxGeometry":case"CubeGeometry":g=new THREE.BoxGeometry(h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case"CircleGeometry":g=new THREE.CircleGeometry(h.radius,h.segments);break;case"CylinderGeometry":g=new THREE.CylinderGeometry(h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded);break;case"SphereGeometry":g=new THREE.SphereGeometry(h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case"IcosahedronGeometry":g=new THREE.IcosahedronGeometry(h.radius,h.detail);break;case"TorusGeometry":g=new THREE.TorusGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case"TorusKnotGeometry":g=new THREE.TorusKnotGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.p,h.q,h.heightScale);break;case"BufferGeometry":g=d.parse(h);break;case"Geometry":g=c.parse(h.data).geometry}g.uuid=h.uuid,void 0!==h.name&&(g.name=h.name),b[h.uuid]=g}return b},parseMaterials:function(a,b){var c={};if(void 0!==a)for(var d=function(a){return void 0===b[a]&&THREE.warn("THREE.ObjectLoader: Undefined texture",a),b[a]},e=new THREE.MaterialLoader,f=0,g=a.length;g>f;f++){var h=a[f],i=e.parse(h);i.uuid=h.uuid,void 0!==h.name&&(i.name=h.name),void 0!==h.map&&(i.map=d(h.map)),void 0!==h.bumpMap&&(i.bumpMap=d(h.bumpMap),h.bumpScale&&(i.bumpScale=new THREE.Vector2(h.bumpScale,h.bumpScale))),void 0!==h.alphaMap&&(i.alphaMap=d(h.alphaMap)),void 0!==h.envMap&&(i.envMap=d(h.envMap)),void 0!==h.normalMap&&(i.normalMap=d(h.normalMap),h.normalScale&&(i.normalScale=new THREE.Vector2(h.normalScale,h.normalScale))),void 0!==h.lightMap&&(i.lightMap=d(h.lightMap)),void 0!==h.specularMap&&(i.specularMap=d(h.specularMap)),c[h.uuid]=i}return c},parseImages:function(a,b){var c=this,d={};if(void 0!==a&&0g;g++){var i=a[g],j=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i.url)?i.url:c.texturePath+i.url;d[i.uuid]=e(j)}}return d},parseTextures:function(a,b){var c={};if(void 0!==a)for(var d=0,e=a.length;e>d;d++){var f=a[d];void 0===f.image&&THREE.warn('THREE.ObjectLoader: No "image" speficied for',f.uuid),void 0===b[f.image]&&THREE.warn("THREE.ObjectLoader: Undefined image",f.image);var g=new THREE.Texture(b[f.image]);g.needsUpdate=!0,g.uuid=f.uuid,void 0!==f.name&&(g.name=f.name),void 0!==f.repeat&&(g.repeat=new THREE.Vector2(f.repeat[0],f.repeat[1])),void 0!==f.minFilter&&(g.minFilter=THREE[f.minFilter]),void 0!==f.magFilter&&(g.magFilter=THREE[f.magFilter]),void 0!==f.anisotropy&&(g.anisotropy=f.anisotropy),f.wrap instanceof Array&&(g.wrapS=THREE[f.wrap[0]],g.wrapT=THREE[f.wrap[1]]),c[f.uuid]=g}return c},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e;e=function(a){return void 0===c[a]&&THREE.warn("THREE.ObjectLoader: Undefined geometry",a),c[a]};var f=function(a){return void 0===d[a]&&THREE.warn("THREE.ObjectLoader: Undefined material",a),d[a]};switch(b.type){case"Scene":e=new THREE.Scene;break;case"PerspectiveCamera":e=new THREE.PerspectiveCamera(b.fov,b.aspect,b.near,b.far);break;case"OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case"AmbientLight":e=new THREE.AmbientLight(b.color);break;case"DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case"PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance,b.decay);break;case"SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay);break;case"HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case"Mesh":e=new THREE.Mesh(e(b.geometry),f(b.material));break;case"Line":e=new THREE.Line(e(b.geometry),f(b.material),b.mode);break;case"PointCloud":e=new THREE.PointCloud(e(b.geometry),f(b.material));break;case"Sprite":e=new THREE.Sprite(f(b.material));break;case"Group":e=new THREE.Group;break;default:e=new THREE.Object3D}if(e.uuid=b.uuid,void 0!==b.name&&(e.name=b.name),void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale)),void 0!==b.visible&&(e.visible=b.visible),void 0!==b.userData&&(e.userData=b.userData),void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()},THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin),e.load(a,function(a){a=new THREE.Texture(a),a.needsUpdate=!0,void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(){this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){var e=this,f=new THREE.DataTexture,g=new THREE.XHRLoader;return g.setResponseType("arraybuffer"),g.load(a,function(a){(a=e._parser(a))&&(void 0!==a.image?f.image=a.image:void 0!==a.data&&(f.image.width=a.width,f.image.height=a.height,f.image.data=a.data),f.wrapS=void 0!==a.wrapS?a.wrapS:THREE.ClampToEdgeWrapping,f.wrapT=void 0!==a.wrapT?a.wrapT:THREE.ClampToEdgeWrapping,f.magFilter=void 0!==a.magFilter?a.magFilter:THREE.LinearFilter,f.minFilter=void 0!==a.minFilter?a.minFilter:THREE.LinearMipMapLinearFilter,f.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(f.format=a.format),void 0!==a.type&&(f.type=a.type),void 0!==a.mipmaps&&(f.mipmaps=a.mipmaps),1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.needsUpdate=!0,b&&b(f,a))},c,d),f}},THREE.CompressedTextureLoader=function(){this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],f=new THREE.CompressedTexture;f.image=e;var g=new THREE.XHRLoader;if(g.setResponseType("arraybuffer"),a instanceof Array){var h=0;c=function(c){g.load(a[c],function(a){a=d._parser(a,!0),e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps},h+=1,6===h&&(1==a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=a.format,f.needsUpdate=!0,b&&b(f))})};for(var i=0,j=a.length;j>i;++i)c(i)}else g.load(a,function(a){if(a=d._parser(a,!0),a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,g=0;c>g;g++){e[g]={mipmaps:[]};for(var h=0;hthis.opacity&&(a.opacity=this.opacity),!1!==this.transparent&&(a.transparent=this.transparent),!1!==this.wireframe&&(a.wireframe=this.wireframe),a +},clone:function(a){return void 0===a&&(a=new THREE.Material),a.name=this.name,a.side=this.side,a.opacity=this.opacity,a.transparent=this.transparent,a.blending=this.blending,a.blendSrc=this.blendSrc,a.blendDst=this.blendDst,a.blendEquation=this.blendEquation,a.blendSrcAlpha=this.blendSrcAlpha,a.blendDstAlpha=this.blendDstAlpha,a.blendEquationAlpha=this.blendEquationAlpha,a.depthTest=this.depthTest,a.depthWrite=this.depthWrite,a.polygonOffset=this.polygonOffset,a.polygonOffsetFactor=this.polygonOffsetFactor,a.polygonOffsetUnits=this.polygonOffsetUnits,a.alphaTest=this.alphaTest,a.overdraw=this.overdraw,a.visible=this.visible,a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(a){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(a)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.linecap=this.linecap,a.linejoin=this.linejoin,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.LineDashedMaterial=function(a){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(a)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.scale=this.scale,a.dashSize=this.dashSize,a.gapSize=this.gapSize,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.MeshBasicMaterial=function(a){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a},THREE.MeshLambertMaterial=function(a){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.wrapAround=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshPhongMaterial=function(a){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.specular=new THREE.Color(1118481),this.shininess=30,this.wrapAround=this.metal=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.bumpMap=this.lightMap=this.map=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.envMap=this.alphaMap=this.specularMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.specular.copy(this.specular),a.shininess=this.shininess,a.metal=this.metal,a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.bumpMap=this.bumpMap,a.bumpScale=this.bumpScale,a.normalMap=this.normalMap,a.normalScale.copy(this.normalScale),a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshDepthMaterial=function(a){THREE.Material.call(this),this.type="MeshDepthMaterial",this.wireframe=this.morphTargets=!1,this.wireframeLinewidth=1,this.setValues(a)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(a)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=a instanceof Array?a:[]},THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;c>b;b++)a.materials.push(this.materials[b].toJSON());return a},clone:function(){for(var a=new THREE.MeshFaceMaterial,b=0;bg){var i=b.closestPointToPoint(a);i.applyMatrix4(e.matrixWorld);var j=c.ray.origin.distanceTo(i);d.push({distance:j,distanceToRay:g,point:i.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var j=f.attributes,k=j.position.array;if(void 0!==j.index){var j=j.index.array,l=f.offsets;0===l.length&&(l=[{start:0,count:j.length,index:0}]);for(var m=0,n=l.length;n>m;++m)for(var o=l[m].start,p=l[m].index,f=o,o=o+l[m].count;o>f;f++){var q=p+j[f];i.fromArray(k,3*q),g(i,q)}}else for(j=k.length/3,f=0;j>f;f++)i.set(k[3*f],k[3*f+1],k[3*f+2]),g(i,f)}else for(i=this.geometry.vertices,f=0;fg;g+=l){var t=s+n[g+1];h.fromArray(m,3*(s+n[g])),i.fromArray(m,3*t),t=b.distanceSqToSegment(h,i,k,j),t>f||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:p,face:null,faceIndex:null,object:this}))}}else for(m=m.position.array,g=0;gf||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,i=h.length,g=0;i-1>g;g+=l)t=b.distanceSqToSegment(h[g],h[g+1],k,j),t>f||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),THREE.Line.prototype.clone=function(a){return void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Mesh=function(a,b){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==a?a:new THREE.Geometry,this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0a;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){return void 0!==this.morphTargetDictionary[a]?this.morphTargetDictionary[a]:(THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var i=this.geometry;if(null===i.boundingSphere&&i.computeBoundingSphere(),c.copy(i.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===i.boundingBox||!1!==b.isIntersectionBox(i.boundingBox)))if(i instanceof THREE.BufferGeometry){var j=this.material;if(void 0!==j){var k,l,m=i.attributes,n=g.precision;if(void 0!==m.index){var o=m.index.array,p=m.position.array,q=i.offsets;0===q.length&&(q=[{start:0,count:o.length,index:0}]);for(var r=0,s=q.length;s>r;++r)for(var m=q[r].start,t=q[r].index,i=m,u=m+q[r].count;u>i;i+=3){m=t+o[i],k=t+o[i+1],l=t+o[i+2],d.fromArray(p,3*m),e.fromArray(p,3*k),f.fromArray(p,3*l);var v=j.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide);if(null!==v){v.applyMatrix4(this.matrixWorld);var w=g.ray.origin.distanceTo(v);n>w||wg.far||h.push({distance:w,point:v,face:new THREE.Face3(m,k,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(p=m.position.array,o=i=0,u=p.length;u>i;i+=3,o+=9)m=i,k=i+1,l=i+2,d.fromArray(p,o),e.fromArray(p,o+3),f.fromArray(p,o+6),v=j.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),w=g.ray.origin.distanceTo(v),n>w||wg.far||h.push({distance:w,point:v,face:new THREE.Face3(m,k,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(i instanceof THREE.Geometry)for(o=this.material instanceof THREE.MeshFaceMaterial,p=!0===o?this.material.materials:null,n=g.precision,q=i.vertices,r=0,s=i.faces.length;s>r;r++)if(t=i.faces[r],j=!0===o?p[t.materialIndex]:this.material,void 0!==j){if(m=q[t.a],k=q[t.b],l=q[t.c],!0===j.morphTargets){v=i.morphTargets,w=this.morphTargetInfluences,d.set(0,0,0),e.set(0,0,0),f.set(0,0,0);for(var u=0,x=v.length;x>u;u++){var y=w[u];if(0!==y){var z=v[u].vertices;d.x+=(z[t.a].x-m.x)*y,d.y+=(z[t.a].y-m.y)*y,d.z+=(z[t.a].z-m.z)*y,e.x+=(z[t.b].x-k.x)*y,e.y+=(z[t.b].y-k.y)*y,e.z+=(z[t.b].z-k.z)*y,f.x+=(z[t.c].x-l.x)*y,f.y+=(z[t.c].y-l.y)*y,f.z+=(z[t.c].z-l.z)*y}}d.add(m),e.add(k),f.add(l),m=d,k=e,l=f}v=j.side===THREE.BackSide?b.intersectTriangle(l,k,m,!0):b.intersectTriangle(m,k,l,j.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),w=g.ray.origin.distanceTo(v),n>w||wg.far||h.push({distance:w,point:v,face:t,faceIndex:r,object:this}))}}}(),THREE.Mesh.prototype.clone=function(a,b){return void 0===a&&(a=new THREE.Mesh(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,a,b),a},THREE.Bone=function(a){THREE.Object3D.call(this),this.type="Bone",this.skin=a},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Skeleton=function(a,b,c){if(this.useVertexTexture=void 0!==c?c:!0,this.identityMatrix=new THREE.Matrix4,a=a||[],this.bones=a.slice(0),this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256b;b++)this.boneInverses.push(new THREE.Matrix4)},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;b>a;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld),this.boneInverses.push(c)}},THREE.Skeleton.prototype.pose=function(){for(var a,b=0,c=this.bones.length;c>b;b++)(a=this.bones[b])&&a.matrixWorld.getInverse(this.boneInverses[b]);for(b=0,c=this.bones.length;c>b;b++)(a=this.bones[b])&&(a.parent?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))},THREE.Skeleton.prototype.update=function(){var a=new THREE.Matrix4;return function(){for(var b=0,c=this.bones.length;c>b;b++)a.multiplyMatrices(this.bones[b]?this.bones[b].matrixWorld:this.identityMatrix,this.boneInverses[b]),a.flattenToArrayOffset(this.boneMatrices,16*b);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.SkinnedMesh=function(a,b,c){if(THREE.Mesh.call(this,a,b),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4,a=[],this.geometry&&void 0!==this.geometry.bones){for(var d,e,f,g,h=0,i=this.geometry.bones.length;i>h;++h)d=this.geometry.bones[h],e=d.pos,f=d.rotq,g=d.scl,b=new THREE.Bone(this),a.push(b),b.name=d.name,b.position.set(e[0],e[1],e[2]),b.quaternion.set(f[0],f[1],f[2],f[3]),void 0!==g?b.scale.set(g[0],g[1],g[2]):b.scale.set(1,1,1);for(h=0,i=this.geometry.bones.length;i>h;++h)d=this.geometry.bones[h],-1!==d.parent?a[d.parent].add(a[h]):this.add(a[h])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(a,void 0,c))},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(a,b){this.skeleton=a,void 0===b&&(this.updateMatrixWorld(!0),b=this.matrixWorld),this.bindMatrix.copy(b),this.bindMatrixInverse.getInverse(b)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var a=0;ae;e++){var g=a.morphTargets[e].name.match(d);if(g&&1h.end&&(h.end=e),b||(b=g)}}a.firstAnimation=b},THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[a]={start:b,end:c}},THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1e3,this.time=0):THREE.warn("THREE.MorphAnimMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a,this.mirroredLoop?(this.time>this.duration||0>this.time)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)):(this.time%=this.duration,0>this.time&&(this.time+=this.duration)),a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1),a!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a),b=this.time%b/b,this.directionBackwards&&(b=1-b),this.morphTargetInfluences[this.currentKeyframe]=b,this.morphTargetInfluences[this.lastKeyframe]=1-b},THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;f>e;e++)d[e]=0;a>-1&&(d[a]=1-c),b>-1&&(d[b]=c)},THREE.MorphAnimMesh.prototype.clone=function(a){return void 0===a&&(a=new THREE.MorphAnimMesh(this.geometry,this.material)),a.duration=this.duration,a.mirroredLoop=this.mirroredLoop,a.time=this.time,a.lastKeyframe=this.lastKeyframe,a.currentKeyframe=this.currentKeyframe,a.direction=this.direction,a.directionBackwards=this.directionBackwards,THREE.Mesh.prototype.clone.call(this,a),a},THREE.LOD=function(){THREE.Object3D.call(this),this.objects=[]},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0),b=Math.abs(b);for(var c=0;cb&&!(ad&&c>=this.objects[d].distance;d++)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;for(;e>d;d++)this.objects[d].object.visible=!1}}}(),THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD),THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;c>b;b++){var d=this.objects[b].object.clone();d.visible=0===b,a.addLevel(d,this.objects[b].distance)}return a},THREE.Sprite=function(){var a=new Uint16Array([0,1,2,0,2,3]),b=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),c=new Float32Array([0,0,1,0,1,1,0,1]),d=new THREE.BufferGeometry;return d.addAttribute("index",new THREE.BufferAttribute(a,1)),d.addAttribute("position",new THREE.BufferAttribute(b,3)),d.addAttribute("uv",new THREE.BufferAttribute(c,2)),function(a){THREE.Object3D.call(this),this.type="Sprite",this.geometry=d,this.material=void 0!==a?a:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3; +return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(a){return void 0===a&&(a=new THREE.Sprite(this.material)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==a&&this.add(a,b,c,d,e)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1),void 0===c&&(c=0),void 0===f&&(f=1),void 0===e&&(e=new THREE.Color(16777215)),void 0===d&&(d=THREE.NormalBlending),c=Math.min(c,Math.max(0,c)),this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})},THREE.LensFlare.prototype.updateLensFlares=function(){var a,b,c=this.lensFlares.length,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;c>a;a++)b=this.lensFlares[a],b.x=this.positionScreen.x+d*b.distance,b.y=this.positionScreen.y+e*b.distance,b.wantedRotation=b.x*Math.PI*.25,b.rotation+=.25*(b.wantedRotation-b.rotation)},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.overrideMaterial=this.fog=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.clone=function(a){return void 0===a&&(a=new THREE.Scene),THREE.Object3D.prototype.clone.call(this,a),null!==this.fog&&(a.fog=this.fog.clone()),null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone()),a.autoUpdate=this.autoUpdate,a.matrixAutoUpdate=this.matrixAutoUpdate,a},THREE.Fog=function(a,b,c){this.name="",this.color=new THREE.Color(a),this.near=void 0!==b?b:1,this.far=void 0!==c?c:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(a,b){this.name="",this.color=new THREE.Color(a),this.density=void 0!==b?b:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2 square( in vec2 a ) { return vec2( a.x*a.x, a.y*a.y ); }\nvec3 square( in vec3 a ) { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4 square( in vec4 a ) { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2 saturate( in vec2 a ) { return clamp( a, 0.0, 1.0 ); }\nvec3 saturate( in vec3 a ) { return clamp( a, 0.0, 1.0 ); }\nvec4 saturate( in vec4 a ) { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a ) { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a ) { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a ) { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2 whiteCompliment( in vec2 a ) { return saturate( vec2(1.0) - a ); }\nvec3 whiteCompliment( in vec3 a ) { return saturate( vec3(1.0) - a ); }\nvec4 whiteCompliment( in vec4 a ) { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n float distance = dot( planeNormal, point-pointOnPlane );\n return point - distance * planeNormal;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n if ( decayExponent > 0.0 ) {\n return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n }\n return 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n return pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n return pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n if ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n vLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n directionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n directionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n #endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n lVector = normalize( lVector );\n float dotProduct = dot( transformedNormal, lVector );\n\n vec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n pointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n pointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n #endif\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n float dotProduct = dot( transformedNormal, lVector );\n vec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n spotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n spotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n #endif\n\n }\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n float dotProduct = dot( transformedNormal, lVector );\n\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n #endif\n\n }\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n vLightBack += ambientLightColor;\n\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n uniform vec4 offsetRepeat;\n uniform sampler2D map;\n\n#endif\n",THREE.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n vec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n vec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n uniform sampler2D map;\n\n#endif",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n #ifdef USE_MORPHNORMALS\n\n vec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n #else\n\n vec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n varying float vFragDepth;\n\n #endif\n\n uniform float logDepthBufFC;\n\n#endif",THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n\n#endif",THREE.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n vec3 normal = normalize( vNormal );\n\n #ifdef DOUBLE_SIDED\n\n normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n #endif\n\n#else\n\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n normal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float pointDiffuseWeightFull = max( dotProduct, 0.0 );\n float pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float pointDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n // specular\n\n vec3 pointHalfVector = normalize( lVector + viewPosition );\n float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n float pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float spotDiffuseWeightFull = max( dotProduct, 0.0 );\n float spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float spotDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n // specular\n\n vec3 spotHalfVector = normalize( lVector + viewPosition );\n float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n float spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n }\n\n }\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n // diffuse\n\n float dotProduct = dot( normal, dirVector );\n\n #ifdef WRAP_AROUND\n\n float dirDiffuseWeightFull = max( dotProduct, 0.0 );\n float dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float dirDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n // specular\n\n vec3 dirHalfVector = normalize( dirVector + viewPosition );\n float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n float dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n /*\n // fresnel term from skin shader\n const float F0 = 0.128;\n\n float base = 1.0 - dot( viewPosition, dirHalfVector );\n float exponential = pow( base, 5.0 );\n\n float fresnel = exponential + F0 * ( 1.0 - exponential );\n */\n\n /*\n // fresnel term from fresnel shader\n const float mFresnelBias = 0.08;\n const float mFresnelScale = 0.3;\n const float mFresnelPower = 5.0;\n\n float fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n */\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n // dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n vec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n totalDiffuseLight += hemiColor;\n\n // specular (sky light)\n\n vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n float hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n // specular (ground light)\n\n vec3 lVectorGround = -lVector;\n\n vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n float hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n float dotProductGround = dot( normal, lVectorGround );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n vec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n totalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n }\n\n#endif\n\n#ifdef METAL\n\n outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n uniform vec3 fogColor;\n\n #ifdef FOG_EXP2\n\n uniform float fogDensity;\n\n #else\n\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n vec3 morphedNormal = vec3( 0.0 );\n\n morphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n morphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n morphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n morphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n morphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n\n // Per-Pixel Tangent Space Normal Mapping\n // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n\n }\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n uniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n }\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n vWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n vec4 texelColor = texture2D( map, vUv );\n\n texelColor.xyz = inputToLinear( texelColor.xyz );\n\n diffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n vUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n vColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n #ifdef USE_MORPHTARGETS\n\n vec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n #endif\n\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n outgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif",THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n",THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n uniform vec4 offsetRepeat;\n\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n // Transforming Normal Vectors with the Inverse Transformation\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n #else\n\n vec3 reflectVec = vReflect;\n\n #endif\n\n #ifdef DOUBLE_SIDED\n float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n #else\n float flipNormal = 1.0;\n #endif\n\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n vec4 envColor = texture2D( envMap, sampleUV );\n\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #endif\n\n envColor.xyz = inputToLinear( envColor.xyz );\n\n #ifdef ENVMAP_BLENDING_MULTIPLY\n\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_MIX )\n\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_ADD )\n\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n #endif\n\n#endif\n",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n uniform sampler2D specularMap;\n\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n vFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n #endif\n\n#endif",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n #ifndef USE_MORPHNORMALS\n\n uniform float morphTargetInfluences[ 8 ];\n\n #else\n\n uniform float morphTargetInfluences[ 4 ];\n\n #endif\n\n#endif",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n\n#else\n\n specularStrength = 1.0;\n\n#endif",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n #else\n\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n #endif\n\n #ifdef FOG_EXP2\n\n float fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n fogFactor = whiteCompliment( fogFactor );\n\n #else\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n #endif\n \n outgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n\n // Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n // http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n vec2 dHdxy_fwd() {\n\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n return vec2( dBx, dBy );\n\n }\n\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n vec3 vSigmaX = dFdx( surf_pos );\n vec3 vSigmaY = dFdy( surf_pos );\n vec3 vN = surf_norm; // normalized\n\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n\n float fDet = dot( vSigmaX, R1 );\n\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n\n }\n\n#endif\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n vec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n vec3 objectNormal = morphedNormal;\n\n#else\n\n vec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n objectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n\n#endif\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n outgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n uniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n diffuseColor.rgb *= vColor;\n\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n vec3 morphed = vec3( 0.0 );\n morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n #ifndef USE_MORPHNORMALS\n\n morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n #endif\n\n morphed += position;\n\n#endif",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n vec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vReflect = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n #ifdef SHADOWMAP_DEBUG\n\n vec3 frustumColors[3];\n frustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n frustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n frustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n #endif\n\n #ifdef SHADOWMAP_CASCADE\n\n int inFrustumCount = 0;\n\n #endif\n\n float fDepth;\n vec3 shadowColor = vec3( 1.0 );\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n // if ( something && something ) breaks ATI OpenGL shader compiler\n // if ( all( something, something ) ) using this instead\n\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n\n // don't shadow pixels outside of light frustum\n // use just first frustum (for cascades)\n // don't shadow pixels behind far plane of light frustum\n\n #ifdef SHADOWMAP_CASCADE\n\n inFrustumCount += int( inFrustum );\n bvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n #else\n\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n #endif\n\n bool frustumTest = all( frustumTestVec );\n\n if ( frustumTest ) {\n\n shadowCoord.z += shadowBias[ i ];\n\n #if defined( SHADOWMAP_TYPE_PCF )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n /*\n // nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n // must enroll loop manually\n\n for ( float y = -1.25; y <= 1.25; y += 1.25 )\n for ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n // doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n //vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n shadow += 1.0;\n\n }\n\n shadow /= 9.0;\n\n */\n\n const float shadowDelta = 1.0 / 9.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.25 * xPixelOffset;\n float dy0 = -1.25 * yPixelOffset;\n float dx1 = 1.25 * xPixelOffset;\n float dy1 = 1.25 * yPixelOffset;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.0 * xPixelOffset;\n float dy0 = -1.0 * yPixelOffset;\n float dx1 = 1.0 * xPixelOffset;\n float dy1 = 1.0 * yPixelOffset;\n\n mat3 shadowKernel;\n mat3 depthKernel;\n\n depthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n depthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n depthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n depthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n depthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n depthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n depthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n depthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n depthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n vec3 shadowZ = vec3( shadowCoord.z );\n shadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n shadowKernel[0] *= vec3(0.25);\n\n shadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n shadowKernel[1] *= vec3(0.25);\n\n shadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n shadowKernel[2] *= vec3(0.25);\n\n vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n shadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n shadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n vec4 shadowValues;\n shadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n shadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n shadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n shadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n shadow = dot( shadowValues, vec4( 1.0 ) );\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #else\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n\n // spot with multiple shadows is darker\n\n shadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n // spot with multiple shadows has the same color as single shadow spot\n\n // shadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n #endif\n\n }\n\n\n #ifdef SHADOWMAP_DEBUG\n\n #ifdef SHADOWMAP_CASCADE\n\n if ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n #else\n\n if ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n #endif\n\n #endif\n\n }\n\n // NOTE: I am unsure if this is correct in linear space. -bhouston, Dec 29, 2014\n shadowColor = inputToLinear( shadowColor );\n\n outgoingLight = outgoingLight * shadowColor;\n\n#endif\n",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n #ifdef USE_SKINNING\n\n vec4 worldPosition = modelMatrix * skinned;\n\n #elif defined( USE_MORPHTARGETS )\n\n vec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n uniform sampler2D shadowMap[ MAX_SHADOWS ];\n uniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n uniform float shadowDarkness[ MAX_SHADOWS ];\n uniform float shadowBias[ MAX_SHADOWS ];\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n float unpackDepth( const in vec4 rgba_depth ) {\n\n const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n float depth = dot( rgba_depth, bit_shift );\n return depth;\n\n }\n\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n\n #ifdef BONE_TEXTURE\n\n uniform sampler2D boneTexture;\n uniform int boneTextureWidth;\n uniform int boneTextureHeight;\n\n mat4 getBoneMatrix( const in float i ) {\n\n float j = i * 4.0;\n float x = mod( j, float( boneTextureWidth ) );\n float y = floor( j / float( boneTextureWidth ) );\n\n float dx = 1.0 / float( boneTextureWidth );\n float dy = 1.0 / float( boneTextureHeight );\n\n y = dy * ( y + 0.5 );\n\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n mat4 bone = mat4( v1, v2, v3, v4 );\n\n return bone;\n\n }\n\n #else\n\n uniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n mat4 getBoneMatrix( const in float i ) {\n\n mat4 bone = boneGlobalMatrices[ int(i) ];\n return bone;\n\n }\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n uniform float logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n #extension GL_EXT_frag_depth : enable\n varying float vFragDepth;\n\n #endif\n\n#endif",THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n uniform sampler2D alphaMap;\n\n#endif\n",THREE.UniformsUtils={merge:function(a){for(var b={},c=0;c dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment," outgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n #else\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n #endif\n float color = 1.0 - smoothstep( mNear, mFar, depth );\n gl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n vec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n res -= res.xxyz * bit_mask;\n return res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT\n gl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n #else\n gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n #endif\n}"].join("\n")}},THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3),e.size=f,e.array=new Float32Array(c*f),e.buffer=W.createBuffer(),e.buffer.belongsToAttribute=d,e.needsUpdate=!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function d(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,g=b.length;g>f;f++){var h=b[f],i=e[h];if(i>=0){var j=c[h];void 0!==j?(h=j.itemSize,W.bindBuffer(W.ARRAY_BUFFER,j.buffer),rb.enableAttribute(i),W.vertexAttribPointer(i,h,W.FLOAT,!1,0,d*h*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[h].length?W.vertexAttrib2fv(i,a.defaultAttributeValues[h]):3===a.defaultAttributeValues[h].length&&W.vertexAttrib3fv(i,a.defaultAttributeValues[h]))}}rb.disableUnusedAttributes()}function e(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function f(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function g(a,b){return b[0]-a[0]}function h(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",Mb));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",Nb),c instanceof THREE.BufferGeometry)X.info.memory.geometries++;else if(a instanceof THREE.Mesh)l(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=W.createBuffer(),c.__webglColorBuffer=W.createBuffer(),c.__webglLineDistanceBuffer=W.createBuffer(),X.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__lineDistanceArray=new Float32Array(1*d),c.__webglLineCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0,c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=W.createBuffer(),c.__webglColorBuffer=W.createBuffer(),X.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh){if(c instanceof THREE.BufferGeometry)m(Q,c,a);else if(c instanceof THREE.Geometry)for(var c=Tb[c.id],d=0,e=c.length;e>d;d++)m(Q,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?m(Q,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&R.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)P.push(a);else if(a instanceof THREE.Sprite)U.push(a);else if(a instanceof THREE.LensFlare)V.push(a);else if((c=Q[a.id])&&(!1===a.frustumCulled||!0===jb.intersectsObject(a)))for(d=0,e=c.length;e>d;d++){var f=c[d],g=f,i=g.object,j=g.buffer,k=i.geometry,i=i.material;i instanceof THREE.MeshFaceMaterial?(i=i.materials[k instanceof THREE.BufferGeometry?0:j.materialIndex],g.material=i,i.transparent?T.push(g):S.push(g)):i&&(g.material=i,i.transparent?T.push(g):S.push(g)),f.render=!0,!0===X.sortObjects&&(lb.setFromMatrixPosition(a.matrixWorld),lb.applyProjection(kb),f.z=lb.z)}}for(d=0,e=a.children.length;e>d;d++)h(a.children[d])}}function i(a,b,c,d,e){for(var f,g=0,h=a.length;h>g;g++){f=a[g];var i=f.object,j=f.buffer;if(u(i,b),e)f=e;else{if(f=f.material,!f)continue;q(f)}X.setMaterialFaces(f),j instanceof THREE.BufferGeometry?X.renderBufferDirect(b,c,d,f,j,i):X.renderBuffer(b,c,d,f,j,i)}}function j(a,b,c,d,e,f){for(var g,h=0,i=a.length;i>h;h++){g=a[h];var j=g.object;if(j.visible){if(f)g=f;else{if(g=g[b],!g)continue;q(g)}X.renderImmediateObject(c,d,e,g,j)}}}function k(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function l(a,b){var d=a.material,e=!1;if(void 0===Tb[b.id]||!0===b.groupsNeedUpdate){delete Q[a.id];for(var f,g,h=Tb,i=b.id,d=d instanceof THREE.MeshFaceMaterial,j=sb.get("OES_element_index_uint")?4294967296:65535,e={},k=b.morphTargets.length,l=b.morphNormals.length,n={},o=[],p=0,q=b.faces.length;q>p;p++){f=b.faces[p];var r=d?f.materialIndex:0;r in e||(e[r]={hash:r,counter:0}),f=e[r].hash+"_"+e[r].counter,f in n||(g={id:Ub++,faces3:[],materialIndex:r,vertices:0,numMorphTargets:k,numMorphNormals:l},n[f]=g,o.push(g)),n[f].vertices+3>j&&(e[r].counter+=1,f=e[r].hash+"_"+e[r].counter,f in n||(g={id:Ub++,faces3:[],materialIndex:r,vertices:0,numMorphTargets:k,numMorphNormals:l},n[f]=g,o.push(g))),n[f].faces3.push(p),n[f].vertices+=3}h[i]=o,b.groupsNeedUpdate=!1}for(h=Tb[b.id],i=0,d=h.length;d>i;i++){if(j=h[i],void 0===j.__webglVertexBuffer){if(e=j,e.__webglVertexBuffer=W.createBuffer(),e.__webglNormalBuffer=W.createBuffer(),e.__webglTangentBuffer=W.createBuffer(),e.__webglColorBuffer=W.createBuffer(),e.__webglUVBuffer=W.createBuffer(),e.__webglUV2Buffer=W.createBuffer(),e.__webglSkinIndicesBuffer=W.createBuffer(),e.__webglSkinWeightsBuffer=W.createBuffer(),e.__webglFaceBuffer=W.createBuffer(),e.__webglLineBuffer=W.createBuffer(),l=e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],k=0;l>k;k++)e.__webglMorphTargetsBuffers.push(W.createBuffer());if(l=e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],k=0;l>k;k++)e.__webglMorphNormalsBuffers.push(W.createBuffer());if(X.info.memory.geometries++,e=j,p=a,q=p.geometry,l=e.faces3,k=3*l.length,n=1*l.length,o=3*l.length,l=c(p,e),e.__vertexArray=new Float32Array(3*k),e.__normalArray=new Float32Array(3*k),e.__colorArray=new Float32Array(3*k),e.__uvArray=new Float32Array(2*k),121845?Uint32Array:Uint16Array,e.__typeArray=p,e.__faceArray=new p(3*n),e.__lineArray=new p(2*o),q=e.numMorphTargets)for(e.__morphTargetsArrays=[],p=0;q>p;p++)e.__morphTargetsArrays.push(new Float32Array(3*k));if(q=e.numMorphNormals)for(e.__morphNormalsArrays=[],p=0;q>p;p++)e.__morphNormalsArrays.push(new Float32Array(3*k));if(e.__webglFaceCount=3*n,e.__webglLineCount=2*o,l.attributes)for(n in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),n=void 0,l.attributes){var s,o=l.attributes[n],p={};for(s in o)p[s]=o[s];(!p.__webglInitialized||p.createUniqueBuffers)&&(p.__webglInitialized=!0,q=1,"v2"===p.type?q=2:"v3"===p.type?q=3:"v4"===p.type?q=4:"c"===p.type&&(q=3),p.size=q,p.array=new Float32Array(k*q),p.buffer=W.createBuffer(),p.buffer.belongsToAttribute=n,o.needsUpdate=!0,p.__original=o),e.__webglCustomAttributesList.push(p)}e.__inittedArrays=!0,b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=!0,e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&m(Q,j,a)}a.__webglActive=!0}function m(a,b,c){var d=c.id;a[d]=a[d]||[],a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function n(a){var b=a.geometry;if(b instanceof THREE.BufferGeometry)for(var d=b.attributes,e=b.attributesKeys,f=0,g=e.length;g>f;f++){var h=e[f],i=d[h],j="index"===h?W.ELEMENT_ARRAY_BUFFER:W.ARRAY_BUFFER;void 0===i.buffer?(i.buffer=W.createBuffer(),W.bindBuffer(j,i.buffer),W.bufferData(j,i.array,i instanceof THREE.DynamicBufferAttribute?W.DYNAMIC_DRAW:W.STATIC_DRAW),i.needsUpdate=!1):!0===i.needsUpdate&&(W.bindBuffer(j,i.buffer),void 0===i.updateRange||-1===i.updateRange.count?W.bufferSubData(j,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(W.bufferSubData(j,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),i.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===b.groupsNeedUpdate&&l(a,b);for(var k=Tb[b.id],f=0,m=k.length;m>f;f++){var n=k[f],q=c(a,n),r=q.attributes&&o(q);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||r){var s=n,t=a,u=W.DYNAMIC_DRAW,v=!b.dynamic,w=q;if(s.__inittedArrays){var x=!1==w instanceof THREE.MeshPhongMaterial&&w.shading===THREE.FlatShading,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,ab=void 0,bb=void 0,cb=void 0,db=void 0,eb=void 0,fb=void 0,gb=void 0,hb=void 0,ib=void 0,jb=void 0,kb=void 0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=void 0,yb=s.__vertexArray,zb=s.__uvArray,Ab=s.__uv2Array,Bb=s.__normalArray,Cb=s.__tangentArray,Db=s.__colorArray,Eb=s.__skinIndexArray,Fb=s.__skinWeightArray,Gb=s.__morphTargetsArrays,Hb=s.__morphNormalsArrays,Ib=s.__webglCustomAttributesList,Jb=void 0,Kb=s.__faceArray,Lb=s.__lineArray,Mb=t.geometry,Nb=Mb.elementsNeedUpdate,Ob=Mb.uvsNeedUpdate,Pb=Mb.normalsNeedUpdate,Qb=Mb.tangentsNeedUpdate,Rb=Mb.colorsNeedUpdate,Sb=Mb.morphTargetsNeedUpdate,Ub=Mb.vertices,Vb=s.faces3,Wb=Mb.faces,Xb=Mb.faceVertexUvs[0],Yb=Mb.faceVertexUvs[1],Zb=Mb.skinIndices,$b=Mb.skinWeights,_b=Mb.morphTargets,ac=Mb.morphNormals;if(Mb.verticesNeedUpdate){for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Ub[B.a],K=Ub[B.b],L=Ub[B.c],yb[mb]=J.x,yb[mb+1]=J.y,yb[mb+2]=J.z,yb[mb+3]=K.x,yb[mb+4]=K.y,yb[mb+5]=K.z,yb[mb+6]=L.x,yb[mb+7]=L.y,yb[mb+8]=L.z,mb+=9;W.bindBuffer(W.ARRAY_BUFFER,s.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,yb,u)}if(Sb)for(fb=0,gb=_b.length;gb>fb;fb++){for(y=vb=0,z=Vb.length;z>y;y++)jb=Vb[y],B=Wb[jb],J=_b[fb].vertices[B.a],K=_b[fb].vertices[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FFER,Eb,u),W.bindBuffer(W.ARRAY_BUFFER,s.__webglSkinWeightsBuffer),W.bufferData(W.ARRAY_BUFFER,Fb,u))}if(Rb){for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],E=B.vertexColors,F=B.color,3===E.length&&w.vertexColors===THREE.VertexColors?(S=E[0],T=E[1],U=E[2]):U=T=S=F,Db[tb]=S.r,Db[tb+1]=S.g,Db[tb+2]=S.b,Db[tb+3]=T.r,Db[tb+4]=T.g,Db[tb+5]=T.b,Db[tb+6]=U.r,Db[tb+7]=U.g,Db[tb+8]=U.b,tb+=9;tb>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,Db,u))}if(Qb&&Mb.hasTangents){for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],G=B.vertexTangents,M=G[0],N=G[1],O=G[2],Cb[rb]=M.x,Cb[rb+1]=M.y,Cb[rb+2]=M.z,Cb[rb+3]=M.w,Cb[rb+4]=N.x,Cb[rb+5]=N.y,Cb[rb+6]=N.z,Cb[rb+7]=N.w,Cb[rb+8]=O.x,Cb[rb+9]=O.y,Cb[rb+10]=O.z,Cb[rb+11]=O.w,rb+=12;W.bindBuffer(W.ARRAY_BUFFER,s.__webglTangentBuffer),W.bufferData(W.ARRAY_BUFFER,Cb,u)}if(Pb){for(y=0,z=Vb.length;z>y;y++)if(B=Wb[Vb[y]],C=B.vertexNormals,D=B.normal,3===C.length&&!1===x)for(ab=0;3>ab;ab++)cb=C[ab],Bb[qb]=cb.x,Bb[qb+1]=cb.y,Bb[qb+2]=cb.z,qb+=3;else for(ab=0;3>ab;ab++)Bb[qb]=D.x,Bb[qb+1]=D.y,Bb[qb+2]=D.z,qb+=3;W.bindBuffer(W.ARRAY_BUFFER,s.__webglNormalBuffer),W.bufferData(W.ARRAY_BUFFER,Bb,u)}if(Ob&&Xb){for(y=0,z=Vb.length;z>y;y++)if(A=Vb[y],H=Xb[A],void 0!==H)for(ab=0;3>ab;ab++)db=H[ab],zb[nb]=db.x,zb[nb+1]=db.y,nb+=2;nb>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglUVBuffer),W.bufferData(W.ARRAY_BUFFER,zb,u))}if(Ob&&Yb){for(y=0,z=Vb.length;z>y;y++)if(A=Vb[y],I=Yb[A],void 0!==I)for(ab=0;3>ab;ab++)eb=I[ab],Ab[ob]=eb.x,Ab[ob+1]=eb.y,ob+=2;ob>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglUV2Buffer),W.bufferData(W.ARRAY_BUFFER,Ab,u))}if(Nb){for(y=0,z=Vb.length;z>y;y++)Kb[pb]=lb,Kb[pb+1]=lb+1,Kb[pb+2]=lb+2,pb+=3,Lb[sb]=lb,Lb[sb+1]=lb+1,Lb[sb+2]=lb,Lb[sb+3]=lb+2,Lb[sb+4]=lb+1,Lb[sb+5]=lb+2,sb+=6,lb+=3;W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,s.__webglFaceBuffer),W.bufferData(W.ELEMENT_ARRAY_BUFFER,Kb,u),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,s.__webglLineBuffer),W.bufferData(W.ELEMENT_ARRAY_BUFFER,Lb,u)}if(Ib)for(ab=0,bb=Ib.length;bb>ab;ab++)if(Jb=Ib[ab],Jb.__original.needsUpdate){if(wb=0,1===Jb.size){if(void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],Jb.array[wb]=Jb.value[B.a],Jb.array[wb+1]=Jb.value[B.b],Jb.array[wb+2]=Jb.value[B.c],wb+=3;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)xb=Jb.value[Vb[y]],Jb.array[wb]=xb,Jb.array[wb+1]=xb,Jb.array[wb+2]=xb,wb+=3}else if(2===Jb.size){if(void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Jb.value[B.a],K=Jb.value[B.b],L=Jb.value[B.c],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=K.x,Jb.array[wb+3]=K.y,Jb.array[wb+4]=L.x,Jb.array[wb+5]=L.y,wb+=6;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)L=K=J=xb=Jb.value[Vb[y]],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=K.x,Jb.array[wb+3]=K.y,Jb.array[wb+4]=L.x,Jb.array[wb+5]=L.y,wb+=6}else if(3===Jb.size){var bc;if(bc="c"===Jb.type?["r","g","b"]:["x","y","z"],void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Jb.value[B.a],K=Jb.value[B.b],L=Jb.value[B.c],Jb.array[wb]=J[bc[0]],Jb.array[wb+1]=J[bc[1]],Jb.array[wb+2]=J[bc[2]],Jb.array[wb+3]=K[bc[0]],Jb.array[wb+4]=K[bc[1]],Jb.array[wb+5]=K[bc[2]],Jb.array[wb+6]=L[bc[0]],Jb.array[wb+7]=L[bc[1]],Jb.array[wb+8]=L[bc[2]],wb+=9;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)L=K=J=xb=Jb.value[Vb[y]],Jb.array[wb]=J[bc[0]],Jb.array[wb+1]=J[bc[1]],Jb.array[wb+2]=J[bc[2]],Jb.array[wb+3]=K[bc[0]],Jb.array[wb+4]=K[bc[1]],Jb.array[wb+5]=K[bc[2]],Jb.array[wb+6]=L[bc[0]],Jb.array[wb+7]=L[bc[1]],Jb.array[wb+8]=L[bc[2]],wb+=9; +else if("faceVertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)xb=Jb.value[Vb[y]],J=xb[0],K=xb[1],L=xb[2],Jb.array[wb]=J[bc[0]],Jb.array[wb+1]=J[bc[1]],Jb.array[wb+2]=J[bc[2]],Jb.array[wb+3]=K[bc[0]],Jb.array[wb+4]=K[bc[1]],Jb.array[wb+5]=K[bc[2]],Jb.array[wb+6]=L[bc[0]],Jb.array[wb+7]=L[bc[1]],Jb.array[wb+8]=L[bc[2]],wb+=9}else if(4===Jb.size)if(void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Jb.value[B.a],K=Jb.value[B.b],L=Jb.value[B.c],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=J.z,Jb.array[wb+3]=J.w,Jb.array[wb+4]=K.x,Jb.array[wb+5]=K.y,Jb.array[wb+6]=K.z,Jb.array[wb+7]=K.w,Jb.array[wb+8]=L.x,Jb.array[wb+9]=L.y,Jb.array[wb+10]=L.z,Jb.array[wb+11]=L.w,wb+=12;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)L=K=J=xb=Jb.value[Vb[y]],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=J.z,Jb.array[wb+3]=J.w,Jb.array[wb+4]=K.x,Jb.array[wb+5]=K.y,Jb.array[wb+6]=K.z,Jb.array[wb+7]=K.w,Jb.array[wb+8]=L.x,Jb.array[wb+9]=L.y,Jb.array[wb+10]=L.z,Jb.array[wb+11]=L.w,wb+=12;else if("faceVertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)xb=Jb.value[Vb[y]],J=xb[0],K=xb[1],L=xb[2],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=J.z,Jb.array[wb+3]=J.w,Jb.array[wb+4]=K.x,Jb.array[wb+5]=K.y,Jb.array[wb+6]=K.z,Jb.array[wb+7]=K.w,Jb.array[wb+8]=L.x,Jb.array[wb+9]=L.y,Jb.array[wb+10]=L.z,Jb.array[wb+11]=L.w,wb+=12;W.bindBuffer(W.ARRAY_BUFFER,Jb.buffer),W.bufferData(W.ARRAY_BUFFER,Jb.array,u)}v&&(delete s.__inittedArrays,delete s.__colorArray,delete s.__normalArray,delete s.__tangentArray,delete s.__uvArray,delete s.__uv2Array,delete s.__faceArray,delete s.__vertexArray,delete s.__lineArray,delete s.__skinIndexArray,delete s.__skinWeightArray)}}}b.verticesNeedUpdate=!1,b.morphTargetsNeedUpdate=!1,b.elementsNeedUpdate=!1,b.uvsNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.tangentsNeedUpdate=!1,q.attributes&&p(q)}else if(a instanceof THREE.Line){if(q=c(a,b),r=q.attributes&&o(q),b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||r){var cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc=W.DYNAMIC_DRAW,pc=b.vertices,qc=b.colors,rc=b.lineDistances,sc=pc.length,tc=qc.length,uc=rc.length,vc=b.__vertexArray,wc=b.__colorArray,xc=b.__lineDistanceArray,yc=b.colorsNeedUpdate,zc=b.lineDistancesNeedUpdate,Ac=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(cc=0;sc>cc;cc++)fc=pc[cc],gc=3*cc,vc[gc]=fc.x,vc[gc+1]=fc.y,vc[gc+2]=fc.z;W.bindBuffer(W.ARRAY_BUFFER,b.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,vc,oc)}if(yc){for(dc=0;tc>dc;dc++)hc=qc[dc],gc=3*dc,wc[gc]=hc.r,wc[gc+1]=hc.g,wc[gc+2]=hc.b;W.bindBuffer(W.ARRAY_BUFFER,b.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,wc,oc)}if(zc){for(ec=0;uc>ec;ec++)xc[ec]=rc[ec];W.bindBuffer(W.ARRAY_BUFFER,b.__webglLineDistanceBuffer),W.bufferData(W.ARRAY_BUFFER,xc,oc)}if(Ac)for(ic=0,jc=Ac.length;jc>ic;ic++)if(nc=Ac[ic],nc.needsUpdate&&(void 0===nc.boundTo||"vertices"===nc.boundTo)){if(gc=0,lc=nc.value.length,1===nc.size)for(kc=0;lc>kc;kc++)nc.array[kc]=nc.value[kc];else if(2===nc.size)for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.x,nc.array[gc+1]=mc.y,gc+=2;else if(3===nc.size)if("c"===nc.type)for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.r,nc.array[gc+1]=mc.g,nc.array[gc+2]=mc.b,gc+=3;else for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.x,nc.array[gc+1]=mc.y,nc.array[gc+2]=mc.z,gc+=3;else if(4===nc.size)for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.x,nc.array[gc+1]=mc.y,nc.array[gc+2]=mc.z,nc.array[gc+3]=mc.w,gc+=4;W.bindBuffer(W.ARRAY_BUFFER,nc.buffer),W.bufferData(W.ARRAY_BUFFER,nc.array,oc),nc.needsUpdate=!1}}b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,b.lineDistancesNeedUpdate=!1,q.attributes&&p(q)}else if(a instanceof THREE.PointCloud){if(q=c(a,b),r=q.attributes&&o(q),b.verticesNeedUpdate||b.colorsNeedUpdate||r){var Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ic,Jc,Kc,Lc,Mc=W.DYNAMIC_DRAW,Nc=b.vertices,Oc=Nc.length,Pc=b.colors,Qc=Pc.length,Rc=b.__vertexArray,Sc=b.__colorArray,Tc=b.colorsNeedUpdate,Uc=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(Bc=0;Oc>Bc;Bc++)Dc=Nc[Bc],Ec=3*Bc,Rc[Ec]=Dc.x,Rc[Ec+1]=Dc.y,Rc[Ec+2]=Dc.z;W.bindBuffer(W.ARRAY_BUFFER,b.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,Rc,Mc)}if(Tc){for(Cc=0;Qc>Cc;Cc++)Fc=Pc[Cc],Ec=3*Cc,Sc[Ec]=Fc.r,Sc[Ec+1]=Fc.g,Sc[Ec+2]=Fc.b;W.bindBuffer(W.ARRAY_BUFFER,b.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,Sc,Mc)}if(Uc)for(Gc=0,Hc=Uc.length;Hc>Gc;Gc++){if(Lc=Uc[Gc],Lc.needsUpdate&&(void 0===Lc.boundTo||"vertices"===Lc.boundTo))if(Jc=Lc.value.length,Ec=0,1===Lc.size)for(Ic=0;Jc>Ic;Ic++)Lc.array[Ic]=Lc.value[Ic];else if(2===Lc.size)for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.x,Lc.array[Ec+1]=Kc.y,Ec+=2;else if(3===Lc.size)if("c"===Lc.type)for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.r,Lc.array[Ec+1]=Kc.g,Lc.array[Ec+2]=Kc.b,Ec+=3;else for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.x,Lc.array[Ec+1]=Kc.y,Lc.array[Ec+2]=Kc.z,Ec+=3;else if(4===Lc.size)for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.x,Lc.array[Ec+1]=Kc.y,Lc.array[Ec+2]=Kc.z,Lc.array[Ec+3]=Kc.w,Ec+=4;W.bindBuffer(W.ARRAY_BUFFER,Lc.buffer),W.bufferData(W.ARRAY_BUFFER,Lc.array,Mc),Lc.needsUpdate=!1}}b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,q.attributes&&p(q)}}function o(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function p(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function q(a){!0===a.transparent?rb.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):rb.setBlending(THREE.NoBlending),rb.setDepthTest(a.depthTest),rb.setDepthWrite(a.depthWrite),rb.setColorWrite(a.colorWrite),rb.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function r(a,b,c,d,e){var f,g,h,i;if(cb=0,d.needsUpdate){d.program&&Sb(d),d.addEventListener("dispose",Qb);var j=Vb[d.type];if(j){var k=THREE.ShaderLib[j];d.__webglShader={uniforms:THREE.UniformsUtils.clone(k.uniforms),vertexShader:k.vertexShader,fragmentShader:k.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var l=0,m=0,n=0,o=0,p=0,q=b.length;q>p;p++){var r=b[p];r.onlyShadow||!1===r.visible||(r instanceof THREE.DirectionalLight&&l++,r instanceof THREE.PointLight&&m++,r instanceof THREE.SpotLight&&n++,r instanceof THREE.HemisphereLight&&o++)}f=l,g=m,h=n,i=o;for(var u,y=0,z=0,A=b.length;A>z;z++){var D=b[z];D.castShadow&&(D instanceof THREE.SpotLight&&y++,D instanceof THREE.DirectionalLight&&!D.shadowCascade&&y++)}u=y;var E;if(Bb&&e&&e.skeleton&&e.skeleton.useVertexTexture)E=1024;else{var G=W.getParameter(W.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((G-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(H=Math.min(e.skeleton.bones.length,H),H0,shadowMapType:X.shadowMapType,shadowMapDebug:X.shadowMapDebug,shadowMapCascade:X.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},J=[];if(j?J.push(j):(J.push(d.fragmentShader),J.push(d.vertexShader)),void 0!==d.defines)for(var K in d.defines)J.push(K),J.push(d.defines[K]);for(K in I)J.push(K),J.push(I[K]);for(var L,N=J.join(),O=0,P=Y.length;P>O;O++){var Q=Y[O];if(Q.code===N){L=Q,L.usedTimes++;break}}void 0===L&&(L=new THREE.WebGLProgram(X,N,d,I),Y.push(L),X.info.memory.programs=Y.length),d.program=L;var R=L.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var S,T="morphTarget",U=0;Ujb;jb++)pb=b[jb],pb.onlyShadow||(qb=pb.color,tb=pb.intensity,ub=pb.distance,pb instanceof THREE.AmbientLight?pb.visible&&(vb+=qb.r,wb+=qb.g,xb+=qb.b):pb instanceof THREE.DirectionalLight?(_b+=1,pb.visible&&(mb.setFromMatrixPosition(pb.matrixWorld),lb.setFromMatrixPosition(pb.target.matrixWorld),mb.sub(lb),mb.normalize(),dc=3*Xb,Db[dc]=mb.x,Db[dc+1]=mb.y,Db[dc+2]=mb.z,v(Cb,dc,qb,tb),Xb+=1)):pb instanceof THREE.PointLight?(ac+=1,pb.visible&&(ec=3*Yb,v(Eb,ec,qb,tb),lb.setFromMatrixPosition(pb.matrixWorld),Fb[ec]=lb.x,Fb[ec+1]=lb.y,Fb[ec+2]=lb.z,Hb[Yb]=ub,Ib[Yb]=0===pb.distance?0:pb.decay,Yb+=1)):pb instanceof THREE.SpotLight?(bc+=1,pb.visible&&(fc=3*Zb,v(Jb,fc,qb,tb),mb.setFromMatrixPosition(pb.matrixWorld),Kb[fc]=mb.x,Kb[fc+1]=mb.y,Kb[fc+2]=mb.z,Lb[Zb]=ub,lb.setFromMatrixPosition(pb.target.matrixWorld),mb.sub(lb),mb.normalize(),Mb[fc]=mb.x,Mb[fc+1]=mb.y,Mb[fc+2]=mb.z,Nb[Zb]=Math.cos(pb.angle),Pb[Zb]=pb.exponent,Rb[Zb]=0===pb.distance?0:pb.decay,Zb+=1)):pb instanceof THREE.HemisphereLight&&(cc+=1,pb.visible&&(mb.setFromMatrixPosition(pb.matrixWorld),mb.normalize(),gc=3*$b,Wb[gc]=mb.x,Wb[gc+1]=mb.y,Wb[gc+2]=mb.z,rb=pb.color,sb=pb.groundColor,v(Tb,gc,rb,tb),v(Ub,gc,sb,tb),$b+=1)));for(jb=3*Xb,kb=Math.max(Cb.length,3*_b);kb>jb;jb++)Cb[jb]=0;for(jb=3*Yb,kb=Math.max(Eb.length,3*ac);kb>jb;jb++)Eb[jb]=0;for(jb=3*Zb,kb=Math.max(Jb.length,3*bc);kb>jb;jb++)Jb[jb]=0;for(jb=3*$b,kb=Math.max(Tb.length,3*cc);kb>jb;jb++)Tb[jb]=0;for(jb=3*$b,kb=Math.max(Ub.length,3*cc);kb>jb;jb++)Ub[jb]=0;yb.directional.length=Xb,yb.point.length=Yb,yb.spot.length=Zb,yb.hemi.length=$b,yb.ambient[0]=vb,yb.ambient[1]=wb,yb.ambient[2]=xb,nb=!1}if(eb){var hc=ob;hb.ambientLightColor.value=hc.ambient,hb.directionalLightColor.value=hc.directional.colors,hb.directionalLightDirection.value=hc.directional.positions,hb.pointLightColor.value=hc.point.colors,hb.pointLightPosition.value=hc.point.positions,hb.pointLightDistance.value=hc.point.distances,hb.pointLightDecay.value=hc.point.decays,hb.spotLightColor.value=hc.spot.colors,hb.spotLightPosition.value=hc.spot.positions,hb.spotLightDistance.value=hc.spot.distances,hb.spotLightDirection.value=hc.spot.directions,hb.spotLightAngleCos.value=hc.spot.anglesCos,hb.spotLightExponent.value=hc.spot.exponents,hb.spotLightDecay.value=hc.spot.decays,hb.hemisphereLightSkyColor.value=hc.hemi.skyColors,hb.hemisphereLightGroundColor.value=hc.hemi.groundColors,hb.hemisphereLightDirection.value=hc.hemi.positions,s(hb,!0)}else s(hb,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){hb.opacity.value=d.opacity,hb.diffuse.value=d.color,hb.map.value=d.map,hb.lightMap.value=d.lightMap,hb.specularMap.value=d.specularMap,hb.alphaMap.value=d.alphaMap,d.bumpMap&&(hb.bumpMap.value=d.bumpMap,hb.bumpScale.value=d.bumpScale),d.normalMap&&(hb.normalMap.value=d.normalMap,hb.normalScale.value.copy(d.normalScale));var ic;if(d.map?ic=d.map:d.specularMap?ic=d.specularMap:d.normalMap?ic=d.normalMap:d.bumpMap?ic=d.bumpMap:d.alphaMap&&(ic=d.alphaMap),void 0!==ic){var jc=ic.offset,kc=ic.repeat;hb.offsetRepeat.value.set(jc.x,jc.y,kc.x,kc.y)}hb.envMap.value=d.envMap,hb.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,hb.reflectivity.value=d.reflectivity,hb.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)hb.diffuse.value=d.color,hb.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)hb.diffuse.value=d.color,hb.opacity.value=d.opacity,hb.dashSize.value=d.dashSize,hb.totalSize.value=d.dashSize+d.gapSize,hb.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(hb.psColor.value=d.color,hb.opacity.value=d.opacity,hb.size.value=d.size,hb.scale.value=C.height/2,hb.map.value=d.map,null!==d.map){var lc=d.map.offset,mc=d.map.repeat;hb.offsetRepeat.value.set(lc.x,lc.y,mc.x,mc.y)}}else d instanceof THREE.MeshPhongMaterial?(hb.shininess.value=d.shininess,hb.emissive.value=d.emissive,hb.specular.value=d.specular,d.wrapAround&&hb.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(hb.emissive.value=d.emissive,d.wrapAround&&hb.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(hb.mNear.value=a.near,hb.mFar.value=a.far,hb.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(hb.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&hb.shadowMatrix)for(var nc=0,oc=0,pc=b.length;pc>oc;oc++){var qc=b[oc];qc.castShadow&&(qc instanceof THREE.SpotLight||qc instanceof THREE.DirectionalLight&&!qc.shadowCascade)&&(hb.shadowMap.value[nc]=qc.shadowMap,hb.shadowMapSize.value[nc]=qc.shadowMapSize,hb.shadowMatrix.value[nc]=qc.shadowMatrix,hb.shadowDarkness.value[nc]=qc.shadowDarkness,hb.shadowBias.value[nc]=qc.shadowBias,nc++)}for(var rc,sc,tc,uc=d.uniformsList,vc=0,wc=uc.length;wc>vc;vc++){var xc=uc[vc][0];if(!1!==xc.needsUpdate){var yc=xc.type,zc=xc.value,Ac=uc[vc][1];switch(yc){case"1i":W.uniform1i(Ac,zc);break;case"1f":W.uniform1f(Ac,zc);break;case"2f":W.uniform2f(Ac,zc[0],zc[1]);break;case"3f":W.uniform3f(Ac,zc[0],zc[1],zc[2]);break;case"4f":W.uniform4f(Ac,zc[0],zc[1],zc[2],zc[3]);break;case"1iv":W.uniform1iv(Ac,zc);break;case"3iv":W.uniform3iv(Ac,zc);break;case"1fv":W.uniform1fv(Ac,zc);break;case"2fv":W.uniform2fv(Ac,zc);break;case"3fv":W.uniform3fv(Ac,zc);break;case"4fv":W.uniform4fv(Ac,zc);break;case"Matrix3fv":W.uniformMatrix3fv(Ac,!1,zc);break;case"Matrix4fv":W.uniformMatrix4fv(Ac,!1,zc);break;case"i":W.uniform1i(Ac,zc);break;case"f":W.uniform1f(Ac,zc);break;case"v2":W.uniform2f(Ac,zc.x,zc.y);break;case"v3":W.uniform3f(Ac,zc.x,zc.y,zc.z);break;case"v4":W.uniform4f(Ac,zc.x,zc.y,zc.z,zc.w);break;case"c":W.uniform3f(Ac,zc.r,zc.g,zc.b);break;case"iv1":W.uniform1iv(Ac,zc);break;case"iv":W.uniform3iv(Ac,zc);break;case"fv1":W.uniform1fv(Ac,zc);break;case"fv":W.uniform3fv(Ac,zc);break;case"v2v":void 0===xc._array&&(xc._array=new Float32Array(2*zc.length));for(var Bc=0,Cc=zc.length;Cc>Bc;Bc++)tc=2*Bc,xc._array[tc]=zc[Bc].x,xc._array[tc+1]=zc[Bc].y;W.uniform2fv(Ac,xc._array);break;case"v3v":for(void 0===xc._array&&(xc._array=new Float32Array(3*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)tc=3*Bc,xc._array[tc]=zc[Bc].x,xc._array[tc+1]=zc[Bc].y,xc._array[tc+2]=zc[Bc].z;W.uniform3fv(Ac,xc._array);break;case"v4v":for(void 0===xc._array&&(xc._array=new Float32Array(4*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)tc=4*Bc,xc._array[tc]=zc[Bc].x,xc._array[tc+1]=zc[Bc].y,xc._array[tc+2]=zc[Bc].z,xc._array[tc+3]=zc[Bc].w;W.uniform4fv(Ac,xc._array);break;case"m3":W.uniformMatrix3fv(Ac,!1,zc.elements);break;case"m3v":for(void 0===xc._array&&(xc._array=new Float32Array(9*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)zc[Bc].flattenToArrayOffset(xc._array,9*Bc);W.uniformMatrix3fv(Ac,!1,xc._array);break;case"m4":W.uniformMatrix4fv(Ac,!1,zc.elements);break;case"m4v":for(void 0===xc._array&&(xc._array=new Float32Array(16*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)zc[Bc].flattenToArrayOffset(xc._array,16*Bc);W.uniformMatrix4fv(Ac,!1,xc._array);break;case"t":if(rc=zc,sc=t(),W.uniform1i(Ac,sc),!rc)continue;if(rc instanceof THREE.CubeTexture||rc.image instanceof Array&&6===rc.image.length){var Dc=rc,Ec=sc;if(6===Dc.image.length)if(Dc.needsUpdate){Dc.image.__webglTextureCube||(Dc.addEventListener("dispose",Ob),Dc.image.__webglTextureCube=W.createTexture(),X.info.memory.textures++),W.activeTexture(W.TEXTURE0+Ec),W.bindTexture(W.TEXTURE_CUBE_MAP,Dc.image.__webglTextureCube),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,Dc.flipY);for(var Fc=Dc instanceof THREE.CompressedTexture,Gc=Dc.image[0]instanceof THREE.DataTexture,Hc=[],Ic=0;6>Ic;Ic++)Hc[Ic]=!X.autoScaleCubemaps||Fc||Gc?Gc?Dc.image[Ic].image:Dc.image[Ic]:x(Dc.image[Ic],zb);var Jc=Hc[0],Kc=THREE.Math.isPowerOfTwo(Jc.width)&&THREE.Math.isPowerOfTwo(Jc.height),Lc=B(Dc.format),Mc=B(Dc.type);for(w(W.TEXTURE_CUBE_MAP,Dc,Kc),Ic=0;6>Ic;Ic++)if(Fc)for(var Nc,Oc=Hc[Ic].mipmaps,Pc=0,Qc=Oc.length;Qc>Pc;Pc++)Nc=Oc[Pc],Dc.format!==THREE.RGBAFormat&&Dc.format!==THREE.RGBFormat?-1Bc;Bc++)xc._array[Bc]=t();for(W.uniform1iv(Ac,xc._array),Bc=0,Cc=xc.value.length;Cc>Bc;Bc++)rc=xc.value[Bc],sc=xc._array[Bc],rc&&X.setTexture(rc,sc);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+yc)}}}}return W.uniformMatrix4fv(gb.modelViewMatrix,!1,e._modelViewMatrix.elements),gb.normalMatrix&&W.uniformMatrix3fv(gb.normalMatrix,!1,e._normalMatrix.elements),null!==gb.modelMatrix&&W.uniformMatrix4fv(gb.modelMatrix,!1,e.matrixWorld.elements),fb}function s(a,b){a.ambientLightColor.needsUpdate=b,a.directionalLightColor.needsUpdate=b,a.directionalLightDirection.needsUpdate=b,a.pointLightColor.needsUpdate=b,a.pointLightPosition.needsUpdate=b,a.pointLightDistance.needsUpdate=b,a.pointLightDecay.needsUpdate=b,a.spotLightColor.needsUpdate=b,a.spotLightPosition.needsUpdate=b,a.spotLightDistance.needsUpdate=b,a.spotLightDirection.needsUpdate=b,a.spotLightAngleCos.needsUpdate=b,a.spotLightExponent.needsUpdate=b,a.spotLightDecay.needsUpdate=b,a.hemisphereLightSkyColor.needsUpdate=b,a.hemisphereLightGroundColor.needsUpdate=b,a.hemisphereLightDirection.needsUpdate=b}function t(){var a=cb;return a>=wb&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+wb),cb+=1,a}function u(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function v(a,b,c,d){a[b]=c.r*d,a[b+1]=c.g*d,a[b+2]=c.b*d}function w(a,b,c){c?(W.texParameteri(a,W.TEXTURE_WRAP_S,B(b.wrapS)),W.texParameteri(a,W.TEXTURE_WRAP_T,B(b.wrapT)),W.texParameteri(a,W.TEXTURE_MAG_FILTER,B(b.magFilter)),W.texParameteri(a,W.TEXTURE_MIN_FILTER,B(b.minFilter))):(W.texParameteri(a,W.TEXTURE_WRAP_S,W.CLAMP_TO_EDGE),W.texParameteri(a,W.TEXTURE_WRAP_T,W.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),W.texParameteri(a,W.TEXTURE_MAG_FILTER,A(b.magFilter)),W.texParameteri(a,W.TEXTURE_MIN_FILTER,A(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )")),(c=sb.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");return d.width=Math.floor(a.width*c),d.height=Math.floor(a.height*c),d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height),THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a),d}return a}function y(a,b){W.bindRenderbuffer(W.RENDERBUFFER,a),b.depthBuffer&&!b.stencilBuffer?(W.renderbufferStorage(W.RENDERBUFFER,W.DEPTH_COMPONENT16,b.width,b.height),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(W.renderbufferStorage(W.RENDERBUFFER,W.DEPTH_STENCIL,b.width,b.height),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_STENCIL_ATTACHMENT,W.RENDERBUFFER,a)):W.renderbufferStorage(W.RENDERBUFFER,W.RGBA4,b.width,b.height)}function z(a){a instanceof THREE.WebGLRenderTargetCube?(W.bindTexture(W.TEXTURE_CUBE_MAP,a.__webglTexture),W.generateMipmap(W.TEXTURE_CUBE_MAP),W.bindTexture(W.TEXTURE_CUBE_MAP,null)):(W.bindTexture(W.TEXTURE_2D,a.__webglTexture),W.generateMipmap(W.TEXTURE_2D),W.bindTexture(W.TEXTURE_2D,null))}function A(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?W.NEAREST:W.LINEAR}function B(a){var b;if(a===THREE.RepeatWrapping)return W.REPEAT;if(a===THREE.ClampToEdgeWrapping)return W.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return W.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return W.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return W.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return W.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return W.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return W.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return W.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return W.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return W.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return W.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return W.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return W.BYTE;if(a===THREE.ShortType)return W.SHORT;if(a===THREE.UnsignedShortType)return W.UNSIGNED_SHORT;if(a===THREE.IntType)return W.INT;if(a===THREE.UnsignedIntType)return W.UNSIGNED_INT;if(a===THREE.FloatType)return W.FLOAT;if(b=sb.get("OES_texture_half_float"),null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return W.ALPHA;if(a===THREE.RGBFormat)return W.RGB;if(a===THREE.RGBAFormat)return W.RGBA;if(a===THREE.LuminanceFormat)return W.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return W.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return W.FUNC_ADD;if(a===THREE.SubtractEquation)return W.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return W.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return W.ZERO;if(a===THREE.OneFactor)return W.ONE;if(a===THREE.SrcColorFactor)return W.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return W.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return W.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return W.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return W.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return W.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return W.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return W.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return W.SRC_ALPHA_SATURATE;if(b=sb.get("WEBGL_compressed_texture_s3tc"),null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(b=sb.get("WEBGL_compressed_texture_pvrtc"),null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(b=sb.get("EXT_blend_minmax"),null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION),a=a||{};var C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),D=void 0!==a.context?a.context:null,E=1,F=void 0!==a.precision?a.precision:"highp",G=void 0!==a.alpha?a.alpha:!1,H=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,K=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,L=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,N=new THREE.Color(0),O=0,P=[],Q={},R=[],S=[],T=[],U=[],V=[];this.domElement=C,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1,this.shadowMapType=THREE.PCFShadowMap,this.shadowMapCullFace=THREE.CullFaceFront,this.shadowMapCascade=this.shadowMapDebug=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var W,X=this,Y=[],Z=null,$=null,_=-1,ab="",bb=null,cb=0,db=0,eb=0,fb=C.width,gb=C.height,hb=0,ib=0,jb=new THREE.Frustum,kb=new THREE.Matrix4,lb=new THREE.Vector3,mb=new THREE.Vector3,nb=!0,ob={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var pb={alpha:G,depth:H,stencil:I,antialias:J,premultipliedAlpha:K,preserveDrawingBuffer:L};if(W=D||C.getContext("webgl",pb)||C.getContext("experimental-webgl",pb),null===W){if(null!==C.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}C.addEventListener("webglcontextlost",function(a){a.preventDefault(),vb(),ub(),Q={}},!1)}catch(qb){THREE.error("THREE.WebGLRenderer: "+qb)}var rb=new THREE.WebGLState(W,B);void 0===W.getShaderPrecisionFormat&&(W.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var sb=new THREE.WebGLExtensions(W);sb.get("OES_texture_float"),sb.get("OES_texture_float_linear"),sb.get("OES_texture_half_float"),sb.get("OES_texture_half_float_linear"),sb.get("OES_standard_derivatives"),M&&sb.get("EXT_frag_depth");var tb=function(a,b,c,d){!0===K&&(a*=d,b*=d,c*=d),W.clearColor(a,b,c,d)},ub=function(){W.clearColor(0,0,0,1),W.clearDepth(1),W.clearStencil(0),W.enable(W.DEPTH_TEST),W.depthFunc(W.LEQUAL),W.frontFace(W.CCW),W.cullFace(W.BACK),W.enable(W.CULL_FACE),W.enable(W.BLEND),W.blendEquation(W.FUNC_ADD),W.blendFunc(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA),W.viewport(db,eb,fb,gb),tb(N.r,N.g,N.b,O)},vb=function(){bb=Z=null,ab="",_=-1,nb=!0,rb.reset()};ub(),this.context=W,this.state=rb;var wb=W.getParameter(W.MAX_TEXTURE_IMAGE_UNITS),xb=W.getParameter(W.MAX_VERTEX_TEXTURE_IMAGE_UNITS),yb=W.getParameter(W.MAX_TEXTURE_SIZE),zb=W.getParameter(W.MAX_CUBE_MAP_TEXTURE_SIZE),Ab=xb>0,Bb=Ab&&sb.get("OES_texture_float"),Cb=W.getShaderPrecisionFormat(W.VERTEX_SHADER,W.HIGH_FLOAT),Db=W.getShaderPrecisionFormat(W.VERTEX_SHADER,W.MEDIUM_FLOAT),Eb=W.getShaderPrecisionFormat(W.FRAGMENT_SHADER,W.HIGH_FLOAT),Fb=W.getShaderPrecisionFormat(W.FRAGMENT_SHADER,W.MEDIUM_FLOAT),Gb=function(){var a;return function(){if(void 0!==a)return a;if(a=[],sb.get("WEBGL_compressed_texture_pvrtc")||sb.get("WEBGL_compressed_texture_s3tc"))for(var b=W.getParameter(W.COMPRESSED_TEXTURE_FORMATS),c=0;c=0;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit,delete a._modelViewMatrix,delete a._normalMatrix,delete a.__webglActive})},Nb=function(a){if(a=a.target,a.removeEventListener("dispose",Nb),delete a.__webglInit,a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(W.deleteBuffer(c.buffer),delete c.buffer)}X.info.memory.geometries--}else if(b=Tb[a.id],void 0!==b){for(var c=0,d=b.length;d>c;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;g>f;f++)W.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){for(f=0,g=e.numMorphNormals;g>f;f++)W.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Rb(e)}delete Tb[a.id]}else Rb(a);ab=""},Ob=function(a){a=a.target,a.removeEventListener("dispose",Ob),a.image&&a.image.__webglTextureCube?(W.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(W.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit),X.info.memory.textures--},Pb=function(a){if(a=a.target,a.removeEventListener("dispose",Pb),a&&void 0!==a.__webglTexture){if(W.deleteTexture(a.__webglTexture),delete a.__webglTexture,a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)W.deleteFramebuffer(a.__webglFramebuffer[b]),W.deleteRenderbuffer(a.__webglRenderbuffer[b]);else W.deleteFramebuffer(a.__webglFramebuffer),W.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer,delete a.__webglRenderbuffer}X.info.memory.textures--},Qb=function(a){a=a.target,a.removeEventListener("dispose",Qb),Sb(a)},Rb=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),c=0,d=b.length;d>c;c++){var e=b[c];void 0!==a[e]&&(W.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)W.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}X.info.memory.geometries--},Sb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;for(a=0,c=Y.length;c>a;a++)if(d=Y[a],d.program===b){d.usedTimes--,0===d.usedTimes&&(e=!0);break}if(!0===e){for(e=[],a=0,c=Y.length;c>a;a++)d=Y[a],d.program!==b&&e.push(d);Y=e,W.deleteProgram(b),X.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){if(rb.initAttributes(),a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=W.createBuffer()),a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=W.createBuffer()),a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=W.createBuffer()),a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=W.createBuffer()),a.hasPositions&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,a.positionArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.position),W.vertexAttribPointer(b.attributes.position,3,W.FLOAT,!1,0,0)),a.hasNormals){if(W.bindBuffer(W.ARRAY_BUFFER,a.__webglNormalBuffer),!1==c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,i,j,k,l,m,n,o=3*a.count;for(n=0;o>n;n+=9)m=a.normalArray,d=m[n],e=m[n+1],f=m[n+2],g=m[n+3],i=m[n+4],k=m[n+5],h=m[n+6],j=m[n+7],l=m[n+8],d=(d+g+h)/3,e=(e+i+j)/3,f=(f+k+l)/3,m[n]=d,m[n+1]=e,m[n+2]=f,m[n+3]=d,m[n+4]=e,m[n+5]=f,m[n+6]=d,m[n+7]=e,m[n+8]=f}W.bufferData(W.ARRAY_BUFFER,a.normalArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.normal),W.vertexAttribPointer(b.attributes.normal,3,W.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglUvBuffer),W.bufferData(W.ARRAY_BUFFER,a.uvArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.uv),W.vertexAttribPointer(b.attributes.uv,2,W.FLOAT,!1,0,0)),a.hasColors&&c.vertexColors!==THREE.NoColors&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,a.colorArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.color),W.vertexAttribPointer(b.attributes.color,3,W.FLOAT,!1,0,0)),rb.disableUnusedAttributes(),W.drawArrays(W.TRIANGLES,0,a.count),a.count=0},this.renderBufferDirect=function(a,b,c,e,f,g){if(!1!==e.visible)if(n(g),a=r(a,b,c,e,g),b=!1,c="direct_"+f.id+"_"+a.id+"_"+(e.wireframe?1:0),c!==ab&&(ab=c,b=!0),b&&rb.initAttributes(),g instanceof THREE.Mesh){g=!0===e.wireframe?W.LINES:W.TRIANGLES;var h=f.attributes.index;if(h){var i,j;if(h.array instanceof Uint32Array&&sb.get("OES_element_index_uint")?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.vertices+=h.array.length,X.info.render.faces+=h.array.length/3;else{b=!0;for(var k=0,l=c.length;l>k;k++){var m=c[k].index;b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.vertices+=c[k].count,X.info.render.faces+=c[k].count/3}}}else b&&d(e,a,f,0),e=f.attributes.position,W.drawArrays(g,0,e.array.length/e.itemSize),X.info.render.calls++,X.info.render.vertices+=e.array.length/e.itemSize,X.info.render.faces+=e.array.length/(3*e.itemSize)}else if(g instanceof THREE.PointCloud)if(g=W.POINTS,h=f.attributes.index)if(h.array instanceof Uint32Array&&sb.get("OES_element_index_uint")?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.points+=h.array.length;else for(1k;k++)m=c[k].index,b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.points+=c[k].count;else if(b&&d(e,a,f,0),e=f.attributes.position,c=f.offsets,0===c.length)W.drawArrays(g,0,e.array.length/3),X.info.render.calls++,X.info.render.points+=e.array.length/3;else for(k=0,l=c.length;l>k;k++)W.drawArrays(g,c[k].index,c[k].count),X.info.render.calls++,X.info.render.points+=c[k].count;else if(g instanceof THREE.Line)if(g=g.mode===THREE.LineStrip?W.LINE_STRIP:W.LINES,rb.setLineWidth(e.linewidth*E),h=f.attributes.index)if(h.array instanceof Uint32Array?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.vertices+=h.array.length;else for(1k;k++)m=c[k].index,b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.vertices+=c[k].count;else if(b&&d(e,a,f,0),e=f.attributes.position,c=f.offsets,0===c.length)W.drawArrays(g,0,e.array.length/3),X.info.render.calls++,X.info.render.vertices+=e.array.length/3;else for(k=0,l=c.length;l>k;k++)W.drawArrays(g,c[k].index,c[k].count),X.info.render.calls++,X.info.render.vertices+=c[k].count},this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){if(n(f),c=r(a,b,c,d,f),b=c.attributes,a=!1,c=e.id+"_"+c.id+"_"+(d.wireframe?1:0),c!==ab&&(ab=c,a=!0),a&&rb.initAttributes(),!d.morphTargets&&0<=b.position)a&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglVertexBuffer),rb.enableAttribute(b.position),W.vertexAttribPointer(b.position,3,W.FLOAT,!1,0,0));else if(f.morphTargetBase){if(c=d.program.attributes,-1!==f.morphTargetBase&&0<=c.position?(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),rb.enableAttribute(c.position),W.vertexAttribPointer(c.position,3,W.FLOAT,!1,0,0)):0<=c.position&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglVertexBuffer),rb.enableAttribute(c.position),W.vertexAttribPointer(c.position,3,W.FLOAT,!1,0,0)),f.morphTargetForcedOrder.length)for(var h,i=0,j=f.morphTargetForcedOrder,k=f.morphTargetInfluences;i=0&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[j[i]]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),h=c["morphNormal"+i],h>=0&&d.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[j[i]]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=k[j[i]],i++;else{for(j=[],k=f.morphTargetInfluences,i=f.geometry.morphTargets,k.length>i.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),k.length=i.length),i=0,h=k.length;h>i;i++)j.push([k[i],i]);j.length>d.numSupportedMorphTargets?(j.sort(g),j.length=d.numSupportedMorphTargets):j.length>d.numSupportedMorphNormals?j.sort(g):0===j.length&&j.push([0,0]);for(var i=0,l=d.numSupportedMorphTargets;l>i;i++)if(j[i]){var m=j[i][1];h=c["morphTarget"+i],h>=0&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[m]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),h=c["morphNormal"+i],h>=0&&d.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[m]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=k[m]}else f.__webglMorphTargetInfluences[i]=0}null!==d.program.uniforms.morphTargetInfluences&&W.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,k=e.__webglCustomAttributesList.length;k>c;c++)j=e.__webglCustomAttributesList[c],0<=b[j.buffer.belongsToAttribute]&&(W.bindBuffer(W.ARRAY_BUFFER,j.buffer),rb.enableAttribute(b[j.buffer.belongsToAttribute]),W.vertexAttribPointer(b[j.buffer.belongsToAttribute],j.size,W.FLOAT,!1,0,0));0<=b.color&&(0d;d++){var m=R[d],n=m.object;n.visible&&(u(n,b),k(m))}a.overrideMaterial?(d=a.overrideMaterial,q(d),i(S,b,P,g,d),i(T,b,P,g,d),j(R,"",b,P,g,d)):(rb.setBlending(THREE.NoBlending),i(S,b,P,g,null),j(R,"opaque",b,P,g,null),i(T,b,P,g,null),j(R,"transparent",b,P,g,null)),Kb.render(a,b),Lb.render(a,b,hb,ib),c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&z(c),rb.setDepthTest(!0),rb.setDepthWrite(!0),rb.setColorWrite(!0)}},this.renderImmediateObject=function(a,b,c,d,e){var f=r(a,b,c,d,e);ab="",X.setMaterialFaces(d),e.immediateRenderCallback?e.immediateRenderCallback(f,W,jb):e.render(function(a){X.renderBufferImmediate(a,f,d)})};var Tb={},Ub=0,Vb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?W.disable(W.CULL_FACE):(W.frontFace(b===THREE.FrontFaceDirectionCW?W.CW:W.CCW),W.cullFace(a===THREE.CullFaceBack?W.BACK:a===THREE.CullFaceFront?W.FRONT:W.FRONT_AND_BACK),W.enable(W.CULL_FACE))},this.setMaterialFaces=function(a){rb.setDoubleSided(a.side===THREE.DoubleSide),rb.setFlipSided(a.side===THREE.BackSide)},this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Ob),a.__webglTexture=W.createTexture(),X.info.memory.textures++),W.bindTexture(W.TEXTURE_2D,a.__webglTexture),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,a.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,a.unpackAlignment),a.image=x(a.image,yb);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=B(a.format),e=B(a.type);w(W.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0g;g++)b=f[g],W.texImage2D(W.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else W.texImage2D(W.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;h>g;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1g;g++)b=f[g],W.texImage2D(W.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else W.texImage2D(W.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&W.generateMipmap(W.TEXTURE_2D),a.needsUpdate=!1,a.onUpdate&&a.onUpdate()},this.setTexture=function(a,b){W.activeTexture(W.TEXTURE0+b),a.needsUpdate?X.uploadTexture(a):W.bindTexture(W.TEXTURE_2D,a.__webglTexture)},this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0),void 0===a.stencilBuffer&&(a.stencilBuffer=!0),a.addEventListener("dispose",Pb),a.__webglTexture=W.createTexture(),X.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=B(a.format),e=B(a.type);if(b){a.__webglFramebuffer=[],a.__webglRenderbuffer=[],W.bindTexture(W.TEXTURE_CUBE_MAP,a.__webglTexture),w(W.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=W.createFramebuffer(),a.__webglRenderbuffer[f]=W.createRenderbuffer(),W.texImage2D(W.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=W.TEXTURE_CUBE_MAP_POSITIVE_X+f;W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer[f]),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,h,g.__webglTexture,0),y(a.__webglRenderbuffer[f],a)}c&&W.generateMipmap(W.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=W.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:W.createRenderbuffer(),W.bindTexture(W.TEXTURE_2D,a.__webglTexture),w(W.TEXTURE_2D,a,c),W.texImage2D(W.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=W.TEXTURE_2D,W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_STENCIL_ATTACHMENT,W.RENDERBUFFER,a.__webglRenderbuffer):y(a.__webglRenderbuffer,a),c&&W.generateMipmap(W.TEXTURE_2D);b?W.bindTexture(W.TEXTURE_CUBE_MAP,null):W.bindTexture(W.TEXTURE_2D,null),W.bindRenderbuffer(W.RENDERBUFFER,null),W.bindFramebuffer(W.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=fb,a=gb,d=db,e=eb),b!==$&&(W.bindFramebuffer(W.FRAMEBUFFER,b),W.viewport(d,e,c,a),$=b),hb=c,ib=a},this.readRenderTargetPixels=function(a,b,c,d,e,f){if(a instanceof THREE.WebGLRenderTarget){if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==$&&(W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer),g=!0),W.checkFramebufferStatus(W.FRAMEBUFFER)===W.FRAMEBUFFER_COMPLETE?W.readPixels(b,c,d,e,W.RGBA,W.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),g&&W.bindFramebuffer(W.FRAMEBUFFER,$)}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},THREE.WebGLRenderTarget=function(a,b,c){this.width=a,this.height=b,c=c||{},this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter,this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.format=void 0!==c.format?c.format:THREE.RGBAFormat,this.type=void 0!==c.type?c.type:THREE.UnsignedByteType,this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0,this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0,this.generateMipmaps=!0,this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a,this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);return a.wrapS=this.wrapS,a.wrapT=this.wrapT,a.magFilter=this.magFilter,a.minFilter=this.minFilter,a.anisotropy=this.anisotropy,a.offset.copy(this.offset),a.repeat.copy(this.repeat),a.format=this.format,a.type=this.type,a.depthBuffer=this.depthBuffer,a.stencilBuffer=this.stencilBuffer,a.generateMipmaps=this.generateMipmaps,a.shareDepthFrom=this.shareDepthFrom,a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c),this.activeCubeFace=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case"EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}return null===d&&THREE.warn("THREE.WebGLRenderer: "+c+" extension not supported."),b[c]=d}},THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,i=d.attributes,j=d.__webglShader.vertexShader,k=d.__webglShader.fragmentShader,l=d.index0AttributeName;void 0===l&&!0===e.morphTargets&&(l="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var n="ENVMAP_TYPE_CUBE",o="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:n="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:n="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:n="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:o="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:p="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:p="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:p="ENVMAP_BLENDING_ADD"}}var q,r,s=0l;l++)m=h[l],u[m]=f.getUniformLocation(g,m);for(this.uniforms=u,l="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" "),h=0;hv;v++)u=e[v],i[u]=f.getAttribLocation(g,u);return this.attributes=i,this.attributesKeys=Object.keys(this.attributes),this.id=a++,this.code=c,this.usedTimes=1,this.program=g,this.vertexShader=j,this.fragmentShader=k,this}}(),THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var b=0;ba;a++)c[a]=0},this.enableAttribute=function(b){c[b]=1,0===d[b]&&(a.enableVertexAttribArray(b),d[b]=1)},this.disableUnusedAttributes=function(){for(var b=0,e=d.length;e>b;b++)d[b]!==c[b]&&(a.disableVertexAttribArray(b),d[b]=0)},this.setBlending=function(c,d,l,m,n,o,p){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),e=c),c===THREE.CustomBlending?(n=n||d,o=o||l,p=p||m,(d!==f||n!==i)&&(a.blendEquationSeparate(b(d),b(n)),f=d,i=n),(l!==g||m!==h||o!==j||p!==k)&&(a.blendFuncSeparate(b(l),b(m),b(o),b(p)),g=l,h=m,j=o,k=p)):k=j=i=h=g=f=null},this.setDepthTest=function(b){l!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),l=b)},this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)},this.setColorWrite=function(b){n!==b&&(a.colorMask(b,b,b,b),n=b)},this.setDoubleSided=function(b){o!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),o=b)},this.setFlipSided=function(b){p!==b&&(a.frontFace(b?a.CW:a.CCW),p=b)},this.setLineWidth=function(b){b!==q&&(a.lineWidth(b),q=b)},this.setPolygonOffset=function(b,c,d){r!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),r=b),!b||s===c&&t===d||(a.polygonOffset(c,d),s=c,t=d)},this.reset=function(){for(var a=0;aE;E++)if(A=16/w,B.set(A*x,A),G=b[E],t.set(G.matrixWorld.elements[12],G.matrixWorld.elements[13],G.matrixWorld.elements[14]),t.applyMatrix4(u.matrixWorldInverse),t.applyProjection(u.projectionMatrix),C.copy(t),D.x=C.x*y+y,D.y=C.y*z+z,p||0H;H++){var J=G.lensFlares[H];.001g;g++){var i=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld),p.push(i)}for(g=0,h=b.children.length;h>g;g++)e(a,b.children[g],d)}}var f,g,h,i,j=a.context,k=new THREE.Frustum,l=new THREE.Matrix4,m=new THREE.Vector3,n=new THREE.Vector3,o=new THREE.Vector3,p=[],q=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(q.uniforms);f=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader}),g=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0}),h=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,skinning:!0}),i=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0,skinning:!0}),f._shadowPass=!0,g._shadowPass=!0,h._shadowPass=!0,i._shadowPass=!0,this.render=function(c,q){if(!1!==a.shadowMapEnabled){var r,s,t,u,v,w,x,y,z=[];for(u=0,j.clearColor(1,1,1,1),j.disable(j.BLEND),j.enable(j.CULL_FACE),j.frontFace(j.CCW),j.cullFace(a.shadowMapCullFace===THREE.CullFaceFront?j.FRONT:j.BACK),a.state.setDepthTest(!0),r=0,s=b.length;s>r;r++)if(t=b[r],t.castShadow)if(t instanceof THREE.DirectionalLight&&t.shadowCascade)for(v=0;vC;C++)y[C]=new THREE.Vector3,w[C]=new THREE.Vector3;y=x.shadowCascadeNearZ[B],x=x.shadowCascadeFarZ[B],w[0].set(-1,-1,y),w[1].set(1,-1,y),w[2].set(-1,1,y),w[3].set(1,1,y),w[4].set(-1,-1,x),w[5].set(1,-1,x),w[6].set(-1,1,x),w[7].set(1,1,x),A.originalCamera=q,w=new THREE.Gyroscope,w.position.copy(t.shadowCascadeOffset),w.add(A),w.add(A.target),q.add(w),t.shadowCascadeArray[v]=A}B=t,y=v,x=B.shadowCascadeArray[y],x.position.copy(B.position),x.target.position.copy(B.target.position),x.lookAt(x.target),x.shadowCameraVisible=B.shadowCameraVisible,x.shadowDarkness=B.shadowDarkness,x.shadowBias=B.shadowCascadeBias[y],w=B.shadowCascadeNearZ[y],B=B.shadowCascadeFarZ[y],x=x.pointsFrustum,x[0].z=w,x[1].z=w,x[2].z=w,x[3].z=w,x[4].z=B,x[5].z=B,x[6].z=B,x[7].z=B,z[u]=A,u++}else z[u]=t,u++;for(r=0,s=z.length;s>r;r++){if(t=z[r],t.shadowMap||(v=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&(v=THREE.NearestFilter),t.shadowMap=new THREE.WebGLRenderTarget(t.shadowMapWidth,t.shadowMapHeight,{minFilter:v,magFilter:v,format:THREE.RGBAFormat}),t.shadowMapSize=new THREE.Vector2(t.shadowMapWidth,t.shadowMapHeight),t.shadowMatrix=new THREE.Matrix4),!t.shadowCamera){if(t instanceof THREE.SpotLight)t.shadowCamera=new THREE.PerspectiveCamera(t.shadowCameraFov,t.shadowMapWidth/t.shadowMapHeight,t.shadowCameraNear,t.shadowCameraFar);else{if(!(t instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",t);continue}t.shadowCamera=new THREE.OrthographicCamera(t.shadowCameraLeft,t.shadowCameraRight,t.shadowCameraTop,t.shadowCameraBottom,t.shadowCameraNear,t.shadowCameraFar)}c.add(t.shadowCamera),!0===c.autoUpdate&&c.updateMatrixWorld()}if(t.shadowCameraVisible&&!t.cameraHelper&&(t.cameraHelper=new THREE.CameraHelper(t.shadowCamera),c.add(t.cameraHelper)),t.isVirtual&&A.originalCamera==q){for(v=q,u=t.shadowCamera,w=t.pointsFrustum,x=t.pointsWorld,m.set(1/0,1/0,1/0),n.set(-1/0,-1/0,-1/0),B=0;8>B;B++)y=x[B],y.copy(w[B]),y.unproject(v),y.applyMatrix4(u.matrixWorldInverse),y.xn.x&&(n.x=y.x),y.yn.y&&(n.y=y.y),y.zn.z&&(n.z=y.z);u.left=m.x,u.right=n.x,u.top=n.y,u.bottom=m.y,u.updateProjectionMatrix()}for(u=t.shadowMap,w=t.shadowMatrix,v=t.shadowCamera,v.position.setFromMatrixPosition(t.matrixWorld),o.setFromMatrixPosition(t.target.matrixWorld),v.lookAt(o),v.updateMatrixWorld(),v.matrixWorldInverse.getInverse(v.matrixWorld),t.cameraHelper&&(t.cameraHelper.visible=t.shadowCameraVisible),t.shadowCameraVisible&&t.cameraHelper.update(),w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(v.projectionMatrix),w.multiply(v.matrixWorldInverse),l.multiplyMatrices(v.projectionMatrix,v.matrixWorldInverse),k.setFromMatrix(l),a.setRenderTarget(u),a.clear(),p.length=0,e(c,c,v),t=0,u=p.length;u>t;t++)x=p[t],w=x.object,x=x.buffer,B=w.material instanceof THREE.MeshFaceMaterial?w.material.materials[0]:w.material,y=void 0!==w.geometry.morphTargets&&0t;t++)x=d[t],w=x.object,w.visible&&w.castShadow&&(w._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,w.matrixWorld),a.renderImmediateObject(v,b,null,f,w))}r=a.getClearColor(),s=a.getClearAlpha(),j.clearColor(r.r,r.g,r.b,s),j.enable(j.BLEND),a.shadowMapCullFace===THREE.CullFaceFront&&j.cullFace(j.BACK),a.resetGLState()}}},THREE.SpritePlugin=function(a,b){function c(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=a.context,z=new THREE.Vector3,A=new THREE.Quaternion,B=new THREE.Vector3;this.render=function(C,D){if(0!==b.length){if(void 0===w){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),F=new Uint16Array([0,1,2,0,2,3]);u=y.createBuffer(),v=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,u),y.bufferData(y.ARRAY_BUFFER,E,y.STATIC_DRAW),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.bufferData(y.ELEMENT_ARRAY_BUFFER,F,y.STATIC_DRAW);var E=y.createProgram(),F=y.createShader(y.VERTEX_SHADER),G=y.createShader(y.FRAGMENT_SHADER);y.shaderSource(F,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),y.shaderSource(G,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),y.compileShader(F),y.compileShader(G),y.attachShader(E,F),y.attachShader(E,G),y.linkProgram(E),w=E,s=y.getAttribLocation(w,"position"),t=y.getAttribLocation(w,"uv"),d=y.getUniformLocation(w,"uvOffset"),e=y.getUniformLocation(w,"uvScale"),f=y.getUniformLocation(w,"rotation"),g=y.getUniformLocation(w,"scale"),h=y.getUniformLocation(w,"color"),i=y.getUniformLocation(w,"map"),j=y.getUniformLocation(w,"opacity"),k=y.getUniformLocation(w,"modelViewMatrix"),l=y.getUniformLocation(w,"projectionMatrix"),m=y.getUniformLocation(w,"fogType"),n=y.getUniformLocation(w,"fogDensity"),o=y.getUniformLocation(w,"fogNear"),p=y.getUniformLocation(w,"fogFar"),q=y.getUniformLocation(w,"fogColor"),r=y.getUniformLocation(w,"alphaTest"),E=document.createElement("canvas"),E.width=8,E.height=8,F=E.getContext("2d"),F.fillStyle="white",F.fillRect(0,0,8,8),x=new THREE.Texture(E),x.needsUpdate=!0}y.useProgram(w),y.enableVertexAttribArray(s),y.enableVertexAttribArray(t),y.disable(y.CULL_FACE),y.enable(y.BLEND),y.bindBuffer(y.ARRAY_BUFFER,u),y.vertexAttribPointer(s,2,y.FLOAT,!1,16,0),y.vertexAttribPointer(t,2,y.FLOAT,!1,16,8),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.uniformMatrix4fv(l,!1,D.projectionMatrix.elements),y.activeTexture(y.TEXTURE0),y.uniform1i(i,0),F=E=0,(G=C.fog)?(y.uniform3f(q,G.color.r,G.color.g,G.color.b),G instanceof THREE.Fog?(y.uniform1f(o,G.near),y.uniform1f(p,G.far),y.uniform1i(m,1),F=E=1):G instanceof THREE.FogExp2&&(y.uniform1f(n,G.density),y.uniform1i(m,2),F=E=2)):(y.uniform1i(m,0),F=E=0);for(var G=0,H=b.length;H>G;G++){var I=b[G];I._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,I.matrixWorld),I.z=-I._modelViewMatrix.elements[14]}b.sort(c);for(var J=[],G=0,H=b.length;H>G;G++){var I=b[G],K=I.material;y.uniform1f(r,K.alphaTest),y.uniformMatrix4fv(k,!1,I._modelViewMatrix.elements),I.matrixWorld.decompose(z,A,B),J[0]=B.x,J[1]=B.y,I=0,C.fog&&K.fog&&(I=F),E!==I&&(y.uniform1i(m,I),E=I),null!==K.map?(y.uniform2f(d,K.map.offset.x,K.map.offset.y),y.uniform2f(e,K.map.repeat.x,K.map.repeat.y)):(y.uniform2f(d,0,0),y.uniform2f(e,1,1)),y.uniform1f(j,K.opacity),y.uniform3f(h,K.color.r,K.color.g,K.color.b),y.uniform1f(f,K.rotation),y.uniform2fv(g,J),a.state.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst),a.state.setDepthTest(K.depthTest),a.state.setDepthWrite(K.depthWrite),K.map&&K.map.image&&K.map.image.width?a.setTexture(K.map,0):a.setTexture(x,0),y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}y.enable(y.CULL_FACE),a.resetGLState()}}},THREE.GeometryUtils={merge:function(a,b,c){THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry),a.merge(b,d,c)},center:function(a){return THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),a.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);return e.load(a,function(a){f.image=a,f.needsUpdate=!0,c&&c(f)},void 0,function(a){d&&d(a)}),f.sourceFile=a,f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a,g+=1,6===g&&(f.needsUpdate=!0,c&&c(f))},void 0,d)};for(var h=0,i=a.length;i>h;++h)b(h);return f},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");f.width=d,f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,i=g.createImageData(d,e),j=i.data,k=0;d>k;k++)for(var l=0;e>l;l++){var m=0>l-1?0:l-1,n=l+1>e-1?e-1:l+1,o=0>k-1?0:k-1,p=k+1>d-1?d-1:k+1,q=[],r=[0,0,h[4*(l*d+k)]/255*b];for(q.push([-1,0,h[4*(l*d+o)]/255*b]),q.push([-1,-1,h[4*(m*d+o)]/255*b]),q.push([0,-1,h[4*(m*d+k)]/255*b]),q.push([1,-1,h[4*(m*d+p)]/255*b]),q.push([1,0,h[4*(l*d+p)]/255*b]),q.push([1,1,h[4*(n*d+p)]/255*b]),q.push([0,1,h[4*(n*d+k)]/255*b]),q.push([-1,1,h[4*(n*d+o)]/255*b]),m=[],o=q.length,n=0;o>n;n++){var p=q[n],s=q[(n+1)%o],p=[p[0]-r[0],p[1]-r[1],p[2]-r[2]],s=[s[0]-r[0],s[1]-r[1],s[2]-r[2]];m.push(c([p[1]*s[2]-p[2]*s[1],p[2]*s[0]-p[0]*s[2],p[0]*s[1]-p[1]*s[0]]))}for(q=[0,0,0],n=0;nh;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;return a=new THREE.DataTexture(e,a,b,THREE.RGBFormat),a.needsUpdate=!0,a}},THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;e>d;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld),b.remove(a),c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld),a.applyMatrix(d),b.remove(a),c.add(a)}},THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(a){var b=a.familyName.toLowerCase();return this.faces[b]=this.faces[b]||{},this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{},this.faces[b][a.cssFontWeight][a.cssFontStyle]=a,this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;f>a;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=[],r=b.glyphs[a]||b.glyphs["?"];if(r){if(r.o)for(b=r._cachedOutline||(r._cachedOutline=r.o.split(" ")),i=b.length,a=0;i>a;)switch(h=b[a++]){case"m":h=b[a++]*c+d,j=b[a++]*c,e.moveTo(h,j);break;case"l":h=b[a++]*c+d,j=b[a++]*c,e.lineTo(h,j);break;case"q":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,e.quadraticCurveTo(m,n,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++){var s=f/g;THREE.Shape.Utils.b2(s,k,m,h),THREE.Shape.Utils.b2(s,l,n,j)}break;case"b":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,o=b[a++]*c+d,p=b[a++]*c,e.bezierCurveTo(m,n,o,p,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++)s=f/g,THREE.Shape.Utils.b3(s,k,m,o,h),THREE.Shape.Utils.b3(s,l,n,p,j)}return{offset:r.ha*c,path:e}}}},THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";for(THREE.FontUtils.size=void 0!==b.size?b.size:100,THREE.FontUtils.divisions=c,THREE.FontUtils.face=d,THREE.FontUtils.weight=e,THREE.FontUtils.style=f,c=THREE.FontUtils.drawText(a).paths,d=[],e=0,f=c.length;f>e;e++)Array.prototype.push.apply(d,c[e].toShapes());return d},function(a){var b=function(a){for(var b=a.length,c=0,d=b-1,e=0;b>e;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c};return a.Triangulate=function(a,c){var d=a.length;if(3>d)return null;var e,f,g,h=[],i=[],j=[];if(0f;f++)i[f]=f;else for(f=0;d>f;f++)i[f]=d-1-f;var k=2*d;for(f=d-1;d>2;){if(0>=k--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}e=f,e>=d&&(e=0),f=e+1,f>=d&&(f=0),g=f+1,g>=d&&(g=0);var l;a:{var m=l=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,m=a[i[e]].x,n=a[i[e]].y,o=a[i[f]].x,p=a[i[f]].y,q=a[i[g]].x,r=a[i[g]].y;if(1e-10>(o-m)*(r-n)-(p-n)*(q-m))l=!1;else{var u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,C=B=A=t=s=void 0,u=q-o,v=r-p,w=m-q,x=n-r,y=o-m,z=p-n;for(l=0;d>l;l++)if(s=a[i[l]].x,t=a[i[l]].y,!(s===m&&t===n||s===o&&t===p||s===q&&t===r)&&(A=s-m,B=t-n,C=s-o,D=t-p,s-=q,t-=r,C=u*D-v*C,A=y*B-z*A,B=w*t-x*s,C>=-1e-10&&B>=-1e-10&&A>=-1e-10)){l=!1;break a}l=!0}}if(l){for(h.push([a[i[e]],a[i[f]],a[i[g]]]),j.push([i[e],i[f],i[g]]),e=f,g=f+1;d>g;e++,g++)i[e]=i[g];d--,k=2*d}}return c?j:h},a.Triangulate.area=b,a}(THREE.FontUtils),self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace},THREE.typeface_js=self._typeface_js,THREE.Audio=function(a){THREE.Object3D.call(this),this.type="Audio",this.context=a.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;return c.open("GET",a,!0),c.responseType="arraybuffer",c.onload=function(){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a,b.autoplay&&b.play()})},c.send(),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)THREE.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer,a.loop=this.source.loop,a.onended=this.source.onended,a.connect(this.panner),a.start(0,this.startTime),this.isPlaying=!0,this.source=a}},THREE.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},THREE.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(a){this.source.loop=a},THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a},THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a},THREE.Audio.prototype.setVolume=function(a){this.gain.gain.value=a},THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b),a.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(a.x,a.y,a.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g){THREE.Object3D.prototype.updateMatrixWorld.call(this,g),g=this.context.listener;var h=this.up;this.matrixWorld.decompose(a,b,c),d.set(0,0,-1).applyQuaternion(b),e.subVectors(a,f),g.setPosition(a.x,a.y,a.z),g.setOrientation(d.x,d.y,d.z,h.x,h.y,h.z),g.setVelocity(e.x,e.y,e.z),f.copy(a)}}(),THREE.Curve=function(){},THREE.Curve.prototype.getPoint=function(){return THREE.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},THREE.Curve.prototype.getPointAt=function(a){return a=this.getUtoTmapping(a),this.getPoint(a)},THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPoint(b/a));return c},THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPointAt(b/a));return c},THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]},THREE.Curve.prototype.getLengths=function(a){if(a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b,c,d=[],e=this.getPoint(0),f=0;for(d.push(0),c=1;a>=c;c++)b=this.getPoint(c/a),f+=b.distanceTo(e),d.push(f),e=b;return this.cacheArcLengths=d},THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},THREE.Curve.prototype.getUtoTmapping=function(a,b){var c,d=this.getLengths(),e=0,f=d.length;c=b?b:a*d[f-1];for(var g,h=0,i=f-1;i>=h;)if(e=Math.floor(h+(i-h)/2),g=d[e]-c,0>g)h=e+1;else{if(!(g>0)){i=e;break}i=e-1}return e=i,d[e]==c?e/(f-1):(h=d[e],d=(e+(c-h)/(d[e+1]-h))/(f-1))},THREE.Curve.prototype.getTangent=function(a){var b=a-1e-4;return a+=1e-4,0>b&&(b=0),a>1&&(a=1),b=this.getPoint(b),this.getPoint(a).clone().sub(b).normalize()},THREE.Curve.prototype.getTangentAt=function(a){return a=this.getUtoTmapping(a),this.getTangent(a)},THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a),d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}},THREE.Curve.create=function(a,b){return a.prototype=Object.create(THREE.Curve.prototype),a.prototype.constructor=a,a.prototype.getPoint=b,a},THREE.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(a){this.curves.push(a)},THREE.CurvePath.prototype.checkConnection=function(){},THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))},THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null},THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a,b=[],c=0,d=this.curves.length;for(a=0;d>a;a++)c+=this.curves[a].getLength(),b.push(c);return this.cacheLengths=b},THREE.CurvePath.prototype.getBoundingBox=function(){var a,b,c,d,e,f,g=this.getPoints();a=b=Number.NEGATIVE_INFINITY,d=e=Number.POSITIVE_INFINITY;var h,i,j,k,l=g[0]instanceof THREE.Vector3;for(k=l?new THREE.Vector3:new THREE.Vector2,i=0,j=g.length;j>i;i++)h=g[i],h.x>a?a=h.x:h.xb?b=h.y:h.yc?c=h.z:h.zc;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c,d,e=this.getSpacedPoints(a);for(b||(b=this.bends),c=0,d=b.length;d>c;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c,d,e,f,g,h,i=this.getBoundingBox();for(c=0,d=a.length;d>c;c++)e=a[c],f=e.x,g=e.y,h=f/i.maxX,h=b.getUtoTmapping(h,f),f=b.getPoint(h),h=b.getTangent(h),h.set(-h.y,h.x).multiplyScalar(g),e.x=f.x+h.x,e.y=f.y+h.y;return a},THREE.Gyroscope=function(){THREE.Object3D.call(this)},THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype),THREE.Gyroscope.prototype.constructor=THREE.Gyroscope,THREE.Gyroscope.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Quaternion,f=new THREE.Vector3;return function(g){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||g)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(d,e,f),this.matrix.decompose(a,b,c),this.matrixWorld.compose(d,b,f)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,g=!0);for(var h=0,i=this.children.length;i>h;h++)this.children[h].updateMatrixWorld(g)}}(),THREE.Path=function(a){THREE.CurvePath.call(this),this.actions=[],a&&this.fromPoints(a)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},THREE.Path.prototype.fromPoints=function(a){this.moveTo(a[0].x,a[0].y); +for(var b=1,c=a.length;c>b;b++)this.lineTo(a[b].x,a[b].y)},THREE.Path.prototype.moveTo=function(){var a=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:a})},THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),d=this.actions[this.actions.length-1].args,d=new THREE.LineCurve(new THREE.Vector2(d[d.length-2],d[d.length-1]),new THREE.Vector2(a,b));this.curves.push(d),this.actions.push({action:THREE.PathActions.LINE_TO,args:c})},THREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args,f=new THREE.QuadraticBezierCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d));this.curves.push(f),this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:e})},THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args,h=new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,f));this.curves.push(h),this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:g})},THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a),c=new THREE.SplineCurve(c),this.curves.push(c),this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})},THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)},THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)},THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)},THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(i),i=i.getPoint(1),h.push(i.x),h.push(i.y),this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})},THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;a>c;c++)b.push(this.getPoint(c/a));return b},THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[];for(c=0,d=this.actions.length;d>c;c++)switch(e=this.actions[c],f=e.action,e=e.args,f){case THREE.PathActions.MOVE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.LINE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:for(g=e[2],h=e[3],k=e[0],l=e[1],0=e;e++)o=e/a,f=THREE.Shape.Utils.b2(o,m,k,g),o=THREE.Shape.Utils.b2(o,n,l,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.BEZIER_CURVE_TO:for(g=e[4],h=e[5],k=e[0],l=e[1],i=e[2],j=e[3],0=e;e++)o=e/a,f=THREE.Shape.Utils.b3(o,m,k,i,g),o=THREE.Shape.Utils.b3(o,n,l,j,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.CSPLINE_THRU:for(f=this.actions[c-1].args,o=[new THREE.Vector2(f[f.length-2],f[f.length-1])],f=a*e[0].length,o=o.concat(e[0]),o=new THREE.SplineCurve(o),e=1;f>=e;e++)p.push(o.getPointAt(e/f));break;case THREE.PathActions.ARC:for(g=e[0],h=e[1],l=e[2],i=e[3],f=e[4],k=!!e[5],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+l*Math.sin(o),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.ELLIPSE:for(g=e[0],h=e[1],l=e[2],j=e[3],i=e[4],f=e[5],k=!!e[6],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+j*Math.sin(o),p.push(new THREE.Vector2(f,o))}return c=p[p.length-1],1e-10>Math.abs(c.x-p[0].x)&&1e-10>Math.abs(c.y-p[0].y)&&p.splice(p.length-1,1),b&&p.push(p[0]),p},THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions,f.curves=e.curves,b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;c>f;e=f++){var g=b[e],h=b[f],i=h.x-g.x,j=h.y-g.y;if(1e-10j&&(g=b[f],i=-i,h=b[e],j=-j),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{if(e=j*(a.x-g.x)-i*(a.y-g.y),0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;for(b=0,c=a.length;c>b;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);return 0!=g.actions.length&&f.push(g),f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,i=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,i.push(h),i;var j=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),j=a?!j:j;h=[];var k,l=[],m=[],n=0;l[n]=void 0,m[n]=[];var o,p;for(o=0,p=e.length;p>o;o++)g=e[o],k=g.getPoints(),f=THREE.Shape.Utils.isClockWise(k),(f=a?!f:f)?(!j&&l[n]&&n++,l[n]={s:new THREE.Shape,p:k},l[n].s.actions=g.actions,l[n].s.curves=g.curves,j&&n++,m[n]=[]):m[n].push({h:g,p:k[0]});if(!l[0])return c(e);if(1g;g++)h[g]=[];for(g=0,e=l.length;e>g;g++)for(f=m[g],j=0;jo;o++)for(h=l[o].s,i.push(h),g=m[o],e=0,f=g.length;f>e;e++)h.holes.push(g[e].h);return i},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)},THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)},THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d},THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d},THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}},THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)},THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}},THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x0){if(0>n||n>m)return[];if(i=j*k-i*l,0>i||i>m)return[]}else{if(n>0||m>n)return[];if(i=j*k-i*l,i>0||m>i)return[]}return 0==i?!f||0!=n&&n!=m?[a]:[]:i==m?!f||0!=n&&n!=m?[b]:[]:0==n?[d]:n==m?[e]:(f=i/m,[{x:a.x+f*g,y:a.y+f*h}])}return 0!=n||j*k!=i*l?[]:(h=0==g&&0==h,i=0==i&&0==j,h&&i?a.x!=d.x||a.y!=d.y?[]:[a]:h?c(d,e,a)?[a]:[]:i?c(a,b,d)?[d]:[]:(0!=g?(a.x=i?m>a?[]:a==m?f?[]:[b]:d>=a?[b,h]:[b,j]:i>d?[]:i==d?f?[]:[g]:d>=a?[g,h]:[g,j]))}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x,c=c.y-a.y;var g=d.x-a.x;return d=d.y-a.y,a=e*c-f*b,e=e*d-f*g,1e-100?e>=0&&b>=0:e>=0||b>=0):e>0}var f,g,h,i,j,k={};for(h=a.concat(),f=0,g=b.length;g>f;f++)Array.prototype.push.apply(h,b[f]);for(f=0,g=h.length;g>f;f++)j=h[f].x+":"+h[f].y,void 0!==k[j]&&THREE.warn("THREE.Shape: Duplicate point",j),k[j]=f;f=function(a,b){function c(a,b){var c=q.length-1,d=a-1;0>d&&(d=c);var f=a+1;return f>c&&(f=0),(c=e(q[a],q[d],q[f],h[b]))?(c=h.length-1,d=b-1,0>d&&(d=c),f=b+1,f>c&&(f=0),(c=e(h[b],h[d],h[f],q[a]))?!0:!1):!1}function f(a,b){var c,e;for(c=0;ct;t++)r.push(t);n=0;for(var u=2*r.length;0u){console.log("Infinite Loop! Holes left:"+r.length+", Probably Hole outside Shape!");break}for(j=n;j=0)break;s[m]=!0}if(i>=0)break}}return q}(a,b);var l=THREE.FontUtils.Triangulate(f,!1);for(f=0,g=l.length;g>f;f++)for(i=l[f],h=0;3>h;h++)j=i[h].x+":"+i[h].y,j=k[j],void 0!==j&&(i[h]=j);return l.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}},THREE.LineCurve=function(a,b){this.v1=a,this.v2=b},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);return b.multiplyScalar(a).add(this.v1),b},THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)},THREE.LineCurve.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a,this.v1=b,this.v2=c},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b},THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;return b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y),b.normalize()},THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;return b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new THREE.Vector2(b,a)},THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;return b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b=new THREE.Vector2(b,a),b.normalize(),b},THREE.SplineCurve=function(a){this.points=void 0==a?[]:a},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector2;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c},THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a,this.aY=b,this.xRadius=c,this.yRadius=d,this.aStartAngle=e,this.aEndAngle=f,this.aClockwise=g},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;return 0>b&&(b+=2*Math.PI),b>2*Math.PI&&(b-=2*Math.PI),a=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b,b=new THREE.Vector2,b.x=this.aX+this.xRadius*Math.cos(a),b.y=this.aY+this.yRadius*Math.sin(a),b},THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a,this.v2=b},function(a){var b=new THREE.Vector3;return b.subVectors(this.v2,this.v1),b.multiplyScalar(a),b.add(this.v1),b}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a,this.v1=b,this.v2=c},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z),b}),THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z),b}),THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(c>0?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){THREE.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){THREE.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){THREE.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;ba.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){for(d={},c=0;ca;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var d=this.data.name,e=c.animationCache.animations,f=e[d];for(void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f),c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.timee.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e,f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a].animationCache;void 0!==c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c,d,e,g,h,i,j=[],k=[];return c=(a.length-1)*b,d=Math.floor(c),c-=d,j[0]=0===d?d:d-1,j[1]=d,j[2]=d>a.length-2?d:d+1,j[3]=d>a.length-3?d:d+2,d=a[j[0]],g=a[j[1]],h=a[j[2]],i=a[j[3]],j=c*c,e=c*j,k[0]=f(d[0],g[0],h[0],i[0],c,j,e),k[1]=f(d[1],g[1],h[1],i[1],c,j,e),k[2]=f(d[2],g[2],h[2],i[2],c,j,e),k},f=function(a,b,c,d,e,f,g){return a=.5*(c-a),d=.5*(d-b),(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length,(this.currentTime>f||0>this.currentTime)&&(this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop()),f=0;for(var g=this.hierarchy.length;g>f;f++)for(var h=this.hierarchy[f],i=h.animationCache.animations[this.data.name],j=h.animationCache.blending,k=0;3>k;k++){var l=this.keyTypes[k],m=i.prevKey[l],n=i.nextKey[l];if(0this.timeScale&&m.time>=this.currentTime){for(m=this.data.hierarchy[f].keys[0],n=this.getNextKeyWith(l,f,1);n.timem.index;)m=n,n=this.getNextKeyWith(l,f,n.index+1);i.prevKey[l]=m,i.nextKey[l]=n}var o=(this.currentTime-m.time)/(n.time-m.time),p=m[l],q=n[l];0>o&&(o=0),o>1&&(o=1),"pos"===l?this.interpolationType===THREE.AnimationHandler.LINEAR?(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.positionWeight),h.position.lerp(c,m),j.positionWeight+=this.weight):(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)&&(a[0]=this.getPrevKeyWith("pos",f,m.index-1).pos,a[1]=p,a[2]=q,a[3]=this.getNextKeyWith("pos",f,n.index+1).pos,o=.33*o+.33,n=e(a,o),m=this.weight/(this.weight+j.positionWeight),j.positionWeight+=this.weight,l=h.position,l.x+=(n[0]-l.x)*m,l.y+=(n[1]-l.y)*m,l.z+=(n[2]-l.z)*m,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(o=e(a,1.01*o),b.set(o[0],o[1],o[2]),b.sub(l),b.y=0,b.normalize(),o=Math.atan2(b.x,b.z),h.rotation.set(0,o,0))):"rot"===l?(THREE.Quaternion.slerp(p,q,d,o),0===j.quaternionWeight?(h.quaternion.copy(d),j.quaternionWeight=this.weight):(m=this.weight/(this.weight+j.quaternionWeight),THREE.Quaternion.slerp(h.quaternion,d,h.quaternion,m),j.quaternionWeight+=this.weight)):"scl"===l&&(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.scaleWeight),h.scale.lerp(c,m),j.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c0?c:0:c>=0?c:c+d.length;c>=0;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}},THREE.KeyFrameAnimation=function(a){this.root=a.node,this.data=THREE.AnimationHandler.init(a),this.hierarchy=THREE.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.loop=this.isPaused=!0,a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;ea;a++)b=this.hierarchy[a],c=this.data.hierarchy[a],void 0===c.animationCache&&(c.animationCache={},c.animationCache.prevKey=null,c.animationCache.nextKey=null,c.animationCache.originalMatrix=b.matrix),b=this.data.hierarchy[a].keys,b.length&&(c.animationCache.prevKey=b[0],c.animationCache.nextKey=b[1],this.startTime=Math.min(b[0].time,this.startTime),this.endTime=Math.max(b[b.length-1].time,this.endTime));this.update(0)}this.isPaused=!1,THREE.AnimationHandler.play(this)},stop:function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.stop(this);for(var a=0;aa&&(this.currentTime%=a),this.currentTime=Math.min(this.currentTime,a),a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a],d=this.data.hierarchy[a],e=d.keys,d=d.animationCache;if(e.length){var f=d.prevKey,g=d.nextKey;if(g.time<=this.currentTime){for(;g.timef.index;)f=g,g=e[f.index+1];d.prevKey=f,d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time),this.data.hierarchy[a].node.updateMatrix(),c.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(a,b,c){for(b=this.data.hierarchy[b].keys,c%=b.length;c=0?c:c+b.length;c>=0;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]}},THREE.MorphAnimation=function(a){this.mesh=a,this.frames=a.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.currentFrame=this.lastFrame=0,this.isPlaying=!1},THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration),a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!=this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b),c[b]=this.currentTime%a/a,c[this.lastFrame]=1-c[b]}}},THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,i){var j,k=h.widthSegments,l=h.heightSegments,m=e/2,n=f/2,o=h.vertices.length;"x"===a&&"y"===b||"y"===a&&"x"===b?j="z":"x"===a&&"z"===b||"z"===a&&"x"===b?(j="y",l=h.depthSegments):("z"===a&&"y"===b||"y"===a&&"z"===b)&&(j="x",k=h.depthSegments);var p=k+1,q=l+1,r=e/k,s=f/l,t=new THREE.Vector3;for(t[j]=g>0?1:-1,e=0;q>e;e++)for(f=0;p>f;f++){var u=new THREE.Vector3;u[a]=(f*r-m)*c,u[b]=(e*s-n)*d,u[j]=g,h.vertices.push(u)}for(e=0;l>e;e++)for(f=0;k>f;f++)n=f+p*e,a=f+p*(e+1),b=f+1+p*(e+1),c=f+1+p*e,d=new THREE.Vector2(f/k,1-e/l),g=new THREE.Vector2(f/k,1-(e+1)/l),j=new THREE.Vector2((f+1)/k,1-(e+1)/l),m=new THREE.Vector2((f+1)/k,1-e/l),n=new THREE.Face3(n+o,a+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([d,g,m]),n=new THREE.Face3(a+o,b+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([g.clone(),j,m.clone()])}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f},this.widthSegments=d||1,this.heightSegments=e||1,this.depthSegments=f||1;var h=this;d=a/2,e=b/2,f=c/2,g("z","y",-1,-1,c,b,d,0),g("z","y",1,-1,c,b,-d,1),g("x","z",1,1,a,c,e,2),g("x","z",1,-1,a,c,-e,3),g("x","y",1,-1,a,b,f,4),g("x","y",-1,-1,a,b,-f,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d},a=a||50,b=void 0!==b?Math.max(3,b):8,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);for(this.vertices.push(e),f.push(g),e=0;b>=e;e++){var h=new THREE.Vector3,i=c+e/b*d;h.x=a*Math.cos(i),h.y=a*Math.sin(i),this.vertices.push(h),f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}for(c=new THREE.Vector3(0,0,1),e=1;b>=e;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CubeGeometry=function(a,b,c,d,e,f){return THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new THREE.BoxGeometry(a,b,c,d,e,f)},THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h},a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,d=d||8,e=e||1,f=void 0!==f?f:!1,g=void 0!==g?g:0,h=void 0!==h?h:2*Math.PI;var i,j,k=c/2,l=[],m=[];for(j=0;e>=j;j++){var n=[],o=[],p=j/e,q=p*(b-a)+a;for(i=0;d>=i;i++){var r=i/d,s=new THREE.Vector3;s.x=q*Math.sin(r*h+g),s.y=-p*c+k,s.z=q*Math.cos(r*h+g),this.vertices.push(s),n.push(this.vertices.length-1),o.push(new THREE.Vector2(r,1-p))}l.push(n),m.push(o)}for(c=(b-a)/c,i=0;d>i;i++)for(0!==a?(g=this.vertices[l[0][i]].clone(),h=this.vertices[l[0][i+1]].clone()):(g=this.vertices[l[1][i]].clone(),h=this.vertices[l[1][i+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),j=0;e>j;j++){var n=l[j][i],o=l[j+1][i],p=l[j+1][i+1],q=l[j][i+1],r=g.clone(),s=g.clone(),t=h.clone(),u=h.clone(),v=m[j][i].clone(),w=m[j+1][i].clone(),x=m[j+1][i+1].clone(),y=m[j][i+1].clone();this.faces.push(new THREE.Face3(n,o,q,[r,s,u])),this.faceVertexUvs[0].push([v,w,y]),this.faces.push(new THREE.Face3(o,p,q,[s.clone(),t,u.clone()])),this.faceVertexUvs[0].push([w.clone(),x,y.clone()])}if(!1===f&&a>0)for(this.vertices.push(new THREE.Vector3(0,k,0)),i=0;d>i;i++)n=l[0][i],o=l[0][i+1],p=this.vertices.length-1,r=new THREE.Vector3(0,1,0),s=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),v=m[0][i].clone(),w=m[0][i+1].clone(),x=new THREE.Vector2(w.x,0),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);if(!1===f&&b>0)for(this.vertices.push(new THREE.Vector3(0,-k,0)),i=0;d>i;i++)n=l[e][i+1],o=l[e][i],p=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),s=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),v=m[e][i+1].clone(),w=m[e][i].clone(),x=new THREE.Vector2(w.x,1),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.ExtrudeGeometry=function(a,b){"undefined"!=typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;c>d;d++)this.addShape(a[d],b)},THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){return b||THREE.error("THREE.ExtrudeGeometry: vec does not exist"),b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1e-10=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,d>1e-10?f>1e-10&&(a=!0):-1e-10>d?-1e-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(O=a.length;0<=--O;){c=O,d=O-1,0>d&&(d=a.length-1);for(var e=0,f=s+2*p,e=0;f>e;e++){var g=M*e,h=M*(e+1),i=b+c+g,g=b+d+g,j=b+d+h,h=b+c+h,i=i+C,g=g+C,j=j+C,h=h+C;B.faces.push(new THREE.Face3(i,g,h,null,null,w)),B.faces.push(new THREE.Face3(g,j,h,null,null,w)),i=x.generateSideWallUV(B,i,g,j,h),B.faceVertexUvs[0].push([i[0],i[1],i[3]]),B.faceVertexUvs[0].push([i[1],i[2],i[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=C,b+=C,c+=C,B.faces.push(new THREE.Face3(a,b,c,null,null,v)),a=x.generateTopUV(B,a,b,c),B.faceVertexUvs[0].push(a)}var h,i,j,k,l,m=void 0!==b.amount?b.amount:100,n=void 0!==b.bevelThickness?b.bevelThickness:6,o=void 0!==b.bevelSize?b.bevelSize:n-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,u=!1,v=b.material,w=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;t&&(h=t.getSpacedPoints(s),u=!0,q=!1,i=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3),q||(o=n=p=0);var y,z,A,B=this,C=this.vertices.length,t=a.extractPoints(r),r=t.shape,D=t.holes; +if(t=!THREE.Shape.Utils.isClockWise(r)){for(r=r.reverse(),z=0,A=D.length;A>z;z++)y=D[z],THREE.Shape.Utils.isClockWise(y)&&(D[z]=y.reverse());t=!1}var E=THREE.Shape.Utils.triangulateShape(r,D),F=r;for(z=0,A=D.length;A>z;z++)y=D[z],r=r.concat(y);var G,H,I,J,K,L,M=r.length,N=E.length,t=[],O=0;for(I=F.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),t[O]=d(F[O],F[G],F[H]);var P,Q=[],R=t.concat();for(z=0,A=D.length;A>z;z++){for(y=D[z],P=[],O=0,I=y.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),P[O]=d(y[O],y[G],y[H]);Q.push(P),R=R.concat(P)}for(G=0;p>G;G++){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,-J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),f(K.x,K.y,-J)}for(H=o,O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[0]).multiplyScalar(K.x),j.copy(i.binormals[0]).multiplyScalar(K.y),l.copy(h[0]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,0);for(I=1;s>=I;I++)for(O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[I]).multiplyScalar(K.x),j.copy(i.binormals[I]).multiplyScalar(K.y),l.copy(h[I]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,m/s*I);for(G=p-1;G>=0;G--){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,m+J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),u?f(K.x,K.y+h[s-1].y,h[s-1].x+J):f(K.x,K.y,m+J)}!function(){if(q){var a;for(a=0*M,O=0;N>O;O++)L=E[O],g(L[2]+a,L[1]+a,L[0]+a);for(a=s+2*p,a*=M,O=0;N>O;O++)L=E[O],g(L[0]+a,L[1]+a,L[2]+a)}else{for(O=0;N>O;O++)L=E[O],g(L[2],L[1],L[0]);for(O=0;N>O;O++)L=E[O],g(L[0]+M*s,L[1]+M*s,L[2]+M*s)}}(),function(){var a=0;for(e(F,a),a+=F.length,z=0,A=D.length;A>z;z++)y=D[z],e(y,a),a+=y.length}()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){return a=a.vertices,b=a[b],c=a[c],d=a[d],[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){return a=a.vertices,b=a[b],c=a[c],d=a[d],e=a[e],.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,1-d.z),new THREE.Vector2(e.y,1-e.z)]}},THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this),this.type="ShapeGeometry",!1==a instanceof Array&&(a=[a]),this.addShapeList(a,b),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;d>c;c++)this.addShape(a[c],b);return this},THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c,d,e,f=b.material,g=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,h=this.vertices.length;c=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var i=c.shape,j=c.holes;if(!THREE.Shape.Utils.isClockWise(i))for(i=i.reverse(),c=0,d=j.length;d>c;c++)e=j[c],THREE.Shape.Utils.isClockWise(e)&&(j[c]=e.reverse());var k=THREE.Shape.Utils.triangulateShape(i,j);for(c=0,d=j.length;d>c;c++)e=j[c],i=i.concat(e);for(j=i.length,d=k.length,c=0;j>c;c++)e=i[c],this.vertices.push(new THREE.Vector3(e.x,e.y,0));for(c=0;d>c;c++)j=k[c],i=j[0]+h,e=j[1]+h,j=j[2]+h,this.faces.push(new THREE.Face3(i,e,j,null,null,f)),this.faceVertexUvs[0].push(g.generateTopUV(this,i,e,j))},THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:a,segments:b,phiStart:c,phiLength:d},b=b||12,c=c||0,d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;h>=g;g++)for(var i=c+g*f*d,j=Math.cos(i),k=Math.sin(i),i=0,l=a.length;l>i;i++){var m=a[i],n=new THREE.Vector3;n.x=j*m.x-k*m.y,n.y=k*m.x+j*m.y,n.z=m.z,this.vertices.push(n)}for(c=a.length,g=0,h=b;h>g;g++)for(i=0,l=a.length-1;l>i;i++){b=k=i+c*g,d=k+c;var j=k+1+c,k=k+1,m=g*f,n=i*e,o=m+f,p=n+e;this.faces.push(new THREE.Face3(b,d,k)),this.faceVertexUvs[0].push([new THREE.Vector2(m,n),new THREE.Vector2(o,n),new THREE.Vector2(m,p)]),this.faces.push(new THREE.Face3(d,j,k)),this.faceVertexUvs[0].push([new THREE.Vector2(o,n),new THREE.Vector2(o,p),new THREE.Vector2(m,p)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1,d=d||1;var g=c+1,h=d+1,i=a/c,j=b/d;b=new Float32Array(g*h*3),a=new Float32Array(g*h*3);for(var k=new Float32Array(g*h*2),l=0,m=0,n=0;h>n;n++)for(var o=n*j-f,p=0;g>p;p++)b[l]=p*i-e,b[l+1]=-o,a[l+2]=1,k[m]=p/c,k[m+1]=1-n/d,l+=3,m+=2;for(l=0,e=new(65535n;n++)for(p=0;c>p;p++)f=p+g*(n+1),h=p+1+g*(n+1),i=p+1+g*n,e[l]=p+g*n,e[l+1]=f,e[l+2]=i,e[l+3]=f,e[l+4]=h,e[l+5]=i,l+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1)),this.addAttribute("position",new THREE.BufferAttribute(b,3)),this.addAttribute("normal",new THREE.BufferAttribute(a,3)),this.addAttribute("uv",new THREE.BufferAttribute(k,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f},a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(1,d):8;var g,h=[],i=a,j=(b-a)/d;for(a=0;d+1>a;a++){for(g=0;c+1>g;g++){var k=new THREE.Vector3,l=e+g/c*f;k.x=i*Math.cos(l),k.y=i*Math.sin(l),this.vertices.push(k),h.push(new THREE.Vector2((k.x/b+1)/2,(k.y/b+1)/2))}i+=j}for(b=new THREE.Vector3(0,0,1),a=0;d>a;a++)for(e=a*(c+1),g=0;c>g;g++)f=l=g+e,j=l+c+1,k=l+c+2,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]),f=l,j=l+c+2,k=l+1,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,i)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g},a=a||50,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),d=void 0!==d?d:0,e=void 0!==e?e:2*Math.PI,f=void 0!==f?f:0,g=void 0!==g?g:Math.PI;var h,i,j=[],k=[];for(i=0;c>=i;i++){var l=[],m=[];for(h=0;b>=h;h++){var n=h/b,o=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+n*e)*Math.sin(f+o*g),p.y=a*Math.cos(f+o*g),p.z=a*Math.sin(d+n*e)*Math.sin(f+o*g),this.vertices.push(p),l.push(this.vertices.length-1),m.push(new THREE.Vector2(n,1-o))}j.push(l),k.push(m)}for(i=0;c>i;i++)for(h=0;b>h;h++){d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1];var l=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),n=this.vertices[f].clone().normalize(),o=this.vertices[g].clone().normalize(),p=k[i][h+1].clone(),q=k[i][h].clone(),r=k[i+1][h].clone(),s=k[i+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(p.x=(p.x+q.x)/2,this.faces.push(new THREE.Face3(d,f,g,[l,n,o])),this.faceVertexUvs[0].push([p,r,s])):Math.abs(this.vertices[f].y)===a?(r.x=(r.x+s.x)/2,this.faces.push(new THREE.Face3(d,e,f,[l,m,n])),this.faceVertexUvs[0].push([p,q,r])):(this.faces.push(new THREE.Face3(d,e,g,[l,m,o])),this.faceVertexUvs[0].push([p,q,s]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),n,o.clone()])),this.faceVertexUvs[0].push([q.clone(),r,s.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50,void 0===b.bevelThickness&&(b.bevelThickness=10),void 0===b.bevelSize&&(b.bevelSize=8),void 0===b.bevelEnabled&&(b.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,c,b),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e},a=a||100,b=b||40,c=c||8,d=d||6,e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],i=0;c>=i;i++)for(var j=0;d>=j;j++){var k=j/d*e,l=i/c*Math.PI*2;f.x=a*Math.cos(k),f.y=a*Math.sin(k);var m=new THREE.Vector3;m.x=(a+b*Math.cos(l))*Math.cos(k),m.y=(a+b*Math.cos(l))*Math.sin(k),m.z=b*Math.sin(l),this.vertices.push(m),g.push(new THREE.Vector2(j/d,i/c)),h.push(m.clone().sub(f).normalize())}for(i=1;c>=i;i++)for(j=1;d>=j;j++)a=(d+1)*i+j-1,b=(d+1)*(i-1)+j-1,e=(d+1)*(i-1)+j,f=(d+1)*i+j,k=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),k=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);return a*=b/c,b=Math.cos(a),f*=d*(2+b)*.5,g=d*(2+b)*g*.5,d=e*d*Math.sin(a)*.5,new THREE.Vector3(f,g,d)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g},a=a||100,b=b||40,c=c||64,d=d||8,e=e||2,f=f||3,g=g||1;for(var i=Array(c),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=0;c>m;++m){i[m]=Array(d);var n=m/c*2*e*Math.PI,o=h(n,f,e,a,g),n=h(n+.01,f,e,a,g);for(j.subVectors(n,o),k.addVectors(n,o),l.crossVectors(j,k),k.crossVectors(l,j),l.normalize(),k.normalize(),n=0;d>n;++n){var p=n/d*2*Math.PI,q=-b*Math.cos(p),p=b*Math.sin(p),r=new THREE.Vector3;r.x=o.x+q*k.x+p*l.x,r.y=o.y+q*k.y+p*l.y,r.z=o.z+q*k.z+p*l.z,i[m][n]=this.vertices.push(r)-1}}for(m=0;c>m;++m)for(n=0;d>n;++n)e=(m+1)%c,f=(n+1)%d,a=i[m][n],b=i[e][n],e=i[e][f],f=i[m][f],g=new THREE.Vector2(m/c,n/d),j=new THREE.Vector2((m+1)/c,n/d),k=new THREE.Vector2((m+1)/c,(n+1)/d),l=new THREE.Vector2(m/c,(n+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,j,l]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([j.clone(),k,l.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e},b=b||64,c=c||1,d=d||8,e=e||!1,f=f||THREE.TubeGeometry.NoTaper;var g,h,i,j,k,l,m,n,o,p,q=[],r=b+1,s=new THREE.Vector3;for(n=new THREE.TubeGeometry.FrenetFrames(a,b,e),o=n.normals,p=n.binormals,this.tangents=n.tangents,this.normals=o,this.binormals=p,n=0;r>n;n++)for(q[n]=[],i=n/(r-1),m=a.getPointAt(i),g=o[n],h=p[n],k=c*f(i),i=0;d>i;i++)j=i/d*2*Math.PI,l=-k*Math.cos(j),j=k*Math.sin(j),s.copy(m),s.x+=l*g.x+j*h.x,s.y+=l*g.y+j*h.y,s.z+=l*g.z+j*h.z,q[n][i]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(n=0;b>n;n++)for(i=0;d>i;i++)f=e?(n+1)%b:n+1,r=(i+1)%d,a=q[n][i],c=q[f][i],f=q[f][r],r=q[n][r],s=new THREE.Vector2(n/b,i/d),o=new THREE.Vector2((n+1)/b,i/d),p=new THREE.Vector2((n+1)/b,(i+1)/d),g=new THREE.Vector2(n/b,(i+1)/d),this.faces.push(new THREE.Face3(a,c,r)),this.faceVertexUvs[0].push([s,o,g]),this.faces.push(new THREE.Face3(c,f,r)),this.faceVertexUvs[0].push([o.clone(),p,g.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(){return 1},THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)},THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,i=new THREE.Matrix4;b+=1;var j,k,l;for(this.tangents=e,this.normals=f,this.binormals=g,j=0;b>j;j++)k=j/(b-1),e[j]=a.getTangentAt(k),e[j].normalize();for(f[0]=new THREE.Vector3,g[0]=new THREE.Vector3,a=Number.MAX_VALUE,j=Math.abs(e[0].x),k=Math.abs(e[0].y),l=Math.abs(e[0].z),a>=j&&(a=j,d.set(1,0,0)),a>=k&&(a=k,d.set(0,1,0)),a>=l&&d.set(0,0,1),h.crossVectors(e[0],d).normalize(),f[0].crossVectors(e[0],h),g[0].crossVectors(e[0],f[0]),j=1;b>j;j++)f[j]=f[j-1].clone(),g[j]=g[j-1].clone(),h.crossVectors(e[j-1],e[j]),1e-4j;j++)f[j].applyMatrix4(i.makeRotationAxis(e[j],d*j)),g[j].crossVectors(e[j],f[j])},THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;return a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5,b.uv=new THREE.Vector2(c,1-a),b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);i.faces.push(d),q.copy(a).add(b).add(c).divideScalar(3),d=Math.atan2(q.z,-q.x),i.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){for(var c=Math.pow(2,b),d=e(i.vertices[a.a]),g=e(i.vertices[a.b]),h=e(i.vertices[a.c]),j=[],k=0;c>=k;k++){j[k]=[];for(var l=e(d.clone().lerp(h,k/c)),m=e(g.clone().lerp(h,k/c)),n=c-k,o=0;n>=o;o++)j[k][o]=0==o&&k==c?l:e(l.clone().lerp(m,o/n))}for(k=0;c>k;k++)for(o=0;2*(c-k)-1>o;o++)d=Math.floor(o/2),0==o%2?f(j[k][d+1],j[k+1][d],j[k][d]):f(j[k][d+1],j[k+1][d+1],j[k+1][d])}function h(a,b,c){return 0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y)),0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y)),a.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:a,indices:b,radius:c,detail:d},c=c||1,d=d||0;for(var i=this,j=0,k=a.length;k>j;j+=3)e(new THREE.Vector3(a[j],a[j+1],a[j+2]));a=this.vertices;for(var l=[],m=j=0,k=b.length;k>j;j+=3,m++){var n=a[b[j]],o=a[b[j+1]],p=a[b[j+2]];l[m]=new THREE.Face3(n.index,o.index,p.index,[n.clone(),o.clone(),p.clone()])}for(var q=new THREE.Vector3,j=0,k=l.length;k>j;j++)g(l[j],d);for(j=0,k=this.faceVertexUvs[0].length;k>j;j++)b=this.faceVertexUvs[0][j],d=b[0].x,a=b[1].x,l=b[2].x,m=Math.max(d,Math.max(a,l)),n=Math.min(d,Math.min(a,l)),m>.9&&.1>n&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>l&&(b[2].x+=1));for(j=0,k=this.vertices.length;k>j;j++)this.vertices[j].multiplyScalar(c);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)},THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b),this.type="IcosahedronGeometry",this.parameters={radius:a,detail:b}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b},THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b),this.type="OctahedronGeometry",this.parameters={radius:a,detail:b}},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b),this.type="TetrahedronGeometry",this.parameters={radius:a,detail:b}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:a,slices:b,stacks:c};var d,e,f,g,h=this.vertices,i=this.faces,j=this.faceVertexUvs[0],k=b+1;for(d=0;c>=d;d++)for(g=d/c,e=0;b>=e;e++)f=e/b,f=a(f,g),h.push(f);var l,m,n,o;for(d=0;c>d;d++)for(e=0;b>e;e++)a=d*k+e,h=d*k+e+1,g=(d+1)*k+e+1,f=(d+1)*k+e,l=new THREE.Vector2(e/b,d/c),m=new THREE.Vector2((e+1)/b,d/c),n=new THREE.Vector2((e+1)/b,(d+1)/c),o=new THREE.Vector2(e/b,(d+1)/c),i.push(new THREE.Face3(a,h,f)),j.push([l,m,o]),i.push(new THREE.Face3(h,g,f)),j.push([m.clone(),n,o.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry,a.addAttribute("position",new THREE.BufferAttribute(b,3)),a.addAttribute("color",new THREE.BufferAttribute(c,3)),b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.Line.call(this,a,b,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);return b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),function(c,d,e,f,g,h){THREE.Object3D.call(this),void 0===f&&(f=16776960),void 0===e&&(e=1),void 0===g&&(g=.2*e),void 0===h&&(h=.2*g),this.position.copy(d),this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:f})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(c),this.setLength(e,g,h)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var a,b=new THREE.Vector3;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(b.set(c.z,0,-c.x).normalize(),a=Math.acos(c.y),this.quaternion.setFromAxisAngle(b,a))}}(),THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a),void 0===c&&(c=.2*b),this.line.scale.set(1,a-b,1),this.line.updateMatrix(),this.cone.scale.set(c,b,c),this.cone.position.y=a,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a),this.cone.material.color.set(a)},THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3)),THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==a&&this.update(a)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x,d[1]=b.y,d[2]=b.z,d[3]=c.x,d[4]=b.y,d[5]=b.z,d[6]=c.x,d[7]=b.y,d[8]=b.z,d[9]=c.x,d[10]=c.y,d[11]=b.z,d[12]=c.x,d[13]=c.y,d[14]=b.z,d[15]=b.x,d[16]=c.y,d[17]=b.z,d[18]=b.x,d[19]=c.y,d[20]=b.z,d[21]=b.x,d[22]=b.y,d[23]=b.z,d[24]=b.x,d[25]=b.y,d[26]=c.z,d[27]=c.x,d[28]=b.y,d[29]=c.z,d[30]=c.x,d[31]=b.y,d[32]=c.z,d[33]=c.x,d[34]=c.y,d[35]=c.z,d[36]=c.x,d[37]=c.y,d[38]=c.z,d[39]=b.x,d[40]=c.y,d[41]=c.z,d[42]=b.x,d[43]=c.y,d[44]=c.z,d[45]=b.x,d[46]=b.y,d[47]=c.z,d[48]=b.x,d[49]=b.y,d[50]=b.z,d[51]=b.x,d[52]=b.y,d[53]=c.z,d[54]=c.x,d[55]=b.y,d[56]=b.z,d[57]=c.x,d[58]=b.y,d[59]=c.z,d[60]=c.x,d[61]=c.y,d[62]=b.z,d[63]=c.x,d[64]=c.y,d[65]=c.z,d[66]=b.x,d[67]=c.y,d[68]=b.z,d[69]=b.x,d[70]=c.y,d[71]=c.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(a){function b(a,b,d){c(a,d),c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3),d.colors.push(new THREE.Color(b)),void 0===f[a]&&(f[a]=[]),f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200),b("n2","n4",16755200),b("n4","n3",16755200),b("n3","n1",16755200),b("f1","f2",16755200),b("f2","f4",16755200),b("f4","f3",16755200),b("f3","f1",16755200),b("n1","f1",16755200),b("n2","f2",16755200),b("n3","f3",16755200),b("n4","f4",16755200),b("p","n1",16711680),b("p","n2",16711680),b("p","n3",16711680),b("p","n4",16711680),b("u1","u2",43775),b("u2","u3",43775),b("u3","u1",43775),b("c","t",16777215),b("p","c",3355443),b("cn1","cn2",3355443),b("cn3","cn4",3355443),b("cf1","cf2",3355443),b("cf3","cf4",3355443),THREE.Line.call(this,d,e,THREE.LinePieces),this.camera=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=f,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){var a,b,c=new THREE.Vector3,d=new THREE.Camera,e=function(e,f,g,h){if(c.set(f,g,h).unproject(d),e=b[e],void 0!==e)for(f=0,g=e.length;g>f;f++)a.vertices[e[f]].copy(c)};return function(){a=this.geometry,b=this.pointMap,d.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-1,-1,-1),e("n2",1,-1,-1),e("n3",-1,1,-1),e("n4",1,1,-1),e("f1",-1,-1,1),e("f2",1,-1,1),e("f3",-1,1,1),e("f4",1,1,1),e("u1",.7,1.1,-1),e("u2",-.7,1.1,-1),e("u3",0,2,-1),e("cf1",-1,0,1),e("cf2",1,0,1),e("cf3",0,-1,1),e("cf4",0,1,1),e("cn1",-1,0,-1),e("cn2",1,0,-1),e("cn3",0,-1,-1),e("cn4",0,1,-1),a.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(c,d),this.add(this.lightPlane),c=new THREE.Geometry,c.vertices.push(new THREE.Vector3,new THREE.Vector3),d=new THREE.LineBasicMaterial({fog:!1}),d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(c,d),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld),b.setFromMatrixPosition(this.light.target.matrixWorld),c.subVectors(b,a),this.lightPlane.lookAt(c),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(c),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(a,b,c){b=void 0!==b?b:16777215,c=Math.cos(THREE.Math.degToRad(void 0!==c?c:1));var d,e=[0,0],f={},g=function(a,b){return a-b},h=["a","b","c"],i=new THREE.BufferGeometry;a.geometry instanceof THREE.BufferGeometry?(d=new THREE.Geometry,d.fromBufferGeometry(a.geometry)):d=a.geometry.clone(),d.mergeVertices(),d.computeFaceNormals();var j=d.vertices;d=d.faces;for(var k=0,l=0,m=d.length;m>l;l++)for(var n=d[l],o=0;3>o;o++){e[0]=n[h[o]],e[1]=n[h[(o+1)%3]],e.sort(g);var p=e.toString();void 0===f[p]?(f[p]={vert1:e[0],vert2:e[1],face1:l,face2:void 0},k++):f[p].face2=l}e=new Float32Array(6*k),g=0;for(p in f)h=f[p],(void 0===h.face2||d[h.face1].normal.dot(d[h.face2].normal)<=c)&&(k=j[h.vert1],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z,k=j[h.vert2],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z);i.addAttribute("position",new THREE.BufferAttribute(e,3)),THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:b}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,a=void 0!==c?c:16776960,d=void 0!==d?d:1,b=new THREE.Geometry,c=0;for(var e=this.object.geometry.faces.length;e>c;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;g>b;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e),a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}return this.geometry.verticesNeedUpdate=!0,this},THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var e=-a;a>=e;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a),this.color2.set(b),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(c,d),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(a,b){this.light=a,this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,c,d),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;ce;e++)for(var g=0,h=a[e].vertexNormals.length;h>g;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexNormals.length;l>k;k++){var m=j.vertexNormals[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,b=void 0!==c?c:255,d=void 0!==d?d:1,c=new THREE.Geometry,a=a.geometry.faces;for(var e=0,f=a.length;f>e;e++)for(var g=0,h=a[e].vertexTangents.length;h>g;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexTangents.length;l>k;k++){var m=j.vertexTangents[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).transformDirection(f).multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var i=a.geometry.vertices,j=a.geometry.faces,k=0,l=new Uint32Array(6*j.length),m=0,n=j.length;n>m;m++)for(var o=j[m],p=0;3>p;p++){d[0]=o[g[p]],d[1]=o[g[(p+1)%3]],d.sort(f);var q=d.toString();void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++)}for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)k=i[l[2*m+p]],g=6*m+3*p,d[g+0]=k.x,d[g+1]=k.y,d[g+2]=k.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){i=a.geometry.attributes.position.array,n=a.geometry.attributes.index.array,j=a.geometry.drawcalls,k=0,0===j.length&&(j=[{count:n.length,index:0,start:0}]);for(var l=new Uint32Array(2*n.length),o=0,r=j.length;r>o;++o)for(var p=j[o].start,q=j[o].count,g=j[o].index,m=p,s=p+q;s>m;m+=3)for(p=0;3>p;p++)d[0]=g+n[m+p],d[1]=g+n[m+(p+1)%3],d.sort(f),q=d.toString(),void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++);for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)g=6*m+3*p,k=3*l[2*m+p],d[g+0]=i[k],d[g+1]=i[k+1],d[g+2]=i[k+2]}else for(i=a.geometry.attributes.position.array,k=i.length/3,l=k/3,d=new Float32Array(6*k),m=0,n=l;n>m;m++)for(p=0;3>p;p++)g=18*m+6*p,l=9*m+3*p,d[g+0]=i[l],d[g+1]=i[l+1],d[g+2]=i[l+2],k=9*m+(p+1)%3*3,d[g+3]=i[k],d[g+4]=i[k+1],d[g+5]=i[k+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b),this.animationsMap={},this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[a]=b,this.animationsList.push(b)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b,c=/([a-z]+)_?(\d+)/,d={},e=this.geometry,f=0,g=e.morphTargets.length;g>f;f++){var h=e.morphTargets[f].name.match(c);if(h&&1h.end&&(h.end=f),b||(b=i)}}for(i in d)h=d[i],this.createAnimation(i,h.start,h.end,a);this.firstAnimation=b},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){(a=this.animationsMap[a])&&(a.direction=1,a.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){(a=this.animationsMap[a])&&(a.direction=-1,a.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;return(a=this.animationsMap[a])&&(b=a.time),b},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;return(a=this.animationsMap[a])&&(b=a.duration),b},THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(a){(a=this.animationsMap[a])&&(a.active=!1)},THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;c>b;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a,d.mirroredLoop?(d.time>d.duration||0>d.time)&&(d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)):(d.time%=d.duration,0>d.time&&(d.time+=d.duration));var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f),e=d.time%e/e,d.directionBackwards&&(e=1-e),this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; \ No newline at end of file diff --git a/thirdparty/react-0.13.0.min.js b/thirdparty/react-0.13.0.min.js deleted file mode 100644 index e7b194a..0000000 --- a/thirdparty/react-0.13.0.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * React v0.13.0 - * - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - */ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.React=e()}}(function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};t[a][0].call(c.exports,function(e){var n=t[a][1][e];return o(n?n:e)},c,c.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a8&&11>=_),M=32,N=String.fromCharCode(M),I=d.topLevelTypes,T={beforeInput:{phasedRegistrationNames:{bubbled:y({onBeforeInput:null}),captured:y({onBeforeInputCapture:null})},dependencies:[I.topCompositionEnd,I.topKeyPress,I.topTextInput,I.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:y({onCompositionEnd:null}),captured:y({onCompositionEndCapture:null})},dependencies:[I.topBlur,I.topCompositionEnd,I.topKeyDown,I.topKeyPress,I.topKeyUp,I.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:y({onCompositionStart:null}),captured:y({onCompositionStartCapture:null})},dependencies:[I.topBlur,I.topCompositionStart,I.topKeyDown,I.topKeyPress,I.topKeyUp,I.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:y({onCompositionUpdate:null}),captured:y({onCompositionUpdateCapture:null})},dependencies:[I.topBlur,I.topCompositionUpdate,I.topKeyDown,I.topKeyPress,I.topKeyUp,I.topMouseDown]}},R=!1,P=null,w={eventTypes:T,extractEvents:function(e,t,n,r){return[s(e,t,n,r),p(e,t,n,r)]}};t.exports=w},{139:139,15:15,20:20,21:21,22:22,91:91,95:95}],4:[function(e,t){"use strict";function n(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var r={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},o=["Webkit","ms","Moz","O"];Object.keys(r).forEach(function(e){o.forEach(function(t){r[n(t,e)]=r[e]})});var i={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},a={isUnitlessNumber:r,shorthandPropertyExpansions:i};t.exports=a},{}],5:[function(e,t){"use strict";var n=e(4),r=e(21),o=(e(106),e(111)),i=e(131),a=e(141),u=(e(150),a(function(e){return i(e)})),s="cssFloat";r.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(s="styleFloat");var l={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=u(n)+":",t+=o(n,r)+";")}return t||null},setValueForStyles:function(e,t){var r=e.style;for(var i in t)if(t.hasOwnProperty(i)){var a=o(i,t[i]);if("float"===i&&(i=s),a)r[i]=a;else{var u=n.shorthandPropertyExpansions[i];if(u)for(var l in u)r[l]="";else r[i]=""}}}};t.exports=l},{106:106,111:111,131:131,141:141,150:150,21:21,4:4}],6:[function(e,t){"use strict";function n(){this._callbacks=null,this._contexts=null}var r=e(28),o=e(27),i=e(133);o(n.prototype,{enqueue:function(e,t){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(e),this._contexts.push(t)},notifyAll:function(){var e=this._callbacks,t=this._contexts;if(e){i(e.length===t.length),this._callbacks=null,this._contexts=null;for(var n=0,r=e.length;r>n;n++)e[n].call(t[n]);e.length=0,t.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),r.addPoolingTo(n),t.exports=n},{133:133,27:27,28:28}],7:[function(e,t){"use strict";function n(e){return"SELECT"===e.nodeName||"INPUT"===e.nodeName&&"file"===e.type}function r(e){var t=_.getPooled(I.change,R,e);C.accumulateTwoPhaseDispatches(t),b.batchedUpdates(o,t)}function o(e){y.enqueueEvents(e),y.processEventQueue()}function i(e,t){T=e,R=t,T.attachEvent("onchange",r)}function a(){T&&(T.detachEvent("onchange",r),T=null,R=null)}function u(e,t,n){return e===N.topChange?n:void 0}function s(e,t,n){e===N.topFocus?(a(),i(t,n)):e===N.topBlur&&a()}function l(e,t){T=e,R=t,P=e.value,w=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(T,"value",A),T.attachEvent("onpropertychange",p)}function c(){T&&(delete T.value,T.detachEvent("onpropertychange",p),T=null,R=null,P=null,w=null)}function p(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==P&&(P=t,r(e))}}function d(e,t,n){return e===N.topInput?n:void 0}function f(e,t,n){e===N.topFocus?(c(),l(t,n)):e===N.topBlur&&c()}function h(e){return e!==N.topSelectionChange&&e!==N.topKeyUp&&e!==N.topKeyDown||!T||T.value===P?void 0:(P=T.value,R)}function m(e){return"INPUT"===e.nodeName&&("checkbox"===e.type||"radio"===e.type)}function v(e,t,n){return e===N.topClick?n:void 0}var g=e(15),y=e(17),C=e(20),E=e(21),b=e(85),_=e(93),x=e(134),D=e(136),M=e(139),N=g.topLevelTypes,I={change:{phasedRegistrationNames:{bubbled:M({onChange:null}),captured:M({onChangeCapture:null})},dependencies:[N.topBlur,N.topChange,N.topClick,N.topFocus,N.topInput,N.topKeyDown,N.topKeyUp,N.topSelectionChange]}},T=null,R=null,P=null,w=null,O=!1;E.canUseDOM&&(O=x("change")&&(!("documentMode"in document)||document.documentMode>8));var S=!1;E.canUseDOM&&(S=x("input")&&(!("documentMode"in document)||document.documentMode>9));var A={get:function(){return w.get.call(this)},set:function(e){P=""+e,w.set.call(this,e)}},k={eventTypes:I,extractEvents:function(e,t,r,o){var i,a;if(n(t)?O?i=u:a=s:D(t)?S?i=d:(i=h,a=f):m(t)&&(i=v),i){var l=i(e,t,r);if(l){var c=_.getPooled(I.change,l,o);return C.accumulateTwoPhaseDispatches(c),c}}a&&a(e,t,r)}};t.exports=k},{134:134,136:136,139:139,15:15,17:17,20:20,21:21,85:85,93:93}],8:[function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};t.exports=r},{}],9:[function(e,t){"use strict";function n(e,t,n){e.insertBefore(t,e.childNodes[n]||null)}var r=e(12),o=e(70),i=e(145),a=e(133),u={dangerouslyReplaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup,updateTextContent:i,processUpdates:function(e,t){for(var u,s=null,l=null,c=0;ct||r.hasOverloadedBooleanValue[e]&&t===!1}var r=e(10),o=e(143),i=(e(150),{createMarkupForID:function(e){return r.ID_ATTRIBUTE_NAME+"="+o(e)},createMarkupForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(e)&&r.isStandardName[e]){if(n(e,t))return"";var i=r.getAttributeName[e];return r.hasBooleanValue[e]||r.hasOverloadedBooleanValue[e]&&t===!0?i:i+"="+o(t)}return r.isCustomAttribute(e)?null==t?"":e+"="+o(t):null},setValueForProperty:function(e,t,o){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var i=r.getMutationMethod[t];if(i)i(e,o);else if(n(t,o))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute[t])e.setAttribute(r.getAttributeName[t],""+o);else{var a=r.getPropertyName[t];r.hasSideEffects[t]&&""+e[a]==""+o||(e[a]=o)}}else r.isCustomAttribute(t)&&(null==o?e.removeAttribute(t):e.setAttribute(t,""+o))},deleteValueForProperty:function(e,t){if(r.isStandardName.hasOwnProperty(t)&&r.isStandardName[t]){var n=r.getMutationMethod[t];if(n)n(e,void 0);else if(r.mustUseAttribute[t])e.removeAttribute(r.getAttributeName[t]);else{var o=r.getPropertyName[t],i=r.getDefaultValueForProperty(e.nodeName,o);r.hasSideEffects[t]&&""+e[o]===i||(e[o]=i)}}else r.isCustomAttribute(t)&&e.removeAttribute(t)}});t.exports=i},{10:10,143:143,150:150}],12:[function(e,t){"use strict";function n(e){return e.substring(1,e.indexOf(" "))}var r=e(21),o=e(110),i=e(112),a=e(125),u=e(133),s=/^(<[^ \/>]+)/,l="data-danger-index",c={dangerouslyRenderMarkup:function(e){u(r.canUseDOM);for(var t,c={},p=0;ps;s++){var c=u[s];if(c){var p=c.extractEvents(e,t,r,i);p&&(a=o(a,p))}}return a},enqueueEvents:function(e){e&&(s=o(s,e))},processEventQueue:function(){var e=s;s=null,i(e,l),a(!s)},__purge:function(){u={}},__getListenerBank:function(){return u}};t.exports=p},{103:103,118:118,133:133,18:18,19:19}],18:[function(e,t){"use strict";function n(){if(a)for(var e in u){var t=u[e],n=a.indexOf(e);if(i(n>-1),!s.plugins[n]){i(t.extractEvents),s.plugins[n]=t;var o=t.eventTypes;for(var l in o)i(r(o[l],t,l))}}}function r(e,t,n){i(!s.eventNameDispatchConfigs.hasOwnProperty(n)),s.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var a in r)if(r.hasOwnProperty(a)){var u=r[a];o(u,t,n)}return!0}return e.registrationName?(o(e.registrationName,t,n),!0):!1}function o(e,t,n){i(!s.registrationNameModules[e]),s.registrationNameModules[e]=t,s.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var i=e(133),a=null,u={},s={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){i(!a),a=Array.prototype.slice.call(e),n()},injectEventPluginsByName:function(e){var t=!1;for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];u.hasOwnProperty(r)&&u[r]===o||(i(!u[r]),u[r]=o,t=!0)}t&&n()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return s.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=s.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){a=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];s.plugins.length=0;var t=s.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=s.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};t.exports=s},{133:133}],19:[function(e,t){"use strict";function n(e){return e===m.topMouseUp||e===m.topTouchEnd||e===m.topTouchCancel}function r(e){return e===m.topMouseMove||e===m.topTouchMove}function o(e){return e===m.topMouseDown||e===m.topTouchStart}function i(e,t){var n=e._dispatchListeners,r=e._dispatchIDs;if(Array.isArray(n))for(var o=0;oe&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var u=t>1?1-t:void 0;return this._fallbackText=o.slice(e,u),this._fallbackText}}),r.addPoolingTo(n),t.exports=n},{128:128,27:27,28:28}],23:[function(e,t){"use strict";var n,r=e(10),o=e(21),i=r.injection.MUST_USE_ATTRIBUTE,a=r.injection.MUST_USE_PROPERTY,u=r.injection.HAS_BOOLEAN_VALUE,s=r.injection.HAS_SIDE_EFFECTS,l=r.injection.HAS_NUMERIC_VALUE,c=r.injection.HAS_POSITIVE_NUMERIC_VALUE,p=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(o.canUseDOM){var d=document.implementation;n=d&&d.hasFeature&&d.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var f={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:i|u,allowTransparency:i,alt:null,async:u,autoComplete:null,autoPlay:u,cellPadding:null,cellSpacing:null,charSet:i,checked:a|u,classID:i,className:n?i:a,cols:i|c,colSpan:null,content:null,contentEditable:null,contextMenu:i,controls:a|u,coords:null,crossOrigin:null,data:null,dateTime:i,defer:u,dir:null,disabled:i|u,download:p,draggable:null,encType:null,form:i,formAction:i,formEncType:i,formMethod:i,formNoValidate:u,formTarget:i,frameBorder:i,headers:null,height:i,hidden:i|u,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:a,label:null,lang:null,list:i,loop:a|u,manifest:i,marginHeight:null,marginWidth:null,max:null,maxLength:i,media:i,mediaGroup:null,method:null,min:null,multiple:a|u,muted:a|u,name:null,noValidate:u,open:u,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:a|u,rel:null,required:u,role:i,rows:i|c,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:i|u,selected:a|u,shape:null,size:i|c,sizes:i,span:c,spellCheck:null,src:null,srcDoc:a,srcSet:i,start:l,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:a|s,width:i,wmode:i,autoCapitalize:null,autoCorrect:null,itemProp:i,itemScope:i|u,itemType:i,itemID:i,itemRef:i,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};t.exports=f},{10:10,21:21}],24:[function(e,t){"use strict";function n(e){s(null==e.props.checkedLink||null==e.props.valueLink)}function r(e){n(e),s(null==e.props.value&&null==e.props.onChange)}function o(e){n(e),s(null==e.props.checked&&null==e.props.onChange)}function i(e){this.props.valueLink.requestChange(e.target.value)}function a(e){this.props.checkedLink.requestChange(e.target.checked)}var u=e(76),s=e(133),l={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},c={Mixin:{propTypes:{value:function(e,t){return!e[t]||l[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:u.func}},getValue:function(e){return e.props.valueLink?(r(e),e.props.valueLink.value):e.props.value},getChecked:function(e){return e.props.checkedLink?(o(e),e.props.checkedLink.value):e.props.checked},getOnChange:function(e){return e.props.valueLink?(r(e),i):e.props.checkedLink?(o(e),a):e.props.onChange}};t.exports=c},{133:133,76:76}],25:[function(e,t){"use strict";function n(e){e.remove()}var r=e(30),o=e(103),i=e(118),a=e(133),u={trapBubbledEvent:function(e,t){a(this.isMounted());var n=this.getDOMNode();a(n);var i=r.trapBubbledEvent(e,t,n);this._localEventListeners=o(this._localEventListeners,i)},componentWillUnmount:function(){this._localEventListeners&&i(this._localEventListeners,n)}};t.exports=u},{103:103,118:118,133:133,30:30}],26:[function(e,t){"use strict";var n=e(15),r=e(112),o=n.topLevelTypes,i={eventTypes:null,extractEvents:function(e,t,n,i){if(e===o.topTouchStart){var a=i.target;a&&!a.onclick&&(a.onclick=r)}}};t.exports=i},{112:112,15:15}],27:[function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var t=Object(e),n=Object.prototype.hasOwnProperty,r=1;rc;c++){var d=u[c];a.hasOwnProperty(d)&&a[d]||(d===s.topWheel?l("wheel")?m.ReactEventListener.trapBubbledEvent(s.topWheel,"wheel",o):l("mousewheel")?m.ReactEventListener.trapBubbledEvent(s.topWheel,"mousewheel",o):m.ReactEventListener.trapBubbledEvent(s.topWheel,"DOMMouseScroll",o):d===s.topScroll?l("scroll",!0)?m.ReactEventListener.trapCapturedEvent(s.topScroll,"scroll",o):m.ReactEventListener.trapBubbledEvent(s.topScroll,"scroll",m.ReactEventListener.WINDOW_HANDLE):d===s.topFocus||d===s.topBlur?(l("focus",!0)?(m.ReactEventListener.trapCapturedEvent(s.topFocus,"focus",o),m.ReactEventListener.trapCapturedEvent(s.topBlur,"blur",o)):l("focusin")&&(m.ReactEventListener.trapBubbledEvent(s.topFocus,"focusin",o),m.ReactEventListener.trapBubbledEvent(s.topBlur,"focusout",o)),a[s.topBlur]=!0,a[s.topFocus]=!0):f.hasOwnProperty(d)&&m.ReactEventListener.trapBubbledEvent(d,f[d],o),a[d]=!0)}},trapBubbledEvent:function(e,t,n){return m.ReactEventListener.trapBubbledEvent(e,t,n)},trapCapturedEvent:function(e,t,n){return m.ReactEventListener.trapCapturedEvent(e,t,n)},ensureScrollValueMonitoring:function(){if(!p){var e=u.refreshScrollValues; -m.ReactEventListener.monitorScrollValue(e),p=!0}},eventNameDispatchConfigs:o.eventNameDispatchConfigs,registrationNameModules:o.registrationNameModules,putListener:o.putListener,getListener:o.getListener,deleteListener:o.deleteListener,deleteAllListeners:o.deleteAllListeners});t.exports=m},{102:102,134:134,15:15,17:17,18:18,27:27,59:59}],31:[function(e,t){"use strict";var n=e(79),r=e(116),o=e(132),i=e(147),a={instantiateChildren:function(e){var t=r(e);for(var n in t)if(t.hasOwnProperty(n)){var i=t[n],a=o(i,null);t[n]=a}return t},updateChildren:function(e,t,a,u){var s=r(t);if(!s&&!e)return null;var l;for(l in s)if(s.hasOwnProperty(l)){var c=e&&e[l],p=c&&c._currentElement,d=s[l];if(i(p,d))n.receiveComponent(c,d,a,u),s[l]=c;else{c&&n.unmountComponent(c,l);var f=o(d,null);s[l]=f}}for(l in e)!e.hasOwnProperty(l)||s&&s.hasOwnProperty(l)||n.unmountComponent(e[l]);return s},unmountChildren:function(e){for(var t in e){var r=e[t];n.unmountComponent(r)}}};t.exports=a},{116:116,132:132,147:147,79:79}],32:[function(e,t){"use strict";function n(e,t){this.forEachFunction=e,this.forEachContext=t}function r(e,t,n,r){var o=e;o.forEachFunction.call(o.forEachContext,t,r)}function o(e,t,o){if(null==e)return e;var i=n.getPooled(t,o);d(e,r,i),n.release(i)}function i(e,t,n){this.mapResult=e,this.mapFunction=t,this.mapContext=n}function a(e,t,n,r){var o=e,i=o.mapResult,a=!i.hasOwnProperty(n);if(a){var u=o.mapFunction.call(o.mapContext,t,r);i[n]=u}}function u(e,t,n){if(null==e)return e;var r={},o=i.getPooled(r,t,n);return d(e,a,o),i.release(o),p.create(r)}function s(){return null}function l(e){return d(e,s,null)}var c=e(28),p=e(61),d=e(149),f=(e(150),c.twoArgumentPooler),h=c.threeArgumentPooler;c.addPoolingTo(n,f),c.addPoolingTo(i,h);var m={forEach:o,map:u,count:l};t.exports=m},{149:149,150:150,28:28,61:61}],33:[function(e,t){"use strict";function n(e,t){var n=x.hasOwnProperty(t)?x[t]:null;M.hasOwnProperty(t)&&g(n===b.OVERRIDE_BASE),e.hasOwnProperty(t)&&g(n===b.DEFINE_MANY||n===b.DEFINE_MANY_MERGED)}function r(e,t){if(t){g("function"!=typeof t),g(!p.isValidElement(t));var r=e.prototype;t.hasOwnProperty(E)&&D.mixins(e,t.mixins);for(var o in t)if(t.hasOwnProperty(o)&&o!==E){var i=t[o];if(n(r,o),D.hasOwnProperty(o))D[o](e,i);else{var s=x.hasOwnProperty(o),l=r.hasOwnProperty(o),c=i&&i.__reactDontBind,d="function"==typeof i,f=d&&!s&&!l&&!c;if(f)r.__reactAutoBindMap||(r.__reactAutoBindMap={}),r.__reactAutoBindMap[o]=i,r[o]=i;else if(l){var h=x[o];g(s&&(h===b.DEFINE_MANY_MERGED||h===b.DEFINE_MANY)),h===b.DEFINE_MANY_MERGED?r[o]=a(r[o],i):h===b.DEFINE_MANY&&(r[o]=u(r[o],i))}else r[o]=i}}}}function o(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in D;g(!o);var i=n in e;g(!i),e[n]=r}}}function i(e,t){g(e&&t&&"object"==typeof e&&"object"==typeof t);for(var n in t)t.hasOwnProperty(n)&&(g(void 0===e[n]),e[n]=t[n]);return e}function a(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return i(o,n),i(o,r),o}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function s(e,t){var n=t.bind(e);return n}function l(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=s(e,d.guard(n,e.constructor.displayName+"."+t))}}var c=e(34),p=(e(39),e(55)),d=e(58),f=e(65),h=e(66),m=(e(75),e(74),e(84)),v=e(27),g=e(133),y=e(138),C=e(139),E=(e(150),C({mixins:null})),b=y({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),_=[],x={mixins:b.DEFINE_MANY,statics:b.DEFINE_MANY,propTypes:b.DEFINE_MANY,contextTypes:b.DEFINE_MANY,childContextTypes:b.DEFINE_MANY,getDefaultProps:b.DEFINE_MANY_MERGED,getInitialState:b.DEFINE_MANY_MERGED,getChildContext:b.DEFINE_MANY_MERGED,render:b.DEFINE_ONCE,componentWillMount:b.DEFINE_MANY,componentDidMount:b.DEFINE_MANY,componentWillReceiveProps:b.DEFINE_MANY,shouldComponentUpdate:b.DEFINE_ONCE,componentWillUpdate:b.DEFINE_MANY,componentDidUpdate:b.DEFINE_MANY,componentWillUnmount:b.DEFINE_MANY,updateComponent:b.OVERRIDE_BASE},D={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n";return this._createOpenTagMarkupAndPutListeners(t)+this._createContentMarkup(t,r)+o},_createOpenTagMarkupAndPutListeners:function(e){var t=this._currentElement.props,n="<"+this._tag;for(var o in t)if(t.hasOwnProperty(o)){var i=t[o];if(null!=i)if(E.hasOwnProperty(o))r(this._rootNodeID,o,i,e);else{o===_&&(i&&(i=this._previousStyleCopy=h({},t.style)),i=a.createMarkupForStyles(i));var u=s.createMarkupForProperty(o,i);u&&(n+=" "+u)}}if(e.renderToStaticMarkup)return n+">";var l=s.createMarkupForID(this._rootNodeID);return n+" "+l+">"},_createContentMarkup:function(e,t){var n="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(n="\n");var r=this._currentElement.props,o=r.dangerouslySetInnerHTML;if(null!=o){if(null!=o.__html)return n+o.__html}else{var i=b[typeof r.children]?r.children:null,a=null!=i?null:r.children;if(null!=i)return n+m(i);if(null!=a){var u=this.mountChildren(a,e,t);return n+u.join("")}}return n},receiveComponent:function(e,t,n){var r=this._currentElement;this._currentElement=e,this.updateComponent(t,r,e,n)},updateComponent:function(e,t,r,o){n(this._currentElement.props),this._updateDOMProperties(t.props,e),this._updateDOMChildren(t.props,e,o)},_updateDOMProperties:function(e,t){var n,o,i,a=this._currentElement.props;for(n in e)if(!a.hasOwnProperty(n)&&e.hasOwnProperty(n))if(n===_){var s=this._previousStyleCopy;for(o in s)s.hasOwnProperty(o)&&(i=i||{},i[o]="")}else E.hasOwnProperty(n)?y(this._rootNodeID,n):(u.isStandardName[n]||u.isCustomAttribute(n))&&D.deletePropertyByID(this._rootNodeID,n);for(n in a){var l=a[n],c=n===_?this._previousStyleCopy:e[n];if(a.hasOwnProperty(n)&&l!==c)if(n===_)if(l&&(l=this._previousStyleCopy=h({},l)),c){for(o in c)!c.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(i=i||{},i[o]="");for(o in l)l.hasOwnProperty(o)&&c[o]!==l[o]&&(i=i||{},i[o]=l[o])}else i=l;else E.hasOwnProperty(n)?r(this._rootNodeID,n,l,t):(u.isStandardName[n]||u.isCustomAttribute(n))&&D.updatePropertyByID(this._rootNodeID,n,l)}i&&D.updateStylesByID(this._rootNodeID,i)},_updateDOMChildren:function(e,t,n){var r=this._currentElement.props,o=b[typeof e.children]?e.children:null,i=b[typeof r.children]?r.children:null,a=e.dangerouslySetInnerHTML&&e.dangerouslySetInnerHTML.__html,u=r.dangerouslySetInnerHTML&&r.dangerouslySetInnerHTML.__html,s=null!=o?null:e.children,l=null!=i?null:r.children,c=null!=o||null!=a,p=null!=i||null!=u;null!=s&&null==l?this.updateChildren(null,t,n):c&&!p&&this.updateTextContent(""),null!=i?o!==i&&this.updateTextContent(""+i):null!=u?a!==u&&D.updateInnerHTMLByID(this._rootNodeID,u):null!=l&&this.updateChildren(l,t,n)},unmountComponent:function(){this.unmountChildren(),l.deleteAllListeners(this._rootNodeID),c.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},f.measureMethods(i,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),h(i.prototype,i.Mixin,d.Mixin),i.injection={injectIDOperations:function(e){i.BackendIDOperations=D=e}},t.exports=i},{10:10,11:11,114:114,133:133,134:134,139:139,150:150,27:27,30:30,35:35,5:5,68:68,69:69,73:73}],43:[function(e,t){"use strict";var n=e(15),r=e(25),o=e(29),i=e(33),a=e(55),u=a.createFactory("form"),s=i.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[o,r],render:function(){return u(this.props)},componentDidMount:function(){this.trapBubbledEvent(n.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(n.topLevelTypes.topSubmit,"submit")}});t.exports=s},{15:15,25:25,29:29,33:33,55:55}],44:[function(e,t){"use strict";var n=e(5),r=e(9),o=e(11),i=e(68),a=e(73),u=e(133),s=e(144),l={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},c={updatePropertyByID:function(e,t,n){var r=i.getNode(e);u(!l.hasOwnProperty(t)),null!=n?o.setValueForProperty(r,t,n):o.deleteValueForProperty(r,t)},deletePropertyByID:function(e,t,n){var r=i.getNode(e);u(!l.hasOwnProperty(t)),o.deleteValueForProperty(r,t,n)},updateStylesByID:function(e,t){var r=i.getNode(e);n.setValueForStyles(r,t)},updateInnerHTMLByID:function(e,t){var n=i.getNode(e);s(n,t)},updateTextContentByID:function(e,t){var n=i.getNode(e);r.updateTextContent(n,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=i.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;np;p++){var m=s[p];if(m!==a&&m.form===a.form){var v=l.getID(m);d(v);var g=h[v];d(g),c.asap(n,g)}}}return t}});t.exports=m},{11:11,133:133,2:2,24:24,27:27,29:29,33:33,55:55,68:68,85:85}],48:[function(e,t){"use strict";var n=e(29),r=e(33),o=e(55),i=(e(150),o.createFactory("option")),a=r.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[n],componentWillMount:function(){},render:function(){return i(this.props,this.props.children)}});t.exports=a},{150:150,29:29,33:33,55:55}],49:[function(e,t){"use strict";function n(){if(this._pendingUpdate){this._pendingUpdate=!1;var e=a.getValue(this);null!=e&&this.isMounted()&&o(this,e)}}function r(e,t){if(null==e[t])return null;if(e.multiple){if(!Array.isArray(e[t]))return new Error("The `"+t+"` prop supplied to must be a scalar value if `multiple` is false.")}function o(e,t){var n,r,o,i=e.getDOMNode().options;if(e.props.multiple){for(n={},r=0,o=t.length;o>r;r++)n[""+t[r]]=!0;for(r=0,o=i.length;o>r;r++){var a=n.hasOwnProperty(i[r].value);i[r].selected!==a&&(i[r].selected=a)}}else{for(n=""+t,r=0,o=i.length;o>r;r++)if(i[r].value===n)return void(i[r].selected=!0);i[0].selected=!0}}var i=e(2),a=e(24),u=e(29),s=e(33),l=e(55),c=e(85),p=e(27),d=l.createFactory("select"),f=s.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[i,a.Mixin,u],propTypes:{defaultValue:r,value:r},render:function(){var e=p({},this.props);return e.onChange=this._handleChange,e.value=null,d(e,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var e=a.getValue(this);null!=e?o(this,e):null!=this.props.defaultValue&&o(this,this.props.defaultValue)},componentDidUpdate:function(e){var t=a.getValue(this);null!=t?(this._pendingUpdate=!1,o(this,t)):!e.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?o(this,this.props.defaultValue):o(this,this.props.multiple?[]:""))},_handleChange:function(e){var t,r=a.getOnChange(this);return r&&(t=r.call(this,e)),this._pendingUpdate=!0,c.asap(n,this),t}});t.exports=f},{2:2,24:24,27:27,29:29,33:33,55:55,85:85}],50:[function(e,t){"use strict";function n(e,t,n,r){return e===n&&t===r}function r(e){var t=document.selection,n=t.createRange(),r=n.text.length,o=n.duplicate();o.moveToElementText(e),o.setEndPoint("EndToStart",n);var i=o.text.length,a=i+r;return{start:i,end:a}}function o(e){var t=window.getSelection&&window.getSelection();if(!t||0===t.rangeCount)return null;var r=t.anchorNode,o=t.anchorOffset,i=t.focusNode,a=t.focusOffset,u=t.getRangeAt(0),s=n(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset),l=s?0:u.toString().length,c=u.cloneRange();c.selectNodeContents(e),c.setEnd(u.startContainer,u.startOffset);var p=n(c.startContainer,c.startOffset,c.endContainer,c.endOffset),d=p?0:c.toString().length,f=d+l,h=document.createRange();h.setStart(r,o),h.setEnd(i,a);var m=h.collapsed;return{start:m?f:d,end:m?d:f}}function i(e,t){var n,r,o=document.selection.createRange().duplicate();"undefined"==typeof t.end?(n=t.start,r=n):t.start>t.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function a(e,t){if(window.getSelection){var n=window.getSelection(),r=e[l()].length,o=Math.min(t.start,r),i="undefined"==typeof t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var u=s(e,o),c=s(e,i);if(u&&c){var p=document.createRange();p.setStart(u.node,u.offset),n.removeAllRanges(),o>i?(n.addRange(p),n.extend(c.node,c.offset)):(p.setEnd(c.node,c.offset),n.addRange(p))}}}var u=e(21),s=e(126),l=e(128),c=u.canUseDOM&&"selection"in document&&!("getSelection"in window),p={getOffsets:c?r:o,setOffsets:c?i:a};t.exports=p},{126:126,128:128,21:21}],51:[function(e,t){"use strict";var n=e(11),r=e(35),o=e(42),i=e(27),a=e(114),u=function(){};i(u.prototype,{construct:function(e){this._currentElement=e,this._stringText=""+e,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(e,t){this._rootNodeID=e;var r=a(this._stringText);return t.renderToStaticMarkup?r:""+r+""},receiveComponent:function(e){if(e!==this._currentElement){this._currentElement=e;var t=""+e;t!==this._stringText&&(this._stringText=t,o.BackendIDOperations.updateTextContentByID(this._rootNodeID,t))}},unmountComponent:function(){r.unmountIDFromEnvironment(this._rootNodeID)}}),t.exports=u},{11:11,114:114,27:27,35:35,42:42}],52:[function(e,t){"use strict";function n(){this.isMounted()&&this.forceUpdate()}var r=e(2),o=e(11),i=e(24),a=e(29),u=e(33),s=e(55),l=e(85),c=e(27),p=e(133),d=(e(150),s.createFactory("textarea")),f=u.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[r,i.Mixin,a],getInitialState:function(){var e=this.props.defaultValue,t=this.props.children;null!=t&&(p(null==e),Array.isArray(t)&&(p(t.length<=1),t=t[0]),e=""+t),null==e&&(e="");var n=i.getValue(this);return{initialValue:""+(null!=n?n:e)}},render:function(){var e=c({},this.props);return p(null==e.dangerouslySetInnerHTML),e.defaultValue=null,e.value=null,e.onChange=this._handleChange,d(e,this.state.initialValue)},componentDidUpdate:function(){var e=i.getValue(this);if(null!=e){var t=this.getDOMNode();o.setValueForProperty(t,"value",""+e)}},_handleChange:function(e){var t,r=i.getOnChange(this);return r&&(t=r.call(this,e)),l.asap(n,this),t}});t.exports=f},{11:11,133:133,150:150,2:2,24:24,27:27,29:29,33:33,55:55,85:85}],53:[function(e,t){"use strict";function n(){this.reinitializeTransaction()}var r=e(85),o=e(101),i=e(27),a=e(112),u={initialize:a,close:function(){p.isBatchingUpdates=!1}},s={initialize:a,close:r.flushBatchedUpdates.bind(r)},l=[s,u];i(n.prototype,o.Mixin,{getTransactionWrappers:function(){return l}});var c=new n,p={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o){var i=p.isBatchingUpdates;p.isBatchingUpdates=!0,i?e(t,n,r,o):c.perform(e,null,t,n,r,o)}};t.exports=p},{101:101,112:112,27:27,85:85}],54:[function(e,t){"use strict";function n(e){return f.createClass({tagName:e.toUpperCase(),render:function(){return new I(e,null,null,null,null,this.props)}})}function r(){R.EventEmitter.injectReactEventListener(T),R.EventPluginHub.injectEventPluginOrder(u),R.EventPluginHub.injectInstanceHandle(P),R.EventPluginHub.injectMount(w),R.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:k,EnterLeaveEventPlugin:s,ChangeEventPlugin:i,MobileSafariClickEventPlugin:p,SelectEventPlugin:S,BeforeInputEventPlugin:o}),R.NativeComponent.injectGenericComponentClass(v),R.NativeComponent.injectTextComponentClass(N),R.NativeComponent.injectAutoWrapper(n),R.Class.injectMixin(d),R.NativeComponent.injectComponentClasses({button:g,form:y,iframe:b,img:C,input:_,option:x,select:D,textarea:M,html:U("html"),head:U("head"),body:U("body")}),R.DOMProperty.injectDOMPropertyConfig(c),R.DOMProperty.injectDOMPropertyConfig(L),R.EmptyComponent.injectEmptyComponent("noscript"),R.Updates.injectReconcileTransaction(O),R.Updates.injectBatchingStrategy(m),R.RootIndex.injectCreateReactRootIndex(l.canUseDOM?a.createReactRootIndex:A.createReactRootIndex),R.Component.injectEnvironment(h),R.DOMComponent.injectIDOperations(E)}var o=e(3),i=e(7),a=e(8),u=e(13),s=e(14),l=e(21),c=e(23),p=e(26),d=e(29),f=e(33),h=e(35),m=e(53),v=e(42),g=e(41),y=e(43),C=e(46),E=e(44),b=e(45),_=e(47),x=e(48),D=e(49),M=e(52),N=e(51),I=e(55),T=e(60),R=e(62),P=e(64),w=e(68),O=e(78),S=e(87),A=e(88),k=e(89),L=e(86),U=e(109);t.exports={inject:r}},{109:109,13:13,14:14,21:21,23:23,26:26,29:29,3:3,33:33,35:35,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,51:51,52:52,53:53,55:55,60:60,62:62,64:64,68:68,7:7,78:78,8:8,86:86,87:87,88:88,89:89}],55:[function(e,t){"use strict";var n=e(38),r=e(39),o=e(27),i=(e(150),{key:!0,ref:!0}),a=function(e,t,n,r,o,i){this.type=e,this.key=t,this.ref=n,this._owner=r,this._context=o,this.props=i};a.prototype={_isReactElement:!0},a.createElement=function(e,t,o){var u,s={},l=null,c=null;if(null!=t){c=void 0===t.ref?null:t.ref,l=void 0===t.key?null:""+t.key;for(u in t)t.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(s[u]=t[u]) -}var p=arguments.length-2;if(1===p)s.children=o;else if(p>1){for(var d=Array(p),f=0;p>f;f++)d[f]=arguments[f+2];s.children=d}if(e&&e.defaultProps){var h=e.defaultProps;for(u in h)"undefined"==typeof s[u]&&(s[u]=h[u])}return new a(e,l,c,r.current,n.current,s)},a.createFactory=function(e){var t=a.createElement.bind(null,e);return t.type=e,t},a.cloneAndReplaceProps=function(e,t){var n=new a(e.type,e.key,e.ref,e._owner,e._context,t);return n},a.cloneElement=function(e,t,n){var u,s=o({},e.props),l=e.key,c=e.ref,p=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,p=r.current),void 0!==t.key&&(l=""+t.key);for(u in t)t.hasOwnProperty(u)&&!i.hasOwnProperty(u)&&(s[u]=t[u])}var d=arguments.length-2;if(1===d)s.children=n;else if(d>1){for(var f=Array(d),h=0;d>h;h++)f[h]=arguments[h+2];s.children=f}return new a(e.type,l,c,p,e._context,s)},a.isValidElement=function(e){var t=!(!e||!e._isReactElement);return t},t.exports=a},{150:150,27:27,38:38,39:39}],56:[function(e,t){"use strict";function n(){if(g.current){var e=g.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function r(e){var t=e&&e.getPublicInstance();if(!t)return void 0;var n=t.constructor;return n?n.displayName||n.name||void 0:void 0}function o(){var e=g.current;return e&&r(e)||void 0}function i(e,t){e._store.validated||null!=e.key||(e._store.validated=!0,u('Each child in an array or iterator should have a unique "key" prop.',e,t))}function a(e,t,n){x.test(e)&&u("Child objects should have non-numeric keys so ordering is preserved.",t,n)}function u(e,t,n){var i=o(),a="string"==typeof n?n:n.displayName||n.name,u=i||a,s=b[e]||(b[e]={});if(!s.hasOwnProperty(u)){s[u]=!0;var l="";if(t&&t._owner&&t._owner!==g.current){var c=r(t._owner);l=" It was passed a child from "+c+"."}}}function s(e,t){if(Array.isArray(e))for(var n=0;n");var u="";o&&(u=" The element was created by "+o+".")}}function p(e,t){return e!==e?t!==t:0===e&&0===t?1/e===1/t:e===t}function d(e){if(e._store){var t=e._store.originalProps,n=e.props;for(var r in n)n.hasOwnProperty(r)&&(t.hasOwnProperty(r)&&p(t[r],n[r])||(c(r,e),t[r]=n[r]))}}function f(e){if(null!=e.type){var t=y.getComponentClassForElement(e),n=t.displayName||t.name;t.propTypes&&l(n,t.propTypes,e.props,v.prop),"function"==typeof t.getDefaultProps}}var h=e(55),m=e(61),v=e(75),g=(e(74),e(39)),y=e(71),C=e(124),E=e(133),b=(e(150),{}),_={},x=/^\d+$/,D={},M={checkAndWarnForMutatedProps:d,createElement:function(e){var t=h.createElement.apply(this,arguments);if(null==t)return t;for(var n=2;no;o++){t=e.ancestors[o];var a=c.getID(t)||"";m._handleTopLevel(e.topLevelType,t,a,e.nativeEvent)}}function i(e){var t=h(window);e(t)}var a=e(16),u=e(21),s=e(28),l=e(64),c=e(68),p=e(85),d=e(27),f=e(123),h=e(129);d(r.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),s.addPoolingTo(r,s.twoArgumentPooler);var m={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:u.canUseDOM?window:null,setHandleTopLevel:function(e){m._handleTopLevel=e},setEnabled:function(e){m._enabled=!!e},isEnabled:function(){return m._enabled},trapBubbledEvent:function(e,t,n){var r=n;return r?a.listen(r,t,m.dispatchEvent.bind(null,e)):null},trapCapturedEvent:function(e,t,n){var r=n;return r?a.capture(r,t,m.dispatchEvent.bind(null,e)):null},monitorScrollValue:function(e){var t=i.bind(null,e);a.listen(window,"scroll",t)},dispatchEvent:function(e,t){if(m._enabled){var n=r.getPooled(e,t);try{p.batchedUpdates(o,n)}finally{r.release(n)}}}};t.exports=m},{123:123,129:129,16:16,21:21,27:27,28:28,64:64,68:68,85:85}],61:[function(e,t){"use strict";var n=(e(55),e(150),{create:function(e){return e},extract:function(e){return e},extractIfFragment:function(e){return e}});t.exports=n},{150:150,55:55}],62:[function(e,t){"use strict";var n=e(10),r=e(17),o=e(36),i=e(33),a=e(57),u=e(30),s=e(71),l=e(42),c=e(73),p=e(81),d=e(85),f={Component:o.injection,Class:i.injection,DOMComponent:l.injection,DOMProperty:n.injection,EmptyComponent:a.injection,EventPluginHub:r.injection,EventEmitter:u.injection,NativeComponent:s.injection,Perf:c.injection,RootIndex:p.injection,Updates:d.injection};t.exports=f},{10:10,17:17,30:30,33:33,36:36,42:42,57:57,71:71,73:73,81:81,85:85}],63:[function(e,t){"use strict";function n(e){return o(document.documentElement,e)}var r=e(50),o=e(107),i=e(117),a=e(119),u={hasSelectionCapabilities:function(e){return e&&("INPUT"===e.nodeName&&"text"===e.type||"TEXTAREA"===e.nodeName||"true"===e.contentEditable)},getSelectionInformation:function(){var e=a();return{focusedElem:e,selectionRange:u.hasSelectionCapabilities(e)?u.getSelection(e):null}},restoreSelection:function(e){var t=a(),r=e.focusedElem,o=e.selectionRange;t!==r&&n(r)&&(u.hasSelectionCapabilities(r)&&u.setSelection(r,o),i(r))},getSelection:function(e){var t;if("selectionStart"in e)t={start:e.selectionStart,end:e.selectionEnd};else if(document.selection&&"INPUT"===e.nodeName){var n=document.selection.createRange();n.parentElement()===e&&(t={start:-n.moveStart("character",-e.value.length),end:-n.moveEnd("character",-e.value.length)})}else t=r.getOffsets(e);return t||{start:0,end:0}},setSelection:function(e,t){var n=t.start,o=t.end;if("undefined"==typeof o&&(o=n),"selectionStart"in e)e.selectionStart=n,e.selectionEnd=Math.min(o,e.value.length);else if(document.selection&&"INPUT"===e.nodeName){var i=e.createTextRange();i.collapse(!0),i.moveStart("character",n),i.moveEnd("character",o-n),i.select()}else r.setOffsets(e,t)}};t.exports=u},{107:107,117:117,119:119,50:50}],64:[function(e,t){"use strict";function n(e){return d+e.toString(36)}function r(e,t){return e.charAt(t)===d||t===e.length}function o(e){return""===e||e.charAt(0)===d&&e.charAt(e.length-1)!==d}function i(e,t){return 0===t.indexOf(e)&&r(t,e.length)}function a(e){return e?e.substr(0,e.lastIndexOf(d)):""}function u(e,t){if(p(o(e)&&o(t)),p(i(e,t)),e===t)return e;var n,a=e.length+f;for(n=a;n=a;a++)if(r(e,a)&&r(t,a))i=a;else if(e.charAt(a)!==t.charAt(a))break;var u=e.substr(0,i);return p(o(u)),u}function l(e,t,n,r,o,s){e=e||"",t=t||"",p(e!==t);var l=i(t,e);p(l||i(e,t));for(var c=0,d=l?a:u,f=e;;f=d(f,t)){var m;if(o&&f===e||s&&f===t||(m=n(f,l,r)),m===!1||f===t)break;p(c++1){var t=e.indexOf(d,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var i=s(e,t);i!==e&&l(e,i,n,r,!1,!0),i!==t&&l(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(l("",e,t,n,!0,!1),l(e,"",t,n,!1,!0))},traverseAncestors:function(e,t,n){l("",e,t,n,!0,!1)},_getFirstCommonAncestorID:s,_getNextDescendantID:u,isAncestorIDOf:i,SEPARATOR:d};t.exports=m},{133:133,81:81}],65:[function(e,t){"use strict";var n={remove:function(e){e._reactInternalInstance=void 0},get:function(e){return e._reactInternalInstance},has:function(e){return void 0!==e._reactInternalInstance},set:function(e,t){e._reactInternalInstance=t}};t.exports=n},{}],66:[function(e,t){"use strict";var n={currentlyMountingInstance:null,currentlyUnmountingInstance:null};t.exports=n},{}],67:[function(e,t){"use strict";var n=e(104),r={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=n(e);return e.replace(">"," "+r.CHECKSUM_ATTR_NAME+'="'+t+'">')},canReuseMarkup:function(e,t){var o=t.getAttribute(r.CHECKSUM_ATTR_NAME);o=o&&parseInt(o,10);var i=n(e);return i===o}};t.exports=r},{104:104}],68:[function(e,t){"use strict";function n(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function r(e){var t=T(e);return t&&K.getID(t)}function o(e){var t=i(e);if(t)if(k.hasOwnProperty(t)){var n=k[t];n!==e&&(P(!l(n,t)),k[t]=e)}else k[t]=e;return t}function i(e){return e&&e.getAttribute&&e.getAttribute(A)||""}function a(e,t){var n=i(e);n!==t&&delete k[n],e.setAttribute(A,t),k[t]=e}function u(e){return k.hasOwnProperty(e)&&l(k[e],e)||(k[e]=K.findReactNodeByID(e)),k[e]}function s(e){var t=E.get(e)._rootNodeID;return y.isNullComponentID(t)?null:(k.hasOwnProperty(t)&&l(k[t],t)||(k[t]=K.findReactNodeByID(t)),k[t])}function l(e,t){if(e){P(i(e)===t);var n=K.findReactContainerForID(t);if(n&&I(n,e))return!0}return!1}function c(e){delete k[e]}function p(e){var t=k[e];return t&&l(t,e)?void(j=t):!1}function d(e){j=null,C.traverseAncestors(e,p);var t=j;return j=null,t}function f(e,t,n,r,o){var i=x.mountComponent(e,t,r,N);e._isTopLevel=!0,K._mountImageIntoNode(i,n,o)}function h(e,t,n,r){var o=M.ReactReconcileTransaction.getPooled();o.perform(f,null,e,t,n,o,r),M.ReactReconcileTransaction.release(o)}var m=e(10),v=e(30),g=(e(39),e(55)),y=(e(56),e(57)),C=e(64),E=e(65),b=e(67),_=e(73),x=e(79),D=e(84),M=e(85),N=e(113),I=e(107),T=e(127),R=e(132),P=e(133),w=e(144),O=e(147),S=(e(150),C.SEPARATOR),A=m.ID_ATTRIBUTE_NAME,k={},L=1,U=9,F={},B={},V=[],j=null,K={_instancesByReactRootID:F,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return K.scrollMonitor(n,function(){D.enqueueElementInternal(e,t),r&&D.enqueueCallbackInternal(e,r)}),e},_registerComponent:function(e,t){P(t&&(t.nodeType===L||t.nodeType===U)),v.ensureScrollValueMonitoring();var n=K.registerContainer(t);return F[n]=e,n},_renderNewRootComponent:function(e,t,n){var r=R(e,null),o=K._registerComponent(r,t);return M.batchedUpdates(h,r,o,t,n),r},render:function(e,t,n){P(g.isValidElement(e));var o=F[r(t)];if(o){var i=o._currentElement;if(O(i,e))return K._updateRootComponent(o,e,t,n).getPublicInstance();K.unmountComponentAtNode(t)}var a=T(t),u=a&&K.isRenderedByReact(a),s=u&&!o,l=K._renderNewRootComponent(e,t,s).getPublicInstance();return n&&n.call(l),l},constructAndRenderComponent:function(e,t,n){var r=g.createElement(e,t);return K.render(r,n)},constructAndRenderComponentByID:function(e,t,n){var r=document.getElementById(n);return P(r),K.constructAndRenderComponent(e,t,r)},registerContainer:function(e){var t=r(e);return t&&(t=C.getReactRootIDFromNodeID(t)),t||(t=C.createReactRootID()),B[t]=e,t},unmountComponentAtNode:function(e){P(e&&(e.nodeType===L||e.nodeType===U));var t=r(e),n=F[t];return n?(K.unmountComponentFromNode(n,e),delete F[t],delete B[t],!0):!1},unmountComponentFromNode:function(e,t){for(x.unmountComponent(e),t.nodeType===U&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)},findReactContainerForID:function(e){var t=C.getReactRootIDFromNodeID(e),n=B[t];return n},findReactNodeByID:function(e){var t=K.findReactContainerForID(e);return K.findComponentRoot(t,e)},isRenderedByReact:function(e){if(1!==e.nodeType)return!1;var t=K.getID(e);return t?t.charAt(0)===S:!1},getFirstReactDOM:function(e){for(var t=e;t&&t.parentNode!==t;){if(K.isRenderedByReact(t))return t;t=t.parentNode}return null},findComponentRoot:function(e,t){var n=V,r=0,o=d(t)||e;for(n[0]=o.firstChild,n.length=1;r>",b=a(),_=p(),x={array:r("array"),bool:r("boolean"),func:r("function"),number:r("number"),object:r("object"),string:r("string"),any:o(),arrayOf:i,element:b,instanceOf:u,node:_,objectOf:l,oneOf:s,oneOfType:c,shape:d};t.exports=x},{112:112,55:55,61:61,74:74}],77:[function(e,t){"use strict";function n(){this.listenersToPut=[]}var r=e(28),o=e(30),i=e(27);i(n.prototype,{enqueuePutListener:function(e,t,n){this.listenersToPut.push({rootNodeID:e,propKey:t,propValue:n})},putListeners:function(){for(var e=0;en;n++){var r=v[n],o=r._pendingCallbacks;if(r._pendingCallbacks=null,d.performUpdateIfNecessary(r,e.reconcileTransaction),o)for(var a=0;a":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;t.exports=r},{}],115:[function(e,t){"use strict";function n(e){return null==e?null:a(e)?e:r.has(e)?o.getNodeFromInstance(e):(i(null==e.render||"function"!=typeof e.render),void i(!1))}{var r=(e(39),e(65)),o=e(68),i=e(133),a=e(135);e(150)}t.exports=n},{133:133,135:135,150:150,39:39,65:65,68:68}],116:[function(e,t){"use strict";function n(e,t,n){var r=e,o=!r.hasOwnProperty(n);o&&null!=t&&(r[n]=t)}function r(e){if(null==e)return e;var t={};return o(e,n,t),t}{var o=e(149);e(150)}t.exports=r},{149:149,150:150}],117:[function(e,t){"use strict";function n(e){try{e.focus()}catch(t){}}t.exports=n},{}],118:[function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};t.exports=n},{}],119:[function(e,t){function n(){try{return document.activeElement||document.body}catch(e){return document.body}}t.exports=n},{}],120:[function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}t.exports=n},{}],121:[function(e,t){"use strict";function n(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=r(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?i[e.keyCode]||"Unidentified":""}var r=e(120),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};t.exports=n},{120:120}],122:[function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function r(){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};t.exports=r},{}],123:[function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}t.exports=n},{}],124:[function(e,t){"use strict";function n(e){var t=e&&(r&&e[r]||e[o]);return"function"==typeof t?t:void 0}var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";t.exports=n},{}],125:[function(e,t){function n(e){return o(!!i),p.hasOwnProperty(e)||(e="*"),a.hasOwnProperty(e)||(i.innerHTML="*"===e?"":"<"+e+">",a[e]=!i.firstChild),a[e]?p[e]:null}var r=e(21),o=e(133),i=r.canUseDOM?document.createElement("div"):null,a={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},u=[1,'"],s=[1,"","
    "],l=[3,"","
    "],c=[1,"",""],p={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:u,option:u,caption:s,colgroup:s,tbody:s,tfoot:s,thead:s,td:l,th:l,circle:c,defs:c,ellipse:c,g:c,line:c,linearGradient:c,path:c,polygon:c,polyline:c,radialGradient:c,rect:c,stop:c,text:c};t.exports=n},{133:133,21:21}],126:[function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var o=n(e),i=0,a=0;o;){if(3===o.nodeType){if(a=i+o.textContent.length,t>=i&&a>=t)return{node:o,offset:t-i};i=a}o=n(r(o))}}t.exports=o},{}],127:[function(e,t){"use strict";function n(e){return e?e.nodeType===r?e.documentElement:e.firstChild:null}var r=9;t.exports=n},{}],128:[function(e,t){"use strict";function n(){return!o&&r.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var r=e(21),o=null;t.exports=n},{21:21}],129:[function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}t.exports=n},{}],130:[function(e,t){function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;t.exports=n},{}],131:[function(e,t){"use strict";function n(e){return r(e).replace(o,"-ms-")}var r=e(130),o=/^ms-/;t.exports=n},{130:130}],132:[function(e,t){"use strict";function n(e){return"function"==typeof e&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function r(e,t){var r;if((null===e||e===!1)&&(e=i.emptyElement),"object"==typeof e){var o=e;r=t===o.type&&"string"==typeof o.type?a.createInternalComponent(o):n(o.type)?new o.type(o):new l}else"string"==typeof e||"number"==typeof e?r=a.createInstanceForText(e):s(!1);return r.construct(e),r._mountIndex=0,r._mountImage=null,r}var o=e(37),i=e(57),a=e(71),u=e(27),s=e(133),l=(e(150),function(){});u(l.prototype,o.Mixin,{_instantiateReactComponent:r}),t.exports=r},{133:133,150:150,27:27,37:37,57:57,71:71}],133:[function(e,t){"use strict";var n=function(e,t,n,r,o,i,a,u){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,u],c=0;s=new Error("Invariant Violation: "+t.replace(/%s/g,function(){return l[c++]}))}throw s.framesToPop=1,s}};t.exports=n},{}],134:[function(e,t){"use strict";function n(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"==typeof a[n]}return!i&&r&&"wheel"===e&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}var r,o=e(21);o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),t.exports=n},{21:21}],135:[function(e,t){function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}t.exports=n},{}],136:[function(e,t){"use strict";function n(e){return e&&("INPUT"===e.nodeName&&r[e.type]||"TEXTAREA"===e.nodeName)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};t.exports=n},{}],137:[function(e,t){function n(e){return r(e)&&3==e.nodeType}var r=e(135);t.exports=n},{135:135}],138:[function(e,t){"use strict";var n=e(133),r=function(e){var t,r={};n(e instanceof Object&&!Array.isArray(e));for(t in e)e.hasOwnProperty(t)&&(r[t]=t);return r};t.exports=r},{133:133}],139:[function(e,t){var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};t.exports=n},{}],140:[function(e,t){"use strict";function n(e,t,n){if(!e)return null;var o={};for(var i in e)r.call(e,i)&&(o[i]=t.call(n,e[i],i,e));return o}var r=Object.prototype.hasOwnProperty;t.exports=n},{}],141:[function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}t.exports=n},{}],142:[function(e,t){"use strict";function n(e){return o(r.isValidElement(e)),e}var r=e(55),o=e(133);t.exports=n},{133:133,55:55}],143:[function(e,t){"use strict";function n(e){return'"'+r(e)+'"'}var r=e(114);t.exports=n},{114:114}],144:[function(e,t){"use strict";var n=e(21),r=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,i=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(i=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),n.canUseDOM){var a=document.createElement("div");a.innerHTML=" ",""===a.innerHTML&&(i=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),r.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=""+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}t.exports=i},{21:21}],145:[function(e,t){"use strict";var n=e(21),r=e(114),o=e(144),i=function(e,t){e.textContent=t};n.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){o(e,r(t))})),t.exports=i},{114:114,144:144,21:21}],146:[function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n;for(n in e)if(e.hasOwnProperty(n)&&(!t.hasOwnProperty(n)||e[n]!==t[n]))return!1;for(n in t)if(t.hasOwnProperty(n)&&!e.hasOwnProperty(n))return!1;return!0}t.exports=n},{}],147:[function(e,t){"use strict";function n(e,t){if(null!=e&&null!=t){var n=typeof e,r=typeof t;if("string"===n||"number"===n)return"string"===r||"number"===r;if("object"===r&&e.type===t.type&&e.key===t.key){var o=e._owner===t._owner;return o}}return!1}e(150);t.exports=n},{150:150}],148:[function(e,t){function n(e){var t=e.length;if(r(!Array.isArray(e)&&("object"==typeof e||"function"==typeof e)),r("number"==typeof t),r(0===t||t-1 in e),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var o=Array(t),i=0;t>i;i++)o[i]=e[i];return o}var r=e(133);t.exports=n},{133:133}],149:[function(e,t){"use strict";function n(e){return m[e]}function r(e,t){return e&&null!=e.key?i(e.key):t.toString(36)}function o(e){return(""+e).replace(v,n)}function i(e){return"$"+o(e)}function a(e,t,n,o,u){var c=typeof e;if(("undefined"===c||"boolean"===c)&&(e=null),null===e||"string"===c||"number"===c||s.isValidElement(e))return o(u,e,""===t?f+r(e,0):t,n),1;var m,v,g,y=0;if(Array.isArray(e))for(var C=0;Ca?-1:0>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b;c=2*c-b;this.r=d(c,b,a+1/3);this.g=d(c,b,a);this.b=d(c,b,a-1/3)}return this},setStyle:function(a){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a))return a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this;if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a))return a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r= -Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this;if(/^\#([0-9a-f]{6})$/i.test(a))return a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this;if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a))return a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this;if(/^(\w+)$/i.test(a))return this.setHex(THREE.ColorKeywords[a]),this},copy:function(a){this.r=a.r;this.g= -a.g;this.b=a.b;return this},copyGammaToLinear:function(a){this.r=a.r*a.r;this.g=a.g*a.g;this.b=a.b*a.b;return this},copyLinearToGamma:function(a){this.r=Math.sqrt(a.r);this.g=Math.sqrt(a.g);this.b=Math.sqrt(a.b);return this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<< -8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),f=Math.min(b,c,d),g,h=(f+e)/2;if(f===e)f=g=0;else{var k=e-f,f=.5>=h?k/(e+f):k/(2-e-f);switch(e){case b:g=(c-d)/k+(cf&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y= -.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;this.normalize();return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*= --1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this.onChangeCallback();return this}, -multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,n=b._w;this._x=c*n+f*g+d*k-e*h;this._y=d*n+f*h+e*g-c*k;this._z=e*n+f*k+c*h-d*g;this._w=f*n-c*g-d*h-e*k;this.onChangeCallback();return this},multiplyVector3:function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."); -return a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(.001>Math.abs(k))return this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h= -Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this.onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2];this._w=a[b+3];this.onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},onChange:function(a){this.onChangeCallback= -a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0}; -THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a, -b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this}, -subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2);a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this}, -roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b= -this.x-a.x;a=this.y-a.y;return b*b+a*a},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+ -c;this.x=a.array[b];this.y=a.array[b+1];return this},clone:function(){return new THREE.Vector2(this.x,this.y)}};THREE.Vector3=function(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}; -THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+ -a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), -this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y= -a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(){var a;return function(b){!1===b instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order.");void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromEuler(b));return this}}(),applyAxisAngle:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Quaternion);this.applyQuaternion(a.setFromAxisAngle(b,c));return this}}(),applyMatrix3:function(a){var b=this.x, -c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]*d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12];this.y=a[1]*b+a[5]*c+a[9]*d+a[13];this.z=a[2]*b+a[6]*c+a[10]*d+a[14];return this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z= -(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,k=a*c+g*b-e*d,n=a*d+e*c-f*b,b=-e*b-f*c-g*d;this.x=h*a+b*-e+k*-g-n*-f;this.y=k*a+b*-f+n*-e-h*-g;this.z=n*a+b*-g+h*-f-k*-e;return this},project:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyProjection(a)}}(),unproject:function(){var a;return function(b){void 0=== -a&&(a=new THREE.Matrix4);a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix));return this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;this.normalize();return this},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0;return this},min:function(a){this.x> -a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3);a.set(c,c,c);b.set(d,d,d);return this.clamp(a, -b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z); -return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/ -b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},cross:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;this.x=d*a.z-e*a.y;this.y=e*a.x-c*a.z;this.z=c*a.y-d*a.x;return this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;this.x=d*h-e*g;this.y=e*f-c*h;this.z=c*g-d*f;return this}, -projectOnVector:function(){var a,b;return function(c){void 0===a&&(a=new THREE.Vector3);a.copy(c).normalize();b=this.dot(a);return this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a;return function(b){void 0===a&&(a=new THREE.Vector3);return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/(this.length()*a.length()); -return Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},setEulerFromRotationMatrix:function(a,b){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(a,b){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")}, -getPositionFromMatrix:function(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(a, -b)},setFromMatrixPosition:function(a){this.x=a.elements[12];this.y=a.elements[13];this.z=a.elements[14];return this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();a=this.set(a.elements[8],a.elements[9],a.elements[10]).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;this.x=d[c];this.y=d[c+1];this.z=d[c+2];return this},equals:function(a){return a.x=== -this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];return this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}}; -THREE.Vector4=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.w=void 0!==d?d:1}; -THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){this.x=a;this.y=b;this.z=c;this.w=d;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x; -case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this}, -addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b= -this.x,c=this.y,d=this.z,e=this.w;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e;this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e;this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1);return this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this}, -setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],k=a[9];c=a[2];b=a[6];var n=a[10];if(.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(k-b)){if(.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(k+b)&&.1>Math.abs(e+h+n-3))return this.set(1,0,0,0),this;a=Math.PI;e=(e+1)/2;h=(h+1)/2;n=(n+1)/2;d=(d+g)/4;f=(f+c)/4;k=(k+b)/4;e>h&&e>n?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>n?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h), -b=d/c,d=k/c):.01>n?(c=b=.707106781,d=0):(d=Math.sqrt(n),b=f/d,c=k/d);this.set(b,c,d,a);return this}a=Math.sqrt((b-k)*(b-k)+(f-c)*(f-c)+(g-d)*(g-d));.001>Math.abs(a)&&(a=1);this.x=(b-k)/a;this.y=(f-c)/a;this.z=(g-d)/a;this.w=Math.acos((e+h+n-1)/2);return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);this.z>a.z&&(this.z=a.z);this.w>a.w&&(this.w=a.w);return this},max:function(a){this.xb.x&&(this.x=b.x);this.yb.y&&(this.y=b.y);this.zb.z&&(this.z=b.z);this.wb.w&&(this.w=b.w);return this},clampScalar:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4);a.set(c,c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w); -return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w); -return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())}, -setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]= -this.z;a[b+3]=this.w;return a},fromAttribute:function(a,b,c){void 0===c&&(c=0);b=b*a.itemSize+c;this.x=a.array[b];this.y=a.array[b+1];this.z=a.array[b+2];this.w=a.array[b+3];return this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ"; -THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a;this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a;this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a;this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a;this.onChangeCallback()},set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this.onChangeCallback();return this},copy:function(a){this._x= -a._x;this._y=a._y;this._z=a._z;this._order=a._order;this.onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],k=e[5],n=e[9],p=e[2],q=e[6],e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-n,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(q,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(n,-1,1)),.99999>Math.abs(n)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h, -k)):(this._y=Math.atan2(-p,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(q,-1,1)),.99999>Math.abs(q)?(this._y=Math.atan2(-p,e),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(p,-1,1)),.99999>Math.abs(p)?(this._x=Math.atan2(q,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-n,k),this._y=Math.atan2(-p,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z= -Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(q,k),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-n,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeRotationFromQuaternion(b);this.setFromRotationMatrix(a,c,d);return this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z, -b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this);this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this.onChangeCallback();return this},toArray:function(){return[this._x,this._y,this._z,this._order]},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new THREE.Vector3(this._x, -this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}};THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3;this.end=void 0!==b?b:new THREE.Vector3}; -THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){this.start.copy(a);this.end.copy(b);return this},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a, -b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;d&&(e=THREE.Math.clamp(e,0,1));return e}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);c=c||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); -this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}};THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector2(-Infinity,-Infinity)}; -THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.y -this.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&& -a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}};THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(Infinity,Infinity,Infinity);this.max=void 0!==b?b:new THREE.Vector3(-Infinity,-Infinity,-Infinity)}; -THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x- -this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a= -new THREE.Vector3;return function(b){b=b||new THREE.Sphere;b.center=this.center();b.radius=.5*this.size(a).length();return b}}(),intersect:function(a){this.min.max(a.min);this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){a[0].set(this.min.x,this.min.y, -this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.makeEmpty();this.setFromPoints(a);return this}}(),translate:function(a){this.min.add(a); -this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}};THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);0this.determinant()&&(g=-g);c.x=f[12]; -c.y=f[13];c.z=f[14];b.elements.set(this.elements);c=1/g;var f=1/h,n=1/k;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=f;b.elements[5]*=f;b.elements[6]*=f;b.elements[8]*=n;b.elements[9]*=n;b.elements[10]*=n;d.setFromRotationMatrix(b);e.x=g;e.y=h;e.z=k;return this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(d-c);g[9]=(d+c)/(d-c);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0; -g[11]=-1;g[15]=0;return this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,k=c-d,n=f-e;g[0]=2/h;g[4]=0;g[8]=0;g[12]=-((b+a)/h);g[1]=0;g[5]=2/k;g[9]=0;g[13]=-((c+d)/k);g[2]=0;g[6]=0;g[10]=-2/n;g[14]=-((f+e)/n);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},fromArray:function(a){this.elements.set(a);return this},toArray:function(){var a=this.elements;return[a[0], -a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}};THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3;this.direction=void 0!==b?b:new THREE.Vector3}; -THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin); -var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceTo(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceTo(b)}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5); -b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var h=.5*d.distanceTo(e),k=-this.direction.dot(b),n=c.dot(this.direction),p=-c.dot(b),q=c.lengthSq(),m=Math.abs(1-k*k),t;0=-t?e<=t?(h=1/m,d*=h,e*=h,k=d*(d+k*e+2*n)+e*(k*d+e+2*p)+q):(e=h,d=Math.max(0,-(k*e+n)),k=-d*d+e*(e+2*p)+q):(e=-h,d=Math.max(0,-(k*e+n)),k=-d*d+e*(e+2*p)+q):e<=-t?(d=Math.max(0,-(-k*h+n)),e=0f)return null;f=Math.sqrt(f-e);e=d-f;d+=f;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0==b)return 0==a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)}, -isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x;f=1/this.direction.y;g=1/this.direction.z;var h=this.origin;0<=d?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x);0<=f?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y);if(c>f||e>d)return null;if(e>c||c!==c)c=e;if(fg||e>d)return null;if(e>c||c!==c)c=e;if(gd?null:this.at(0<=c?c:d,b)},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,k){b.subVectors(f,e);c.subVectors(g,e);d.crossVectors(b,c);f=this.direction.dot(d);if(0f)h=-1,f=-f;else return null;a.subVectors(this.origin,e);e=h*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;g=h*this.direction.dot(b.cross(a)); -if(0>g||e+g>f)return null;e=-h*a.dot(d);return 0>e?null:this.at(e/f,k)}}(),applyMatrix4:function(a){this.direction.add(this.origin).applyMatrix4(a);this.origin.applyMatrix4(a);this.direction.sub(this.origin);this.direction.normalize();return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}};THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3;this.radius=void 0!==b?b:0}; -THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;f=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<= -this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;d.copy(a);c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center));return d},getBoundingBox:function(a){a=a||new THREE.Box3;a.set(this.center,this.center);a.expandByScalar(this.radius); -return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this},translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}}; -THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]}; -THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;g[0].copy(a);g[1].copy(b);g[2].copy(c);g[3].copy(d);g[4].copy(e);g[5].copy(f);return this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],k=c[6],n=c[7],p=c[8],q=c[9],m=c[10],t=c[11],s=c[12],r=c[13],u=c[14],c=c[15];b[0].setComponents(f-a,n-g,t-p,c-s).normalize();b[1].setComponents(f+ -a,n+g,t+p,c+s).normalize();b[2].setComponents(f+d,n+h,t+q,c+r).normalize();b[3].setComponents(f-d,n-h,t-q,c-r).normalize();b[4].setComponents(f-e,n-k,t-m,c-u).normalize();b[5].setComponents(f+e,n+k,t+m,c+u).normalize();return this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere);a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes, -c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(), -containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}};THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0);this.constant=void 0!==b?b:0}; -THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a,b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d, -c);return this}}(),copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*=-1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a, -b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0a&&0f||1e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}}(),clamp:function(a,b,c){return ac?c:a},clampBottom:function(a,b){return a=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a= -180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a}}; -THREE.Spline=function(a){function b(a,b,c,d,e,f,g){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c=[],d={x:0,y:0,z:0},e,f,g,h,k,n,p,q,m;this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:f+1;c[3]=f>this.points.length-3?this.points.length-1:f+ -2;n=this.points[c[0]];p=this.points[c[1]];q=this.points[c[2]];m=this.points[c[3]];h=g*g;k=g*h;d.x=b(n.x,p.x,q.x,m.x,g,h,k);d.y=b(n.y,p.y,q.y,m.y,g,h,k);d.z=b(n.z,p.z,q.z,m.z,g,h,k);return d};this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;a=b.x+b.y}}(); -THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),midpoint:function(a){return(a|| -new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}, -clone:function(){return(new THREE.Triangle).copy(this)}};THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}; -THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();this.running=!0},stop:function(){this.getElapsedTime();this.running=!1},getElapsedTime:function(){this.getDelta();return this.elapsedTime},getDelta:function(){var a=0;this.autoStart&&!this.running&&this.start();if(this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(), -a=.001*(b-this.oldTime);this.oldTime=b;this.elapsedTime+=a}return a}};THREE.EventDispatcher=function(){}; -THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener;a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener;a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener;a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&& -c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;eya?-1:1;h[4*a]=ga.x;h[4*a+1]=ga.y;h[4*a+2]=ga.z;h[4*a+3]=$a}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array, -e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,k=[],n=[],p=0;pr;r++)s=a[3*c+r],-1==m[s]?(q[2*r]=s,q[2*r+1]=-1,p++):m[s]k.index+b)for(k={start:f,count:0,index:g},h.push(k),p=0;6>p;p+=2)r=q[p+1],-1p;p+=2)s=q[p],r=q[p+1],-1===r&&(r=g++),m[s]=r,t[r]=s,e[f++]=r-k.index,k.count++}this.reorderBuffers(e,t,g);return this.offsets=h},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,f=a.attributes[d],g=f.array,h=0,f=f.itemSize*b;hd?-1:1,e.vertexTangents[c]=new THREE.Vector4(x.x,x.y,x.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;cd;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;ca.opacity)h.transparent=a.transparent;void 0!==a.depthTest&&(h.depthTest=a.depthTest);void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite);void 0!==a.visible&&(h.visible=a.visible);void 0!==a.flipSided&&(h.side=THREE.BackSide);void 0!==a.doubleSided&&(h.side=THREE.DoubleSide);void 0!==a.wireframe&&(h.wireframe=a.wireframe);void 0!==a.vertexColors&&("face"=== -a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors));a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor);a.colorSpecular&&(h.specular=e(a.colorSpecular));a.colorAmbient&&(h.ambient=e(a.colorAmbient));a.colorEmissive&&(h.emissive=e(a.colorEmissive));a.transparency&&(h.opacity=a.transparency);a.specularCoef&&(h.shininess=a.specularCoef);a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap, -a.mapDiffuseAnisotropy);a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy);a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy);a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy);a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy);a.mapAlpha&& -b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy);a.mapBumpScale&&(h.bumpScale=a.mapBumpScale);a.mapNormalFactor&&(h.normalScale=new THREE.Vector2(a.mapNormalFactor,a.mapNormalFactor));g=new THREE[g](h);void 0!==a.DbgName&&(g.name=a.DbgName);return g}};THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;bg;g++)m=y[k++],v=u[2*m],m=u[2*m+1],v=new THREE.Vector2(v,m),2!==g&&c.faceVertexUvs[d][h].push(v),0!==g&&c.faceVertexUvs[d][h+1].push(v);q&&(q=3*y[k++],t.normal.set(C[q++],C[q++],C[q]),r.normal.copy(t.normal));if(s)for(d=0;4>d;d++)q=3*y[k++],s=new THREE.Vector3(C[q++], -C[q++],C[q]),2!==d&&t.vertexNormals.push(s),0!==d&&r.vertexNormals.push(s);p&&(p=y[k++],p=x[p],t.color.setHex(p),r.color.setHex(p));if(b)for(d=0;4>d;d++)p=y[k++],p=x[p],2!==d&&t.vertexColors.push(new THREE.Color(p)),0!==d&&r.vertexColors.push(new THREE.Color(p));c.faces.push(t);c.faces.push(r)}else{t=new THREE.Face3;t.a=y[k++];t.b=y[k++];t.c=y[k++];h&&(h=y[k++],t.materialIndex=h);h=c.faces.length;if(d)for(d=0;dg;g++)m=y[k++],v=u[2*m],m=u[2*m+1], -v=new THREE.Vector2(v,m),c.faceVertexUvs[d][h].push(v);q&&(q=3*y[k++],t.normal.set(C[q++],C[q++],C[q]));if(s)for(d=0;3>d;d++)q=3*y[k++],s=new THREE.Vector3(C[q++],C[q++],C[q]),t.vertexNormals.push(s);p&&(p=y[k++],t.color.setHex(x[p]));if(b)for(d=0;3>d;d++)p=y[k++],t.vertexColors.push(new THREE.Color(x[p]));c.faces.push(t)}})(d);(function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,g=a.skinWeights.length;dthis.opacity&&(a.opacity=this.opacity);!1!==this.transparent&&(a.transparent=this.transparent);!1!==this.wireframe&&(a.wireframe=this.wireframe);return a},clone:function(a){void 0===a&&(a=new THREE.Material);a.name=this.name;a.side=this.side;a.opacity=this.opacity;a.transparent=this.transparent;a.blending=this.blending;a.blendSrc=this.blendSrc;a.blendDst=this.blendDst;a.blendEquation=this.blendEquation;a.depthTest=this.depthTest;a.depthWrite=this.depthWrite;a.polygonOffset=this.polygonOffset;a.polygonOffsetFactor= -this.polygonOffsetFactor;a.polygonOffsetUnits=this.polygonOffsetUnits;a.alphaTest=this.alphaTest;a.overdraw=this.overdraw;a.visible=this.visible;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Material.prototype);THREE.MaterialIdCount=0; -THREE.LineBasicMaterial=function(a){THREE.Material.call(this);this.type="LineBasicMaterial";this.color=new THREE.Color(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.vertexColors=THREE.NoColors;this.fog=!0;this.setValues(a)};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial; -THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.linecap=this.linecap;a.linejoin=this.linejoin;a.vertexColors=this.vertexColors;a.fog=this.fog;return a}; -THREE.LineDashedMaterial=function(a){THREE.Material.call(this);this.type="LineDashedMaterial";this.color=new THREE.Color(16777215);this.scale=this.linewidth=1;this.dashSize=3;this.gapSize=1;this.vertexColors=!1;this.fog=!0;this.setValues(a)};THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial; -THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.linewidth=this.linewidth;a.scale=this.scale;a.dashSize=this.dashSize;a.gapSize=this.gapSize;a.vertexColors=this.vertexColors;a.fog=this.fog;return a}; -THREE.MeshBasicMaterial=function(a){THREE.Material.call(this);this.type="MeshBasicMaterial";this.color=new THREE.Color(16777215);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphTargets=this.skinning=!1;this.setValues(a)}; -THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial; -THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap; -a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;return a}; -THREE.MeshLambertMaterial=function(a){THREE.Material.call(this);this.type="MeshLambertMaterial";this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.wrapAround=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth= -1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial; -THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog; -a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a}; -THREE.MeshPhongMaterial=function(a){THREE.Material.call(this);this.type="MeshPhongMaterial";this.color=new THREE.Color(16777215);this.ambient=new THREE.Color(16777215);this.emissive=new THREE.Color(0);this.specular=new THREE.Color(1118481);this.shininess=30;this.wrapAround=this.metal=!1;this.wrapRGB=new THREE.Vector3(1,1,1);this.bumpMap=this.lightMap=this.map=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.envMap=this.alphaMap=this.specularMap=null;this.combine= -THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=.98;this.fog=!0;this.shading=THREE.SmoothShading;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.vertexColors=THREE.NoColors;this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(a)};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial; -THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;THREE.Material.prototype.clone.call(this,a);a.color.copy(this.color);a.ambient.copy(this.ambient);a.emissive.copy(this.emissive);a.specular.copy(this.specular);a.shininess=this.shininess;a.metal=this.metal;a.wrapAround=this.wrapAround;a.wrapRGB.copy(this.wrapRGB);a.map=this.map;a.lightMap=this.lightMap;a.bumpMap=this.bumpMap;a.bumpScale=this.bumpScale;a.normalMap=this.normalMap;a.normalScale.copy(this.normalScale); -a.specularMap=this.specularMap;a.alphaMap=this.alphaMap;a.envMap=this.envMap;a.combine=this.combine;a.reflectivity=this.reflectivity;a.refractionRatio=this.refractionRatio;a.fog=this.fog;a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;a.wireframeLinecap=this.wireframeLinecap;a.wireframeLinejoin=this.wireframeLinejoin;a.vertexColors=this.vertexColors;a.skinning=this.skinning;a.morphTargets=this.morphTargets;a.morphNormals=this.morphNormals;return a}; -THREE.MeshDepthMaterial=function(a){THREE.Material.call(this);this.type="MeshDepthMaterial";this.wireframe=this.morphTargets=!1;this.wireframeLinewidth=1;this.setValues(a)};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial; -THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;THREE.Material.prototype.clone.call(this,a);a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a);this.type="MeshNormalMaterial";this.shading=THREE.FlatShading;this.wireframe=!1;this.wireframeLinewidth=1;this.morphTargets=!1;this.setValues(a)};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype); -THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;THREE.Material.prototype.clone.call(this,a);a.shading=this.shading;a.wireframe=this.wireframe;a.wireframeLinewidth=this.wireframeLinewidth;return a};THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID();this.type="MeshFaceMaterial";this.materials=a instanceof Array?a:[]}; -THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;bf||(C=b.origin.distanceTo(p),Cd.far||e.push({distance:C,point:n.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this}))}}else for(m= -m.position.array,g=0;gf||(C=b.origin.distanceTo(p),Cd.far||e.push({distance:C,point:n.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,k=h.length,g=0;gf||(C=b.origin.distanceTo(p),Cd.far||e.push({distance:C,point:n.clone().applyMatrix4(this.matrixWorld), -face:null,faceIndex:null,object:this}))}}}();THREE.Line.prototype.clone=function(a){void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode));THREE.Object3D.prototype.clone.call(this,a);return a};THREE.Mesh=function(a,b){THREE.Object3D.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new THREE.Geometry;this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()});this.updateMorphTargets()};THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype); -THREE.Mesh.prototype.constructor=THREE.Mesh;THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0g.far||h.push({distance:z,point:F,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(r=p.position.array,s=k=0,x=r.length;k -g.far||h.push({distance:z,point:F,face:new THREE.Face3(p,q,m,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(k instanceof THREE.Geometry)for(s=this.material instanceof THREE.MeshFaceMaterial,r=!0===s?this.material.materials:null,t=g.precision,u=k.vertices,v=0,y=k.faces.length;vg.far||h.push({distance:z,point:F,face:C,faceIndex:v,object:this}))}}}();THREE.Mesh.prototype.clone=function(a,b){void 0===a&&(a=new THREE.Mesh(this.geometry,this.material));THREE.Object3D.prototype.clone.call(this,a,b);return a};THREE.Bone=function(a){THREE.Object3D.call(this);this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone; -THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256h.end&&(h.end=e);b||(b=g)}}a.firstAnimation=b}; -THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={});this.geometry.animations[a]={start:b,end:c}};THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1E3,this.time=0):console.warn("animation["+a+"] undefined")}; -THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a;if(this.mirroredLoop){if(this.time>this.duration||0>this.time)this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)}else this.time%=this.duration,0>this.time&&(this.time+=this.duration);a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1);a!==this.currentKeyframe&& -(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a);b=this.time%b/b;this.directionBackwards&&(b=1-b);this.morphTargetInfluences[this.currentKeyframe]=b;this.morphTargetInfluences[this.lastKeyframe]=1-b}; -THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;e=this.objects[d].distance)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;else break;for(;dthis.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.clone=function(a){void 0===a&&(a=new THREE.Sprite(this.material));THREE.Object3D.prototype.clone.call(this,a);return a}; -THREE.Particle=THREE.Sprite;THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);THREE.LensFlare.prototype.constructor=THREE.LensFlare; -THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===f&&(f=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})}; -THREE.LensFlare.prototype.updateLensFlares=function(){var a,b=this.lensFlares.length,c,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;a dashSize ) {\n\t\tdiscard;\n\t}\n\tgl_FragColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.fog_fragment, -"}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2E3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment, -"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );", -THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_vertex, -"void main() {\n\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\tvWorldPosition = worldPosition.xyz;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment, -"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\tvWorldPosition = worldPosition.xyz;\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;", -THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = clamp( tFlip * direction.y * -0.5 + 0.5, 0.0, 1.0);\nsampleUV.x = atan( direction.z, direction.x ) * 0.15915494309189533576888376337251 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex, -THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {", -THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}}; -THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate= -!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1h&&(e[v].counter+=1,k=e[v].hash+"_"+e[v].counter,k in q||(p={id:kc++,faces3:[],materialIndex:v,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,r.push(p)));q[k].faces3.push(t);q[k].vertices+=3}f[g]=r;b.groupsNeedUpdate=!1}f=sb[b.id];g=0;for(d=f.length;gY;Y++)qa=Q[Y],Pa[Va]=qa.x,Pa[Va+1]=qa.y,Pa[Va+2]=qa.z,Va+=3;else for(Y=0;3>Y;Y++)Pa[Va]=M.x,Pa[Va+1]=M.y,Pa[Va+2]=M.z,Va+=3;l.bindBuffer(l.ARRAY_BUFFER,v.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER, -Pa,z)}if(Ma&&Wa){w=0;for(F=V.length;wY;Y++)Da=T[Y],wb[mb]=Da.x,wb[mb+1]=Da.y,mb+=2;0Y;Y++)Aa=U[Y],ob[ya]=Aa.x,ob[ya+1]=Aa.y,ya+=2;0ua;ua++)gb[ua]=!I.autoScaleCubemaps||Fb||ba?ba?ka.image[ua].image:ka.image[ua]:M(ka.image[ua],Ec);var Qb=gb[0],Rb=THREE.Math.isPowerOfTwo(Qb.width)&&THREE.Math.isPowerOfTwo(Qb.height),qb=T(ka.format),Sb=T(ka.type);U(l.TEXTURE_CUBE_MAP,ka,Rb);for(ua=0;6>ua;ua++)if(Fb)for(var yb,Gb=gb[ua].mipmaps,rb=0,Yb=Gb.length;rb=pc&&console.warn("WebGLRenderer: trying to use "+ -a+" texture units while this GPU supports only "+pc);Mb+=1;return a}function G(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function E(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function w(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function D(a){a*=O;a!==qc&&(l.lineWidth(a),qc=a)}function A(a,b,c){rc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),rc=a);!a||sc===b&&tc===c|| -(l.polygonOffset(b,c),sc=b,tc=c)}function U(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,T(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,T(b.wrapT)),l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+ -b.sourceFile+" )"),l.texParameteri(a,l.TEXTURE_MAG_FILTER,N(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,N(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+b.sourceFile+" )"));(c=aa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&(1b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.log("THREE.WebGLRenderer:",a,"is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height+".");return d}return a}function K(a,b){l.bindRenderbuffer(l.RENDERBUFFER, -a);b.depthBuffer&&!b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_COMPONENT16,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH_STENCIL,b.width,b.height),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a)):l.renderbufferStorage(l.RENDERBUFFER,l.RGBA4,b.width,b.height)}function L(a){a instanceof THREE.WebGLRenderTargetCube?(l.bindTexture(l.TEXTURE_CUBE_MAP, -a.__webglTexture),l.generateMipmap(l.TEXTURE_CUBE_MAP),l.bindTexture(l.TEXTURE_CUBE_MAP,null)):(l.bindTexture(l.TEXTURE_2D,a.__webglTexture),l.generateMipmap(l.TEXTURE_2D),l.bindTexture(l.TEXTURE_2D,null))}function N(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?l.NEAREST:l.LINEAR}function T(a){var b;if(a===THREE.RepeatWrapping)return l.REPEAT;if(a===THREE.ClampToEdgeWrapping)return l.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return l.MIRRORED_REPEAT; -if(a===THREE.NearestFilter)return l.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return l.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return l.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return l.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return l.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return l.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return l.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return l.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return l.UNSIGNED_SHORT_5_5_5_1; -if(a===THREE.UnsignedShort565Type)return l.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return l.BYTE;if(a===THREE.ShortType)return l.SHORT;if(a===THREE.UnsignedShortType)return l.UNSIGNED_SHORT;if(a===THREE.IntType)return l.INT;if(a===THREE.UnsignedIntType)return l.UNSIGNED_INT;if(a===THREE.FloatType)return l.FLOAT;if(a===THREE.AlphaFormat)return l.ALPHA;if(a===THREE.RGBFormat)return l.RGB;if(a===THREE.RGBAFormat)return l.RGBA;if(a===THREE.LuminanceFormat)return l.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return l.LUMINANCE_ALPHA; -if(a===THREE.AddEquation)return l.FUNC_ADD;if(a===THREE.SubtractEquation)return l.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return l.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return l.ZERO;if(a===THREE.OneFactor)return l.ONE;if(a===THREE.SrcColorFactor)return l.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return l.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return l.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return l.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return l.DST_ALPHA; -if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return l.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return l.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return l.SRC_ALPHA_SATURATE;b=aa.get("WEBGL_compressed_texture_s3tc");if(null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT; -if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}b=aa.get("WEBGL_compressed_texture_pvrtc");if(null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}b=aa.get("EXT_blend_minmax");if(null!==b){if(a===THREE.MinEquation)return b.MIN_EXT; -if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var Q=void 0!==a.canvas?a.canvas:document.createElement("canvas"),W=void 0!==a.context?a.context:null,O=1,ga=void 0!==a.precision?a.precision:"highp",ea=void 0!==a.alpha?a.alpha:!1,xa=void 0!==a.depth?a.depth:!0,H=void 0!==a.stencil?a.stencil:!0,$a=void 0!==a.antialias?a.antialias:!1,qa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ya=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer: -!1,X=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,ta=new THREE.Color(0),Za=0,pa=[],Fa={},Ga=[],Ta=[],za=[],tb=[],eb=[];this.domElement=Q;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps= -!0;this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var I=this,Xa=[],Wb=null,uc=null,Hb=-1,Sa="",Ib=null,Mb=0,zb=-1,Xb=-1,Yb=-1,Zb=-1,ec=-1,fc=-1,gc=-1,hc=-1,rc=null,sc=null,tc=null,qc=null,hb=0,Ya=0,ib=Q.width,jb=Q.height,vc=0,wc=0,kb=new Uint8Array(16),Ma=new Uint8Array(16),ub=new THREE.Frustum,vb=new THREE.Matrix4;new THREE.Matrix4;var Da=new THREE.Vector3,ma=new THREE.Vector3,Ob=!0,nc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]}, -point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l;try{var xc={alpha:ea,depth:xa,stencil:H,antialias:$a,premultipliedAlpha:qa,preserveDrawingBuffer:ya};l=W||Q.getContext("webgl",xc)||Q.getContext("experimental-webgl",xc);if(null===l){if(null!==Q.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."; -}Q.addEventListener("webglcontextlost",function(a){a.preventDefault();yc();zc();Fa={}},!1)}catch(Fc){console.error(Fc)}void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var aa=new THREE.WebGLExtensions(l);aa.get("OES_texture_float");aa.get("OES_texture_float_linear");aa.get("OES_standard_derivatives");X&&aa.get("EXT_frag_depth");var zc=function(){l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL); -l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA);l.viewport(hb,Ya,ib,jb);l.clearColor(ta.r,ta.g,ta.b,Za)},yc=function(){Ib=Wb=null;Xb=zb=hc=gc=Yb=-1;Sa="";Hb=-1;Ob=!0;for(var a=0;ab;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}I.info.memory.textures--},mc=function(a){a=a.target;a.removeEventListener("dispose",mc);lc(a)},Bc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "), -c=0,d=b.length;cd.numSupportedMorphTargets?(n.sort(p),n.length=d.numSupportedMorphTargets):n.length>d.numSupportedMorphNormals?n.sort(p):0===n.length&&n.push([0,0]);for(var m=0,r=d.numSupportedMorphTargets;mg;g++){a.__webglFramebuffer[g]=l.createFramebuffer();a.__webglRenderbuffer[g]=l.createRenderbuffer();l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,d,a.width,a.height,0,d,e,null);var f=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+g;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[g]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0, -h,f.__webglTexture,0);K(a.__webglRenderbuffer[g],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),U(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture, -0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):K(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a? -(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=ib,a=jb,d=hb,e=Ya);b!==uc&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),uc=b);vc=c;wc=a};this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")};this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")}; -this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}; -THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format: -THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null}; -THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a;this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);a.wrapS=this.wrapS;a.wrapT=this.wrapT;a.magFilter=this.magFilter;a.minFilter=this.minFilter;a.anisotropy=this.anisotropy;a.offset.copy(this.offset);a.repeat.copy(this.repeat);a.format=this.format;a.type=this.type;a.depthBuffer=this.depthBuffer;a.stencilBuffer=this.stencilBuffer;a.generateMipmaps=this.generateMipmaps; -a.shareDepthFrom=this.shareDepthFrom;return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c);this.activeCubeFace=0};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube; -THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case "EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc"); -break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.log("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}}; -THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,k=d.attributes,n=d.__webglShader.vertexShader,p=d.__webglShader.fragmentShader,q=d.index0AttributeName;void 0===q&&!0===e.morphTargets&&(q="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var t="ENVMAP_TYPE_CUBE",s="ENVMAP_MODE_REFLECTION",r="ENVMAP_BLENDING_MULTIPLY"; -if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:t="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:t="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:t="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:s="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:r="ENVMAP_BLENDING_MULTIPLY"; -break;case THREE.MixOperation:r="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:r="ENVMAP_BLENDING_ADD"}}var u,v;u=[];for(var y in g)v=g[y],!1!==v&&(v="#define "+y+" "+v,u.push(v));u=u.join("\n");g=f.createProgram();d instanceof THREE.RawShaderMaterial?b=d="":(d=["precision "+e.precision+" float;","precision "+e.precision+" int;",u,e.supportsVertexTextures?"#define VERTEX_TEXTURES":"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+e.maxDirLights, -"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,"#define MAX_BONES "+e.maxBones,e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+s:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR": -"",e.skinning?"#define USE_SKINNING":"",e.useVertexTexture?"#define BONE_TEXTURE":"",e.morphTargets?"#define USE_MORPHTARGETS":"",e.morphNormals?"#define USE_MORPHNORMALS":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED":"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.sizeAttenuation?"#define USE_SIZEATTENUATION": -"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"), -b=["precision "+e.precision+" float;","precision "+e.precision+" int;",e.bumpMap||e.normalMap?"#extension GL_OES_standard_derivatives : enable":"",u,"#define MAX_DIR_LIGHTS "+e.maxDirLights,"#define MAX_POINT_LIGHTS "+e.maxPointLights,"#define MAX_SPOT_LIGHTS "+e.maxSpotLights,"#define MAX_HEMI_LIGHTS "+e.maxHemiLights,"#define MAX_SHADOWS "+e.maxShadows,e.alphaTest?"#define ALPHATEST "+e.alphaTest:"",b.gammaInput?"#define GAMMA_INPUT":"",b.gammaOutput?"#define GAMMA_OUTPUT":"",e.useFog&&e.fog?"#define USE_FOG": -"",e.useFog&&e.fogExp?"#define FOG_EXP2":"",e.map?"#define USE_MAP":"",e.envMap?"#define USE_ENVMAP":"",e.envMap?"#define "+t:"",e.envMap?"#define "+s:"",e.envMap?"#define "+r:"",e.lightMap?"#define USE_LIGHTMAP":"",e.bumpMap?"#define USE_BUMPMAP":"",e.normalMap?"#define USE_NORMALMAP":"",e.specularMap?"#define USE_SPECULARMAP":"",e.alphaMap?"#define USE_ALPHAMAP":"",e.vertexColors?"#define USE_COLOR":"",e.metal?"#define METAL":"",e.wrapAround?"#define WRAP_AROUND":"",e.doubleSided?"#define DOUBLE_SIDED": -"",e.flipSided?"#define FLIP_SIDED":"",e.shadowMapEnabled?"#define USE_SHADOWMAP":"",e.shadowMapEnabled?"#define "+m:"",e.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",e.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",e.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n"));n=new THREE.WebGLShader(f,f.VERTEX_SHADER,d+n);p=new THREE.WebGLShader(f,f.FRAGMENT_SHADER,b+p);f.attachShader(g,n);f.attachShader(g,p);void 0!==q&&f.bindAttribLocation(g, -0,q);f.linkProgram(g);!1===f.getProgramParameter(g,f.LINK_STATUS)&&(console.error("THREE.WebGLProgram: Could not initialise shader."),console.error("gl.VALIDATE_STATUS",f.getProgramParameter(g,f.VALIDATE_STATUS)),console.error("gl.getError()",f.getError()));""!==f.getProgramInfoLog(g)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",f.getProgramInfoLog(g));f.deleteShader(n);f.deleteShader(p);q="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" "); -e.useVertexTexture?(q.push("boneTexture"),q.push("boneTextureWidth"),q.push("boneTextureHeight")):q.push("boneGlobalMatrices");e.logarithmicDepthBuffer&&q.push("logDepthBufFC");for(var C in h)q.push(C);h=q;C={};q=0;for(b=h.length;qL;L++)A[L]=new THREE.Vector3,w[L]=new THREE.Vector3;A=D.shadowCascadeNearZ[K];D=D.shadowCascadeFarZ[K];w[0].set(-1,-1,A);w[1].set(1,-1,A);w[2].set(-1,1,A);w[3].set(1,1,A);w[4].set(-1,-1,D);w[5].set(1,-1,D);w[6].set(-1,1,D);w[7].set(1,1,D);M.originalCamera=v;w=new THREE.Gyroscope;w.position.copy(z.shadowCascadeOffset);w.add(M);w.add(M.target);v.add(w);z.shadowCascadeArray[E]=M;console.log("Created virtualLight",M)}K= -z;A=E;D=K.shadowCascadeArray[A];D.position.copy(K.position);D.target.position.copy(K.target.position);D.lookAt(D.target);D.shadowCameraVisible=K.shadowCameraVisible;D.shadowDarkness=K.shadowDarkness;D.shadowBias=K.shadowCascadeBias[A];w=K.shadowCascadeNearZ[A];K=K.shadowCascadeFarZ[A];D=D.pointsFrustum;D[0].z=w;D[1].z=w;D[2].z=w;D[3].z=w;D[4].z=K;D[5].z=K;D[6].z=K;D[7].z=K;U[G]=M;G++}else U[G]=z,G++;u=0;for(F=U.length;uK;K++)A=D[K],A.copy(w[K]),A.unproject(E),A.applyMatrix4(G.matrixWorldInverse),A.xt.x&&(t.x=A.x),A.yt.y&&(t.y=A.y),A.zt.z&&(t.z=A.z);G.left=m.x;G.right=t.x;G.top=t.y;G.bottom=m.y;G.updateProjectionMatrix()}G=z.shadowMap;w=z.shadowMatrix;E=z.shadowCamera;E.position.setFromMatrixPosition(z.matrixWorld);s.setFromMatrixPosition(z.target.matrixWorld);E.lookAt(s);E.updateMatrixWorld();E.matrixWorldInverse.getInverse(E.matrixWorld);z.cameraHelper&& -(z.cameraHelper.visible=z.shadowCameraVisible);z.shadowCameraVisible&&z.cameraHelper.update();w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);w.multiply(E.projectionMatrix);w.multiply(E.matrixWorldInverse);q.multiplyMatrices(E.projectionMatrix,E.matrixWorldInverse);p.setFromMatrix(q);a.setRenderTarget(G);a.clear();r.length=0;e(c,c,E);z=0;for(G=r.length;z 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); -x.compileShader(L);x.compileShader(N);x.attachShader(K,L);x.attachShader(K,N);x.linkProgram(K);G=K;v=x.getAttribLocation(G,"position");y=x.getAttribLocation(G,"uv");c=x.getUniformLocation(G,"uvOffset");d=x.getUniformLocation(G,"uvScale");e=x.getUniformLocation(G,"rotation");f=x.getUniformLocation(G,"scale");g=x.getUniformLocation(G,"color");h=x.getUniformLocation(G,"map");k=x.getUniformLocation(G,"opacity");n=x.getUniformLocation(G,"modelViewMatrix");p=x.getUniformLocation(G,"projectionMatrix");q= -x.getUniformLocation(G,"fogType");m=x.getUniformLocation(G,"fogDensity");t=x.getUniformLocation(G,"fogNear");s=x.getUniformLocation(G,"fogFar");r=x.getUniformLocation(G,"fogColor");u=x.getUniformLocation(G,"alphaTest");K=document.createElement("canvas");K.width=8;K.height=8;L=K.getContext("2d");L.fillStyle="white";L.fillRect(0,0,8,8);E=new THREE.Texture(K);E.needsUpdate=!0}x.useProgram(G);x.enableVertexAttribArray(v);x.enableVertexAttribArray(y);x.disable(x.CULL_FACE);x.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER, -F);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(y,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(p,!1,M.projectionMatrix.elements);x.activeTexture(x.TEXTURE0);x.uniform1i(h,0);L=K=0;(N=U.fog)?(x.uniform3f(r,N.color.r,N.color.g,N.color.b),N instanceof THREE.Fog?(x.uniform1f(t,N.near),x.uniform1f(s,N.far),x.uniform1i(q,1),L=K=1):N instanceof THREE.FogExp2&&(x.uniform1f(m,N.density),x.uniform1i(q,2),L=K=2)):(x.uniform1i(q,0),L=K=0);for(var N=0,T=b.length;N< -T;N++){var Q=b[N];Q._modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,Q.matrixWorld);Q.z=-Q._modelViewMatrix.elements[14]}b.sort(C);for(var W=[],N=0,T=b.length;Nq-1?0:q-1,t=q+1>e-1?e-1:q+1,s=0>p-1?0:p-1,r=p+1>d-1?d-1:p+1,u=[],v=[0,0,h[4*(q*d+p)]/255*b];u.push([-1,0,h[4*(q*d+s)]/255*b]);u.push([-1,-1,h[4*(m*d+s)]/255*b]);u.push([0,-1,h[4*(m*d+p)]/255*b]);u.push([1,-1,h[4*(m*d+r)]/255*b]);u.push([1,0,h[4*(q*d+r)]/255*b]);u.push([1,1,h[4*(t*d+r)]/255*b]);u.push([0,1,h[4*(t*d+p)]/255* -b]);u.push([-1,1,h[4*(t*d+s)]/255*b]);m=[];s=u.length;for(t=0;te)return null;var f=[],g=[],h=[],k,n,p;if(0=q--){console.log("Warning, unable to triangulate polygon!");break}k=n;e<=k&&(k=0);n=k+1;e<=n&&(n=0);p=n+1;e<=p&&(p=0);var m;a:{var t=m=void 0,s=void 0,r=void 0,u=void 0,v=void 0,y=void 0,C=void 0,x=void 0, -t=a[g[k]].x,s=a[g[k]].y,r=a[g[n]].x,u=a[g[n]].y,v=a[g[p]].x,y=a[g[p]].y;if(1E-10>(r-t)*(y-s)-(u-s)*(v-t))m=!1;else{var F=void 0,z=void 0,G=void 0,E=void 0,w=void 0,D=void 0,A=void 0,U=void 0,M=void 0,K=void 0,M=U=A=x=C=void 0,F=v-r,z=y-u,G=t-v,E=s-y,w=r-t,D=u-s;for(m=0;mk)g=d+1;else if(0b&&(b=0);1=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null};THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]}; -THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a=[],b=0,c,d=this.curves.length;for(c=0;cb?b=h.x:h.xc?c=h.y:h.yd?d=h.z:h.zMath.abs(d.x-c[0].x)&&1E-10>Math.abs(d.y-c[0].y)&&c.splice(c.length-1,1);b&&c.push(c[0]);return c}; -THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;cm&&(f=b[g],k=-k,h=b[e],m=-m),!(a.yh.y))if(a.y==f.y){if(a.x==f.x)return!0}else{e=m*(a.x-f.x)-k*(a.y-f.y);if(0==e)return!0;0>e||(d=!d)}}else if(a.y==f.y&&(h.x<=a.x&&a.x<=f.x||f.x<=a.x&&a.x<= -h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;b=0;for(c=a.length;bE||E>G)return[];k=n*p-k*q;if(0>k||k>G)return[]}else{if(0d?[]:k==d?g?[]:[f]:a<=d?[f,h]: -[f,n]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10f&&(f=d);var g=a+1;g>d&&(g=0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1; -d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;cK){console.log("Infinite Loop! Holes left:"+ -n.length+", Probably Hole outside Shape!");break}for(q=D;qh;h++)n=k[h].x+":"+k[h].y, -n=p[n],void 0!==n&&(k[h]=n);return q.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a, -b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()}; -THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);return b}; -THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y);return b.normalize()};THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d};THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve; -THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new THREE.Vector2(b,a)};THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b=new THREE.Vector2(b,a);b.normalize();return b}; -THREE.SplineCurve=function(a){this.points=void 0==a?[]:a};THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.SplineCurve.prototype.constructor=THREE.SplineCurve; -THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector2;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);return c};THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a;this.aY=b;this.xRadius=c;this.yRadius=d;this.aStartAngle=e;this.aEndAngle=f;this.aClockwise=g}; -THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype);THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve;THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;0>b&&(b+=2*Math.PI);b>2*Math.PI&&(b-=2*Math.PI);a=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b;b=new THREE.Vector2;b.x=this.aX+this.xRadius*Math.cos(a);b.y=this.aY+this.yRadius*Math.sin(a);return b}; -THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)};THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype);THREE.ArcCurve.prototype.constructor=THREE.ArcCurve;THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a;this.v2=b},function(a){var b=new THREE.Vector3;b.subVectors(this.v2,this.v1);b.multiplyScalar(a);b.add(this.v1);return b}); -THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a;this.v1=b;this.v2=c},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x);b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y);b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z);return b}); -THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a;this.v1=b;this.v2=c;this.v3=d},function(a){var b=new THREE.Vector3;b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x);b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y);b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return b}); -THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a);c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a);c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a);return c}); -THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(0a.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time= -0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){d={};for(c=0;cd;d++){for(var e=this.keyTypes[d],f=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(e,a,1);g.timef.index;)f=g,g=this.getNextKeyWith(e,a,g.index+1);c.prevKey[e]=f;c.nextKey[e]=g}}}; -THREE.Animation.prototype.resetBlendWeights=function(){for(var a=0,b=this.hierarchy.length;aa.length-2?q:q+1;c[3]=q>a.length-3?q:q+2;q=a[c[0]];t=a[c[1]];s=a[c[2]];r=a[c[3]];c=e*e;m=e*c;d[0]=f(q[0],t[0],s[0],r[0],e,c,m);d[1]=f(q[1],t[1],s[1],r[1],e,c,m);d[2]=f(q[2],t[2],s[2],r[2],e,c,m);return d},f=function(a,b,c,d,e,f,m){a=.5*(c-a);d=.5*(d-b);return(2*(b-c)+a+d)*m+ -(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length;if(this.currentTime>f||0>this.currentTime)this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop();f=0;for(var h=this.hierarchy.length;fq;q++){var m=this.keyTypes[q],t=n.prevKey[m],s=n.nextKey[m];if(0this.timeScale&&t.time>=this.currentTime){t=this.data.hierarchy[f].keys[0];for(s=this.getNextKeyWith(m,f,1);s.timet.index;)t=s,s=this.getNextKeyWith(m,f,s.index+1);n.prevKey[m]=t;n.nextKey[m]=s}var r=(this.currentTime-t.time)/(s.time-t.time),u=t[m],v=s[m];0>r&&(r=0);1a&&(this.currentTime%=a);this.currentTime=Math.min(this.currentTime,a);a=0;for(var b=this.hierarchy.length;af.index;)f=g,g=e[f.index+1];d.prevKey= -f;d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorldNeedsUpdate=!0}}}};THREE.KeyFrameAnimation.prototype.getNextKeyWith=function(a,b,c){b=this.data.hierarchy[b].keys;for(c%=b.length;cthis.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);a=this.duration/this.frames;var b=Math.floor(this.currentTime/a);b!=this.currentFrame&&(this.mesh.morphTargetInfluences[this.lastFrame]=0,this.mesh.morphTargetInfluences[this.currentFrame]= -1,this.mesh.morphTargetInfluences[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b);this.mesh.morphTargetInfluences[b]=this.currentTime%a/a;this.mesh.morphTargetInfluences[this.lastFrame]=1-this.mesh.morphTargetInfluences[b]}}}; -THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,r){var u,v=h.widthSegments,y=h.heightSegments,C=e/2,x=f/2,F=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",y=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",v=h.depthSegments;var z=v+1,G=y+1,E=e/v,w=f/y,D=new THREE.Vector3;D[u]=0=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10d?-1E-10>f&&(a=!0):Math.sign(e)== -Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(H=a.length;0<=--H;){c=H;d=H-1;0>d&&(d=a.length-1);for(var e=0,f=t+2*p,e=0;eMath.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y, -1-d.z),new THREE.Vector2(e.y,1-e.z)]}};THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this);this.type="ShapeGeometry";!1===a instanceof Array&&(a=[a]);this.addShapeList(a,b);this.computeFaceNormals()};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;cc&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5, -a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,n=0,p=a.length;nt&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>q&&(b[2].x+=1));n=0;for(p=this.vertices.length;nc.y?this.quaternion.set(1,0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,a-b,1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()}; -THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3));THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces);void 0!==a&&this.update(a)};THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype);THREE.BoxHelper.prototype.constructor=THREE.BoxHelper; -THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x;d[1]=b.y;d[2]=b.z;d[3]=c.x;d[4]=b.y;d[5]=b.z;d[6]=c.x;d[7]=b.y;d[8]=b.z;d[9]=c.x;d[10]=c.y;d[11]=b.z;d[12]=c.x;d[13]=c.y;d[14]=b.z;d[15]=b.x;d[16]=c.y;d[17]=b.z;d[18]=b.x;d[19]=c.y;d[20]=b.z;d[21]=b.x;d[22]=b.y;d[23]=b.z;d[24]=b.x;d[25]=b.y;d[26]=c.z;d[27]=c.x;d[28]=b.y;d[29]=c.z;d[30]=c.x;d[31]=b.y; -d[32]=c.z;d[33]=c.x;d[34]=c.y;d[35]=c.z;d[36]=c.x;d[37]=c.y;d[38]=c.z;d[39]=b.x;d[40]=c.y;d[41]=c.z;d[42]=b.x;d[43]=c.y;d[44]=c.z;d[45]=b.x;d[46]=b.y;d[47]=c.z;d[48]=b.x;d[49]=b.y;d[50]=b.z;d[51]=b.x;d[52]=b.y;d[53]=c.z;d[54]=c.x;d[55]=b.y;d[56]=b.z;d[57]=c.x;d[58]=b.y;d[59]=c.z;d[60]=c.x;d[61]=c.y;d[62]=b.z;d[63]=c.x;d[64]=c.y;d[65]=c.z;d[66]=b.x;d[67]=c.y;d[68]=b.z;d[69]=b.x;d[70]=c.y;d[71]=c.z;this.geometry.attributes.position.needsUpdate=!0;this.geometry.computeBoundingSphere();this.matrix=a.matrixWorld; -this.matrixAutoUpdate=!1};THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a;this.box=new THREE.Box3;THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper;THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position)}; -THREE.CameraHelper=function(a){function b(a,b,d){c(a,d);c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3);d.colors.push(new THREE.Color(b));void 0===f[a]&&(f[a]=[]);f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200);b("n2","n4",16755200);b("n4","n3",16755200);b("n3","n1",16755200);b("f1","f2",16755200);b("f2","f4",16755200);b("f4","f3",16755200);b("f3","f1",16755200);b("n1","f1",16755200); -b("n2","f2",16755200);b("n3","f3",16755200);b("n4","f4",16755200);b("p","n1",16711680);b("p","n2",16711680);b("p","n3",16711680);b("p","n4",16711680);b("u1","u2",43775);b("u2","u3",43775);b("u3","u1",43775);b("c","t",16777215);b("p","c",3355443);b("cn1","cn2",3355443);b("cn3","cn4",3355443);b("cf1","cf2",3355443);b("cf3","cf4",3355443);THREE.Line.call(this,d,e,THREE.LinePieces);this.camera=a;this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=f;this.update()}; -THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype);THREE.CameraHelper.prototype.constructor=THREE.CameraHelper; -THREE.CameraHelper.prototype.update=function(){var a,b,c=new THREE.Vector3,d=new THREE.Camera,e=function(e,g,h,k){c.set(g,h,k).unproject(d);e=b[e];if(void 0!==e)for(g=0,h=e.length;gs;s++){d[0]=t[g[s]];d[1]=t[g[(s+1)%3]];d.sort(f);var r=d.toString();void 0===e[r]?(e[r]={vert1:d[0],vert2:d[1],face1:q,face2:void 0},p++):e[r].face2=q}d=new Float32Array(6*p);f=0;for(r in e)if(g=e[r],void 0===g.face2|| -.9999>k[g.face1].normal.dot(k[g.face2].normal))p=n[g.vert1],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z,p=n[g.vert2],d[f++]=p.x,d[f++]=p.y,d[f++]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3));THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype);THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper; -THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a;this.size=void 0!==b?b:1;a=void 0!==c?c:16776960;d=void 0!==d?d:1;b=new THREE.Geometry;c=0;for(var e=this.object.geometry.faces.length;cb;b++)a.faces[b].color=this.colors[4>b?0:1];b=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(a,b);this.add(this.lightSphere); -this.update()};THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype);THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper;THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose();this.lightSphere.material.dispose()}; -THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity);this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity);this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate());this.lightSphere.geometry.colorsNeedUpdate=!0}}(); -THREE.PointLightHelper=function(a,b){this.light=a;this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity);THREE.Mesh.call(this,c,d);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1};THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper; -THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}; -THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;cr;r++){d[0]=s[g[r]];d[1]=s[g[(r+1)%3]];d.sort(f);var u=d.toString();void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++)}d=new Float32Array(6*p);m=0;for(t=p;mr;r++)p= -k[q[2*m+r]],g=6*m+3*r,d[g+0]=p.x,d[g+1]=p.y,d[g+2]=p.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){k=a.geometry.attributes.position.array;t=a.geometry.attributes.index.array;n=a.geometry.drawcalls;p=0;0===n.length&&(n=[{count:t.length,index:0,start:0}]);for(var q=new Uint32Array(2*t.length),s=0,v=n.length;sr;r++)d[0]= -g+t[m+r],d[1]=g+t[m+(r+1)%3],d.sort(f),u=d.toString(),void 0===e[u]&&(q[2*p]=d[0],q[2*p+1]=d[1],e[u]=!0,p++);d=new Float32Array(6*p);m=0;for(t=p;mr;r++)g=6*m+3*r,p=3*q[2*m+r],d[g+0]=k[p],d[g+1]=k[p+1],d[g+2]=k[p+2]}else for(k=a.geometry.attributes.position.array,p=k.length/3,q=p/3,d=new Float32Array(6*p),m=0,t=q;mr;r++)g=18*m+6*r,q=9*m+3*r,d[g+0]=k[q],d[g+1]=k[q+1],d[g+2]=k[q+2],p=9*m+(r+1)%3*3,d[g+3]=k[p],d[g+4]=k[p+1],d[g+5]=k[p+2];h.addAttribute("position",new THREE.BufferAttribute(d, -3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces);this.matrix=a.matrixWorld;this.matrixAutoUpdate=!1};THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype);THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper;THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this);this.render=function(a){}};THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype);THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject; -THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b);this.animationsMap={};this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1);this.setAnimationWeight("__default",1)};THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype);THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh; -THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[a]=b;this.animationsList.push(b)}; -THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b=/([a-z]+)_?(\d+)/,c,d={},e=this.geometry,f=0,g=e.morphTargets.length;fh.end&&(h.end=f);c||(c=k)}}for(k in d)h=d[k],this.createAnimation(k,h.start,h.end,a);this.firstAnimation=c}; -THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){if(a=this.animationsMap[a])a.direction=1,a.directionBackwards=!1};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){if(a=this.animationsMap[a])a.direction=-1,a.directionBackwards=!0};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)}; -THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)};THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)};THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;if(a=this.animationsMap[a])b=a.time;return b}; -THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;if(a=this.animationsMap[a])b=a.duration;return b};THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):console.warn("animation["+a+"] undefined")};THREE.MorphBlendMesh.prototype.stopAnimation=function(a){if(a=this.animationsMap[a])a.active=!1}; -THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;bd.duration||0>d.time)d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)}else d.time%=d.duration,0>d.time&&(d.time+=d.duration);var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight; -f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f);e=d.time%e/e;d.directionBackwards&&(e=1-e);this.morphTargetInfluences[d.currentFrame]=e*g;this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; From 00c5002a4ffcee2569345a4e06fe5cf2ff2e6f41 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Mar 2015 15:52:26 -0400 Subject: [PATCH 125/190] Thirdparty libraries are now minified and concatenated together --- Gruntfile.coffee | 12 ++++++++++-- index.html | 5 ----- package.json | 1 + public/thirdparty.min.js | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 7532483..f83f460 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -19,6 +19,13 @@ module.exports = ( grunt ) -> if grunt.file.exists( min ) then return min else return filepath ) + concat: + options: + separator: ';' + dist: + src: ['<%= bower_concat.all.dest %>', 'thirdparty/*.js'] + dest: 'build/thirdparty.js' + cjsx: options: bare: true @@ -66,7 +73,7 @@ module.exports = ( grunt ) -> dist: files: 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] - 'public/thirdparty.min.js': [ '<%= bower_concat.all.dest %>' ] + 'public/thirdparty.min.js': [ '<%= concat.dist.dest %>' ] watch: files: [ @@ -83,5 +90,6 @@ module.exports = ( grunt ) -> grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-clean' grunt.loadNpmTasks 'grunt-bower-concat' + grunt.loadNpmTasks 'grunt-contrib-concat' - grunt.registerTask 'default', [ 'clean', 'bower_concat', 'cjsx', 'coffee', 'browserify', 'uglify' ] + grunt.registerTask 'default', [ 'clean', 'bower_concat', 'concat', 'cjsx', 'coffee', 'browserify', 'uglify' ] diff --git a/index.html b/index.html index 2381744..30cceba 100755 --- a/index.html +++ b/index.html @@ -77,11 +77,6 @@

    Data Visualization Globe - - - - - diff --git a/package.json b/package.json index 8774983..d61af79 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "grunt-coffee-react": "^2.4.1", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-coffee": "^0.13.0", + "grunt-contrib-concat": "^0.5.1", "grunt-contrib-uglify": "^0.8.0", "grunt-contrib-watch": "^0.6.1", "underscore": "^1.8.2" diff --git a/public/thirdparty.min.js b/public/thirdparty.min.js index 4b066c8..4dd1c83 100644 --- a/public/thirdparty.min.js +++ b/public/thirdparty.min.js @@ -15,4 +15,4 @@ else if("faceVertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)xb=Jb.value[Vb[y var x=w/v,y=.5*v,z=.5*w,A=16/w,B=new THREE.Vector2(A*x,A),C=new THREE.Vector3(1,1,0),D=new THREE.Vector2(1,1);if(void 0===o){var A=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),E=new Uint16Array([0,1,2,0,2,3]);m=s.createBuffer(),n=s.createBuffer(),s.bindBuffer(s.ARRAY_BUFFER,m),s.bufferData(s.ARRAY_BUFFER,A,s.STATIC_DRAW),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),s.bufferData(s.ELEMENT_ARRAY_BUFFER,E,s.STATIC_DRAW),q=s.createTexture(),r=s.createTexture(),s.bindTexture(s.TEXTURE_2D,q),s.texImage2D(s.TEXTURE_2D,0,s.RGB,16,16,0,s.RGB,s.UNSIGNED_BYTE,null),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST),s.bindTexture(s.TEXTURE_2D,r),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,16,16,0,s.RGBA,s.UNSIGNED_BYTE,null),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.NEAREST),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.NEAREST);var A=(p=0E;E++)if(A=16/w,B.set(A*x,A),G=b[E],t.set(G.matrixWorld.elements[12],G.matrixWorld.elements[13],G.matrixWorld.elements[14]),t.applyMatrix4(u.matrixWorldInverse),t.applyProjection(u.projectionMatrix),C.copy(t),D.x=C.x*y+y,D.y=C.y*z+z,p||0H;H++){var J=G.lensFlares[H];.001g;g++){var i=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld),p.push(i)}for(g=0,h=b.children.length;h>g;g++)e(a,b.children[g],d)}}var f,g,h,i,j=a.context,k=new THREE.Frustum,l=new THREE.Matrix4,m=new THREE.Vector3,n=new THREE.Vector3,o=new THREE.Vector3,p=[],q=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(q.uniforms);f=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader}),g=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0}),h=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,skinning:!0}),i=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0,skinning:!0}),f._shadowPass=!0,g._shadowPass=!0,h._shadowPass=!0,i._shadowPass=!0,this.render=function(c,q){if(!1!==a.shadowMapEnabled){var r,s,t,u,v,w,x,y,z=[];for(u=0,j.clearColor(1,1,1,1),j.disable(j.BLEND),j.enable(j.CULL_FACE),j.frontFace(j.CCW),j.cullFace(a.shadowMapCullFace===THREE.CullFaceFront?j.FRONT:j.BACK),a.state.setDepthTest(!0),r=0,s=b.length;s>r;r++)if(t=b[r],t.castShadow)if(t instanceof THREE.DirectionalLight&&t.shadowCascade)for(v=0;vC;C++)y[C]=new THREE.Vector3,w[C]=new THREE.Vector3;y=x.shadowCascadeNearZ[B],x=x.shadowCascadeFarZ[B],w[0].set(-1,-1,y),w[1].set(1,-1,y),w[2].set(-1,1,y),w[3].set(1,1,y),w[4].set(-1,-1,x),w[5].set(1,-1,x),w[6].set(-1,1,x),w[7].set(1,1,x),A.originalCamera=q,w=new THREE.Gyroscope,w.position.copy(t.shadowCascadeOffset),w.add(A),w.add(A.target),q.add(w),t.shadowCascadeArray[v]=A}B=t,y=v,x=B.shadowCascadeArray[y],x.position.copy(B.position),x.target.position.copy(B.target.position),x.lookAt(x.target),x.shadowCameraVisible=B.shadowCameraVisible,x.shadowDarkness=B.shadowDarkness,x.shadowBias=B.shadowCascadeBias[y],w=B.shadowCascadeNearZ[y],B=B.shadowCascadeFarZ[y],x=x.pointsFrustum,x[0].z=w,x[1].z=w,x[2].z=w,x[3].z=w,x[4].z=B,x[5].z=B,x[6].z=B,x[7].z=B,z[u]=A,u++}else z[u]=t,u++;for(r=0,s=z.length;s>r;r++){if(t=z[r],t.shadowMap||(v=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&(v=THREE.NearestFilter),t.shadowMap=new THREE.WebGLRenderTarget(t.shadowMapWidth,t.shadowMapHeight,{minFilter:v,magFilter:v,format:THREE.RGBAFormat}),t.shadowMapSize=new THREE.Vector2(t.shadowMapWidth,t.shadowMapHeight),t.shadowMatrix=new THREE.Matrix4),!t.shadowCamera){if(t instanceof THREE.SpotLight)t.shadowCamera=new THREE.PerspectiveCamera(t.shadowCameraFov,t.shadowMapWidth/t.shadowMapHeight,t.shadowCameraNear,t.shadowCameraFar);else{if(!(t instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",t);continue}t.shadowCamera=new THREE.OrthographicCamera(t.shadowCameraLeft,t.shadowCameraRight,t.shadowCameraTop,t.shadowCameraBottom,t.shadowCameraNear,t.shadowCameraFar)}c.add(t.shadowCamera),!0===c.autoUpdate&&c.updateMatrixWorld()}if(t.shadowCameraVisible&&!t.cameraHelper&&(t.cameraHelper=new THREE.CameraHelper(t.shadowCamera),c.add(t.cameraHelper)),t.isVirtual&&A.originalCamera==q){for(v=q,u=t.shadowCamera,w=t.pointsFrustum,x=t.pointsWorld,m.set(1/0,1/0,1/0),n.set(-1/0,-1/0,-1/0),B=0;8>B;B++)y=x[B],y.copy(w[B]),y.unproject(v),y.applyMatrix4(u.matrixWorldInverse),y.xn.x&&(n.x=y.x),y.yn.y&&(n.y=y.y),y.zn.z&&(n.z=y.z);u.left=m.x,u.right=n.x,u.top=n.y,u.bottom=m.y,u.updateProjectionMatrix()}for(u=t.shadowMap,w=t.shadowMatrix,v=t.shadowCamera,v.position.setFromMatrixPosition(t.matrixWorld),o.setFromMatrixPosition(t.target.matrixWorld),v.lookAt(o),v.updateMatrixWorld(),v.matrixWorldInverse.getInverse(v.matrixWorld),t.cameraHelper&&(t.cameraHelper.visible=t.shadowCameraVisible),t.shadowCameraVisible&&t.cameraHelper.update(),w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(v.projectionMatrix),w.multiply(v.matrixWorldInverse),l.multiplyMatrices(v.projectionMatrix,v.matrixWorldInverse),k.setFromMatrix(l),a.setRenderTarget(u),a.clear(),p.length=0,e(c,c,v),t=0,u=p.length;u>t;t++)x=p[t],w=x.object,x=x.buffer,B=w.material instanceof THREE.MeshFaceMaterial?w.material.materials[0]:w.material,y=void 0!==w.geometry.morphTargets&&0t;t++)x=d[t],w=x.object,w.visible&&w.castShadow&&(w._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,w.matrixWorld),a.renderImmediateObject(v,b,null,f,w))}r=a.getClearColor(),s=a.getClearAlpha(),j.clearColor(r.r,r.g,r.b,s),j.enable(j.BLEND),a.shadowMapCullFace===THREE.CullFaceFront&&j.cullFace(j.BACK),a.resetGLState()}}},THREE.SpritePlugin=function(a,b){function c(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=a.context,z=new THREE.Vector3,A=new THREE.Quaternion,B=new THREE.Vector3;this.render=function(C,D){if(0!==b.length){if(void 0===w){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),F=new Uint16Array([0,1,2,0,2,3]);u=y.createBuffer(),v=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,u),y.bufferData(y.ARRAY_BUFFER,E,y.STATIC_DRAW),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.bufferData(y.ELEMENT_ARRAY_BUFFER,F,y.STATIC_DRAW);var E=y.createProgram(),F=y.createShader(y.VERTEX_SHADER),G=y.createShader(y.FRAGMENT_SHADER);y.shaderSource(F,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),y.shaderSource(G,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),y.compileShader(F),y.compileShader(G),y.attachShader(E,F),y.attachShader(E,G),y.linkProgram(E),w=E,s=y.getAttribLocation(w,"position"),t=y.getAttribLocation(w,"uv"),d=y.getUniformLocation(w,"uvOffset"),e=y.getUniformLocation(w,"uvScale"),f=y.getUniformLocation(w,"rotation"),g=y.getUniformLocation(w,"scale"),h=y.getUniformLocation(w,"color"),i=y.getUniformLocation(w,"map"),j=y.getUniformLocation(w,"opacity"),k=y.getUniformLocation(w,"modelViewMatrix"),l=y.getUniformLocation(w,"projectionMatrix"),m=y.getUniformLocation(w,"fogType"),n=y.getUniformLocation(w,"fogDensity"),o=y.getUniformLocation(w,"fogNear"),p=y.getUniformLocation(w,"fogFar"),q=y.getUniformLocation(w,"fogColor"),r=y.getUniformLocation(w,"alphaTest"),E=document.createElement("canvas"),E.width=8,E.height=8,F=E.getContext("2d"),F.fillStyle="white",F.fillRect(0,0,8,8),x=new THREE.Texture(E),x.needsUpdate=!0}y.useProgram(w),y.enableVertexAttribArray(s),y.enableVertexAttribArray(t),y.disable(y.CULL_FACE),y.enable(y.BLEND),y.bindBuffer(y.ARRAY_BUFFER,u),y.vertexAttribPointer(s,2,y.FLOAT,!1,16,0),y.vertexAttribPointer(t,2,y.FLOAT,!1,16,8),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.uniformMatrix4fv(l,!1,D.projectionMatrix.elements),y.activeTexture(y.TEXTURE0),y.uniform1i(i,0),F=E=0,(G=C.fog)?(y.uniform3f(q,G.color.r,G.color.g,G.color.b),G instanceof THREE.Fog?(y.uniform1f(o,G.near),y.uniform1f(p,G.far),y.uniform1i(m,1),F=E=1):G instanceof THREE.FogExp2&&(y.uniform1f(n,G.density),y.uniform1i(m,2),F=E=2)):(y.uniform1i(m,0),F=E=0);for(var G=0,H=b.length;H>G;G++){var I=b[G];I._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,I.matrixWorld),I.z=-I._modelViewMatrix.elements[14]}b.sort(c);for(var J=[],G=0,H=b.length;H>G;G++){var I=b[G],K=I.material;y.uniform1f(r,K.alphaTest),y.uniformMatrix4fv(k,!1,I._modelViewMatrix.elements),I.matrixWorld.decompose(z,A,B),J[0]=B.x,J[1]=B.y,I=0,C.fog&&K.fog&&(I=F),E!==I&&(y.uniform1i(m,I),E=I),null!==K.map?(y.uniform2f(d,K.map.offset.x,K.map.offset.y),y.uniform2f(e,K.map.repeat.x,K.map.repeat.y)):(y.uniform2f(d,0,0),y.uniform2f(e,1,1)),y.uniform1f(j,K.opacity),y.uniform3f(h,K.color.r,K.color.g,K.color.b),y.uniform1f(f,K.rotation),y.uniform2fv(g,J),a.state.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst),a.state.setDepthTest(K.depthTest),a.state.setDepthWrite(K.depthWrite),K.map&&K.map.image&&K.map.image.width?a.setTexture(K.map,0):a.setTexture(x,0),y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}y.enable(y.CULL_FACE),a.resetGLState()}}},THREE.GeometryUtils={merge:function(a,b,c){THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry),a.merge(b,d,c)},center:function(a){return THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),a.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);return e.load(a,function(a){f.image=a,f.needsUpdate=!0,c&&c(f)},void 0,function(a){d&&d(a)}),f.sourceFile=a,f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a,g+=1,6===g&&(f.needsUpdate=!0,c&&c(f))},void 0,d)};for(var h=0,i=a.length;i>h;++h)b(h);return f},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");f.width=d,f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,i=g.createImageData(d,e),j=i.data,k=0;d>k;k++)for(var l=0;e>l;l++){var m=0>l-1?0:l-1,n=l+1>e-1?e-1:l+1,o=0>k-1?0:k-1,p=k+1>d-1?d-1:k+1,q=[],r=[0,0,h[4*(l*d+k)]/255*b];for(q.push([-1,0,h[4*(l*d+o)]/255*b]),q.push([-1,-1,h[4*(m*d+o)]/255*b]),q.push([0,-1,h[4*(m*d+k)]/255*b]),q.push([1,-1,h[4*(m*d+p)]/255*b]),q.push([1,0,h[4*(l*d+p)]/255*b]),q.push([1,1,h[4*(n*d+p)]/255*b]),q.push([0,1,h[4*(n*d+k)]/255*b]),q.push([-1,1,h[4*(n*d+o)]/255*b]),m=[],o=q.length,n=0;o>n;n++){var p=q[n],s=q[(n+1)%o],p=[p[0]-r[0],p[1]-r[1],p[2]-r[2]],s=[s[0]-r[0],s[1]-r[1],s[2]-r[2]];m.push(c([p[1]*s[2]-p[2]*s[1],p[2]*s[0]-p[0]*s[2],p[0]*s[1]-p[1]*s[0]]))}for(q=[0,0,0],n=0;nh;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;return a=new THREE.DataTexture(e,a,b,THREE.RGBFormat),a.needsUpdate=!0,a}},THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;e>d;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld),b.remove(a),c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld),a.applyMatrix(d),b.remove(a),c.add(a)}},THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(a){var b=a.familyName.toLowerCase();return this.faces[b]=this.faces[b]||{},this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{},this.faces[b][a.cssFontWeight][a.cssFontStyle]=a,this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;f>a;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=[],r=b.glyphs[a]||b.glyphs["?"];if(r){if(r.o)for(b=r._cachedOutline||(r._cachedOutline=r.o.split(" ")),i=b.length,a=0;i>a;)switch(h=b[a++]){case"m":h=b[a++]*c+d,j=b[a++]*c,e.moveTo(h,j);break;case"l":h=b[a++]*c+d,j=b[a++]*c,e.lineTo(h,j);break;case"q":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,e.quadraticCurveTo(m,n,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++){var s=f/g;THREE.Shape.Utils.b2(s,k,m,h),THREE.Shape.Utils.b2(s,l,n,j)}break;case"b":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,o=b[a++]*c+d,p=b[a++]*c,e.bezierCurveTo(m,n,o,p,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++)s=f/g,THREE.Shape.Utils.b3(s,k,m,o,h),THREE.Shape.Utils.b3(s,l,n,p,j)}return{offset:r.ha*c,path:e}}}},THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";for(THREE.FontUtils.size=void 0!==b.size?b.size:100,THREE.FontUtils.divisions=c,THREE.FontUtils.face=d,THREE.FontUtils.weight=e,THREE.FontUtils.style=f,c=THREE.FontUtils.drawText(a).paths,d=[],e=0,f=c.length;f>e;e++)Array.prototype.push.apply(d,c[e].toShapes());return d},function(a){var b=function(a){for(var b=a.length,c=0,d=b-1,e=0;b>e;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c};return a.Triangulate=function(a,c){var d=a.length;if(3>d)return null;var e,f,g,h=[],i=[],j=[];if(0f;f++)i[f]=f;else for(f=0;d>f;f++)i[f]=d-1-f;var k=2*d;for(f=d-1;d>2;){if(0>=k--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}e=f,e>=d&&(e=0),f=e+1,f>=d&&(f=0),g=f+1,g>=d&&(g=0);var l;a:{var m=l=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,m=a[i[e]].x,n=a[i[e]].y,o=a[i[f]].x,p=a[i[f]].y,q=a[i[g]].x,r=a[i[g]].y;if(1e-10>(o-m)*(r-n)-(p-n)*(q-m))l=!1;else{var u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,C=B=A=t=s=void 0,u=q-o,v=r-p,w=m-q,x=n-r,y=o-m,z=p-n;for(l=0;d>l;l++)if(s=a[i[l]].x,t=a[i[l]].y,!(s===m&&t===n||s===o&&t===p||s===q&&t===r)&&(A=s-m,B=t-n,C=s-o,D=t-p,s-=q,t-=r,C=u*D-v*C,A=y*B-z*A,B=w*t-x*s,C>=-1e-10&&B>=-1e-10&&A>=-1e-10)){l=!1;break a}l=!0}}if(l){for(h.push([a[i[e]],a[i[f]],a[i[g]]]),j.push([i[e],i[f],i[g]]),e=f,g=f+1;d>g;e++,g++)i[e]=i[g];d--,k=2*d}}return c?j:h},a.Triangulate.area=b,a}(THREE.FontUtils),self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace},THREE.typeface_js=self._typeface_js,THREE.Audio=function(a){THREE.Object3D.call(this),this.type="Audio",this.context=a.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;return c.open("GET",a,!0),c.responseType="arraybuffer",c.onload=function(){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a,b.autoplay&&b.play()})},c.send(),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)THREE.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer,a.loop=this.source.loop,a.onended=this.source.onended,a.connect(this.panner),a.start(0,this.startTime),this.isPlaying=!0,this.source=a}},THREE.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},THREE.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(a){this.source.loop=a},THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a},THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a},THREE.Audio.prototype.setVolume=function(a){this.gain.gain.value=a},THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b),a.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(a.x,a.y,a.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g){THREE.Object3D.prototype.updateMatrixWorld.call(this,g),g=this.context.listener;var h=this.up;this.matrixWorld.decompose(a,b,c),d.set(0,0,-1).applyQuaternion(b),e.subVectors(a,f),g.setPosition(a.x,a.y,a.z),g.setOrientation(d.x,d.y,d.z,h.x,h.y,h.z),g.setVelocity(e.x,e.y,e.z),f.copy(a)}}(),THREE.Curve=function(){},THREE.Curve.prototype.getPoint=function(){return THREE.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},THREE.Curve.prototype.getPointAt=function(a){return a=this.getUtoTmapping(a),this.getPoint(a)},THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPoint(b/a));return c},THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPointAt(b/a));return c},THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]},THREE.Curve.prototype.getLengths=function(a){if(a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b,c,d=[],e=this.getPoint(0),f=0;for(d.push(0),c=1;a>=c;c++)b=this.getPoint(c/a),f+=b.distanceTo(e),d.push(f),e=b;return this.cacheArcLengths=d},THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},THREE.Curve.prototype.getUtoTmapping=function(a,b){var c,d=this.getLengths(),e=0,f=d.length;c=b?b:a*d[f-1];for(var g,h=0,i=f-1;i>=h;)if(e=Math.floor(h+(i-h)/2),g=d[e]-c,0>g)h=e+1;else{if(!(g>0)){i=e;break}i=e-1}return e=i,d[e]==c?e/(f-1):(h=d[e],d=(e+(c-h)/(d[e+1]-h))/(f-1))},THREE.Curve.prototype.getTangent=function(a){var b=a-1e-4;return a+=1e-4,0>b&&(b=0),a>1&&(a=1),b=this.getPoint(b),this.getPoint(a).clone().sub(b).normalize()},THREE.Curve.prototype.getTangentAt=function(a){return a=this.getUtoTmapping(a),this.getTangent(a)},THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a),d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}},THREE.Curve.create=function(a,b){return a.prototype=Object.create(THREE.Curve.prototype),a.prototype.constructor=a,a.prototype.getPoint=b,a},THREE.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(a){this.curves.push(a)},THREE.CurvePath.prototype.checkConnection=function(){},THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))},THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null},THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a,b=[],c=0,d=this.curves.length;for(a=0;d>a;a++)c+=this.curves[a].getLength(),b.push(c);return this.cacheLengths=b},THREE.CurvePath.prototype.getBoundingBox=function(){var a,b,c,d,e,f,g=this.getPoints();a=b=Number.NEGATIVE_INFINITY,d=e=Number.POSITIVE_INFINITY;var h,i,j,k,l=g[0]instanceof THREE.Vector3;for(k=l?new THREE.Vector3:new THREE.Vector2,i=0,j=g.length;j>i;i++)h=g[i],h.x>a?a=h.x:h.xb?b=h.y:h.yc?c=h.z:h.zc;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c,d,e=this.getSpacedPoints(a);for(b||(b=this.bends),c=0,d=b.length;d>c;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c,d,e,f,g,h,i=this.getBoundingBox();for(c=0,d=a.length;d>c;c++)e=a[c],f=e.x,g=e.y,h=f/i.maxX,h=b.getUtoTmapping(h,f),f=b.getPoint(h),h=b.getTangent(h),h.set(-h.y,h.x).multiplyScalar(g),e.x=f.x+h.x,e.y=f.y+h.y;return a},THREE.Gyroscope=function(){THREE.Object3D.call(this)},THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype),THREE.Gyroscope.prototype.constructor=THREE.Gyroscope,THREE.Gyroscope.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Quaternion,f=new THREE.Vector3;return function(g){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||g)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(d,e,f),this.matrix.decompose(a,b,c),this.matrixWorld.compose(d,b,f)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,g=!0);for(var h=0,i=this.children.length;i>h;h++)this.children[h].updateMatrixWorld(g)}}(),THREE.Path=function(a){THREE.CurvePath.call(this),this.actions=[],a&&this.fromPoints(a)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},THREE.Path.prototype.fromPoints=function(a){this.moveTo(a[0].x,a[0].y); for(var b=1,c=a.length;c>b;b++)this.lineTo(a[b].x,a[b].y)},THREE.Path.prototype.moveTo=function(){var a=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:a})},THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),d=this.actions[this.actions.length-1].args,d=new THREE.LineCurve(new THREE.Vector2(d[d.length-2],d[d.length-1]),new THREE.Vector2(a,b));this.curves.push(d),this.actions.push({action:THREE.PathActions.LINE_TO,args:c})},THREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args,f=new THREE.QuadraticBezierCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d));this.curves.push(f),this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:e})},THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args,h=new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,f));this.curves.push(h),this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:g})},THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a),c=new THREE.SplineCurve(c),this.curves.push(c),this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})},THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)},THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)},THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)},THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(i),i=i.getPoint(1),h.push(i.x),h.push(i.y),this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})},THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;a>c;c++)b.push(this.getPoint(c/a));return b},THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[];for(c=0,d=this.actions.length;d>c;c++)switch(e=this.actions[c],f=e.action,e=e.args,f){case THREE.PathActions.MOVE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.LINE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:for(g=e[2],h=e[3],k=e[0],l=e[1],0=e;e++)o=e/a,f=THREE.Shape.Utils.b2(o,m,k,g),o=THREE.Shape.Utils.b2(o,n,l,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.BEZIER_CURVE_TO:for(g=e[4],h=e[5],k=e[0],l=e[1],i=e[2],j=e[3],0=e;e++)o=e/a,f=THREE.Shape.Utils.b3(o,m,k,i,g),o=THREE.Shape.Utils.b3(o,n,l,j,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.CSPLINE_THRU:for(f=this.actions[c-1].args,o=[new THREE.Vector2(f[f.length-2],f[f.length-1])],f=a*e[0].length,o=o.concat(e[0]),o=new THREE.SplineCurve(o),e=1;f>=e;e++)p.push(o.getPointAt(e/f));break;case THREE.PathActions.ARC:for(g=e[0],h=e[1],l=e[2],i=e[3],f=e[4],k=!!e[5],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+l*Math.sin(o),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.ELLIPSE:for(g=e[0],h=e[1],l=e[2],j=e[3],i=e[4],f=e[5],k=!!e[6],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+j*Math.sin(o),p.push(new THREE.Vector2(f,o))}return c=p[p.length-1],1e-10>Math.abs(c.x-p[0].x)&&1e-10>Math.abs(c.y-p[0].y)&&p.splice(p.length-1,1),b&&p.push(p[0]),p},THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions,f.curves=e.curves,b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;c>f;e=f++){var g=b[e],h=b[f],i=h.x-g.x,j=h.y-g.y;if(1e-10j&&(g=b[f],i=-i,h=b[e],j=-j),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{if(e=j*(a.x-g.x)-i*(a.y-g.y),0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;for(b=0,c=a.length;c>b;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);return 0!=g.actions.length&&f.push(g),f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,i=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,i.push(h),i;var j=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),j=a?!j:j;h=[];var k,l=[],m=[],n=0;l[n]=void 0,m[n]=[];var o,p;for(o=0,p=e.length;p>o;o++)g=e[o],k=g.getPoints(),f=THREE.Shape.Utils.isClockWise(k),(f=a?!f:f)?(!j&&l[n]&&n++,l[n]={s:new THREE.Shape,p:k},l[n].s.actions=g.actions,l[n].s.curves=g.curves,j&&n++,m[n]=[]):m[n].push({h:g,p:k[0]});if(!l[0])return c(e);if(1g;g++)h[g]=[];for(g=0,e=l.length;e>g;g++)for(f=m[g],j=0;jo;o++)for(h=l[o].s,i.push(h),g=m[o],e=0,f=g.length;f>e;e++)h.holes.push(g[e].h);return i},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)},THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)},THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d},THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d},THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}},THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)},THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}},THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x0){if(0>n||n>m)return[];if(i=j*k-i*l,0>i||i>m)return[]}else{if(n>0||m>n)return[];if(i=j*k-i*l,i>0||m>i)return[]}return 0==i?!f||0!=n&&n!=m?[a]:[]:i==m?!f||0!=n&&n!=m?[b]:[]:0==n?[d]:n==m?[e]:(f=i/m,[{x:a.x+f*g,y:a.y+f*h}])}return 0!=n||j*k!=i*l?[]:(h=0==g&&0==h,i=0==i&&0==j,h&&i?a.x!=d.x||a.y!=d.y?[]:[a]:h?c(d,e,a)?[a]:[]:i?c(a,b,d)?[d]:[]:(0!=g?(a.x=i?m>a?[]:a==m?f?[]:[b]:d>=a?[b,h]:[b,j]:i>d?[]:i==d?f?[]:[g]:d>=a?[g,h]:[g,j]))}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x,c=c.y-a.y;var g=d.x-a.x;return d=d.y-a.y,a=e*c-f*b,e=e*d-f*g,1e-100?e>=0&&b>=0:e>=0||b>=0):e>0}var f,g,h,i,j,k={};for(h=a.concat(),f=0,g=b.length;g>f;f++)Array.prototype.push.apply(h,b[f]);for(f=0,g=h.length;g>f;f++)j=h[f].x+":"+h[f].y,void 0!==k[j]&&THREE.warn("THREE.Shape: Duplicate point",j),k[j]=f;f=function(a,b){function c(a,b){var c=q.length-1,d=a-1;0>d&&(d=c);var f=a+1;return f>c&&(f=0),(c=e(q[a],q[d],q[f],h[b]))?(c=h.length-1,d=b-1,0>d&&(d=c),f=b+1,f>c&&(f=0),(c=e(h[b],h[d],h[f],q[a]))?!0:!1):!1}function f(a,b){var c,e;for(c=0;ct;t++)r.push(t);n=0;for(var u=2*r.length;0u){console.log("Infinite Loop! Holes left:"+r.length+", Probably Hole outside Shape!");break}for(j=n;j=0)break;s[m]=!0}if(i>=0)break}}return q}(a,b);var l=THREE.FontUtils.Triangulate(f,!1);for(f=0,g=l.length;g>f;f++)for(i=l[f],h=0;3>h;h++)j=i[h].x+":"+i[h].y,j=k[j],void 0!==j&&(i[h]=j);return l.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}},THREE.LineCurve=function(a,b){this.v1=a,this.v2=b},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);return b.multiplyScalar(a).add(this.v1),b},THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)},THREE.LineCurve.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a,this.v1=b,this.v2=c},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b},THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;return b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y),b.normalize()},THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;return b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new THREE.Vector2(b,a)},THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;return b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b=new THREE.Vector2(b,a),b.normalize(),b},THREE.SplineCurve=function(a){this.points=void 0==a?[]:a},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector2;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c},THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a,this.aY=b,this.xRadius=c,this.yRadius=d,this.aStartAngle=e,this.aEndAngle=f,this.aClockwise=g},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;return 0>b&&(b+=2*Math.PI),b>2*Math.PI&&(b-=2*Math.PI),a=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b,b=new THREE.Vector2,b.x=this.aX+this.xRadius*Math.cos(a),b.y=this.aY+this.yRadius*Math.sin(a),b},THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a,this.v2=b},function(a){var b=new THREE.Vector3;return b.subVectors(this.v2,this.v1),b.multiplyScalar(a),b.add(this.v1),b}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a,this.v1=b,this.v2=c},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z),b}),THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z),b}),THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(c>0?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){THREE.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){THREE.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){THREE.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;ba.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){for(d={},c=0;ca;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var d=this.data.name,e=c.animationCache.animations,f=e[d];for(void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f),c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.timee.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e,f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a].animationCache;void 0!==c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c,d,e,g,h,i,j=[],k=[];return c=(a.length-1)*b,d=Math.floor(c),c-=d,j[0]=0===d?d:d-1,j[1]=d,j[2]=d>a.length-2?d:d+1,j[3]=d>a.length-3?d:d+2,d=a[j[0]],g=a[j[1]],h=a[j[2]],i=a[j[3]],j=c*c,e=c*j,k[0]=f(d[0],g[0],h[0],i[0],c,j,e),k[1]=f(d[1],g[1],h[1],i[1],c,j,e),k[2]=f(d[2],g[2],h[2],i[2],c,j,e),k},f=function(a,b,c,d,e,f,g){return a=.5*(c-a),d=.5*(d-b),(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length,(this.currentTime>f||0>this.currentTime)&&(this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop()),f=0;for(var g=this.hierarchy.length;g>f;f++)for(var h=this.hierarchy[f],i=h.animationCache.animations[this.data.name],j=h.animationCache.blending,k=0;3>k;k++){var l=this.keyTypes[k],m=i.prevKey[l],n=i.nextKey[l];if(0this.timeScale&&m.time>=this.currentTime){for(m=this.data.hierarchy[f].keys[0],n=this.getNextKeyWith(l,f,1);n.timem.index;)m=n,n=this.getNextKeyWith(l,f,n.index+1);i.prevKey[l]=m,i.nextKey[l]=n}var o=(this.currentTime-m.time)/(n.time-m.time),p=m[l],q=n[l];0>o&&(o=0),o>1&&(o=1),"pos"===l?this.interpolationType===THREE.AnimationHandler.LINEAR?(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.positionWeight),h.position.lerp(c,m),j.positionWeight+=this.weight):(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)&&(a[0]=this.getPrevKeyWith("pos",f,m.index-1).pos,a[1]=p,a[2]=q,a[3]=this.getNextKeyWith("pos",f,n.index+1).pos,o=.33*o+.33,n=e(a,o),m=this.weight/(this.weight+j.positionWeight),j.positionWeight+=this.weight,l=h.position,l.x+=(n[0]-l.x)*m,l.y+=(n[1]-l.y)*m,l.z+=(n[2]-l.z)*m,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(o=e(a,1.01*o),b.set(o[0],o[1],o[2]),b.sub(l),b.y=0,b.normalize(),o=Math.atan2(b.x,b.z),h.rotation.set(0,o,0))):"rot"===l?(THREE.Quaternion.slerp(p,q,d,o),0===j.quaternionWeight?(h.quaternion.copy(d),j.quaternionWeight=this.weight):(m=this.weight/(this.weight+j.quaternionWeight),THREE.Quaternion.slerp(h.quaternion,d,h.quaternion,m),j.quaternionWeight+=this.weight)):"scl"===l&&(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.scaleWeight),h.scale.lerp(c,m),j.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c0?c:0:c>=0?c:c+d.length;c>=0;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}},THREE.KeyFrameAnimation=function(a){this.root=a.node,this.data=THREE.AnimationHandler.init(a),this.hierarchy=THREE.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.loop=this.isPaused=!0,a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;ea;a++)b=this.hierarchy[a],c=this.data.hierarchy[a],void 0===c.animationCache&&(c.animationCache={},c.animationCache.prevKey=null,c.animationCache.nextKey=null,c.animationCache.originalMatrix=b.matrix),b=this.data.hierarchy[a].keys,b.length&&(c.animationCache.prevKey=b[0],c.animationCache.nextKey=b[1],this.startTime=Math.min(b[0].time,this.startTime),this.endTime=Math.max(b[b.length-1].time,this.endTime));this.update(0)}this.isPaused=!1,THREE.AnimationHandler.play(this)},stop:function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.stop(this);for(var a=0;aa&&(this.currentTime%=a),this.currentTime=Math.min(this.currentTime,a),a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a],d=this.data.hierarchy[a],e=d.keys,d=d.animationCache;if(e.length){var f=d.prevKey,g=d.nextKey;if(g.time<=this.currentTime){for(;g.timef.index;)f=g,g=e[f.index+1];d.prevKey=f,d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time),this.data.hierarchy[a].node.updateMatrix(),c.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(a,b,c){for(b=this.data.hierarchy[b].keys,c%=b.length;c=0?c:c+b.length;c>=0;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]}},THREE.MorphAnimation=function(a){this.mesh=a,this.frames=a.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.currentFrame=this.lastFrame=0,this.isPlaying=!1},THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration),a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!=this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b),c[b]=this.currentTime%a/a,c[this.lastFrame]=1-c[b]}}},THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,i){var j,k=h.widthSegments,l=h.heightSegments,m=e/2,n=f/2,o=h.vertices.length;"x"===a&&"y"===b||"y"===a&&"x"===b?j="z":"x"===a&&"z"===b||"z"===a&&"x"===b?(j="y",l=h.depthSegments):("z"===a&&"y"===b||"y"===a&&"z"===b)&&(j="x",k=h.depthSegments);var p=k+1,q=l+1,r=e/k,s=f/l,t=new THREE.Vector3;for(t[j]=g>0?1:-1,e=0;q>e;e++)for(f=0;p>f;f++){var u=new THREE.Vector3;u[a]=(f*r-m)*c,u[b]=(e*s-n)*d,u[j]=g,h.vertices.push(u)}for(e=0;l>e;e++)for(f=0;k>f;f++)n=f+p*e,a=f+p*(e+1),b=f+1+p*(e+1),c=f+1+p*e,d=new THREE.Vector2(f/k,1-e/l),g=new THREE.Vector2(f/k,1-(e+1)/l),j=new THREE.Vector2((f+1)/k,1-(e+1)/l),m=new THREE.Vector2((f+1)/k,1-e/l),n=new THREE.Face3(n+o,a+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([d,g,m]),n=new THREE.Face3(a+o,b+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([g.clone(),j,m.clone()])}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f},this.widthSegments=d||1,this.heightSegments=e||1,this.depthSegments=f||1;var h=this;d=a/2,e=b/2,f=c/2,g("z","y",-1,-1,c,b,d,0),g("z","y",1,-1,c,b,-d,1),g("x","z",1,1,a,c,e,2),g("x","z",1,-1,a,c,-e,3),g("x","y",1,-1,a,b,f,4),g("x","y",-1,-1,a,b,-f,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d},a=a||50,b=void 0!==b?Math.max(3,b):8,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);for(this.vertices.push(e),f.push(g),e=0;b>=e;e++){var h=new THREE.Vector3,i=c+e/b*d;h.x=a*Math.cos(i),h.y=a*Math.sin(i),this.vertices.push(h),f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}for(c=new THREE.Vector3(0,0,1),e=1;b>=e;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CubeGeometry=function(a,b,c,d,e,f){return THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new THREE.BoxGeometry(a,b,c,d,e,f)},THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h},a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,d=d||8,e=e||1,f=void 0!==f?f:!1,g=void 0!==g?g:0,h=void 0!==h?h:2*Math.PI;var i,j,k=c/2,l=[],m=[];for(j=0;e>=j;j++){var n=[],o=[],p=j/e,q=p*(b-a)+a;for(i=0;d>=i;i++){var r=i/d,s=new THREE.Vector3;s.x=q*Math.sin(r*h+g),s.y=-p*c+k,s.z=q*Math.cos(r*h+g),this.vertices.push(s),n.push(this.vertices.length-1),o.push(new THREE.Vector2(r,1-p))}l.push(n),m.push(o)}for(c=(b-a)/c,i=0;d>i;i++)for(0!==a?(g=this.vertices[l[0][i]].clone(),h=this.vertices[l[0][i+1]].clone()):(g=this.vertices[l[1][i]].clone(),h=this.vertices[l[1][i+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),j=0;e>j;j++){var n=l[j][i],o=l[j+1][i],p=l[j+1][i+1],q=l[j][i+1],r=g.clone(),s=g.clone(),t=h.clone(),u=h.clone(),v=m[j][i].clone(),w=m[j+1][i].clone(),x=m[j+1][i+1].clone(),y=m[j][i+1].clone();this.faces.push(new THREE.Face3(n,o,q,[r,s,u])),this.faceVertexUvs[0].push([v,w,y]),this.faces.push(new THREE.Face3(o,p,q,[s.clone(),t,u.clone()])),this.faceVertexUvs[0].push([w.clone(),x,y.clone()])}if(!1===f&&a>0)for(this.vertices.push(new THREE.Vector3(0,k,0)),i=0;d>i;i++)n=l[0][i],o=l[0][i+1],p=this.vertices.length-1,r=new THREE.Vector3(0,1,0),s=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),v=m[0][i].clone(),w=m[0][i+1].clone(),x=new THREE.Vector2(w.x,0),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);if(!1===f&&b>0)for(this.vertices.push(new THREE.Vector3(0,-k,0)),i=0;d>i;i++)n=l[e][i+1],o=l[e][i],p=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),s=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),v=m[e][i+1].clone(),w=m[e][i].clone(),x=new THREE.Vector2(w.x,1),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.ExtrudeGeometry=function(a,b){"undefined"!=typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;c>d;d++)this.addShape(a[d],b)},THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){return b||THREE.error("THREE.ExtrudeGeometry: vec does not exist"),b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1e-10=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,d>1e-10?f>1e-10&&(a=!0):-1e-10>d?-1e-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(O=a.length;0<=--O;){c=O,d=O-1,0>d&&(d=a.length-1);for(var e=0,f=s+2*p,e=0;f>e;e++){var g=M*e,h=M*(e+1),i=b+c+g,g=b+d+g,j=b+d+h,h=b+c+h,i=i+C,g=g+C,j=j+C,h=h+C;B.faces.push(new THREE.Face3(i,g,h,null,null,w)),B.faces.push(new THREE.Face3(g,j,h,null,null,w)),i=x.generateSideWallUV(B,i,g,j,h),B.faceVertexUvs[0].push([i[0],i[1],i[3]]),B.faceVertexUvs[0].push([i[1],i[2],i[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=C,b+=C,c+=C,B.faces.push(new THREE.Face3(a,b,c,null,null,v)),a=x.generateTopUV(B,a,b,c),B.faceVertexUvs[0].push(a)}var h,i,j,k,l,m=void 0!==b.amount?b.amount:100,n=void 0!==b.bevelThickness?b.bevelThickness:6,o=void 0!==b.bevelSize?b.bevelSize:n-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,u=!1,v=b.material,w=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;t&&(h=t.getSpacedPoints(s),u=!0,q=!1,i=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3),q||(o=n=p=0);var y,z,A,B=this,C=this.vertices.length,t=a.extractPoints(r),r=t.shape,D=t.holes; if(t=!THREE.Shape.Utils.isClockWise(r)){for(r=r.reverse(),z=0,A=D.length;A>z;z++)y=D[z],THREE.Shape.Utils.isClockWise(y)&&(D[z]=y.reverse());t=!1}var E=THREE.Shape.Utils.triangulateShape(r,D),F=r;for(z=0,A=D.length;A>z;z++)y=D[z],r=r.concat(y);var G,H,I,J,K,L,M=r.length,N=E.length,t=[],O=0;for(I=F.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),t[O]=d(F[O],F[G],F[H]);var P,Q=[],R=t.concat();for(z=0,A=D.length;A>z;z++){for(y=D[z],P=[],O=0,I=y.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),P[O]=d(y[O],y[G],y[H]);Q.push(P),R=R.concat(P)}for(G=0;p>G;G++){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,-J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),f(K.x,K.y,-J)}for(H=o,O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[0]).multiplyScalar(K.x),j.copy(i.binormals[0]).multiplyScalar(K.y),l.copy(h[0]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,0);for(I=1;s>=I;I++)for(O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[I]).multiplyScalar(K.x),j.copy(i.binormals[I]).multiplyScalar(K.y),l.copy(h[I]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,m/s*I);for(G=p-1;G>=0;G--){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,m+J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),u?f(K.x,K.y+h[s-1].y,h[s-1].x+J):f(K.x,K.y,m+J)}!function(){if(q){var a;for(a=0*M,O=0;N>O;O++)L=E[O],g(L[2]+a,L[1]+a,L[0]+a);for(a=s+2*p,a*=M,O=0;N>O;O++)L=E[O],g(L[0]+a,L[1]+a,L[2]+a)}else{for(O=0;N>O;O++)L=E[O],g(L[2],L[1],L[0]);for(O=0;N>O;O++)L=E[O],g(L[0]+M*s,L[1]+M*s,L[2]+M*s)}}(),function(){var a=0;for(e(F,a),a+=F.length,z=0,A=D.length;A>z;z++)y=D[z],e(y,a),a+=y.length}()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){return a=a.vertices,b=a[b],c=a[c],d=a[d],[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){return a=a.vertices,b=a[b],c=a[c],d=a[d],e=a[e],.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,1-d.z),new THREE.Vector2(e.y,1-e.z)]}},THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this),this.type="ShapeGeometry",!1==a instanceof Array&&(a=[a]),this.addShapeList(a,b),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;d>c;c++)this.addShape(a[c],b);return this},THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c,d,e,f=b.material,g=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,h=this.vertices.length;c=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var i=c.shape,j=c.holes;if(!THREE.Shape.Utils.isClockWise(i))for(i=i.reverse(),c=0,d=j.length;d>c;c++)e=j[c],THREE.Shape.Utils.isClockWise(e)&&(j[c]=e.reverse());var k=THREE.Shape.Utils.triangulateShape(i,j);for(c=0,d=j.length;d>c;c++)e=j[c],i=i.concat(e);for(j=i.length,d=k.length,c=0;j>c;c++)e=i[c],this.vertices.push(new THREE.Vector3(e.x,e.y,0));for(c=0;d>c;c++)j=k[c],i=j[0]+h,e=j[1]+h,j=j[2]+h,this.faces.push(new THREE.Face3(i,e,j,null,null,f)),this.faceVertexUvs[0].push(g.generateTopUV(this,i,e,j))},THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:a,segments:b,phiStart:c,phiLength:d},b=b||12,c=c||0,d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;h>=g;g++)for(var i=c+g*f*d,j=Math.cos(i),k=Math.sin(i),i=0,l=a.length;l>i;i++){var m=a[i],n=new THREE.Vector3;n.x=j*m.x-k*m.y,n.y=k*m.x+j*m.y,n.z=m.z,this.vertices.push(n)}for(c=a.length,g=0,h=b;h>g;g++)for(i=0,l=a.length-1;l>i;i++){b=k=i+c*g,d=k+c;var j=k+1+c,k=k+1,m=g*f,n=i*e,o=m+f,p=n+e;this.faces.push(new THREE.Face3(b,d,k)),this.faceVertexUvs[0].push([new THREE.Vector2(m,n),new THREE.Vector2(o,n),new THREE.Vector2(m,p)]),this.faces.push(new THREE.Face3(d,j,k)),this.faceVertexUvs[0].push([new THREE.Vector2(o,n),new THREE.Vector2(o,p),new THREE.Vector2(m,p)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1,d=d||1;var g=c+1,h=d+1,i=a/c,j=b/d;b=new Float32Array(g*h*3),a=new Float32Array(g*h*3);for(var k=new Float32Array(g*h*2),l=0,m=0,n=0;h>n;n++)for(var o=n*j-f,p=0;g>p;p++)b[l]=p*i-e,b[l+1]=-o,a[l+2]=1,k[m]=p/c,k[m+1]=1-n/d,l+=3,m+=2;for(l=0,e=new(65535n;n++)for(p=0;c>p;p++)f=p+g*(n+1),h=p+1+g*(n+1),i=p+1+g*n,e[l]=p+g*n,e[l+1]=f,e[l+2]=i,e[l+3]=f,e[l+4]=h,e[l+5]=i,l+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1)),this.addAttribute("position",new THREE.BufferAttribute(b,3)),this.addAttribute("normal",new THREE.BufferAttribute(a,3)),this.addAttribute("uv",new THREE.BufferAttribute(k,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f},a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(1,d):8;var g,h=[],i=a,j=(b-a)/d;for(a=0;d+1>a;a++){for(g=0;c+1>g;g++){var k=new THREE.Vector3,l=e+g/c*f;k.x=i*Math.cos(l),k.y=i*Math.sin(l),this.vertices.push(k),h.push(new THREE.Vector2((k.x/b+1)/2,(k.y/b+1)/2))}i+=j}for(b=new THREE.Vector3(0,0,1),a=0;d>a;a++)for(e=a*(c+1),g=0;c>g;g++)f=l=g+e,j=l+c+1,k=l+c+2,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]),f=l,j=l+c+2,k=l+1,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,i)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g},a=a||50,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),d=void 0!==d?d:0,e=void 0!==e?e:2*Math.PI,f=void 0!==f?f:0,g=void 0!==g?g:Math.PI;var h,i,j=[],k=[];for(i=0;c>=i;i++){var l=[],m=[];for(h=0;b>=h;h++){var n=h/b,o=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+n*e)*Math.sin(f+o*g),p.y=a*Math.cos(f+o*g),p.z=a*Math.sin(d+n*e)*Math.sin(f+o*g),this.vertices.push(p),l.push(this.vertices.length-1),m.push(new THREE.Vector2(n,1-o))}j.push(l),k.push(m)}for(i=0;c>i;i++)for(h=0;b>h;h++){d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1];var l=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),n=this.vertices[f].clone().normalize(),o=this.vertices[g].clone().normalize(),p=k[i][h+1].clone(),q=k[i][h].clone(),r=k[i+1][h].clone(),s=k[i+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(p.x=(p.x+q.x)/2,this.faces.push(new THREE.Face3(d,f,g,[l,n,o])),this.faceVertexUvs[0].push([p,r,s])):Math.abs(this.vertices[f].y)===a?(r.x=(r.x+s.x)/2,this.faces.push(new THREE.Face3(d,e,f,[l,m,n])),this.faceVertexUvs[0].push([p,q,r])):(this.faces.push(new THREE.Face3(d,e,g,[l,m,o])),this.faceVertexUvs[0].push([p,q,s]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),n,o.clone()])),this.faceVertexUvs[0].push([q.clone(),r,s.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50,void 0===b.bevelThickness&&(b.bevelThickness=10),void 0===b.bevelSize&&(b.bevelSize=8),void 0===b.bevelEnabled&&(b.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,c,b),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e},a=a||100,b=b||40,c=c||8,d=d||6,e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],i=0;c>=i;i++)for(var j=0;d>=j;j++){var k=j/d*e,l=i/c*Math.PI*2;f.x=a*Math.cos(k),f.y=a*Math.sin(k);var m=new THREE.Vector3;m.x=(a+b*Math.cos(l))*Math.cos(k),m.y=(a+b*Math.cos(l))*Math.sin(k),m.z=b*Math.sin(l),this.vertices.push(m),g.push(new THREE.Vector2(j/d,i/c)),h.push(m.clone().sub(f).normalize())}for(i=1;c>=i;i++)for(j=1;d>=j;j++)a=(d+1)*i+j-1,b=(d+1)*(i-1)+j-1,e=(d+1)*(i-1)+j,f=(d+1)*i+j,k=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),k=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);return a*=b/c,b=Math.cos(a),f*=d*(2+b)*.5,g=d*(2+b)*g*.5,d=e*d*Math.sin(a)*.5,new THREE.Vector3(f,g,d)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g},a=a||100,b=b||40,c=c||64,d=d||8,e=e||2,f=f||3,g=g||1;for(var i=Array(c),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=0;c>m;++m){i[m]=Array(d);var n=m/c*2*e*Math.PI,o=h(n,f,e,a,g),n=h(n+.01,f,e,a,g);for(j.subVectors(n,o),k.addVectors(n,o),l.crossVectors(j,k),k.crossVectors(l,j),l.normalize(),k.normalize(),n=0;d>n;++n){var p=n/d*2*Math.PI,q=-b*Math.cos(p),p=b*Math.sin(p),r=new THREE.Vector3;r.x=o.x+q*k.x+p*l.x,r.y=o.y+q*k.y+p*l.y,r.z=o.z+q*k.z+p*l.z,i[m][n]=this.vertices.push(r)-1}}for(m=0;c>m;++m)for(n=0;d>n;++n)e=(m+1)%c,f=(n+1)%d,a=i[m][n],b=i[e][n],e=i[e][f],f=i[m][f],g=new THREE.Vector2(m/c,n/d),j=new THREE.Vector2((m+1)/c,n/d),k=new THREE.Vector2((m+1)/c,(n+1)/d),l=new THREE.Vector2(m/c,(n+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,j,l]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([j.clone(),k,l.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e},b=b||64,c=c||1,d=d||8,e=e||!1,f=f||THREE.TubeGeometry.NoTaper;var g,h,i,j,k,l,m,n,o,p,q=[],r=b+1,s=new THREE.Vector3;for(n=new THREE.TubeGeometry.FrenetFrames(a,b,e),o=n.normals,p=n.binormals,this.tangents=n.tangents,this.normals=o,this.binormals=p,n=0;r>n;n++)for(q[n]=[],i=n/(r-1),m=a.getPointAt(i),g=o[n],h=p[n],k=c*f(i),i=0;d>i;i++)j=i/d*2*Math.PI,l=-k*Math.cos(j),j=k*Math.sin(j),s.copy(m),s.x+=l*g.x+j*h.x,s.y+=l*g.y+j*h.y,s.z+=l*g.z+j*h.z,q[n][i]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(n=0;b>n;n++)for(i=0;d>i;i++)f=e?(n+1)%b:n+1,r=(i+1)%d,a=q[n][i],c=q[f][i],f=q[f][r],r=q[n][r],s=new THREE.Vector2(n/b,i/d),o=new THREE.Vector2((n+1)/b,i/d),p=new THREE.Vector2((n+1)/b,(i+1)/d),g=new THREE.Vector2(n/b,(i+1)/d),this.faces.push(new THREE.Face3(a,c,r)),this.faceVertexUvs[0].push([s,o,g]),this.faces.push(new THREE.Face3(c,f,r)),this.faceVertexUvs[0].push([o.clone(),p,g.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(){return 1},THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)},THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,i=new THREE.Matrix4;b+=1;var j,k,l;for(this.tangents=e,this.normals=f,this.binormals=g,j=0;b>j;j++)k=j/(b-1),e[j]=a.getTangentAt(k),e[j].normalize();for(f[0]=new THREE.Vector3,g[0]=new THREE.Vector3,a=Number.MAX_VALUE,j=Math.abs(e[0].x),k=Math.abs(e[0].y),l=Math.abs(e[0].z),a>=j&&(a=j,d.set(1,0,0)),a>=k&&(a=k,d.set(0,1,0)),a>=l&&d.set(0,0,1),h.crossVectors(e[0],d).normalize(),f[0].crossVectors(e[0],h),g[0].crossVectors(e[0],f[0]),j=1;b>j;j++)f[j]=f[j-1].clone(),g[j]=g[j-1].clone(),h.crossVectors(e[j-1],e[j]),1e-4j;j++)f[j].applyMatrix4(i.makeRotationAxis(e[j],d*j)),g[j].crossVectors(e[j],f[j])},THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;return a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5,b.uv=new THREE.Vector2(c,1-a),b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);i.faces.push(d),q.copy(a).add(b).add(c).divideScalar(3),d=Math.atan2(q.z,-q.x),i.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){for(var c=Math.pow(2,b),d=e(i.vertices[a.a]),g=e(i.vertices[a.b]),h=e(i.vertices[a.c]),j=[],k=0;c>=k;k++){j[k]=[];for(var l=e(d.clone().lerp(h,k/c)),m=e(g.clone().lerp(h,k/c)),n=c-k,o=0;n>=o;o++)j[k][o]=0==o&&k==c?l:e(l.clone().lerp(m,o/n))}for(k=0;c>k;k++)for(o=0;2*(c-k)-1>o;o++)d=Math.floor(o/2),0==o%2?f(j[k][d+1],j[k+1][d],j[k][d]):f(j[k][d+1],j[k+1][d+1],j[k+1][d])}function h(a,b,c){return 0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y)),0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y)),a.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:a,indices:b,radius:c,detail:d},c=c||1,d=d||0;for(var i=this,j=0,k=a.length;k>j;j+=3)e(new THREE.Vector3(a[j],a[j+1],a[j+2]));a=this.vertices;for(var l=[],m=j=0,k=b.length;k>j;j+=3,m++){var n=a[b[j]],o=a[b[j+1]],p=a[b[j+2]];l[m]=new THREE.Face3(n.index,o.index,p.index,[n.clone(),o.clone(),p.clone()])}for(var q=new THREE.Vector3,j=0,k=l.length;k>j;j++)g(l[j],d);for(j=0,k=this.faceVertexUvs[0].length;k>j;j++)b=this.faceVertexUvs[0][j],d=b[0].x,a=b[1].x,l=b[2].x,m=Math.max(d,Math.max(a,l)),n=Math.min(d,Math.min(a,l)),m>.9&&.1>n&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>l&&(b[2].x+=1));for(j=0,k=this.vertices.length;k>j;j++)this.vertices[j].multiplyScalar(c);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)},THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b),this.type="IcosahedronGeometry",this.parameters={radius:a,detail:b}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b},THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b),this.type="OctahedronGeometry",this.parameters={radius:a,detail:b}},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b),this.type="TetrahedronGeometry",this.parameters={radius:a,detail:b}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:a,slices:b,stacks:c};var d,e,f,g,h=this.vertices,i=this.faces,j=this.faceVertexUvs[0],k=b+1;for(d=0;c>=d;d++)for(g=d/c,e=0;b>=e;e++)f=e/b,f=a(f,g),h.push(f);var l,m,n,o;for(d=0;c>d;d++)for(e=0;b>e;e++)a=d*k+e,h=d*k+e+1,g=(d+1)*k+e+1,f=(d+1)*k+e,l=new THREE.Vector2(e/b,d/c),m=new THREE.Vector2((e+1)/b,d/c),n=new THREE.Vector2((e+1)/b,(d+1)/c),o=new THREE.Vector2(e/b,(d+1)/c),i.push(new THREE.Face3(a,h,f)),j.push([l,m,o]),i.push(new THREE.Face3(h,g,f)),j.push([m.clone(),n,o.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry,a.addAttribute("position",new THREE.BufferAttribute(b,3)),a.addAttribute("color",new THREE.BufferAttribute(c,3)),b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.Line.call(this,a,b,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);return b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),function(c,d,e,f,g,h){THREE.Object3D.call(this),void 0===f&&(f=16776960),void 0===e&&(e=1),void 0===g&&(g=.2*e),void 0===h&&(h=.2*g),this.position.copy(d),this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:f})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(c),this.setLength(e,g,h)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var a,b=new THREE.Vector3;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(b.set(c.z,0,-c.x).normalize(),a=Math.acos(c.y),this.quaternion.setFromAxisAngle(b,a))}}(),THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a),void 0===c&&(c=.2*b),this.line.scale.set(1,a-b,1),this.line.updateMatrix(),this.cone.scale.set(c,b,c),this.cone.position.y=a,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a),this.cone.material.color.set(a)},THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3)),THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==a&&this.update(a)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x,d[1]=b.y,d[2]=b.z,d[3]=c.x,d[4]=b.y,d[5]=b.z,d[6]=c.x,d[7]=b.y,d[8]=b.z,d[9]=c.x,d[10]=c.y,d[11]=b.z,d[12]=c.x,d[13]=c.y,d[14]=b.z,d[15]=b.x,d[16]=c.y,d[17]=b.z,d[18]=b.x,d[19]=c.y,d[20]=b.z,d[21]=b.x,d[22]=b.y,d[23]=b.z,d[24]=b.x,d[25]=b.y,d[26]=c.z,d[27]=c.x,d[28]=b.y,d[29]=c.z,d[30]=c.x,d[31]=b.y,d[32]=c.z,d[33]=c.x,d[34]=c.y,d[35]=c.z,d[36]=c.x,d[37]=c.y,d[38]=c.z,d[39]=b.x,d[40]=c.y,d[41]=c.z,d[42]=b.x,d[43]=c.y,d[44]=c.z,d[45]=b.x,d[46]=b.y,d[47]=c.z,d[48]=b.x,d[49]=b.y,d[50]=b.z,d[51]=b.x,d[52]=b.y,d[53]=c.z,d[54]=c.x,d[55]=b.y,d[56]=b.z,d[57]=c.x,d[58]=b.y,d[59]=c.z,d[60]=c.x,d[61]=c.y,d[62]=b.z,d[63]=c.x,d[64]=c.y,d[65]=c.z,d[66]=b.x,d[67]=c.y,d[68]=b.z,d[69]=b.x,d[70]=c.y,d[71]=c.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(a){function b(a,b,d){c(a,d),c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3),d.colors.push(new THREE.Color(b)),void 0===f[a]&&(f[a]=[]),f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200),b("n2","n4",16755200),b("n4","n3",16755200),b("n3","n1",16755200),b("f1","f2",16755200),b("f2","f4",16755200),b("f4","f3",16755200),b("f3","f1",16755200),b("n1","f1",16755200),b("n2","f2",16755200),b("n3","f3",16755200),b("n4","f4",16755200),b("p","n1",16711680),b("p","n2",16711680),b("p","n3",16711680),b("p","n4",16711680),b("u1","u2",43775),b("u2","u3",43775),b("u3","u1",43775),b("c","t",16777215),b("p","c",3355443),b("cn1","cn2",3355443),b("cn3","cn4",3355443),b("cf1","cf2",3355443),b("cf3","cf4",3355443),THREE.Line.call(this,d,e,THREE.LinePieces),this.camera=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=f,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){var a,b,c=new THREE.Vector3,d=new THREE.Camera,e=function(e,f,g,h){if(c.set(f,g,h).unproject(d),e=b[e],void 0!==e)for(f=0,g=e.length;g>f;f++)a.vertices[e[f]].copy(c)};return function(){a=this.geometry,b=this.pointMap,d.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-1,-1,-1),e("n2",1,-1,-1),e("n3",-1,1,-1),e("n4",1,1,-1),e("f1",-1,-1,1),e("f2",1,-1,1),e("f3",-1,1,1),e("f4",1,1,1),e("u1",.7,1.1,-1),e("u2",-.7,1.1,-1),e("u3",0,2,-1),e("cf1",-1,0,1),e("cf2",1,0,1),e("cf3",0,-1,1),e("cf4",0,1,1),e("cn1",-1,0,-1),e("cn2",1,0,-1),e("cn3",0,-1,-1),e("cn4",0,1,-1),a.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(c,d),this.add(this.lightPlane),c=new THREE.Geometry,c.vertices.push(new THREE.Vector3,new THREE.Vector3),d=new THREE.LineBasicMaterial({fog:!1}),d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(c,d),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld),b.setFromMatrixPosition(this.light.target.matrixWorld),c.subVectors(b,a),this.lightPlane.lookAt(c),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(c),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(a,b,c){b=void 0!==b?b:16777215,c=Math.cos(THREE.Math.degToRad(void 0!==c?c:1));var d,e=[0,0],f={},g=function(a,b){return a-b},h=["a","b","c"],i=new THREE.BufferGeometry;a.geometry instanceof THREE.BufferGeometry?(d=new THREE.Geometry,d.fromBufferGeometry(a.geometry)):d=a.geometry.clone(),d.mergeVertices(),d.computeFaceNormals();var j=d.vertices;d=d.faces;for(var k=0,l=0,m=d.length;m>l;l++)for(var n=d[l],o=0;3>o;o++){e[0]=n[h[o]],e[1]=n[h[(o+1)%3]],e.sort(g);var p=e.toString();void 0===f[p]?(f[p]={vert1:e[0],vert2:e[1],face1:l,face2:void 0},k++):f[p].face2=l}e=new Float32Array(6*k),g=0;for(p in f)h=f[p],(void 0===h.face2||d[h.face1].normal.dot(d[h.face2].normal)<=c)&&(k=j[h.vert1],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z,k=j[h.vert2],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z);i.addAttribute("position",new THREE.BufferAttribute(e,3)),THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:b}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,a=void 0!==c?c:16776960,d=void 0!==d?d:1,b=new THREE.Geometry,c=0;for(var e=this.object.geometry.faces.length;e>c;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;g>b;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e),a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}return this.geometry.verticesNeedUpdate=!0,this},THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var e=-a;a>=e;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a),this.color2.set(b),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(c,d),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(a,b){this.light=a,this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,c,d),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;ce;e++)for(var g=0,h=a[e].vertexNormals.length;h>g;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexNormals.length;l>k;k++){var m=j.vertexNormals[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,b=void 0!==c?c:255,d=void 0!==d?d:1,c=new THREE.Geometry,a=a.geometry.faces;for(var e=0,f=a.length;f>e;e++)for(var g=0,h=a[e].vertexTangents.length;h>g;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexTangents.length;l>k;k++){var m=j.vertexTangents[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).transformDirection(f).multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var i=a.geometry.vertices,j=a.geometry.faces,k=0,l=new Uint32Array(6*j.length),m=0,n=j.length;n>m;m++)for(var o=j[m],p=0;3>p;p++){d[0]=o[g[p]],d[1]=o[g[(p+1)%3]],d.sort(f);var q=d.toString();void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++)}for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)k=i[l[2*m+p]],g=6*m+3*p,d[g+0]=k.x,d[g+1]=k.y,d[g+2]=k.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){i=a.geometry.attributes.position.array,n=a.geometry.attributes.index.array,j=a.geometry.drawcalls,k=0,0===j.length&&(j=[{count:n.length,index:0,start:0}]);for(var l=new Uint32Array(2*n.length),o=0,r=j.length;r>o;++o)for(var p=j[o].start,q=j[o].count,g=j[o].index,m=p,s=p+q;s>m;m+=3)for(p=0;3>p;p++)d[0]=g+n[m+p],d[1]=g+n[m+(p+1)%3],d.sort(f),q=d.toString(),void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++);for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)g=6*m+3*p,k=3*l[2*m+p],d[g+0]=i[k],d[g+1]=i[k+1],d[g+2]=i[k+2]}else for(i=a.geometry.attributes.position.array,k=i.length/3,l=k/3,d=new Float32Array(6*k),m=0,n=l;n>m;m++)for(p=0;3>p;p++)g=18*m+6*p,l=9*m+3*p,d[g+0]=i[l],d[g+1]=i[l+1],d[g+2]=i[l+2],k=9*m+(p+1)%3*3,d[g+3]=i[k],d[g+4]=i[k+1],d[g+5]=i[k+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b),this.animationsMap={},this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[a]=b,this.animationsList.push(b)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b,c=/([a-z]+)_?(\d+)/,d={},e=this.geometry,f=0,g=e.morphTargets.length;g>f;f++){var h=e.morphTargets[f].name.match(c);if(h&&1h.end&&(h.end=f),b||(b=i)}}for(i in d)h=d[i],this.createAnimation(i,h.start,h.end,a);this.firstAnimation=b},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){(a=this.animationsMap[a])&&(a.direction=1,a.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){(a=this.animationsMap[a])&&(a.direction=-1,a.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;return(a=this.animationsMap[a])&&(b=a.time),b},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;return(a=this.animationsMap[a])&&(b=a.duration),b},THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(a){(a=this.animationsMap[a])&&(a.active=!1)},THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;c>b;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a,d.mirroredLoop?(d.time>d.duration||0>d.time)&&(d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)):(d.time%=d.duration,0>d.time&&(d.time+=d.duration));var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f),e=d.time%e/e,d.directionBackwards&&(e=1-e),this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}}; \ No newline at end of file +f.parent instanceof THREE.Bone&&(c.multiplyMatrices(b,f.matrixWorld),a.vertices[d].setFromMatrixPosition(c),c.multiplyMatrices(b,f.parent.matrixWorld),a.vertices[d+1].setFromMatrixPosition(c),d+=2)}a.verticesNeedUpdate=!0,a.computeBoundingSphere()},THREE.SpotLightHelper=function(a){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,a=new THREE.CylinderGeometry(0,1,1,8,1,!0),a.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),a.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var b=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(a,b),this.add(this.cone),this.update()},THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper,THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},THREE.SpotLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){var c=this.light.distance?this.light.distance:1e4,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c),a.setFromMatrixPosition(this.light.matrixWorld),b.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(b.sub(a)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),THREE.VertexNormalsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,b=void 0!==c?c:16711680,d=void 0!==d?d:1,c=new THREE.Geometry,a=a.geometry.faces;for(var e=0,f=a.length;f>e;e++)for(var g=0,h=a[e].vertexNormals.length;h>g;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexNormals.length;l>k;k++){var m=j.vertexNormals[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,b=void 0!==c?c:255,d=void 0!==d?d:1,c=new THREE.Geometry,a=a.geometry.faces;for(var e=0,f=a.length;f>e;e++)for(var g=0,h=a[e].vertexTangents.length;h>g;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexTangents.length;l>k;k++){var m=j.vertexTangents[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).transformDirection(f).multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var i=a.geometry.vertices,j=a.geometry.faces,k=0,l=new Uint32Array(6*j.length),m=0,n=j.length;n>m;m++)for(var o=j[m],p=0;3>p;p++){d[0]=o[g[p]],d[1]=o[g[(p+1)%3]],d.sort(f);var q=d.toString();void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++)}for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)k=i[l[2*m+p]],g=6*m+3*p,d[g+0]=k.x,d[g+1]=k.y,d[g+2]=k.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){i=a.geometry.attributes.position.array,n=a.geometry.attributes.index.array,j=a.geometry.drawcalls,k=0,0===j.length&&(j=[{count:n.length,index:0,start:0}]);for(var l=new Uint32Array(2*n.length),o=0,r=j.length;r>o;++o)for(var p=j[o].start,q=j[o].count,g=j[o].index,m=p,s=p+q;s>m;m+=3)for(p=0;3>p;p++)d[0]=g+n[m+p],d[1]=g+n[m+(p+1)%3],d.sort(f),q=d.toString(),void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++);for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)g=6*m+3*p,k=3*l[2*m+p],d[g+0]=i[k],d[g+1]=i[k+1],d[g+2]=i[k+2]}else for(i=a.geometry.attributes.position.array,k=i.length/3,l=k/3,d=new Float32Array(6*k),m=0,n=l;n>m;m++)for(p=0;3>p;p++)g=18*m+6*p,l=9*m+3*p,d[g+0]=i[l],d[g+1]=i[l+1],d[g+2]=i[l+2],k=9*m+(p+1)%3*3,d[g+3]=i[k],d[g+4]=i[k+1],d[g+5]=i[k+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b),this.animationsMap={},this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[a]=b,this.animationsList.push(b)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b,c=/([a-z]+)_?(\d+)/,d={},e=this.geometry,f=0,g=e.morphTargets.length;g>f;f++){var h=e.morphTargets[f].name.match(c);if(h&&1h.end&&(h.end=f),b||(b=i)}}for(i in d)h=d[i],this.createAnimation(i,h.start,h.end,a);this.firstAnimation=b},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){(a=this.animationsMap[a])&&(a.direction=1,a.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){(a=this.animationsMap[a])&&(a.direction=-1,a.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;return(a=this.animationsMap[a])&&(b=a.time),b},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;return(a=this.animationsMap[a])&&(b=a.duration),b},THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(a){(a=this.animationsMap[a])&&(a.active=!1)},THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;c>b;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a,d.mirroredLoop?(d.time>d.duration||0>d.time)&&(d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)):(d.time%=d.duration,0>d.time&&(d.time+=d.duration));var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f),e=d.time%e/e,d.directionBackwards&&(e=1-e),this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}},Detector={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(a){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var a=document.createElement("div");return a.id="webgl-error-message",a.style.fontFamily="arial",a.style.fontSize="13px",a.style.fontWeight="normal",a.style.textAlign="center",a.style.background="#222222",a.style.color="#ffffff",a.style.padding="1.5em",a.style.width="100%",a.style.margin="5em auto 0",a.style.zIndex="500000",a.style.position="absolute",a.style.pointerEvents="all",this.webgl||(a.innerHTML=['Either your graphics card or your browser does not support WebGL.. Try Google Chrome
    ','or view a list of WebGL compatible browsers.'].join("\n")),a},addGetWebGLMessage:function(a){var b,c,d;a=a||{},b=void 0!==a.parent?a.parent:document.body,c=void 0!==a.id?a.id:"oldie",d=Detector.getWebGLErrorMessage(),d.id=c,b.appendChild(d)}},window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}());var THREEx=THREEx||{};THREEx.KeyboardState=function(){this.keyCodes={},this.modifiers={};var a=this;this._onKeyDown=function(b){a._onKeyChange(b,!0)},this._onKeyUp=function(b){a._onKeyChange(b,!1)},document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)},THREEx.KeyboardState.prototype.destroy=function(){document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)},THREEx.KeyboardState.MODIFIERS=["shift","ctrl","alt","meta"],THREEx.KeyboardState.ALIAS={left:37,up:38,right:39,down:40,space:32,pageup:33,pagedown:34,tab:9},THREEx.KeyboardState.prototype._onKeyChange=function(a,b){var c=a.keyCode;this.keyCodes[c]=b,this.modifiers.shift=a.shiftKey,this.modifiers.ctrl=a.ctrlKey,this.modifiers.alt=a.altKey,this.modifiers.meta=a.metaKey},THREEx.KeyboardState.prototype.pressed=function(a){for(var b=a.split("+"),c=0;cd&&(d=c),a.setSize(d,window.innerHeight),b.aspect=d/window.innerHeight,b.updateProjectionMatrix()};return window.addEventListener("resize",c,!1),{stop:function(){window.removeEventListener("resize",c)}}}; \ No newline at end of file From f54f866b0a5ce13cab394e2cefc4b1849baf95e5 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Mar 2015 15:59:54 -0400 Subject: [PATCH 126/190] Fixed issue with keyboard events --- public/dataglobe.min.js | 2 +- src/main.coffee | 2 +- src/mousekeyboard.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 5c4b8f3..3e1954a 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,2 +1,2 @@ /*! dataglobe 20-03-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?k>g:g>k;h=k>=0?++g:--g)l=Math.floor(Math.random()*i.length),f=Math.floor(Math.random()*i.length),e=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],l===f&&(f=f===i.length-1?0:f+1),j={},j.src=b[i[l]],j.dest=b[i[f]],j.colour=e,m.push(j);return c(m)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;k=a("./dataloading"),p=a("./mousekeyboard"),z=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,y=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),z.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),y=new THREE.Object3D,v.add(y),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove,!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:z.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),z.initMeshPool(i.MESH_POOL_SIZE,y),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=a,b=l.loadGeoData(e,d),z.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a){return h=f,i=g,f=a.clientX-.5*window.innerWidth,g=a.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(camera.position.x-=.5*(f-h),camera.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.RingGeometry(2,1,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.outerRadius,this.innerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0?k>g:g>k;h=k>=0?++g:--g)l=Math.floor(Math.random()*i.length),f=Math.floor(Math.random()*i.length),e=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],l===f&&(f=f===i.length-1?0:f+1),j={},j.src=b[i[l]],j.dest=b[i[f]],j.colour=e,m.push(j);return c(m)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;k=a("./dataloading"),p=a("./mousekeyboard"),z=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,y=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),z.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),y=new THREE.Object3D,v.add(y),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove.bind(null,h),!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:z.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),z.initMeshPool(i.MESH_POOL_SIZE,y),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=a,b=l.loadGeoData(e,d),z.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.RingGeometry(2,1,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.outerRadius,this.innerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime scene.add camera # Event listeners - masterContainer.addEventListener 'mousemove', mouseKeyboard.onDocumentMouseMove, true + masterContainer.addEventListener 'mousemove', mouseKeyboard.onDocumentMouseMove.bind( null, camera ), true masterContainer.addEventListener 'mousedown', mouseKeyboard.onDocumentMouseDown, true masterContainer.addEventListener 'mouseup', mouseKeyboard.onDocumentMouseUp, false diff --git a/src/mousekeyboard.coffee b/src/mousekeyboard.coffee index 37a5724..630cb4f 100644 --- a/src/mousekeyboard.coffee +++ b/src/mousekeyboard.coffee @@ -45,7 +45,7 @@ module.exports = this.rotateX = rotateXMax rotateVX *= -0.95 - onDocumentMouseMove: ( event ) -> + onDocumentMouseMove: ( camera, event ) -> pmouseX = mouseX pmouseY = mouseY From b8ab00794cf8514a914e656e85e598610d36c2e9 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Mar 2015 16:14:02 -0400 Subject: [PATCH 127/190] grunt watch will no longer build thirdparty components --- Gruntfile.coffee | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index f83f460..d472982 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -7,7 +7,8 @@ module.exports = ( grunt ) -> pkg: grunt.file.readJSON 'package.json' clean: - [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/*.js' ] + all: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/*.js' ] + incr: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/public/<%= pkg.name %>.min.js' ] bower_concat: all: @@ -70,18 +71,22 @@ module.exports = ( grunt ) -> options: banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' - dist: + all: files: 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] 'public/thirdparty.min.js': [ '<%= concat.dist.dest %>' ] + incr: + files: + 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] + watch: files: [ 'Gruntfile.coffee' 'src/**/*.coffee' 'src/**/*.cjsx' ] - tasks: 'default' + tasks: 'incremental' grunt.loadNpmTasks 'grunt-coffee-react' grunt.loadNpmTasks 'grunt-contrib-coffee' @@ -92,4 +97,20 @@ module.exports = ( grunt ) -> grunt.loadNpmTasks 'grunt-bower-concat' grunt.loadNpmTasks 'grunt-contrib-concat' - grunt.registerTask 'default', [ 'clean', 'bower_concat', 'concat', 'cjsx', 'coffee', 'browserify', 'uglify' ] + grunt.registerTask 'default', [ + 'clean:all' + 'bower_concat:all' + 'concat:dist' + 'cjsx' + 'coffee' + 'browserify:production' + 'uglify:all' + ] + + grunt.registerTask 'incremental', [ + 'clean:incr' + 'cjsx' + 'coffee' + 'browserify:production' + 'uglify:incr' + ] From 25180b2204a23f1b686deecd65c98ac3f38ee8ab Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 20 Mar 2015 16:17:09 -0400 Subject: [PATCH 128/190] Updated README to reflect Bower. Also updated Bower package list --- README.md | 3 ++- bower.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 287517a..8e139e6 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,11 @@ This fork attempts to make the globe data-agnostic so that users can simply prov ## Building -To build this application you'll need an up-to-date copy of [Node.js](http://nodejs.org/), [Grunt CLI](http://gruntjs.com/), and [CoffeeScript](http://coffeescript.org/). Once all these are installed, simply run the following from within the `dataglobe` directory: +To build this application you'll need an up-to-date copy of [Node.js](http://nodejs.org/), [Grunt CLI](http://gruntjs.com/), [Bower](http://bower.io/), and [CoffeeScript](http://coffeescript.org/). Once all these are installed, simply run the following from within the `dataglobe` directory: ``` $ npm install +$ bower install $ grunt ``` And everything will be built for you. diff --git a/bower.json b/bower.json index ddf3c98..aa03230 100644 --- a/bower.json +++ b/bower.json @@ -16,6 +16,6 @@ ], "dependencies": { "react": "^0.13.1", - "threejs": "^0.0.71" + "threejs": "*" } } From ad15fabaefc90a9443a80b28014e6803ffa2e4da Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 25 Mar 2015 13:19:35 -0400 Subject: [PATCH 129/190] Fixed hack for explosions where the geometry was inside-out. Now we tell THREE to just render the back side of the material. --- public/dataglobe.min.js | 4 ++-- src/visualize.coffee | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 3e1954a..258d1a1 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,2 +1,2 @@ -/*! dataglobe 20-03-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?k>g:g>k;h=k>=0?++g:--g)l=Math.floor(Math.random()*i.length),f=Math.floor(Math.random()*i.length),e=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],l===f&&(f=f===i.length-1?0:f+1),j={},j.src=b[i[l]],j.dest=b[i[f]],j.colour=e,m.push(j);return c(m)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;k=a("./dataloading"),p=a("./mousekeyboard"),z=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,y=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),z.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),y=new THREE.Object3D,v.add(y),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove.bind(null,h),!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:z.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),z.initMeshPool(i.MESH_POOL_SIZE,y),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=a,b=l.loadGeoData(e,d),z.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.RingGeometry(2,1,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.outerRadius,this.innerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0?k>g:g>k;h=k>=0?++g:--g)l=Math.floor(Math.random()*i.length),f=Math.floor(Math.random()*i.length),e=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],l===f&&(f=f===i.length-1?0:f+1),j={},j.src=b[i[l]],j.dest=b[i[f]],j.colour=e,m.push(j);return c(m)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;k=a("./dataloading"),p=a("./mousekeyboard"),z=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,y=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),z.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),y=new THREE.Object3D,v.add(y),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove.bind(null,h),!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:z.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),z.initMeshPool(i.MESH_POOL_SIZE,y),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=a,b=l.loadGeoData(e,d),z.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,side:THREE.BackSide}),b=new THREE.RingGeometry(1,2,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.innerRadius,this.outerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime Date: Mon, 6 Apr 2015 11:27:04 -0400 Subject: [PATCH 130/190] Globe will now generate random timestamps, and data will be sorted by time --- package.json | 3 ++- public/dataglobe.min.js | 5 +++-- src/constants.coffee | 3 +++ src/dataloading.coffee | 5 +++++ src/main.coffee | 5 ++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d61af79..5ff93c1 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "dependencies": { "express": "^4.11.1", "react-tween-state": "0.0.4", - "serve-static": "^1.8.1" + "serve-static": "^1.8.1", + "underscore": "^1.8.3" }, "devDependencies": { "grunt": "^0.4.5", diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 258d1a1..d57ac92 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,2 +1,3 @@ -/*! dataglobe 25-03-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?k>g:g>k;h=k>=0?++g:--g)l=Math.floor(Math.random()*i.length),f=Math.floor(Math.random()*i.length),e=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],l===f&&(f=f===i.length-1?0:f+1),j={},j.src=b[i[l]],j.dest=b[i[f]],j.colour=e,m.push(j);return c(m)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;k=a("./dataloading"),p=a("./mousekeyboard"),z=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,y=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),z.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),y=new THREE.Object3D,v.add(y),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove.bind(null,h),!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:z.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),z.initMeshPool(i.MESH_POOL_SIZE,y),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=a,b=l.loadGeoData(e,d),z.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,side:THREE.BackSide}),b=new THREE.RingGeometry(1,2,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.innerRadius,this.outerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;y=a("underscore"),k=a("./dataloading"),p=a("./mousekeyboard"),A=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,z=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),A.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),z=new THREE.Object3D,v.add(z),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove.bind(null,h),!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:A.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),A.initMeshPool(i.MESH_POOL_SIZE,z),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=y.sortBy(a,"time"),b=l.loadGeoData(e,d),A.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,side:THREE.BackSide}),b=new THREE.RingGeometry(1,2,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.innerRadius,this.outerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e; +if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index 31c6dc3..2ee8161 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -13,3 +13,6 @@ module.exports = TRAIL_OPACITY_MULTIPLIER: 0.083 # this is just 1.0 / NUM_TRAIL_PARTICLES MESH_POOL_SIZE: 100 + + # For generating random dates + ONE_WEEK_IN_MILLIS: 604800000 diff --git a/src/dataloading.coffee b/src/dataloading.coffee index 4b4197b..f3e7661 100644 --- a/src/dataloading.coffee +++ b/src/dataloading.coffee @@ -14,12 +14,16 @@ module.exports = loadRandomizedContentData: ( numPoints, countries, callback ) -> toRet = [] keys = Object.keys countries + now = Date.now() for idx in [0...numPoints] srcIdx = Math.floor( Math.random() * keys.length ) destIdx = Math.floor( Math.random() * keys.length ) colourIdx = constants.COLOUR_TYPES[ Math.floor( Math.random() * constants.COLOUR_TYPES.length ) ] + # generate a random timestamp within the last week + backInTime = Math.floor( Math.random() * constants.ONE_WEEK_IN_MILLIS ) + # account for the rare cases where we get the same index if srcIdx is destIdx destIdx = if destIdx is keys.length - 1 then 0 else destIdx + 1 @@ -28,6 +32,7 @@ module.exports = point.src = countries[ keys[ srcIdx ] ] point.dest = countries[ keys[ destIdx ] ] point.colour = colourIdx + point.time = new Date( now - backInTime ) toRet.push point callback toRet diff --git a/src/main.coffee b/src/main.coffee index 92cb4c7..8a6d2b9 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -1,3 +1,6 @@ +# 3rd Party libraries +us = require 'underscore' + # All our dependencies dataLoading = require './dataloading' mouseKeyboard = require './mousekeyboard' @@ -163,7 +166,7 @@ else dataLoading.loadWorldPins 'country_lat_lon.json', ( latLonData ) -> _latLonData = latLonData dataLoading.loadRandomizedContentData 200, _countryLookup, ( sampleData ) -> - _sampleData = sampleData + _sampleData = us.sortBy sampleData, 'time' countryData = geopins.loadGeoData _latLonData, _countryLookup visualize.buildDataVizGeometries _sampleData, countryData From f819485624bbf78315a09e9fcb11db3ce8ba30e0 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 6 Apr 2015 12:26:34 -0400 Subject: [PATCH 131/190] We now visualize data according to timestamp --- public/dataglobe.min.js | 4 +-- src/constants.coffee | 4 +++ src/main.coffee | 64 ++++++++++++++++++++++++++++++++++------- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index d57ac92..a2c5a95 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 06-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A;y=a("underscore"),k=a("./dataloading"),p=a("./mousekeyboard"),A=a("./visualize"),l=a("./geopins"),i=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),o=document.getElementById("visualization"),r=document.getElementById("visualization"),m=document.getElementById("glContainer"),v=null,u=null,w=null,h=null,z=null,s=null,d=null,e=null,f=null,j=0,q=5,x=function(){return window.setInterval(function(){var a;a=j+5,a>f.length&&(a=f.length),A.initVisualization(f.slice(j,a)),s.handleProgressUpdate(a/f.length),j=(j+5)%f.length},500)},n=function(){var a,b,c,d,e,f;return w=new THREE.Scene,w.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,w.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,w.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,w.add(c),v=new THREE.Object3D,w.add(v),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",v.add(e),z=new THREE.Object3D,v.add(z),u=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),u.setSize(window.innerWidth,window.innerHeight),u.autoClear=!1,u.sortObjects=!1,u.generateMipmaps=!1,m.appendChild(u.domElement),h=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),h.position.z=1400,h.position.y=0,w.add(h),o.addEventListener("mousemove",p.onDocumentMouseMove.bind(null,h),!0),o.addEventListener("mousedown",p.onDocumentMouseDown,!0),o.addEventListener("mouseup",p.onDocumentMouseUp,!1),o.addEventListener("click",p.onClick,!0),o.addEventListener("mousewheel",p.onMouseWheel.bind(null,h),!1),o.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,p.onMouseWheel(h,b)},!1),f=THREEx.WindowResize(u,h),p.startAutoRotate()},g=function(){return p.updateRotation(),v.rotation.x=p.rotateX,v.rotation.y=p.rotateY,requestAnimationFrame(g),u.render(w,h)},t=function(){return React.render(React.createElement(b,{types:i.COLOUR_TYPES,clickCallback:A.toggleVisualizationType}),document.getElementById("legend")),s=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(n(),A.initMeshPool(i.MESH_POOL_SIZE,z),t(),k.loadCountryCodes("country_iso3166.json",function(a){return d=a,k.loadWorldPins("country_lat_lon.json",function(a){return e=a,k.loadRandomizedContentData(200,d,function(a){var b;return f=y.sortBy(a,"time"),b=l.loadGeoData(e,d),A.buildDataVizGeometries(f,b),g(),x()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,side:THREE.BackSide}),b=new THREE.RingGeometry(1,2,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.innerRadius,this.outerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e; -if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,side:THREE.BackSide}),b=new THREE.RingGeometry(1,2,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.innerRadius,this.outerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b; +if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index 2ee8161..6d92b89 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -16,3 +16,7 @@ module.exports = # For generating random dates ONE_WEEK_IN_MILLIS: 604800000 + + # Determines how long (in ms) we want one "loop" of the viz to run + VIZ_LOOP_LENGTH: 300000 # default: 5min + VIZ_POLLING_INTERVAL: 500 diff --git a/src/main.coffee b/src/main.coffee index 8a6d2b9..ca8ead9 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -29,21 +29,61 @@ _countryLookup = null _latLonData = null _sampleData = null -# used with the data pump -currIndexIntoData = 0 -nextIndexIntoData = 5 +# Used with our data pump. Allows us to evenly distribute the points +_minDataTimestamp = null +_maxDataTimestamp = null +_remainingData = null startDataPump = -> + # How many times we'll be polling for data in a single "loop" + numPollingIntervals = constants.VIZ_LOOP_LENGTH / constants.VIZ_POLLING_INTERVAL + + # keep track of the current polling interval for the progress viz + currPollingInterval = 0 + + # How much "real time" elapses in the data set + timeRangeInData = _maxDataTimestamp.getTime() - _minDataTimestamp.getTime() + + # How much "real time" we'll consume on each tick of the data pump + tickLength = Math.floor( timeRangeInData / numPollingIntervals ) + + # keep track of our last "start time" + lastTime = _minDataTimestamp.getTime() + window.setInterval -> - endIndex = currIndexIntoData + 5 - if endIndex > _sampleData.length - endIndex = _sampleData.length + dataToViz = getDataForTick( lastTime, lastTime + tickLength ) + lastTime += tickLength + currPollingInterval++ - visualize.initVisualization( _sampleData.slice( currIndexIntoData, endIndex ) ) - progressViz.handleProgressUpdate( endIndex / _sampleData.length ) - currIndexIntoData = (currIndexIntoData + 5) % _sampleData.length + if lastTime >= _maxDataTimestamp.getTime() + lastTime = _minDataTimestamp.getTime() + currPollingInterval = 0 + + visualize.initVisualization( dataToViz ) + progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ) return - , 500 + , constants.VIZ_POLLING_INTERVAL + +getDataForTick = ( startTime, endTime ) -> + # We could be smarter about this algorithm and keep track of our last + # index into the data to speed up processing, but given that we'll only + # be operating on a few thousand points at a time, we kept it fairly simple + + # If we're starting at the beginning, all our data is technically "remaining" + if startTime == _minDataTimestamp.getTime() + _remainingData = _sampleData + + # This will split our array into two pieces: those points which fall into + # the given "tick", and those that don't. Since time's advancing we know that + # once a point satisfies this condition we won't use it again until we loop + partitions = us.partition( _remainingData, ( point ) -> + time = point.time.getTime() + return time >= startTime and time <= endTime + ) + + _remainingData = partitions[1] + + return partitions[0] # All the initialization stuff for THREE.js initScene = -> @@ -165,8 +205,10 @@ else _countryLookup = isoData dataLoading.loadWorldPins 'country_lat_lon.json', ( latLonData ) -> _latLonData = latLonData - dataLoading.loadRandomizedContentData 200, _countryLookup, ( sampleData ) -> + dataLoading.loadRandomizedContentData 2000, _countryLookup, ( sampleData ) -> _sampleData = us.sortBy sampleData, 'time' + _minDataTimestamp = _sampleData[0].time + _maxDataTimestamp = _sampleData[ _sampleData.length - 1 ].time countryData = geopins.loadGeoData _latLonData, _countryLookup visualize.buildDataVizGeometries _sampleData, countryData From 2fab16268e3cbafa3298def75ef2d109d7ffa016 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 6 Apr 2015 12:37:22 -0400 Subject: [PATCH 132/190] README updates --- README.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8e139e6..117a031 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This fork attempts to make the globe data-agnostic so that users can simply prov To build this application you'll need an up-to-date copy of [Node.js](http://nodejs.org/), [Grunt CLI](http://gruntjs.com/), [Bower](http://bower.io/), and [CoffeeScript](http://coffeescript.org/). Once all these are installed, simply run the following from within the `dataglobe` directory: -``` +```bash $ npm install $ bower install $ grunt @@ -18,16 +18,36 @@ And everything will be built for you. To run this application, ensure Node.js has been installed along with all the dataglobe dependencies (see "Building"). Once the application has been built, run: -``` +```bash $ node app.js ``` And it will start a development server for you to view your work. In addition, you can also run -``` +```bash $ grunt watch ``` To have it watch for changes and automatically rebuild. +## Data Format + +The visualization expects data to be of the following format: + +```json +[ + { + src: , + dest: , + colour: ['r'|'o'|'b'|'g'|'p'], + time: + }, + // ... etc. +] +``` + +Acceptable country names can be found in `country_iso3166.json`. Timestamps can be anything that is convertable to a [JavaScript Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date). + +Data does not need to be in any particular order; the visualization takes care of sorting the data by date for you. + ## TODOs * [ ] Allow source/destination data to be specified as lat/long, rather than country names From a598b232f7876477f60434f3c3174ee023aeda61 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 6 Apr 2015 12:38:36 -0400 Subject: [PATCH 133/190] README updates --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 117a031..f6deaae 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,13 @@ To have it watch for changes and automatically rebuild. The visualization expects data to be of the following format: -```json +``` [ { - src: , - dest: , - colour: ['r'|'o'|'b'|'g'|'p'], - time: + "src": , + "dest": , + "colour": ["r"|"o"|"b"|"g"|"p"], + "time": }, // ... etc. ] From 9fd7049146904abd52c44870531e37ee092d44fd Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 10:10:33 -0400 Subject: [PATCH 134/190] Replaced ring effect with a sphere-based explosion for performance reasons --- public/dataglobe.min.js | 6 +++--- src/constants.coffee | 6 ++++++ src/visualize.coffee | 27 ++++++++++++--------------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index a2c5a95..a446772 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ -/*! dataglobe 06-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.innerRadius=1,a.explosionSphere.outerRadius=2,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,side:THREE.BackSide}),b=new THREE.RingGeometry(1,2,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.innerRadius=1,this.explosionSphere.outerRadius=2,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.innerRadius>10)return this.complete=!0,this.visible=!1,this.innerRadius=1,this.outerRadius=2,void this.dispatchEvent({type:"ExplosionComplete"});this.innerRadius+=2*i.PARTICLE_SPEED,this.outerRadius+=2*i.PARTICLE_SPEED,this.geometry.dispose(),this.geometry=new THREE.RingGeometry(this.innerRadius,this.outerRadius,32),this.material.opacity-=.05}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.lookAt(n),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b; -if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +/*! dataglobe 07-04-2015 */ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.material.opacity-=i.EXPLOSION_OPACITY_LERP}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; +if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index 6d92b89..b397f50 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -12,6 +12,12 @@ module.exports = NUM_TRAIL_PARTICLES: 12 TRAIL_OPACITY_MULTIPLIER: 0.083 # this is just 1.0 / NUM_TRAIL_PARTICLES + # Constants for the explosion effect (mostly just "magic numbers" that were + # determined by trial and error) + EXPLOSION_INITIAL_LERP_FACTOR: 0.08 + EXPLOSION_INCREMENTAL_LERP: 0.005 + EXPLOSION_OPACITY_LERP: 0.05 + MESH_POOL_SIZE: 100 # For generating random dates diff --git a/src/visualize.coffee b/src/visualize.coffee index f80ede4..d61f845 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -102,8 +102,8 @@ _returnMeshToPool = ( mesh ) -> mesh.particlesGeo.vertices = [] mesh.pSystem.systemComplete = false mesh.explosionSphere.complete = false - mesh.explosionSphere.innerRadius = 1 - mesh.explosionSphere.outerRadius = 2 + mesh.explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR + mesh.explosionSphere.finalPos = null mesh.explosionSphere.material.opacity = 1.0 mesh.attributes.alpha.value = [] mesh.attributes.customColor.value = [] @@ -174,12 +174,11 @@ class ParticleMesh color: 0xffffff transparent: true opacity: 1.0 - side: THREE.BackSide - explosionGeo = new THREE.RingGeometry 1, 2, 32 + explosionGeo = new THREE.SphereGeometry 5, 32, 32 @explosionSphere = new THREE.Mesh explosionGeo, explosionMat @explosionSphere.complete = false - @explosionSphere.innerRadius = 1 - @explosionSphere.outerRadius = 2 + @explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR + @explosionSphere.finalPos = null @explosionSphere.update = -> return if @complete @@ -187,20 +186,17 @@ class ParticleMesh if not @visible @visible = true - if @innerRadius > 10 + if @lerpVal <= 0.0 @complete = true @visible = false - @innerRadius = 1 - @outerRadius = 2 @dispatchEvent { type: 'ExplosionComplete' } return - @innerRadius += constants.PARTICLE_SPEED*2 - @outerRadius += constants.PARTICLE_SPEED*2 - @geometry.dispose() - @geometry = new THREE.RingGeometry @innerRadius, @outerRadius, 32 + @lerpVal -= constants.EXPLOSION_INCREMENTAL_LERP + @position.set @finalPos.x, @finalPos.y, @finalPos.z + @position.lerp vec3_origin, @lerpVal - @material.opacity -= 0.05 + @material.opacity -= constants.EXPLOSION_OPACITY_LERP return @@ -255,8 +251,9 @@ class ParticleMesh finalPt = path[ path.length - 2 ] color = @attributes.customColor.value[0].getHex() + @explosionSphere.finalPos = finalPt.clone() @explosionSphere.position.set finalPt.x, finalPt.y, finalPt.z - @explosionSphere.lookAt vec3_origin + @explosionSphere.position.lerp vec3_origin, @explosionSphere.lerpVal @explosionUpdateId = window.setInterval( @explosionSphere.update.bind( @explosionSphere ), 16 ) @vizMesh.add @explosionSphere From b775ecf16435661e64a7cdb7f7374cf97175dde1 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 10:18:22 -0400 Subject: [PATCH 135/190] Updated explosion lerp factors for a nicer looking effect --- public/dataglobe.min.js | 2 +- src/constants.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index a446772..c0b9116 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.material.opacity-=i.EXPLOSION_OPACITY_LERP}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.material.opacity-=i.EXPLOSION_OPACITY_LERP}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index b397f50..62957d7 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -14,8 +14,8 @@ module.exports = # Constants for the explosion effect (mostly just "magic numbers" that were # determined by trial and error) - EXPLOSION_INITIAL_LERP_FACTOR: 0.08 - EXPLOSION_INCREMENTAL_LERP: 0.005 + EXPLOSION_INITIAL_LERP_FACTOR: 0.06 + EXPLOSION_INCREMENTAL_LERP: 0.0035 EXPLOSION_OPACITY_LERP: 0.05 MESH_POOL_SIZE: 100 From 8086eb8cecae52abb9e849770355e219960d91aa Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 10:45:22 -0400 Subject: [PATCH 136/190] Increased opacity lerp factor for a better effect --- public/dataglobe.min.js | 2 +- src/constants.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index c0b9116..1b7e703 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.material.opacity-=i.EXPLOSION_OPACITY_LERP}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.material.opacity-=i.EXPLOSION_OPACITY_LERP}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index 62957d7..aa38688 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -16,7 +16,7 @@ module.exports = # determined by trial and error) EXPLOSION_INITIAL_LERP_FACTOR: 0.06 EXPLOSION_INCREMENTAL_LERP: 0.0035 - EXPLOSION_OPACITY_LERP: 0.05 + EXPLOSION_OPACITY_LERP: 0.06 MESH_POOL_SIZE: 100 From 56412905abc57ab2ff774c209bf5470ca28d0bb3 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 11:17:04 -0400 Subject: [PATCH 137/190] Added texture for explosion. Temporarily disabled opacity fade --- images/explosion_texture.png | Bin 0 -> 100474 bytes public/dataglobe.min.js | 2 +- src/visualize.coffee | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 images/explosion_texture.png diff --git a/images/explosion_texture.png b/images/explosion_texture.png new file mode 100644 index 0000000000000000000000000000000000000000..26f44a10f9b3e2ca1757e84e1d90486afc895c54 GIT binary patch literal 100474 zcmV)hK%>8jP)Px#24YJ`L;wH)0002_L%V+f000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2j2t- z4+$?eq+1RE000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}001BWNkl`r<+)6GiYJ`A%PjB@t~6xpj;n$g%z z7K>Gx06g3y!lTVO|1SWq0RDLU{JMPo_V)P-;QsbG0Gw~1bNPh$e*@6p{@=sr^|M>} z|FL{M!sCwRu{ZMg7QXiI9F4q=9v*jld%f%LTt7p2zV&adpVxDa<(iyt*K)jloy)Zx z%h&tc&#vn|!sFK8yOZCI_vw0E{9EVp{OjLRpX&B$%X#%Jtoe1_$2GHFlM$}jy8f|zb>|+)+FTzC^Rw)GGu$urGqz8! zvn%csg!4L{-|J(KaDK1n-?|Te3HS8cS7W(9-vY+GhV^oi`!UH{THj*}@3#dEVvp_N z9JmGSS@-?RvSzQZ*Lz*p?Y{%~FK=J}T)*H!g?g$qx zF0S==$8s^*;%v*;5f;??J0m>i+E}-@Yj7-&JH+B10jT3)Ho|5+m*k5jzn&-iG`S9e{fc)cgtGq*Juy1hk>r-?qES%B?d`0$A! z9zg{Hl*baKH*y_zujlv|-RO-h%9F6Wb+a8|u^%EJ`z&DmKlL#J1F0Mc5KQJe%+~)8 z@|ZO+ji46)jti=0P)@GH^H>h%+wwl+J$C{1m$&CqtnSO^I@zp=!=5S>Zx7h}DSB+SA-Z=2^xOMd?_ zdt;Kdbr0|J`rbv@<^{lmM5`lQ%yT0Gnc@vq4#voG6@zPn#kOz|t>8J9Ly1Lq2+whZ z*Rw{CCpiSy*LQ@!AEWIdB(YPlSQnk{9u6@;aECqHh*_}0BExl~eG7~72&@Pj8)u45 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yUP8&BC&hZdN&KpsRT6eguWL6G;9{P*I)A2ecuBG90fQ5UhlyGVD(G zi{u!;5`%;wn2o5y$YkW8uTk?=7l5@2=VV|O&8IS$jt@HbMiF!$>B)(*Y3DD`XU5v2 z@Iu%A+}I1dtW=g5MVYb6czIv(nrbTmubY46*(=(-|8&|ue~>h2^8ytJxyGu0K8vr< z!l=(mHK6o_0}ajTlI6lDs-P9XptN0%MR{h~uO6XJ=opQ;GYqxHxh9Ih1& zarJXYKSu&a&jyfOTV-$H{=v`pEB1ry(*NuGeg4Le8Tm+|trf55M~Lx6BT7vKcrOl& zZ-mNkX2U#&e?zy|96^g~4JL>ia>@KT#9b_~)keYBL(} zE8JA(c_8i#-*G8(HDqogQQ2Vo4Lp9X{ zh(vT8+g6!mXvwwc=DPE2{L6Bmt5L8AY@y0>BL%maoaYfU;uN$F!8EO9r8@>HD;)1; zb^qM<#$(javf!r&z^=p>+-B@1(1;?ti0VX;rB&_nGCki)hFs~G-ZcTw=-;+^jj)lC zW_9vvJsrs*=td^Kx*l|Y@b4<-8a>%}AEA4m)nAoH^P`fCKuw-=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.material.opacity-=i.EXPLOSION_OPACITY_LERP}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index d61f845..61f4273 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -174,6 +174,7 @@ class ParticleMesh color: 0xffffff transparent: true opacity: 1.0 + map: THREE.ImageUtils.loadTexture 'images/explosion_texture.png' explosionGeo = new THREE.SphereGeometry 5, 32, 32 @explosionSphere = new THREE.Mesh explosionGeo, explosionMat @explosionSphere.complete = false @@ -196,7 +197,7 @@ class ParticleMesh @position.set @finalPos.x, @finalPos.y, @finalPos.z @position.lerp vec3_origin, @lerpVal - @material.opacity -= constants.EXPLOSION_OPACITY_LERP + # @material.opacity -= constants.EXPLOSION_OPACITY_LERP return From 30734a726c760391a1c90c0c97950d2a7ef24cda Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 11:30:08 -0400 Subject: [PATCH 138/190] Explosions now rotate about a randomly-chosen axis --- public/dataglobe.min.js | 4 ++-- src/constants.coffee | 1 + src/visualize.coffee | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index b5bc616..3797987 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o;for(i=a("./constants"),o=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=o.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c;return c=this.particlesGeo.vertices[0].path,b=c[c.length-2],a=this.attributes.customColor.value[0].getHex(),this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length; -if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j]; +d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index aa38688..7919441 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -17,6 +17,7 @@ module.exports = EXPLOSION_INITIAL_LERP_FACTOR: 0.06 EXPLOSION_INCREMENTAL_LERP: 0.0035 EXPLOSION_OPACITY_LERP: 0.06 + EXPLOSION_ROTATION_ANGLE: 0.06 MESH_POOL_SIZE: 100 diff --git a/src/visualize.coffee b/src/visualize.coffee index 61f4273..4ff0007 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -2,6 +2,9 @@ constants = require './constants' vizLines = require './visualize_lines' vec3_origin = new THREE.Vector3 0, 0, 0 +vec3_x_axis = new THREE.Vector3 1, 0, 0 +vec3_y_axis = new THREE.Vector3 0, 1, 0 +vec3_z_axis = new THREE.Vector3 0, 0, 1 _meshPool = [] @@ -104,6 +107,7 @@ _returnMeshToPool = ( mesh ) -> mesh.explosionSphere.complete = false mesh.explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR mesh.explosionSphere.finalPos = null + mesh.explosionSphere.rotationAxis = null mesh.explosionSphere.material.opacity = 1.0 mesh.attributes.alpha.value = [] mesh.attributes.customColor.value = [] @@ -180,6 +184,7 @@ class ParticleMesh @explosionSphere.complete = false @explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR @explosionSphere.finalPos = null + @explosionSphere.rotationAxis = null @explosionSphere.update = -> return if @complete @@ -197,6 +202,8 @@ class ParticleMesh @position.set @finalPos.x, @finalPos.y, @finalPos.z @position.lerp vec3_origin, @lerpVal + @rotateOnAxis @rotationAxis, constants.EXPLOSION_ROTATION_ANGLE + # @material.opacity -= constants.EXPLOSION_OPACITY_LERP return @@ -252,6 +259,13 @@ class ParticleMesh finalPt = path[ path.length - 2 ] color = @attributes.customColor.value[0].getHex() + # Decide which axis this explosion is going to rotate about + choice = Math.floor( Math.random() * 3 ) + switch choice + when 0 then @explosionSphere.rotationAxis = vec3_x_axis + when 1 then @explosionSphere.rotationAxis = vec3_y_axis + when 2 then @explosionSphere.rotationAxis = vec3_z_axis + @explosionSphere.finalPos = finalPt.clone() @explosionSphere.position.set finalPt.x, finalPt.y, finalPt.z @explosionSphere.position.lerp vec3_origin, @explosionSphere.lerpVal From 5c35f2adcd06db445692bdbee637dae5d572923c Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 11:43:37 -0400 Subject: [PATCH 139/190] Explosions now fade out again. --- images/explosion_texture.png | Bin 100474 -> 118479 bytes public/dataglobe.min.js | 4 ++-- src/constants.coffee | 2 +- src/visualize.coffee | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/images/explosion_texture.png b/images/explosion_texture.png index 26f44a10f9b3e2ca1757e84e1d90486afc895c54..417b080153104fd1156880a6d0d229b38050da29 100644 GIT binary patch literal 118479 zcmXtEmeY=jgx__|oqM&%OKl2Br}-%mBax+}Bb! z3R>9f*!2;)mwNYSRPXBc5n<$rX~*sjH~vw4bE&ix0BTWyte+-~4&zq;4dS zn6Wu4*FGJWd(}x7jE{abtVm9x6e+_U#W(xcAY-&J^CHG^tXv{ z{+Fk#U=@40u(8cW2ndh3y1oim4Ir*G4)o8yQR`jeE+AbynO|K$Qg6?=%(_nC3<=;` za%bdXC`juFU>*n}7PNG1wdD7o9{s(fP{X^5uaxB5ci}t3xEJwJSMI3;U(f1mq97P* z3@s22K41ojl$Zig=qqJ{Gk_#HkOPQ87D&%E-FgE1@y$`r!Ox z>hxq|!*hF^cydS}90p;xxxASN9EhFV13}@ZzN9`D&U4S_B$JQ@Yeew@#;Tcyq;1uSfpZFYn~8J~~xx z7Qqodvce-3LD?T;+|gmD-K-%uaNVElGEuR zwadKg$8wkUr^$ZzQwf0~~ z+LLxxr#CiSqb%M?D-T>nC0_F7koO#_qs>dPonLhryH0n1ae+&~lMh1!)gB+R))Oz| z{o4s@U*xn5{@&S35Iu05#kP>w)Y{gp%M8zCT`07jzBjATg#P6R#;3K^`5#~R9U19+ zIN4fSTQ*HysrIcp+a_G?*ZqLu@Sr~ABGX?gYxCkRLW1}O!H((5yt^ctWTNTPIS85N zFeGxdx}<7KWwI=K>aj8_EOs1zSa<0hyP8AxO_*$aeV5Qy)!SUx2!J!@+lhIYpZBco z2|4?;aeLIR5Rh~K-_vs{&*$j7BtezXsw4@&g0RG`MlmejQrV-US%=g2?c<>8!~5IF zu%4sRZ8xG=9O1OE+Nn^hD|+lD+{Keb$0iJ?aarW~+xmdZgzVU~-h}Dg5DNBy?2Av> z?I@T9NcXxr@ZhZJJ`qZ(1F%=jD-YpqqKA|IM>};EMi<_6Vjw&w6)}ve)$=_Uc}Lk@k4mMP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R{h~uO6XJ=opQ;GYqxHxh9Ih1& zarJXYKSu&a&jyfOTV-$H{=v`pEB1ry(*NuGeg4Le8Tm+|trf55M~Lx6BT7vKcrOl& zZ-mNkX2U#&e?zy|96^g~4JL>ia>@KT#9b_~)keYBL(} zE8JA(c_8i#-*G8(HDqogQQ2Vo4Lp9X{ zh(vT8+g6!mXvwwc=DPE2{L6Bmt5L8AY@y0>BL%maoaYfU;uN$F!8EO9r8@>HD;)1; zb^qM<#$(javf!r&z^=p>+-B@1(1;?ti0VX;rB&_nGCki)hFs~G-ZcTw=-;+^jj)lC zW_9vvJsrs*=td^Kx*l|Y@b4<-8a>%}AEA4m)nAoH^P`fCKuw-=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j]; -d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c +},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index 7919441..692c1f0 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -16,7 +16,7 @@ module.exports = # determined by trial and error) EXPLOSION_INITIAL_LERP_FACTOR: 0.06 EXPLOSION_INCREMENTAL_LERP: 0.0035 - EXPLOSION_OPACITY_LERP: 0.06 + EXPLOSION_OPACITY_LERP: 0.2 EXPLOSION_ROTATION_ANGLE: 0.06 MESH_POOL_SIZE: 100 diff --git a/src/visualize.coffee b/src/visualize.coffee index 4ff0007..de88ee6 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -204,7 +204,10 @@ class ParticleMesh @rotateOnAxis @rotationAxis, constants.EXPLOSION_ROTATION_ANGLE - # @material.opacity -= constants.EXPLOSION_OPACITY_LERP + # Don't start fading out until we're half done + if @lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2 + @material.opacity -= constants.EXPLOSION_OPACITY_LERP + return From 252113ebc8b1dde9829ad1e1f995feaa232f7d0b Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 12:33:14 -0400 Subject: [PATCH 140/190] removed unnecessary material code --- public/dataglobe.min.js | 4 ++-- src/visualize.coffee | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 08c6316..bf8ae2d 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c -},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k) +}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index de88ee6..7daf4de 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -136,15 +136,7 @@ class ParticleMesh # Particle size now set in custom shader # @particleSize = 150 - @lineMat = new THREE.LineBasicMaterial - color: 0xffffff - opacity: 0.0 - blending: THREE.AdditiveBlending - transparent: true - depthWrite: false - vertexColors: false - linewidth: 1 - @splineOutline = new THREE.Line null, @lineMat + @splineOutline = new THREE.Line null, new THREE.LineBasicMaterial( { visible: false } ) # Use custom shader to have the trail taper off in transparency @attributes = From ff6e2e69d9f54d284869410fc625ef1fd03631d9 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 15:03:43 -0400 Subject: [PATCH 141/190] partial checkin so I can switch over to master --- public/dataglobe.min.js | 4 ++-- src/visualize.coffee | 27 ++++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index bf8ae2d..54a7515 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k) -}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:.5,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete){for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN)}return this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d +},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index 7daf4de..aa16580 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -58,6 +58,9 @@ module.exports = particle.path = points meshObj.particlesGeo.vertices.push particle + # meshObj.traceLine.geometry.vertices = points.slice 0, 10 + # meshObj.traceLine.geometry.verticesNeedUpdate = true + meshObj.attributes.alpha.value.push 1.0 meshObj.attributes.customColor.value.push color @@ -74,12 +77,14 @@ module.exports = # Set the explosion color, too meshObj.explosionSphere.material.color = color + meshObj.traceLineMat.color = color # since colours have been updated, tell THREE to force an update meshObj.attributes.alpha.needsUpdate = true meshObj.attributes.customColor.needsUpdate = true meshObj.vizMesh.add meshObj.splineOutline + meshObj.vizMesh.add meshObj.traceLine meshObj.startParticleUpdates() initVisualization: ( linearData ) -> @@ -117,6 +122,7 @@ _returnMeshToPool = ( mesh ) -> # have to remove from the scene or else bad things happen mesh.vizMesh.remove mesh.splineOutline + mesh.vizMesh.remove mesh.traceLine mesh.vizMesh.remove mesh.explosionSphere _meshPool.push mesh @@ -165,6 +171,14 @@ class ParticleMesh @splineOutline.add @pSystem @splineOutline.geometry = @linesGeo + # Trace line + @traceLineMat = new THREE.LineBasicMaterial + color: 0xffffff + opacity: 0.5 + transparent: true + + @traceLine = new THREE.Line new THREE.Geometry(), @traceLineMat + # Elements for the explosion effect explosionMat = new THREE.MeshBasicMaterial color: 0xffffff @@ -209,7 +223,7 @@ class ParticleMesh # This update method is what actually gets our points moving across the scene. # Once the point has finished its path, this method will emit a "ParticleSystemComplete" # event, to allow us to re-pool the mesh. - @pSystem.update = -> + @pSystem.update = ( traceLine ) -> # no point doing all the calculations if the particle is already done return if @systemComplete @@ -245,7 +259,14 @@ class ParticleMesh particle.copy currentPoint particle.lerp nextPoint, particle.lerpN - @geometry.verticesNeedUpdate = true + # update our trace line + # TODO: this won't work. See: + # http://stackoverflow.com/questions/14840026/dynamically-adding-vertices-to-a-line-in-three-js + # firstPt = @geometry.vertices[0] + # traceLine.geometry.vertices = firstPt.path.slice( 0, 10 ) + # traceLine.geometry.verticesNeedUpdate = true + + @geometry.verticesNeedUpdate = true runExplosion: -> path = @particlesGeo.vertices[0].path @@ -269,4 +290,4 @@ class ParticleMesh startParticleUpdates: -> # 16ms interval is approx a 60FPS refresh rate - @particleUpdateId = window.setInterval( @pSystem.update.bind( @pSystem ), 16 ) + @particleUpdateId = window.setInterval( @pSystem.update.bind( @pSystem, @traceLine ), 16 ) From 60d42b518272095ca54a43a640628a9d71711055 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 15:24:15 -0400 Subject: [PATCH 142/190] Tweaked constants for the rotation effect --- public/dataglobe.min.js | 2 +- src/constants.coffee | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 08c6316..deee2b2 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c },g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index 692c1f0..ef7a359 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -15,9 +15,9 @@ module.exports = # Constants for the explosion effect (mostly just "magic numbers" that were # determined by trial and error) EXPLOSION_INITIAL_LERP_FACTOR: 0.06 - EXPLOSION_INCREMENTAL_LERP: 0.0035 - EXPLOSION_OPACITY_LERP: 0.2 - EXPLOSION_ROTATION_ANGLE: 0.06 + EXPLOSION_INCREMENTAL_LERP: 0.0018 + EXPLOSION_OPACITY_LERP: 0.1 + EXPLOSION_ROTATION_ANGLE: 0.12 MESH_POOL_SIZE: 100 From ec4e6153e7f806c7fe2195c40dd71556fac5d2be Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 16:05:14 -0400 Subject: [PATCH 143/190] Legend now loads colours from the constants file --- public/dataglobe.min.js | 4 ++-- src/components/legend-item.cjsx | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index deee2b2..88114af 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c -},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.lineMat=new THREE.LineBasicMaterial({color:16777215,opacity:0,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1,vertexColors:!1,linewidth:1}),this.splineOutline=new THREE.Line(null,this.lineMat),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete)for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN),this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j]; +d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/components/legend-item.cjsx b/src/components/legend-item.cjsx index cec7b0d..8fd0726 100644 --- a/src/components/legend-item.cjsx +++ b/src/components/legend-item.cjsx @@ -1,5 +1,7 @@ # Component representing an individual legend item +constants = require '../constants' + #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Component definition #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -56,25 +58,21 @@ module.exports = React.createClass switch @props.type when "r" itemText = 'Red' - @circleStyle.backgroundColor = '#ff1e00' when "o" itemText = 'Orange' - @circleStyle.backgroundColor = '#ff7f00' when "g" itemText = 'Green' - @circleStyle.backgroundColor = '#00ca35' when "b" itemText = 'Blue' - @circleStyle.backgroundColor = '#008eaf' when "p" itemText = 'Purple' - @circleStyle.backgroundColor = '#dc0068' if !@state.active @toggleLinkStyle.color = '#555' @circleStyle.backgroundColor = '#555' else @toggleLinkStyle.color = '#ddd' + @circleStyle.backgroundColor = '#' + constants.COLOUR_MAP[ @props.type ].getHexString()

  • From c045527a340b74769250dd0fe537aefa0090e2ae Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Tue, 7 Apr 2015 16:43:36 -0400 Subject: [PATCH 144/190] Lines now trace, but weird artifacting occurs as meshes are reused --- public/dataglobe.min.js | 4 ++-- src/visualize.coffee | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index efaf799..519ca2d 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:.5,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(){var a,b,c,d,e,f,g;if(!this.systemComplete){for(this.visible||(this.visible=!0),g=this.geometry.vertices,b=0,c=g.length;c>b;b++){if(e=g[b],f=e.path,e.lerpN+=i.PARTICLE_SPEED,e.lerpN>1&&(e.lerpN=0,e.moveIndex=e.nextIndex,e.nextIndex++,e.nextIndex>=f.length))return e.moveIndex=0,e.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});a=f[e.moveIndex],d=f[e.nextIndex],e.copy(a),e.lerp(d,e.lerpN)}return this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c -},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m;if(!this.systemComplete){for(this.visible||(this.visible=!0),k=this.geometry.vertices,d=0,f=k.length;f>d;d++){if(h=k[d],j=h.path,h.lerpN+=i.PARTICLE_SPEED,h.lerpN>1&&(h.lerpN=0,h.moveIndex=h.nextIndex,h.nextIndex++,h.nextIndex>=j.length))return h.moveIndex=0,h.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});for(b=j[h.moveIndex],g=j[h.nextIndex],h.copy(b),h.lerp(g,h.lerpN),c=e=l=h.moveIndex,m=h.path.length;m>=l?m>e:e>m;c=m>=l?++e:--e)a.geometry.vertices[c].copy(g);a.geometry.verticesNeedUpdate=!0}return this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; +return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index aa16580..219321c 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -58,8 +58,9 @@ module.exports = particle.path = points meshObj.particlesGeo.vertices.push particle - # meshObj.traceLine.geometry.vertices = points.slice 0, 10 - # meshObj.traceLine.geometry.verticesNeedUpdate = true + # "Bundle" our trace line points at the start + meshObj.traceLine.geometry.vertices = ( particle.clone() for num in [1..particle.path.length] ) + meshObj.traceLineMat.opacity = 1.0 meshObj.attributes.alpha.value.push 1.0 meshObj.attributes.customColor.value.push color @@ -114,6 +115,7 @@ _returnMeshToPool = ( mesh ) -> mesh.explosionSphere.finalPos = null mesh.explosionSphere.rotationAxis = null mesh.explosionSphere.material.opacity = 1.0 + mesh.traceLine.geometry.vertices = [] mesh.attributes.alpha.value = [] mesh.attributes.customColor.value = [] @@ -174,7 +176,7 @@ class ParticleMesh # Trace line @traceLineMat = new THREE.LineBasicMaterial color: 0xffffff - opacity: 0.5 + opacity: 1.0 transparent: true @traceLine = new THREE.Line new THREE.Geometry(), @traceLineMat @@ -192,7 +194,7 @@ class ParticleMesh @explosionSphere.finalPos = null @explosionSphere.rotationAxis = null - @explosionSphere.update = -> + @explosionSphere.update = ( traceLineMat ) -> return if @complete if not @visible @@ -213,6 +215,7 @@ class ParticleMesh # Don't start fading out until we're half done if @lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2 @material.opacity -= constants.EXPLOSION_OPACITY_LERP + traceLineMat.opacity -= constants.EXPLOSION_OPACITY_LERP return @@ -259,12 +262,9 @@ class ParticleMesh particle.copy currentPoint particle.lerp nextPoint, particle.lerpN - # update our trace line - # TODO: this won't work. See: - # http://stackoverflow.com/questions/14840026/dynamically-adding-vertices-to-a-line-in-three-js - # firstPt = @geometry.vertices[0] - # traceLine.geometry.vertices = firstPt.path.slice( 0, 10 ) - # traceLine.geometry.verticesNeedUpdate = true + for index in [ particle.moveIndex...particle.path.length ] + traceLine.geometry.vertices[index].copy nextPoint + traceLine.geometry.verticesNeedUpdate = true @geometry.verticesNeedUpdate = true @@ -285,7 +285,7 @@ class ParticleMesh @explosionSphere.finalPos = finalPt.clone() @explosionSphere.position.set finalPt.x, finalPt.y, finalPt.z @explosionSphere.position.lerp vec3_origin, @explosionSphere.lerpVal - @explosionUpdateId = window.setInterval( @explosionSphere.update.bind( @explosionSphere ), 16 ) + @explosionUpdateId = window.setInterval( @explosionSphere.update.bind( @explosionSphere, @traceLineMat ), 16 ) @vizMesh.add @explosionSphere startParticleUpdates: -> From 3f2ce34ee1acb77d338bc1a335d964f7faea125a Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 8 Apr 2015 15:26:32 -0400 Subject: [PATCH 145/190] Slightly cleaner implementation of non-working code --- public/dataglobe.min.js | 4 ++-- src/visualize.coffee | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 519ca2d..a5ab08f 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ -/*! dataglobe 07-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m;if(!this.systemComplete){for(this.visible||(this.visible=!0),k=this.geometry.vertices,d=0,f=k.length;f>d;d++){if(h=k[d],j=h.path,h.lerpN+=i.PARTICLE_SPEED,h.lerpN>1&&(h.lerpN=0,h.moveIndex=h.nextIndex,h.nextIndex++,h.nextIndex>=j.length))return h.moveIndex=0,h.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});for(b=j[h.moveIndex],g=j[h.nextIndex],h.copy(b),h.lerp(g,h.lerpN),c=e=l=h.moveIndex,m=h.path.length;m>=l?m>e:e>m;c=m>=l?++e:--e)a.geometry.vertices[c].copy(g);a.geometry.verticesNeedUpdate=!0}return this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; +/*! dataglobe 08-04-2015 */ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&n.copy(h);return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index 219321c..ad90c5c 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -262,9 +262,9 @@ class ParticleMesh particle.copy currentPoint particle.lerp nextPoint, particle.lerpN - for index in [ particle.moveIndex...particle.path.length ] - traceLine.geometry.vertices[index].copy nextPoint - traceLine.geometry.verticesNeedUpdate = true + for vertex, index in traceLine.geometry.vertices + vertex.copy nextPoint if index >= particle.moveIndex + traceLine.geometry.verticesNeedUpdate = true @geometry.verticesNeedUpdate = true From 94201ea2a4bd5e8f47bf4d051167c211a1d03469 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 8 Apr 2015 16:10:11 -0400 Subject: [PATCH 146/190] Smoothed out the line drawing. Still broken, though --- public/dataglobe.min.js | 2 +- src/visualize.coffee | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index a5ab08f..12668e8 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 08-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&n.copy(h);return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index ad90c5c..2e0875d 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -263,7 +263,9 @@ class ParticleMesh particle.lerp nextPoint, particle.lerpN for vertex, index in traceLine.geometry.vertices - vertex.copy nextPoint if index >= particle.moveIndex + if index >= particle.moveIndex + vertex.copy currentPoint + vertex.lerp nextPoint, particle.lerpN traceLine.geometry.verticesNeedUpdate = true @geometry.verticesNeedUpdate = true From 501added13fc8ffada8fa7a37bd641869dc60fcd Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 8 Apr 2015 16:25:22 -0400 Subject: [PATCH 147/190] Fixed trace line flicker issue. Phantom vertex issue still present --- public/dataglobe.min.js | 2 +- src/visualize.coffee | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 12668e8..5dd5399 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 08-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index 2e0875d..e564129 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -233,6 +233,7 @@ class ParticleMesh # Ensure we're visible if not @visible @visible = true + traceLine.visible = true for particle in @geometry.vertices path = particle.path @@ -253,6 +254,7 @@ class ParticleMesh # Make ourselves invisible. This resolves an issue where a pooled mesh # would "flicker" when being reset @visible = false + traceLine.visible = false @dispatchEvent { type: 'ParticleSystemComplete' } return From aba2cc8929e3efccc851d3ba41441a14cb7fe837 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 11:37:56 -0400 Subject: [PATCH 148/190] Removed phantom vertex issue --- public/dataglobe.min.js | 4 ++-- src/visualize.coffee | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 5dd5399..e8513b9 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ -/*! dataglobe 08-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],f=a=1,b=g.path.length;b>=1?b>=a:a>=b;f=b>=1?++a:--a)c.push(g.clone());return c}(),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.traceLine.geometry.vertices=[],a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; +/*! dataglobe 09-04-2015 */ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b;for(b=[],d=a=1;100>=a;d=++a)b.push(n.clone());return b}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index e564129..cf55b95 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -58,8 +58,6 @@ module.exports = particle.path = points meshObj.particlesGeo.vertices.push particle - # "Bundle" our trace line points at the start - meshObj.traceLine.geometry.vertices = ( particle.clone() for num in [1..particle.path.length] ) meshObj.traceLineMat.opacity = 1.0 meshObj.attributes.alpha.value.push 1.0 @@ -115,7 +113,6 @@ _returnMeshToPool = ( mesh ) -> mesh.explosionSphere.finalPos = null mesh.explosionSphere.rotationAxis = null mesh.explosionSphere.material.opacity = 1.0 - mesh.traceLine.geometry.vertices = [] mesh.attributes.alpha.value = [] mesh.attributes.customColor.value = [] @@ -180,6 +177,7 @@ class ParticleMesh transparent: true @traceLine = new THREE.Line new THREE.Geometry(), @traceLineMat + @traceLine.geometry.vertices = ( vec3_origin.clone() for num in [1..100] ) # Elements for the explosion effect explosionMat = new THREE.MeshBasicMaterial From 555c226ae7dbc3e0a58491233947515b4672c599 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 12:09:15 -0400 Subject: [PATCH 149/190] More tweaks to the trace line --- public/dataglobe.min.js | 4 ++-- src/constants.coffee | 4 ++++ src/visualize.coffee | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index e8513b9..75b57ee 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 09-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b;for(b=[],d=a=1;100>=a;d=++a)b.push(n.clone());return b}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLineMat),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d]; -return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]]; +return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index ef7a359..aab5fa3 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -12,6 +12,10 @@ module.exports = NUM_TRAIL_PARTICLES: 12 TRAIL_OPACITY_MULTIPLIER: 0.083 # this is just 1.0 / NUM_TRAIL_PARTICLES + # This number was reached by multiple trials in which a particle curve never + # exceeded 40 vertices; just add a bit of buffer + TRACE_LINE_VERTEX_COUNT: 50 + # Constants for the explosion effect (mostly just "magic numbers" that were # determined by trial and error) EXPLOSION_INITIAL_LERP_FACTOR: 0.06 diff --git a/src/visualize.coffee b/src/visualize.coffee index cf55b95..32cd4e1 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -177,7 +177,7 @@ class ParticleMesh transparent: true @traceLine = new THREE.Line new THREE.Geometry(), @traceLineMat - @traceLine.geometry.vertices = ( vec3_origin.clone() for num in [1..100] ) + @traceLine.geometry.vertices = ( vec3_origin.clone() for num in [1..constants.TRACE_LINE_VERTEX_COUNT] ) # Elements for the explosion effect explosionMat = new THREE.MeshBasicMaterial @@ -192,7 +192,7 @@ class ParticleMesh @explosionSphere.finalPos = null @explosionSphere.rotationAxis = null - @explosionSphere.update = ( traceLineMat ) -> + @explosionSphere.update = ( traceLine ) -> return if @complete if not @visible @@ -201,6 +201,7 @@ class ParticleMesh if @lerpVal <= 0.0 @complete = true @visible = false + traceLine.visible = false @dispatchEvent { type: 'ExplosionComplete' } return @@ -213,7 +214,7 @@ class ParticleMesh # Don't start fading out until we're half done if @lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2 @material.opacity -= constants.EXPLOSION_OPACITY_LERP - traceLineMat.opacity -= constants.EXPLOSION_OPACITY_LERP + traceLine.material.opacity -= constants.EXPLOSION_OPACITY_LERP return @@ -252,7 +253,6 @@ class ParticleMesh # Make ourselves invisible. This resolves an issue where a pooled mesh # would "flicker" when being reset @visible = false - traceLine.visible = false @dispatchEvent { type: 'ParticleSystemComplete' } return @@ -287,7 +287,7 @@ class ParticleMesh @explosionSphere.finalPos = finalPt.clone() @explosionSphere.position.set finalPt.x, finalPt.y, finalPt.z @explosionSphere.position.lerp vec3_origin, @explosionSphere.lerpVal - @explosionUpdateId = window.setInterval( @explosionSphere.update.bind( @explosionSphere, @traceLineMat ), 16 ) + @explosionUpdateId = window.setInterval( @explosionSphere.update.bind( @explosionSphere, @traceLine ), 16 ) @vizMesh.add @explosionSphere startParticleUpdates: -> From 50f55d215495256a12f1bd0de552e6ca081e6412 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 12:40:40 -0400 Subject: [PATCH 150/190] Hopeful fix for issue where trace lines intersect the globe - we now shoot the particles higher --- public/dataglobe.min.js | 2 +- src/visualize_lines.coffee | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 75b57ee..325422b 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 09-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.3*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.4*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]]; +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]]; return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize_lines.coffee b/src/visualize_lines.coffee index 5c9a3ab..a3385ba 100644 --- a/src/visualize_lines.coffee +++ b/src/visualize_lines.coffee @@ -9,7 +9,7 @@ module.exports = distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length() # how high we want to shoot the curve upwards - anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.3 + anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.7 # start/end of the line start = exporter.center @@ -19,7 +19,7 @@ module.exports = mid = start.clone().lerp end, 0.5 midLength = mid.length() mid.normalize() - mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.4 ) + mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.45 ) # the normal from start to end normal = (new THREE.Vector3()).subVectors start, end From 9ee3c8c995febbdd244673b83d8502d8ddfca559 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 13:38:11 -0400 Subject: [PATCH 151/190] Trace line now has a nice fade/retract effect --- public/dataglobe.min.js | 4 ++-- src/constants.coffee | 4 +++- src/visualize.coffee | 22 ++++++++++++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 325422b..ec1c3f8 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 09-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP,a.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),l=this.geometry.vertices,d=0,f=l.length;f>d;d++){if(j=l[d],k=j.path,j.lerpN+=i.PARTICLE_SPEED,j.lerpN>1&&(j.lerpN=0,j.moveIndex=j.nextIndex,j.nextIndex++,j.nextIndex>=k.length))return j.moveIndex=0,j.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=k[j.moveIndex],h=k[j.nextIndex],j.copy(b),j.lerp(h,j.lerpN)}for(m=a.geometry.vertices,c=e=0,g=m.length;g>e;c=++e)n=m[c],c>=j.moveIndex&&(n.copy(b),n.lerp(h,j.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]]; -return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){var b,c,d,e,f;if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});for(this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),e=a.geometry.vertices,b=c=0,d=e.length;d>c&&(f=e[b],!(b>a.slurpIndex||a.slurpIndex>=a.geometry.vertices.length));b=++c)f.copy(a.geometry.vertices[a.slurpIndex]);a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=i.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n,o;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),m=this.geometry.vertices,j=d=0,f=m.length;f>d;j=++d){if(k=m[j],l=k.path,k.lerpN+=i.PARTICLE_SPEED,k.lerpN>1&&(k.lerpN=0,k.moveIndex=k.nextIndex,k.nextIndex++,0===j&&(a.material.opacity-=.66/l.length),k.nextIndex>=l.length))return k.moveIndex=0,k.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=l[k.moveIndex],h=l[k.nextIndex],k.copy(b),k.lerp(h,k.lerpN)}for(n=a.geometry.vertices,c=e=0,g=n.length;g>e;c=++e)o=n[c],c>=k.moveIndex&&(o.copy(b),o.lerp(h,k.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),this.traceLine.slurpIndex=0,a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c); +return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index aab5fa3..fa4b40a 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -16,10 +16,12 @@ module.exports = # exceeded 40 vertices; just add a bit of buffer TRACE_LINE_VERTEX_COUNT: 50 + TRACE_LINE_OPACITY_LERP: 0.00567 # 0.34/60 + # Constants for the explosion effect (mostly just "magic numbers" that were # determined by trial and error) EXPLOSION_INITIAL_LERP_FACTOR: 0.06 - EXPLOSION_INCREMENTAL_LERP: 0.0018 + EXPLOSION_INCREMENTAL_LERP: 0.001 EXPLOSION_OPACITY_LERP: 0.1 EXPLOSION_ROTATION_ANGLE: 0.12 diff --git a/src/visualize.coffee b/src/visualize.coffee index 32cd4e1..23a1b16 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -209,12 +209,20 @@ class ParticleMesh @position.set @finalPos.x, @finalPos.y, @finalPos.z @position.lerp vec3_origin, @lerpVal + # This will "slurp up" the trace line + for vertex, index in traceLine.geometry.vertices + break if index > traceLine.slurpIndex or traceLine.slurpIndex >= traceLine.geometry.vertices.length + vertex.copy traceLine.geometry.vertices[ traceLine.slurpIndex ] + + traceLine.slurpIndex++ + traceLine.geometry.verticesNeedUpdate = true + traceLine.material.opacity -= constants.TRACE_LINE_OPACITY_LERP + @rotateOnAxis @rotationAxis, constants.EXPLOSION_ROTATION_ANGLE # Don't start fading out until we're half done if @lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2 @material.opacity -= constants.EXPLOSION_OPACITY_LERP - traceLine.material.opacity -= constants.EXPLOSION_OPACITY_LERP return @@ -234,7 +242,7 @@ class ParticleMesh @visible = true traceLine.visible = true - for particle in @geometry.vertices + for particle, pIndex in @geometry.vertices path = particle.path particle.lerpN += constants.PARTICLE_SPEED @@ -242,6 +250,13 @@ class ParticleMesh particle.lerpN = 0 particle.moveIndex = particle.nextIndex particle.nextIndex++ + + if pIndex is 0 + # decrease the opacity of the trace line material so that + # it's at 0.34 when we're done (The explosion routine handles + # the remaining transparency) + traceLine.material.opacity -= (0.66 / path.length) + if particle.nextIndex >= path.length particle.moveIndex = 0 particle.nextIndex = 0 @@ -277,6 +292,9 @@ class ParticleMesh finalPt = path[ path.length - 2 ] color = @attributes.customColor.value[0].getHex() + # To help "slurp up" the trace line + @traceLine.slurpIndex = 0 + # Decide which axis this explosion is going to rotate about choice = Math.floor( Math.random() * 3 ) switch choice From 709e7421aeafeb7e2655159c04d3260b62811c4a Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 13:55:29 -0400 Subject: [PATCH 152/190] Tweaked opacity values on trace line a bit --- public/dataglobe.min.js | 2 +- src/constants.coffee | 2 +- src/visualize.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index ec1c3f8..ec5261c 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 09-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){var b,c,d,e,f;if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});for(this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),e=a.geometry.vertices,b=c=0,d=e.length;d>c&&(f=e[b],!(b>a.slurpIndex||a.slurpIndex>=a.geometry.vertices.length));b=++c)f.copy(a.geometry.vertices[a.slurpIndex]);a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=i.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n,o;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),m=this.geometry.vertices,j=d=0,f=m.length;f>d;j=++d){if(k=m[j],l=k.path,k.lerpN+=i.PARTICLE_SPEED,k.lerpN>1&&(k.lerpN=0,k.moveIndex=k.nextIndex,k.nextIndex++,0===j&&(a.material.opacity-=.66/l.length),k.nextIndex>=l.length))return k.moveIndex=0,k.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=l[k.moveIndex],h=l[k.nextIndex],k.copy(b),k.lerp(h,k.lerpN)}for(n=a.geometry.vertices,c=e=0,g=n.length;g>e;c=++e)o=n[c],c>=k.moveIndex&&(o.copy(b),o.lerp(h,k.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),this.traceLine.slurpIndex=0,a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c); +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){var b,c,d,e,f;if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});for(this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),e=a.geometry.vertices,b=c=0,d=e.length;d>c&&(f=e[b],!(b>a.slurpIndex||a.slurpIndex>=a.geometry.vertices.length));b=++c)f.copy(a.geometry.vertices[a.slurpIndex]);a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=i.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n,o;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),m=this.geometry.vertices,j=d=0,f=m.length;f>d;j=++d){if(k=m[j],l=k.path,k.lerpN+=i.PARTICLE_SPEED,k.lerpN>1&&(k.lerpN=0,k.moveIndex=k.nextIndex,k.nextIndex++,0===j&&(a.material.opacity-=.7/l.length),k.nextIndex>=l.length))return k.moveIndex=0,k.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=l[k.moveIndex],h=l[k.nextIndex],k.copy(b),k.lerp(h,k.lerpN)}for(n=a.geometry.vertices,c=e=0,g=n.length;g>e;c=++e)o=n[c],c>=k.moveIndex&&(o.copy(b),o.lerp(h,k.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),this.traceLine.slurpIndex=0,a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c); return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/constants.coffee b/src/constants.coffee index fa4b40a..242635a 100644 --- a/src/constants.coffee +++ b/src/constants.coffee @@ -16,7 +16,7 @@ module.exports = # exceeded 40 vertices; just add a bit of buffer TRACE_LINE_VERTEX_COUNT: 50 - TRACE_LINE_OPACITY_LERP: 0.00567 # 0.34/60 + TRACE_LINE_OPACITY_LERP: 0.005 # 0.3/60 # Constants for the explosion effect (mostly just "magic numbers" that were # determined by trial and error) diff --git a/src/visualize.coffee b/src/visualize.coffee index 23a1b16..44baa14 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -255,7 +255,7 @@ class ParticleMesh # decrease the opacity of the trace line material so that # it's at 0.34 when we're done (The explosion routine handles # the remaining transparency) - traceLine.material.opacity -= (0.66 / path.length) + traceLine.material.opacity -= (0.7 / path.length) if particle.nextIndex >= path.length particle.moveIndex = 0 From 4d73c45f26e8329ec5430fb901e2c172b444daea Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 14:03:30 -0400 Subject: [PATCH 153/190] Updated explosion texture --- images/explosion_texture.png | Bin 118479 -> 0 bytes images/explosion_texture_2.png | Bin 0 -> 127046 bytes public/dataglobe.min.js | 2 +- src/visualize.coffee | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 images/explosion_texture.png create mode 100644 images/explosion_texture_2.png diff --git a/images/explosion_texture.png b/images/explosion_texture.png deleted file mode 100644 index 417b080153104fd1156880a6d0d229b38050da29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 118479 zcmXtEmeY=jgx__|oqM&%OKl2Br}-%mBax+}Bb! z3R>9f*!2;)mwNYSRPXBc5n<$rX~*sjH~vw4bE&ix0BTWyte+-~4&zq;4dS zn6Wu4*FGJWd(}x7jE{abtVm9x6e+_U#W(xcAY-&J^CHG^tXv{ z{+Fk#U=@40u(8cW2ndh3y1oim4Ir*G4)o8yQR`jeE+AbynO|K$Qg6?=%(_nC3<=;` za%bdXC`juFU>*n}7PNG1wdD7o9{s(fP{X^5uaxB5ci}t3xEJwJSMI3;U(f1mq97P* z3@s22K41ojl$Zig=qqJ{Gk_#HkOPQ87D&%E-FgE1@y$`r!Ox z>hxq|!*hF^cydS}90p;xxxASN9EhFV13}@ZzN9`D&U4S_B$JQ@Yeew@#;Tcyq;1uSfpZFYn~8J~~xx z7Qqodvce-3LD?T;+|gmD-K-%uaNVElGEuR zwadKg$8wkUr^$ZzQwf0~~ z+LLxxr#CiSqb%M?D-T>nC0_F7koO#_qs>dPonLhryH0n1ae+&~lMh1!)gB+R))Oz| z{o4s@U*xn5{@&S35Iu05#kP>w)Y{gp%M8zCT`07jzBjATg#P6R#;3K^`5#~R9U19+ zIN4fSTQ*HysrIcp+a_G?*ZqLu@Sr~ABGX?gYxCkRLW1}O!H((5yt^ctWTNTPIS85N zFeGxdx}<7KWwI=K>aj8_EOs1zSa<0hyP8AxO_*$aeV5Qy)!SUx2!J!@+lhIYpZBco z2|4?;aeLIR5Rh~K-_vs{&*$j7BtezXsw4@&g0RG`MlmejQrV-US%=g2?c<>8!~5IF zu%4sRZ8xG=9O1OE+Nn^hD|+lD+{Keb$0iJ?aarW~+xmdZgzVU~-h}Dg5DNBy?2Av> z?I@T9NcXxr@ZhZJJ`qZ(1F%=jD-YpqqKA|IM>};EMi<_6Vjw&w6)}ve)$=_Uc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kr--OzCA`@_)q0Po>f#ThK)n?>qe`L(-^$|_TpKKvyx024n3awtGD z6Yx=?`W?;L;Vn&7_OGN4z&oUMvWA@LO_ZH>SfJ1B^l%4EEdED{4by{FCSPR|oJ`OH{r?5;+h%WXAi%w*-D~UYr(I3P^}24Tje}liRGa~zFi8Z^ z-v5r`hPXaE?DNjvn8~>XJo>U^a)JAqsxe?|V3I^p$-L@}vumcp0PJS|c!E)I1x7Hy z;3F-46MA6FApk-|q*>LmYUi7q^1!Y;;4>RQd4XRC+Sj+wFM+ORmD_GJ{X0n<6TFDJtw&J@PIF-tpF)zxf~gQ*!I=H{Sa2^ zWMI!{B4a6sSUYOptN`E}-uo1|iFz^fbs*WbsH*GlJTlZQ2oSdN4AitLPMz3unPq`L z19dR$j0(W6^9$zvPw0-4Spb`Wp9+`-Yn8wpf)#+dk8PCzjt?TMs_~DTtalXXn=byY z0ut)=^dxhrAk$}xuzqz9|3@=KHNLfn1MMq*PU55G(#w(Qr1>x0->*!n4?c z5gCB5%RYJ`Yp^;~AOmq~A0Og=9C(y}I`}ZCb?wGhW~NcI$%ug0u;;(wndn*rKf*{< z*Pj}5t(XZU(f|dOw@sQIMe5zr=+(c&djB&P;4mmpId(Dq{|Mh-{~vq%*F$a=GRmx` zpd~cbzbYsI@7w>rEDXT00Dzdu4Z|)}`u~C2*izR8kgeD1I{asca9lghEomoihngb!Z8MwdXq}0R5MADY%O*Y zz;65B*r5AaWjS#j?hsVH`Wcc;g_!`U5t2K>`I!UWwE!ZadVqZ&09A;0TMo6a zA^ShX-*}b*=*92h0~F&&*^%?1Y^O=JeRj{#eQ zZWxWLq3GfLv7*VVy-%5FA)&?{OEHsu?gnVZ*%{Zq8Q|@Z*&1sJ%aj$QX69GQFJNt3 zuAJ910src}R7IViy=Ujf9!mL+ykA4`@RR2`lhUg8%>k07*qo IM6N<$g6G>k%K!iX diff --git a/images/explosion_texture_2.png b/images/explosion_texture_2.png new file mode 100644 index 0000000000000000000000000000000000000000..c6fb0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w}bb{D}OAoR@~ zEL;D7!?Uh$rx<>i069ePkNUtHS^JY@#-kXtDw(CdpZl72@c#keFMJMEvLL`0V=CYc zv3Hlq`~mGBUiVv9+UZJ|E;TEh-RmhnzdE4zPGkaak^2tdANadU9{BV;w?TL~ zs(cXIUj<5l*Ex(N>tly>RKUer^Cq6%H#cMPj=$R=|GWc$zYH623)qZ#Vqa!1h^#KB zlUH-sbTe|r4UaVoUb0bLNJtn1)yDd2PyZ^$1~$gL0%jt^w*_7V*n*_Z2IQ+?oLHU1 z2GDPKt_NsjPa{YQJgYfetYOIp%k-HHKtaH(H2|#2-UoB`Z@$RNQoM=|Q&aqW8;$Sp zY{j{-W6Tv?<0RF(=4tZYz{0pDH16C)$ zk>GzLKp1E3fdb`GiTgh?d8NfHL{5NJmO@4(+2 z2=MKD6@LI$$jv@7#xrs&RfElzWdQaKy9PSRIsneRtvmf zs|gm)0@<5+eHb=mJ1es6|B6R5tjMz4pA*^SKLitcV}x z8gGQb0OCo6(HVS(@~@n++2^zPvuEDtN?4>uDEKAVgXyS$n>2e6Fo=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){var b,c,d,e,f;if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});for(this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),e=a.geometry.vertices,b=c=0,d=e.length;d>c&&(f=e[b],!(b>a.slurpIndex||a.slurpIndex>=a.geometry.vertices.length));b=++c)f.copy(a.geometry.vertices[a.slurpIndex]);a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=i.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n,o;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),m=this.geometry.vertices,j=d=0,f=m.length;f>d;j=++d){if(k=m[j],l=k.path,k.lerpN+=i.PARTICLE_SPEED,k.lerpN>1&&(k.lerpN=0,k.moveIndex=k.nextIndex,k.nextIndex++,0===j&&(a.material.opacity-=.7/l.length),k.nextIndex>=l.length))return k.moveIndex=0,k.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=l[k.moveIndex],h=l[k.nextIndex],k.copy(b),k.lerp(h,k.lerpN)}for(n=a.geometry.vertices,c=e=0,g=n.length;g>e;c=++e)o=n[c],c>=k.moveIndex&&(o.copy(b),o.lerp(h,k.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),this.traceLine.slurpIndex=0,a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c); +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture_2.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){var b,c,d,e,f;if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});for(this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),e=a.geometry.vertices,b=c=0,d=e.length;d>c&&(f=e[b],!(b>a.slurpIndex||a.slurpIndex>=a.geometry.vertices.length));b=++c)f.copy(a.geometry.vertices[a.slurpIndex]);a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=i.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n,o;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),m=this.geometry.vertices,j=d=0,f=m.length;f>d;j=++d){if(k=m[j],l=k.path,k.lerpN+=i.PARTICLE_SPEED,k.lerpN>1&&(k.lerpN=0,k.moveIndex=k.nextIndex,k.nextIndex++,0===j&&(a.material.opacity-=.7/l.length),k.nextIndex>=l.length))return k.moveIndex=0,k.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=l[k.moveIndex],h=l[k.nextIndex],k.copy(b),k.lerp(h,k.lerpN)}for(n=a.geometry.vertices,c=e=0,g=n.length;g>e;c=++e)o=n[c],c>=k.moveIndex&&(o.copy(b),o.lerp(h,k.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),this.traceLine.slurpIndex=0,a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c); return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file diff --git a/src/visualize.coffee b/src/visualize.coffee index 44baa14..3378f4d 100644 --- a/src/visualize.coffee +++ b/src/visualize.coffee @@ -184,7 +184,7 @@ class ParticleMesh color: 0xffffff transparent: true opacity: 1.0 - map: THREE.ImageUtils.loadTexture 'images/explosion_texture.png' + map: THREE.ImageUtils.loadTexture 'images/explosion_texture_2.png' explosionGeo = new THREE.SphereGeometry 5, 32, 32 @explosionSphere = new THREE.Mesh explosionGeo, explosionMat @explosionSphere.complete = false From e7efebd721a3377944f747432919c899814efdb0 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 16:12:25 -0400 Subject: [PATCH 154/190] Updated README with idea about es6 --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index f6deaae..1402f09 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,6 @@ Data does not need to be in any particular order; the visualization takes care o ## TODOs * [ ] Allow source/destination data to be specified as lat/long, rather than country names +* [ ] Consider updating repo to use es6 with Babel, rather than CoffeeScript * [x] Highlight the destination country when the particle "hits" it * [x] Create subtle trail effect for particles - -## Notes - -* Data is currently fed into the visualization via `main.js:startDataPump()`. Eventually we'll want to replace that with a RESTful endpoint that is periodically polled for new data -* `visualize.js:selectVisualization()` is the current entry point to add new lines to the visualization, while `visualize.js:getVisualizedMesh()` is the method that actually does the heavy lifting (current call stack is `main.js:startDataPump()` -> `visualize.js:selectVisualization()` -> `visualize.js:getVisualizedMesh()`) From 7587468334f802ed8b8a86298473f7da102a8341 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 16:39:56 -0400 Subject: [PATCH 155/190] Update .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 502d59a..802f3ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .DS_Store app.yaml client -coffeelint.json +.jshintrc hostery-files .hostery-config From 90baa690a962f8bbd4954445309f7ef916460e7e Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 16:59:41 -0400 Subject: [PATCH 156/190] Initial checkin of an es6-based Gruntfile --- Gruntfile.coffee | 116 -------------------------------------------- Gruntfile.js | 124 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 3 files changed, 125 insertions(+), 118 deletions(-) delete mode 100644 Gruntfile.coffee create mode 100644 Gruntfile.js diff --git a/Gruntfile.coffee b/Gruntfile.coffee deleted file mode 100644 index d472982..0000000 --- a/Gruntfile.coffee +++ /dev/null @@ -1,116 +0,0 @@ -# Gruntfile for building the dataglobe project -us = require 'underscore' - -module.exports = ( grunt ) -> - - grunt.initConfig - pkg: grunt.file.readJSON 'package.json' - - clean: - all: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/*.js' ] - incr: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/public/<%= pkg.name %>.min.js' ] - - bower_concat: - all: - dest: 'build/bower.js' - # nice little callback to look for/use minified versions when available - callback: ( mainFiles, component ) -> - us.map( mainFiles, ( filepath ) -> - min = filepath.replace( /\.js$/, '.min.js' ) - if grunt.file.exists( min ) then return min else return filepath - ) - - concat: - options: - separator: ';' - dist: - src: ['<%= bower_concat.all.dest %>', 'thirdparty/*.js'] - dest: 'build/thirdparty.js' - - cjsx: - options: - bare: true - - files: - expand: true - flatten: true - cwd: 'src/components/' - src: ['*.cjsx'] - dest: 'build/tmp/components' - ext: '.js' - - coffee: - options: - bare: true # we don't want the wrapper function or else bad things - # happen with browserify - files: - expand: true - flatten: true - cwd: 'src/' - src: ['**/*.coffee'] - dest: 'build/tmp' - ext: '.js' - - browserify: - options: - debug: true - destFile: 'build/bundle.js' - src: [ 'build/tmp/**/*.js' ] - - dev: - src: '<%= browserify.options.src %>' - dest: '<%= browserify.options.destFile %>' - - production: - options: - debug: false - src: '<%= browserify.options.src %>' - dest: '<%= browserify.options.destFile %>' - - uglify: - options: - banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' - - all: - files: - 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] - 'public/thirdparty.min.js': [ '<%= concat.dist.dest %>' ] - - incr: - files: - 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] - - watch: - files: [ - 'Gruntfile.coffee' - 'src/**/*.coffee' - 'src/**/*.cjsx' - ] - tasks: 'incremental' - - grunt.loadNpmTasks 'grunt-coffee-react' - grunt.loadNpmTasks 'grunt-contrib-coffee' - grunt.loadNpmTasks 'grunt-browserify' - grunt.loadNpmTasks 'grunt-contrib-uglify' - grunt.loadNpmTasks 'grunt-contrib-watch' - grunt.loadNpmTasks 'grunt-contrib-clean' - grunt.loadNpmTasks 'grunt-bower-concat' - grunt.loadNpmTasks 'grunt-contrib-concat' - - grunt.registerTask 'default', [ - 'clean:all' - 'bower_concat:all' - 'concat:dist' - 'cjsx' - 'coffee' - 'browserify:production' - 'uglify:all' - ] - - grunt.registerTask 'incremental', [ - 'clean:incr' - 'cjsx' - 'coffee' - 'browserify:production' - 'uglify:incr' - ] diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..ecee91d --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,124 @@ +// Gruntfile for building the dataglobe project +us = require( 'underscore' ); + +module.exports = function( grunt ) { + + grunt.initConfig({ + pkg: grunt.file.readJSON( 'package.json' ), + + clean: { + all: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/*.js' ], + incr: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/public/<%= pkg.name %>.min.js' ] + }, + + bower_concat: { + all: { + dest: 'build/bower.js', + // nice little callback to look for/use minified versions when available + callback: function( mainFiles, component ) { + us.map( mainFiles, function( filepath ) { + min = filepath.replace( /\.js$/, '.min.js' ); + if( grunt.file.exists( min ) ) { + return min; + } else { + return filepath; + } + }); + } + } + }, + + concat: { + options: { + separator: ';' + }, + dist: { + src: ['<%= bower_concat.all.dest %>', 'thirdparty/*.js'], + dest: 'build/thirdparty.js' + } + }, + + babel: { + files: { + expand: true, + flatten: true, + cwd: 'src/', + src: ['**/*.js', '**/*.jsx'], + dest: 'build/tmp' + } + }, + + browserify: { + options: { + debug: true, + destFile: 'build/bundle.js', + src: [ 'build/tmp/**/*.js' ] + }, + + dev: { + src: '<%= browserify.options.src %>', + dest: '<%= browserify.options.destFile %>' + }, + + production: { + options: { + debug: false + }, + src: '<%= browserify.options.src %>', + dest: '<%= browserify.options.destFile %>' + } + }, + + uglify: { + options: { + banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' + }, + + all: { + files: { + 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ], + 'public/thirdparty.min.js': [ '<%= concat.dist.dest %>' ] + } + }, + + incr: { + files: { + 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] + } + }, + }, + + watch: { + files: [ + 'Gruntfile.js', + 'src/**/*.js', + 'src/**/*.jsx' + ], + tasks: 'incremental' + }, + }); + + grunt.loadNpmTasks( 'grunt-babel' ); + grunt.loadNpmTasks( 'grunt-browserify' ); + grunt.loadNpmTasks( 'grunt-contrib-uglify' ); + grunt.loadNpmTasks( 'grunt-contrib-watch' ); + grunt.loadNpmTasks( 'grunt-contrib-clean' ); + grunt.loadNpmTasks( 'grunt-bower-concat' ); + grunt.loadNpmTasks( 'grunt-contrib-concat' ); + + grunt.registerTask( 'default', [ + 'clean:all', + 'bower_concat:all', + 'concat:dist', + 'babel', + 'browserify:production', + 'uglify:all' + ]); + + grunt.registerTask( 'incremental', [ + 'clean:incr', + 'babel', + 'browserify:production', + 'uglify:incr' + ]); +}; diff --git a/package.json b/package.json index 5ff93c1..36dac02 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,10 @@ }, "devDependencies": { "grunt": "^0.4.5", + "grunt-babel": "^5.0.0", "grunt-bower-concat": "^0.4.0", "grunt-browserify": "^3.4.0", - "grunt-coffee-react": "^2.4.1", "grunt-contrib-clean": "^0.6.0", - "grunt-contrib-coffee": "^0.13.0", "grunt-contrib-concat": "^0.5.1", "grunt-contrib-uglify": "^0.8.0", "grunt-contrib-watch": "^0.6.1", From 9ddddbc946729bbfac81a37be66241699533487a Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 9 Apr 2015 17:02:07 -0400 Subject: [PATCH 157/190] Fixed error in gruntfile --- Gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index ecee91d..11e4075 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -16,7 +16,7 @@ module.exports = function( grunt ) { dest: 'build/bower.js', // nice little callback to look for/use minified versions when available callback: function( mainFiles, component ) { - us.map( mainFiles, function( filepath ) { + return us.map( mainFiles, function( filepath ) { min = filepath.replace( /\.js$/, '.min.js' ); if( grunt.file.exists( min ) ) { return min; From d2bcd5be5d36f3ceb4cdf2bb71999fdd5945375d Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 10:13:50 -0400 Subject: [PATCH 158/190] Switched React components over --- src/components/legend-item.cjsx | 81 ----------------------- src/components/legend-item.jsx | 99 +++++++++++++++++++++++++++ src/components/legend.cjsx | 33 --------- src/components/legend.jsx | 43 ++++++++++++ src/components/progress.cjsx | 101 ---------------------------- src/components/progress.jsx | 114 ++++++++++++++++++++++++++++++++ 6 files changed, 256 insertions(+), 215 deletions(-) delete mode 100644 src/components/legend-item.cjsx create mode 100644 src/components/legend-item.jsx delete mode 100644 src/components/legend.cjsx create mode 100644 src/components/legend.jsx delete mode 100644 src/components/progress.cjsx create mode 100644 src/components/progress.jsx diff --git a/src/components/legend-item.cjsx b/src/components/legend-item.cjsx deleted file mode 100644 index 8fd0726..0000000 --- a/src/components/legend-item.cjsx +++ /dev/null @@ -1,81 +0,0 @@ -# Component representing an individual legend item - -constants = require '../constants' - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Component definition -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = React.createClass - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Styles - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - legendItemStyle: - height: 20 - paddingBottom: 5 - - toggleLinkStyle: - textDecoration: 'none' - fontWeight: 'normal' - # Transition for when we become inactive - WebkitTransition: 'color 500ms ease-out' - MozTransition: 'color 500ms ease-out' - OTransition: 'color 500ms ease-out' - transition: 'color 500ms ease-out' - - circleStyle: - display: 'inline-block' - width: 15 - height: 15 - borderRadius: '50%' - # This is what lets us get the text centered - marginTop: 3 - marginBottom: -2 - # Transition for when we become inactive - WebkitTransition: 'background-color 500ms ease-out' - MozTransition: 'background-color 500ms ease-out' - OTransition: 'background-color 500ms ease-out' - transition: 'background-color 500ms ease-out' - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Behaviours - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - getInitialState: -> - return { active: true } - - handleLinkClick: (e) -> - e.preventDefault() - newActive = !@state.active - @setState { active: newActive } - @props.clickCallback( @props.type, newActive ) - return false - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Final Render - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - render: -> - itemText = '' - - switch @props.type - when "r" - itemText = 'Red' - when "o" - itemText = 'Orange' - when "g" - itemText = 'Green' - when "b" - itemText = 'Blue' - when "p" - itemText = 'Purple' - - if !@state.active - @toggleLinkStyle.color = '#555' - @circleStyle.backgroundColor = '#555' - else - @toggleLinkStyle.color = '#ddd' - @circleStyle.backgroundColor = '#' + constants.COLOUR_MAP[ @props.type ].getHexString() - -

  • - -
    - {itemText} -
    -
  • diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx new file mode 100644 index 0000000..6eaaa28 --- /dev/null +++ b/src/components/legend-item.jsx @@ -0,0 +1,99 @@ +// Component representing an individual legend item + +const constants = require( '../constants' ); + +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Component definition + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +module.exports = React.createClass({ + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + legendItemStyle: { + height: 20, + paddingBottom: 5 + }, + + toggleLinkStyle: { + textDecoration: 'none', + fontWeight: 'normal', + // Transition for when we become inactive + WebkitTransition: 'color 500ms ease-out', + MozTransition: 'color 500ms ease-out', + OTransition: 'color 500ms ease-out', + transition: 'color 500ms ease-out', + }, + + circleStyle: { + display: 'inline-block', + width: 15, + height: 15, + borderRadius: '50%', + // This is what lets us get the text centered + marginTop: 3, + marginBottom: -2, + // Transition for when we become inactive + WebkitTransition: 'background-color 500ms ease-out', + MozTransition: 'background-color 500ms ease-out', + OTransition: 'background-color 500ms ease-out', + transition: 'background-color 500ms ease-out', + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Behaviours + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + getInitialState() { + return { active: true }; + }, + + handleLinkClick( e ) { + e.preventDefault(); + let newActive = !this.state.active; + this.setState( { active: newActive } ); + this.props.clickCallback( this.props.type, newActive ); + return false; + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Final Render + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + render() { + let itemText = ''; + + switch( this.props.type ) { + case "r": + itemText = 'Red'; + break; + case "o": + itemText = 'Orange'; + break; + case "g": + itemText = 'Green'; + break; + case "b": + itemText = 'Blue'; + break; + case "p": + itemText = 'Purple'; + break; + } + + if( !this.state.active ) { + this.toggleLinkStyle.color = '#555'; + this.circleStyle.backgroundColor = '#555'; + } else { + this.toggleLinkStyle.color = '#ddd'; + this.circleStyle.backgroundColor = '#' + constants.COLOUR_MAP[ this.props.type ].getHexString(); + } + + /* jshint ignore: start */ + return ( +
  • + +
    - {itemText} +
    +
  • + ); + /* jshint ignore: end */ + } +}); diff --git a/src/components/legend.cjsx b/src/components/legend.cjsx deleted file mode 100644 index 0e91623..0000000 --- a/src/components/legend.cjsx +++ /dev/null @@ -1,33 +0,0 @@ -# Main component for the interactive legend -LegendItem = require './legend-item' - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# component definition -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -module.exports = React.createClass - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Styles - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - headerStyle: - fontSize: 18 - marginTop: 0 - - listStyle: - listStyleType: 'none' - margin: 0 - padding: 0 - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Final Render - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - render: -> - callback = @props.clickCallback - -
    -

    Legend

    -
      - { @props.types.map ( type )-> - return - } -
    -
    diff --git a/src/components/legend.jsx b/src/components/legend.jsx new file mode 100644 index 0000000..3dff797 --- /dev/null +++ b/src/components/legend.jsx @@ -0,0 +1,43 @@ +// Main component for the interactive legend +const LegendItem = require( './legend-item' ); + +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Component definition + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +module.exports = React.createClass({ + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + headerStyle: { + fontSize: 18, + marginTop: 0 + }, + + listStyle: { + listStyleType: 'none', + margin: 0, + padding: 0 + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Final Render + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + render() { + let callback = this.props.clickCallback; + + /* jshint ignore: start */ + return ( +
    +

    Legend

    +
      + { + this.props.types.map( function( type ) { + return ; + }); + } +
    +
    + ); + /* jshint ignore: end */ + } +}); diff --git a/src/components/progress.cjsx b/src/components/progress.cjsx deleted file mode 100644 index beb09b9..0000000 --- a/src/components/progress.cjsx +++ /dev/null @@ -1,101 +0,0 @@ -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# component definition -# -# This component inspired by: -# http://jsfiddle.net/oskar/Aapn8/ and -# https://github.com/pughpugh/react-countdown-clock -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -tween = require 'react-tween-state' - -module.exports = React.createClass - mixins: [tween.Mixin] - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Component state definition - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - getInitialState: -> - currVal: 0.0 - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Styles - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - canvasStyle: - display: 'block' - - strokeStyle: - radius: 25 - width: 5.0 - color: '#008EAF' - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Instance Variables - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - _canvas: null - _context: null - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Component Methods - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - componentDidMount: -> - if @_canvas then return - - @_canvas = @getDOMNode() - @_context = @_canvas.getContext '2d' - - # additional bootstrapping - @_context.beginPath() - @_context.strokeStyle = @strokeStyle.color - @_context.lineCap = 'square' - @_context.closePath() - @_context.fill() - @_context.lineWidth = @strokeStyle.width - @_context.globalAlpha = 0.33 - - componentDidUpdate: -> - @_updateProgress() - - handleProgressUpdate: (newVal) -> - onEndFunc = undefined - - # Handles weird case where a currVal of 1.0 gives us no circle. Basically - # we tween to a value that will appear to be a full circle and then as soon - # as it's done, tween back to the start value (i.e. empty circle) - if newVal is 1.0 - newVal = 0.99999 - onEndFunc = => - @tweenState( 'currVal', { endValue: 0.0 } ) - - @tweenState( 'currVal', - endValue: newVal, - onEnd: onEndFunc - ) - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Behaviours - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - _updateProgress: -> - if !@_context then return - - # Clear out our previous strokes - @_context.clearRect 0, 0, @_canvas.width, @_canvas.height - - # Basic idea: angle has to be between PI * -0.5 (12 o'clock) and PI * 1.5 - # (full circle) - since a circle is 2PI radians - endAngle = (2 * @getTweeningValue( 'currVal' )) - 0.5 - - @_context.beginPath() - @_context.arc( - @strokeStyle.radius # x-coordinate of origin - @strokeStyle.radius # y-coordinate of origin - @strokeStyle.radius - @strokeStyle.width # radius of arc (less the stroke width) - Math.PI * 1.5 # starting angle in radians. PI * -0.5 is the 12 o'clock position - Math.PI * endAngle # ending angle in radians - false # stroke counterclockwise? - ) - @_context.stroke() - - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # Final Render - #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - render: -> - diff --git a/src/components/progress.jsx b/src/components/progress.jsx new file mode 100644 index 0000000..a752855 --- /dev/null +++ b/src/components/progress.jsx @@ -0,0 +1,114 @@ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * component definition + * + * This component inspired by: + * http://jsfiddle.net/oskar/Aapn8/ and + * https://github.com/pughpugh/react-countdown-clock + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +const tween = require( 'react-tween-state' ); + +module.exports = React.createClass({ + mixins: [tween.Mixin], + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Component state definition + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + getInitialState() { + return { currVal: 0.0 }; + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + canvasStyle: { + display: 'block' + }, + + strokeStyle: { + radius: 25, + width: 5.0, + color: '#008EAF' + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Instance Variables + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + _canvas: null, + _context: null, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Component Methods + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + componentDidMount() { + if( this._canvas ) return; + + this._canvas = this.getDOMNode(); + this._context = this._canvas.getContext( '2d' ); + + // additional bootstrapping + this._context.beginPath(); + this._context.strokeStyle = this.strokeStyle.color; + this._context.lineCap = 'square'; + this._context.closePath(); + this._context.fill(); + this._context.lineWidth = this.strokeStyle.width; + this._context.globalAlpha = 0.33; + }, + + componentDidUpdate() { + this._updateProgress(); + }, + + handleProgressUpdate( newVal ) { + let onEndFunc; + + // Handles weird case where a currVal of 1.0 gives us no circle. Basically + // we tween to a value that will appear to be a full circle and then as soon + // as it's done, tween back to the start value (i.e. empty circle) + if( newVal === 1.0 ) { + newVal = 0.99999; + onEndFunc = () => { + this.tweenState( 'currVal', { endValue: 0.0 } ); + }; + } + + this.tweenState( 'currVal', { + endValue: newVal, + onEnd: onEndFunc + }); + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Behaviours + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + _updateProgress() { + if( !this._context ) return; + + // Clear out our previous strokes + this._context.clearRect( 0, 0, this._canvas.width, this._canvas.height ); + + // Basic idea: angle has to be between PI * -0.5 (12 o'clock) and PI * 1.5 + // (full circle) - since a circle is 2PI radians + let endAngle = (2 * this.getTweeningValue( 'currVal' )) - 0.5; + + this._context.beginPath(); + this._context.arc( + this.strokeStyle.radius, // x-coordinate of origin + this.strokeStyle.radius, // y-coordinate of origin + this.strokeStyle.radius - this.strokeStyle.width, // radius of arc (less the stroke width) + Math.PI * 1.5, // starting angle in radians. PI * -0.5 is the 12 o'clock position + Math.PI * endAngle, // ending angle in radians + false // stroke counterclockwise? + ); + this._context.stroke(); + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Final Render + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + render() { + /* jshint ignore: start */ + return( ); + /* jshint ignore: end */ + } +}); From 61f0656a298ad2f4d6661a2255491665284c7051 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 10:21:01 -0400 Subject: [PATCH 159/190] Fixed a couple es6 gotchas --- src/components/legend.jsx | 8 +++----- src/components/progress.jsx | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/legend.jsx b/src/components/legend.jsx index 3dff797..4e8496a 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -30,11 +30,9 @@ module.exports = React.createClass({

    Legend

      - { - this.props.types.map( function( type ) { - return ; - }); - } + {this.props.types.map( function( type ) { + return( ); + })}
    ); diff --git a/src/components/progress.jsx b/src/components/progress.jsx index a752855..6d2df20 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -108,7 +108,7 @@ module.exports = React.createClass({ *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ render() { /* jshint ignore: start */ - return( ); + return( ); /* jshint ignore: end */ } }); From edc8f0e3c094e14f01af8f8c52489ed63715937b Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 10:53:33 -0400 Subject: [PATCH 160/190] React components now use es6 classes --- src/components/legend-item.jsx | 78 ++++++++++++++++++---------------- src/components/legend.jsx | 33 ++++++++------ src/components/progress.jsx | 61 ++++++++++++-------------- 3 files changed, 88 insertions(+), 84 deletions(-) diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index 6eaaa28..2d22ab1 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -5,54 +5,58 @@ const constants = require( '../constants' ); /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -module.exports = React.createClass({ - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Styles - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - legendItemStyle: { - height: 20, - paddingBottom: 5 - }, +export class LegendItem extends React.Component { + constructor( props ) { + + super( props ); + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + this.legendItemStyle = { + height: 20, + paddingBottom: 5 + }; - toggleLinkStyle: { - textDecoration: 'none', - fontWeight: 'normal', - // Transition for when we become inactive - WebkitTransition: 'color 500ms ease-out', - MozTransition: 'color 500ms ease-out', - OTransition: 'color 500ms ease-out', - transition: 'color 500ms ease-out', - }, + this.toggleLinkStyle = { + textDecoration: 'none', + fontWeight: 'normal', + // Transition for when we become inactive + WebkitTransition: 'color 500ms ease-out', + MozTransition: 'color 500ms ease-out', + OTransition: 'color 500ms ease-out', + transition: 'color 500ms ease-out', + }; - circleStyle: { - display: 'inline-block', - width: 15, - height: 15, - borderRadius: '50%', - // This is what lets us get the text centered - marginTop: 3, - marginBottom: -2, - // Transition for when we become inactive - WebkitTransition: 'background-color 500ms ease-out', - MozTransition: 'background-color 500ms ease-out', - OTransition: 'background-color 500ms ease-out', - transition: 'background-color 500ms ease-out', - }, + this.circleStyle = { + display: 'inline-block', + width: 15, + height: 15, + borderRadius: '50%', + // This is what lets us get the text centered + marginTop: 3, + marginBottom: -2, + // Transition for when we become inactive + WebkitTransition: 'background-color 500ms ease-out', + MozTransition: 'background-color 500ms ease-out', + OTransition: 'background-color 500ms ease-out', + transition: 'background-color 500ms ease-out', + }; + + // Set our initial state + this.state = { active: true }; + } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Behaviours *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - getInitialState() { - return { active: true }; - }, - handleLinkClick( e ) { e.preventDefault(); let newActive = !this.state.active; this.setState( { active: newActive } ); this.props.clickCallback( this.props.type, newActive ); return false; - }, + } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Final Render @@ -96,4 +100,4 @@ module.exports = React.createClass({ ); /* jshint ignore: end */ } -}); +} diff --git a/src/components/legend.jsx b/src/components/legend.jsx index 4e8496a..a80ff81 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -4,20 +4,25 @@ const LegendItem = require( './legend-item' ); /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -module.exports = React.createClass({ - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Styles - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - headerStyle: { - fontSize: 18, - marginTop: 0 - }, +export class Legend extends React.Component { + constructor( props ) { + + super( props ); - listStyle: { - listStyleType: 'none', - margin: 0, - padding: 0 - }, + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + this.headerStyle = { + fontSize: 18, + marginTop: 0 + }; + + this.listStyle = { + listStyleType: 'none', + margin: 0, + padding: 0 + }; + } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Final Render @@ -38,4 +43,4 @@ module.exports = React.createClass({ ); /* jshint ignore: end */ } -}); +} diff --git a/src/components/progress.jsx b/src/components/progress.jsx index 6d2df20..b47989b 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -7,34 +7,29 @@ *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ const tween = require( 'react-tween-state' ); -module.exports = React.createClass({ - mixins: [tween.Mixin], - - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Component state definition - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - getInitialState() { - return { currVal: 0.0 }; - }, - - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Styles - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - canvasStyle: { - display: 'block' - }, - - strokeStyle: { - radius: 25, - width: 5.0, - color: '#008EAF' - }, - - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Instance Variables - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - _canvas: null, - _context: null, +export class Progress extends React.Component { + constructor( props ) { + super( props ); + + this.mixins = [tween.Mixin]; + this.state = { currVal: 0.0 }; + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + this.canvasStyle = { display: 'block' }; + this.strokeStyle = { + radius: 25, + width: 5.0, + color: '#008EAF' + }; + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Instance Variables + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + this._canvas = null; + this._context = null; + } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component Methods @@ -53,11 +48,11 @@ module.exports = React.createClass({ this._context.fill(); this._context.lineWidth = this.strokeStyle.width; this._context.globalAlpha = 0.33; - }, + } componentDidUpdate() { this._updateProgress(); - }, + } handleProgressUpdate( newVal ) { let onEndFunc; @@ -76,7 +71,7 @@ module.exports = React.createClass({ endValue: newVal, onEnd: onEndFunc }); - }, + } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Behaviours @@ -101,7 +96,7 @@ module.exports = React.createClass({ false // stroke counterclockwise? ); this._context.stroke(); - }, + } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Final Render @@ -111,4 +106,4 @@ module.exports = React.createClass({ return( ); /* jshint ignore: end */ } -}); +} From ec6392303bd2feed61954846d8f1f6eb7c875d2a Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 10:59:27 -0400 Subject: [PATCH 161/190] Added note about React es6 status --- src/components/progress.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/progress.jsx b/src/components/progress.jsx index b47989b..f5ea0b0 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -10,7 +10,9 @@ const tween = require( 'react-tween-state' ); export class Progress extends React.Component { constructor( props ) { super( props ); - + + // FIXME: React's current es6 state doesn't support mixins. We may need to + // convert this class back to the old-school React.createClass() style this.mixins = [tween.Mixin]; this.state = { currVal: 0.0 }; From ef5b37ae71bd79284ab0b92a9ef9556fc92e368c Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 11:04:33 -0400 Subject: [PATCH 162/190] Constants are now es6 --- src/constants.coffee | 35 ----------------------------------- src/constants.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 35 deletions(-) delete mode 100644 src/constants.coffee create mode 100644 src/constants.js diff --git a/src/constants.coffee b/src/constants.coffee deleted file mode 100644 index 242635a..0000000 --- a/src/constants.coffee +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = - # Colour Constants - COLOUR_MAP: - r: new THREE.Color 0xFF1E00 - o: new THREE.Color 0xFF7F00 - b: new THREE.Color 0x008EAF - g: new THREE.Color 0x00CA35 - p: new THREE.Color 0xDC0068 - COLOUR_TYPES: [ 'r', 'o','b', 'g', 'p' ] - - PARTICLE_SPEED: 0.22 - NUM_TRAIL_PARTICLES: 12 - TRAIL_OPACITY_MULTIPLIER: 0.083 # this is just 1.0 / NUM_TRAIL_PARTICLES - - # This number was reached by multiple trials in which a particle curve never - # exceeded 40 vertices; just add a bit of buffer - TRACE_LINE_VERTEX_COUNT: 50 - - TRACE_LINE_OPACITY_LERP: 0.005 # 0.3/60 - - # Constants for the explosion effect (mostly just "magic numbers" that were - # determined by trial and error) - EXPLOSION_INITIAL_LERP_FACTOR: 0.06 - EXPLOSION_INCREMENTAL_LERP: 0.001 - EXPLOSION_OPACITY_LERP: 0.1 - EXPLOSION_ROTATION_ANGLE: 0.12 - - MESH_POOL_SIZE: 100 - - # For generating random dates - ONE_WEEK_IN_MILLIS: 604800000 - - # Determines how long (in ms) we want one "loop" of the viz to run - VIZ_LOOP_LENGTH: 300000 # default: 5min - VIZ_POLLING_INTERVAL: 500 diff --git a/src/constants.js b/src/constants.js new file mode 100644 index 0000000..f9df7ce --- /dev/null +++ b/src/constants.js @@ -0,0 +1,37 @@ +module.exports = { + // Colour Constants + COLOUR_MAP: { + r: new THREE.Color( 0xFF1E00 ), + o: new THREE.Color( 0xFF7F00 ), + b: new THREE.Color( 0x008EAF ), + g: new THREE.Color( 0x00CA35 ), + p: new THREE.Color( 0xDC0068 ) + }, + COLOUR_TYPES: [ 'r', 'o','b', 'g', 'p' ], + + PARTICLE_SPEED: 0.22, + NUM_TRAIL_PARTICLES: 12, + TRAIL_OPACITY_MULTIPLIER: 0.083, // this is just 1.0 / NUM_TRAIL_PARTICLES + + // This number was reached by multiple trials in which a particle curve never + // exceeded 40 vertices; just add a bit of buffer + TRACE_LINE_VERTEX_COUNT: 50, + + TRACE_LINE_OPACITY_LERP: 0.005, // 0.3/60 + + // Constants for the explosion effect (mostly just "magic numbers" that were + // determined by trial and error) + EXPLOSION_INITIAL_LERP_FACTOR: 0.06, + EXPLOSION_INCREMENTAL_LERP: 0.001, + EXPLOSION_OPACITY_LERP: 0.1, + EXPLOSION_ROTATION_ANGLE: 0.12, + + MESH_POOL_SIZE: 100, + + // For generating random dates + ONE_WEEK_IN_MILLIS: 604800000, + + // Determines how long (in ms) we want one "loop" of the viz to run + VIZ_LOOP_LENGTH: 300000, // default: 5min + VIZ_POLLING_INTERVAL: 500 +}; From e78c9a1cb5b23d2aacb493c8b78160395270bda3 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 11:20:34 -0400 Subject: [PATCH 163/190] replace CommonJS requires with module imports --- src/components/legend-item.jsx | 2 +- src/components/legend.jsx | 2 +- src/components/progress.jsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index 2d22ab1..dbd931c 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -1,6 +1,6 @@ // Component representing an individual legend item -const constants = require( '../constants' ); +import constants from '../constants'; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition diff --git a/src/components/legend.jsx b/src/components/legend.jsx index a80ff81..50e3592 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -1,5 +1,5 @@ // Main component for the interactive legend -const LegendItem = require( './legend-item' ); +import LegendItem from './legend-item'; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition diff --git a/src/components/progress.jsx b/src/components/progress.jsx index f5ea0b0..2670e32 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -5,7 +5,7 @@ * http://jsfiddle.net/oskar/Aapn8/ and * https://github.com/pughpugh/react-countdown-clock *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -const tween = require( 'react-tween-state' ); +import tween from 'react-tween-state'; export class Progress extends React.Component { constructor( props ) { From 5c9fbe2afc77b826366ddf0d5d1df198128e755e Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 11:35:15 -0400 Subject: [PATCH 164/190] Constants now use exports instead of CommonJS --- src/constants.js | 58 +++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/src/constants.js b/src/constants.js index f9df7ce..092fc49 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,37 +1,35 @@ -module.exports = { - // Colour Constants - COLOUR_MAP: { - r: new THREE.Color( 0xFF1E00 ), - o: new THREE.Color( 0xFF7F00 ), - b: new THREE.Color( 0x008EAF ), - g: new THREE.Color( 0x00CA35 ), - p: new THREE.Color( 0xDC0068 ) - }, - COLOUR_TYPES: [ 'r', 'o','b', 'g', 'p' ], +// Colour Constants +export const COLOUR_MAP = { + r: new THREE.Color( 0xFF1E00 ), + o: new THREE.Color( 0xFF7F00 ), + b: new THREE.Color( 0x008EAF ), + g: new THREE.Color( 0x00CA35 ), + p: new THREE.Color( 0xDC0068 ) +}; +export const COLOUR_TYPES = [ 'r', 'o','b', 'g', 'p' ]; - PARTICLE_SPEED: 0.22, - NUM_TRAIL_PARTICLES: 12, - TRAIL_OPACITY_MULTIPLIER: 0.083, // this is just 1.0 / NUM_TRAIL_PARTICLES +export const PARTICLE_SPEED = 0.22; +export const NUM_TRAIL_PARTICLES = 12; +export const TRAIL_OPACITY_MULTIPLIER = 0.083; // this is just 1.0 / NUM_TRAIL_PARTICLES - // This number was reached by multiple trials in which a particle curve never - // exceeded 40 vertices; just add a bit of buffer - TRACE_LINE_VERTEX_COUNT: 50, +// This number was reached by multiple trials in which a particle curve never +// exceeded 40 vertices; just add a bit of buffer +export const TRACE_LINE_VERTEX_COUNT = 50; - TRACE_LINE_OPACITY_LERP: 0.005, // 0.3/60 +export const TRACE_LINE_OPACITY_LERP = 0.005; // 0.3/60 - // Constants for the explosion effect (mostly just "magic numbers" that were - // determined by trial and error) - EXPLOSION_INITIAL_LERP_FACTOR: 0.06, - EXPLOSION_INCREMENTAL_LERP: 0.001, - EXPLOSION_OPACITY_LERP: 0.1, - EXPLOSION_ROTATION_ANGLE: 0.12, +// Constants for the explosion effect (mostly just "magic numbers" that were +// determined by trial and error) +export const EXPLOSION_INITIAL_LERP_FACTOR = 0.06; +export const EXPLOSION_INCREMENTAL_LERP = 0.001; +export const EXPLOSION_OPACITY_LERP = 0.1; +export const EXPLOSION_ROTATION_ANGLE = 0.12; - MESH_POOL_SIZE: 100, +export const MESH_POOL_SIZE = 100; - // For generating random dates - ONE_WEEK_IN_MILLIS: 604800000, +// For generating random dates +export const ONE_WEEK_IN_MILLIS = 604800000; - // Determines how long (in ms) we want one "loop" of the viz to run - VIZ_LOOP_LENGTH: 300000, // default: 5min - VIZ_POLLING_INTERVAL: 500 -}; +// Determines how long (in ms) we want one "loop" of the viz to run +export const VIZ_LOOP_LENGTH = 300000; // default: 5min +export const VIZ_POLLING_INTERVAL = 500; From d7369fb0058fa96ebd2304313c6b8606d104d0ca Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 12:01:32 -0400 Subject: [PATCH 165/190] Dataloading is now converted --- src/dataloading.coffee | 57 ----------------------------------- src/dataloading.js | 67 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 57 deletions(-) delete mode 100644 src/dataloading.coffee create mode 100644 src/dataloading.js diff --git a/src/dataloading.coffee b/src/dataloading.coffee deleted file mode 100644 index f3e7661..0000000 --- a/src/dataloading.coffee +++ /dev/null @@ -1,57 +0,0 @@ -constants = require './constants' - -module.exports = - loadWorldPins: ( latLonFile, callback ) -> _getDataFromServer latLonFile, callback - - loadCountryCodes: ( isoFile, callback ) -> _getDataFromServer isoFile, callback - - loadContentData: ( callback ) -> - filePath = encodeURI "categories/All.json" - _getDataFromServer filePath, callback - - # Generates randomized src/dest data, for when you want something slightly - # more "interesting" - loadRandomizedContentData: ( numPoints, countries, callback ) -> - toRet = [] - keys = Object.keys countries - now = Date.now() - - for idx in [0...numPoints] - srcIdx = Math.floor( Math.random() * keys.length ) - destIdx = Math.floor( Math.random() * keys.length ) - colourIdx = constants.COLOUR_TYPES[ Math.floor( Math.random() * constants.COLOUR_TYPES.length ) ] - - # generate a random timestamp within the last week - backInTime = Math.floor( Math.random() * constants.ONE_WEEK_IN_MILLIS ) - - # account for the rare cases where we get the same index - if srcIdx is destIdx - destIdx = if destIdx is keys.length - 1 then 0 else destIdx + 1 - - point = {} - point.src = countries[ keys[ srcIdx ] ] - point.dest = countries[ keys[ destIdx ] ] - point.colour = colourIdx - point.time = new Date( now - backInTime ) - toRet.push point - - callback toRet - -# private helper method -_getDataFromServer = ( path, callback ) -> - # We're going to ask a file for the JSON data. - xhr = new XMLHttpRequest() - - # Where do we get the data? - xhr.open 'GET', path, true - - # What do we do when we have it? - xhr.onreadystatechange = -> - # If we've received the data - if xhr.readyState is 4 and xhr.status is 200 - # Parse the JSON - parsedData = JSON.parse xhr.responseText - callback parsedData if callback - - # Begin request - xhr.send null diff --git a/src/dataloading.js b/src/dataloading.js new file mode 100644 index 0000000..ffbbdb6 --- /dev/null +++ b/src/dataloading.js @@ -0,0 +1,67 @@ +import constants from './constants'; + +export function loadWorldPins( latLonFile, callback ) { + _getDataFromServer( latLonFile, callback ); +} + +export function loadCountryCodes( isoFile, callback ) { + _getDataFromServer( isoFile, callback ); +} + +export function loadContentData( callback ) { + let filePath = encodeURI( "categories/All.json" ); + _getDataFromServer( filePath, callback ); +} + +// Generates randomized src/dest data, for when you want something slightly +// more "interesting" +export function loadRandomizedContentData( numPoints, countries, callback ) { + let toRet = []; + let keys = Object.keys( countries ); + let now = Date.now(); + + for( let idx = 0; idx < numPoints; idx++ ) { + let srcIdx = Math.floor( Math.random() * keys.length ); + let destIdx = Math.floor( Math.random() * keys.length ); + let colourIdx = constants.COLOUR_TYPES[ Math.floor( Math.random() * constants.COLOUR_TYPES.length ) ]; + + // generate a random timestamp within the last week + let backInTime = Math.floor( Math.random() * constants.ONE_WEEK_IN_MILLIS ); + + // account for the rare cases where we get the same index + if( srcIdx === destIdx ) { + destIdx = (destIdx === keys.length - 1) ? 0 : destIdx + 1; + } + + let point = {}; + point.src = countries[ keys[ srcIdx ] ]; + point.dest = countries[ keys[ destIdx ] ]; + point.colour = colourIdx; + point.time = new Date( now - backInTime ); + toRet.push( point ); + } + + callback( toRet ); +} + +// private helper method +function _getDataFromServer( path, callback ) { + // We're going to ask a file for the JSON data. + let xhr = new XMLHttpRequest(); + + // Where do we get the data? + xhr.open( 'GET', path, true ); + + // What do we do when we have it? + xhr.onreadystatechange = function() { + // If we've received the data + if( xhr.readyState === 4 && xhr.status === 200 ) { + // Parse the JSON + let parsedData = JSON.parse( xhr.responseText ); + if( callback ) callback( parsedData ); + } + }; + + // Begin request + xhr.send( null ); +} From 82f762f1e5e492af5c5d3f9627d0526b8e7e0918 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 12:51:18 -0400 Subject: [PATCH 166/190] Converted geopins --- src/geopins.coffee | 30 ------------------------------ src/geopins.js | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 30 deletions(-) delete mode 100644 src/geopins.coffee create mode 100644 src/geopins.js diff --git a/src/geopins.coffee b/src/geopins.coffee deleted file mode 100644 index dad1eb7..0000000 --- a/src/geopins.coffee +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = - loadGeoData: ( latlonData, countryLookup ) -> - countryData = {} - for index, country of latlonData.countries - # save out country name and code info - country.countryCode = index - country.countryName = countryLookup[index] - - # take the lat lon from the data and convert this to 3d globe space - center = module.exports.convertLatLonToVector country.lat, country.lon - - country.center = center - countryData[country.countryName] = country - - return countryData - - # Convert arbitrary lat/lon to a vector within the globe's space - convertLatLonToVector: ( lat, lon ) -> - rad = 100 - lon -= 90 - - phi = Math.PI/2 - lat * Math.PI / 180 - Math.PI * 0.01 - theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06 - - vec = new THREE.Vector3 - vec.x = Math.sin(phi) * Math.cos(theta) * rad - vec.y = Math.cos(phi) * rad - vec.z = Math.sin(phi) * Math.sin(theta) * rad - - return vec diff --git a/src/geopins.js b/src/geopins.js new file mode 100644 index 0000000..f882ae0 --- /dev/null +++ b/src/geopins.js @@ -0,0 +1,35 @@ +export function loadGeoData( latlonData, countryLookup ) { + let countryData = {}; + + Object.keys( latlonData.countries ).forEach( function( key ) { + let country = latlonData.countries[key]; + + // save out country name and code info + country.countryCode = key; + country.countryName = countryLookup[key]; + + // take the lat lon from the data and convert this to 3d globe space + center = convertLatLonToVector( country.lat, country.lon ); + + country.center = center; + countryData[country.countryName] = country; + }); + + return countryData; +} + +// Convert arbitrary lat/lon to a vector within the globe's space +export function convertLatLonToVector( lat, lon ) { + let rad = 100; + lon -= 90; + + let phi = Math.PI/2 - lat * Math.PI / 180 - Math.PI * 0.01; + let theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06; + + let vec = new THREE.Vector3(); + vec.x = Math.sin(phi) * Math.cos(theta) * rad; + vec.y = Math.cos(phi) * rad; + vec.z = Math.sin(phi) * Math.sin(theta) * rad; + + return vec; +} From 1f6d579ffd88561387701f362d667c666676072f Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 12:52:52 -0400 Subject: [PATCH 167/190] Switched anon function to arrow function --- src/geopins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geopins.js b/src/geopins.js index f882ae0..4c4c43f 100644 --- a/src/geopins.js +++ b/src/geopins.js @@ -1,7 +1,7 @@ export function loadGeoData( latlonData, countryLookup ) { let countryData = {}; - Object.keys( latlonData.countries ).forEach( function( key ) { + Object.keys( latlonData.countries ).forEach( ( key ) => { let country = latlonData.countries[key]; // save out country name and code info From 1a5cb98042440f23db8456290781cf7416e06459 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 14:24:30 -0400 Subject: [PATCH 168/190] Converted mousekeyboard --- src/mousekeyboard.coffee | 107 ---------------------------------- src/mousekeyboard.js | 122 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 107 deletions(-) delete mode 100644 src/mousekeyboard.coffee create mode 100644 src/mousekeyboard.js diff --git a/src/mousekeyboard.coffee b/src/mousekeyboard.coffee deleted file mode 100644 index 630cb4f..0000000 --- a/src/mousekeyboard.coffee +++ /dev/null @@ -1,107 +0,0 @@ -vizLines = require './visualize_lines' - -# Ugly variable declarations -mouseX = 0; mouseY = 0; pmouseX = 0; pmouseY = 0; pressX = 0; pressY = 0 -dragging = false; rotateVY = 0 -rotateTargetX = 0; rotateTargetY = 0 - -rotateVX = 0.35 * Math.PI/180 -rotateXMax = 90 * Math.PI/180 -_autoRotateId = null - -keyboard = new THREEx.KeyboardState() - -module.exports = - - rotateX: 0 - rotateY: 0 - - updateRotation: -> - if rotateTargetX? and rotateTargetY? - rotateVX += (rotateTargetX - this.rotateX) * 0.012 - rotateVY += (rotateTargetY - this.rotateY) * 0.012 - - if Math.abs(rotateTargetX - this.rotateX) < 0.1 && Math.abs(rotateTargetY - this.rotateY) < 0.1 - rotateTargetX = undefined - rotateTargetY = undefined - - this.rotateX += rotateVX - this.rotateY += rotateVY - - rotateVX *= 0.98 - rotateVY *= 0.98 - - if dragging or rotateTargetX? - rotateVX *= 0.6 - rotateVY *= 0.6 - - # constrain the pivot up/down to the poles - # force a bit of bounce back action when hitting the poles - if this.rotateX < -rotateXMax - this.rotateX = -rotateXMax - rotateVX *= -0.95 - - if this.rotateX > rotateXMax - this.rotateX = rotateXMax - rotateVX *= -0.95 - - onDocumentMouseMove: ( camera, event ) -> - pmouseX = mouseX - pmouseY = mouseY - - mouseX = event.clientX - window.innerWidth * 0.5 - mouseY = event.clientY - window.innerHeight * 0.5 - - if dragging - if keyboard.pressed( "shift" ) is false - rotateVY += (mouseX - pmouseX) / 2 * Math.PI / 180 * 0.3 - rotateVX += (mouseY - pmouseY) / 2 * Math.PI / 180 * 0.3 - else - camera.position.x -= (mouseX - pmouseX) * 0.5 - camera.position.y += (mouseY - pmouseY) * 0.5 - - onDocumentMouseDown: ( event ) -> - if event.target.className.indexOf( 'noMapDrag' ) isnt -1 - return - - dragging = true - pressX = mouseX - pressY = mouseY - rotateTargetX = undefined - rotateTargetX = undefined - module.exports.stopAutoRotate() - return - - onDocumentMouseUp: ( event ) -> - dragging = false - histogramPressed = false - module.exports.startAutoRotate() - return - - onClick: ( event ) -> - if Math.abs(pressX - mouseX) > 3 or Math.abs(pressY - mouseY) > 3 - return - - handleMWheel: ( delta, camera ) -> - camera.scale.z += delta * 0.1 - camera.scale.z = vizLines.constrain camera.scale.z, 0.7, 5.0 - - onMouseWheel: ( camera, event ) -> - delta = 0 - - if event.wheelDelta - delta = event.wheelDelta / 120 - else if event.detail - delta = -event.detail/3 - - if delta? - module.exports.handleMWheel delta, camera - - event.returnValue = false - - startAutoRotate: -> - _autoRotateId = window.setInterval -> - rotateVY += 0.1 * Math.PI / 180 * 0.3 - , 100 - - stopAutoRotate: -> window.clearInterval _autoRotateId diff --git a/src/mousekeyboard.js b/src/mousekeyboard.js new file mode 100644 index 0000000..f97c8bf --- /dev/null +++ b/src/mousekeyboard.js @@ -0,0 +1,122 @@ +import vizLines from './visualize_lines'; + +// Ugly variable declarations +const rotateXMax = 90 * Math.PI/180; + +let rotateVX = 0.35 * Math.PI/180; +let mouseX = 0; +let mouseY = 0; +let pmouseX = 0; +let pmouseY = 0; +let pressX = 0; +let pressY = 0; +let dragging = false; +let rotateVY = 0; +let rotateTargetX = 0; +let rotateTargetY = 0; + +let _autoRotateId = null; +let keyboard = new THREEx.KeyboardState(); + +export var rotateX = 0; +export var rotateY = 0; + +export function updateRotation() { + if( rotateTargetX && rotateTargetY ) { + rotateVX += (rotateTargetX - rotateX) * 0.012; + rotateVY += (rotateTargetY - rotateY) * 0.012; + + if( Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1 ) { + rotateTargetX = undefined; + rotateTargetY = undefined; + } + } + + rotateX += rotateVX; + rotateY += rotateVY; + + rotateVX *= 0.98; + rotateVY *= 0.98; + + if( dragging || rotateTargetX ) { + rotateVX *= 0.6; + rotateVY *= 0.6; + } + + // constrain the pivot up/down to the poles + // force a bit of bounce back action when hitting the poles + if( rotateX < -rotateXMax ) { + rotateX = -rotateXMax; + rotateVX *= -0.95; + } + + if( rotateX > rotateXMax ) { + rotateX = rotateXMax; + rotateVX *= -0.95; + } +} + +export function onDocumentMouseMove( camera, event ) { + pmouseX = mouseX; + pmouseY = mouseY; + + mouseX = event.clientX - window.innerWidth * 0.5; + mouseY = event.clientY - window.innerHeight * 0.5; + + if( dragging ) { + if( !keyboard.pressed( "shift" ) ) { + rotateVY += (mouseX - pmouseX) / 2 * Math.PI / 180 * 0.3; + rotateVX += (mouseY - pmouseY) / 2 * Math.PI / 180 * 0.3; + } else { + camera.position.x -= (mouseX - pmouseX) * 0.5; + camera.position.y += (mouseY - pmouseY) * 0.5; + } + } +} + +export function onDocumentMouseDown( event ) { + if( event.target.className.indexOf( 'noMapDrag' ) != -1 ) { + return; + } + + dragging = true; + pressX = mouseX; + pressY = mouseY; + rotateTargetX = undefined; + rotateTargetX = undefined; + stopAutoRotate(); +} + +export function onDocumentMouseUp( event ) { + dragging = false; + startAutoRotate(); +} + +export function handleMWheel( delta, camera ) { + camera.scale.z += delta * 0.1; + camera.scale.z = vizLines.constrain( camera.scale.z, 0.7, 5.0 ); +} + +export function onMouseWheel( camera, event ) { + let delta = 0; + + if( event.wheelDelta ) { + delta = event.wheelDelta / 120; + } else if( event.detail ) { + delta = -event.detail/3; + } + + if( delta ) { + handleMWheel( delta, camera ); + } + + event.returnValue = false; +} + +export function startAutoRotate() { + _autoRotateId = window.setInterval( () => { + rotateVY += 0.1 * Math.PI / 180 * 0.3; + }, 100 ); +} + +export function stopAutoRotate() { window.clearInterval( _autoRotateId ); } From a4219466789c6790d6654d7c3435f599e4440f43 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 15:03:03 -0400 Subject: [PATCH 169/190] Converted util --- src/util.coffee | 29 ----------------------------- src/util.js | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 29 deletions(-) delete mode 100644 src/util.coffee create mode 100644 src/util.js diff --git a/src/util.coffee b/src/util.coffee deleted file mode 100644 index d74a396..0000000 --- a/src/util.coffee +++ /dev/null @@ -1,29 +0,0 @@ -THREE.Curve.Utils.createLineGeometry = ( points ) -> - geometry = new THREE.Geometry() - for point in points - geometry.vertices.push point - - return geometry - -module.exports = - wrap: ( value, min, rangeSize ) -> - rangeSize -= min - while value < min - value += rangeSize - - return value % rangeSize - - screenXY: ( vec3, camera ) -> - projector = new THREE.Projector() - vector = projector.projectVector vec3.clone(), camera - result = {} - - windowWidth = window.innerWidth - minWidth = 1280 - if windowWidth < minWidth - windowWidth = minWidth - - result.x = Math.round( vector.x * (windowWidth/2) ) + windowWidth/2 - result.y = Math.round( (0-vector.y) * (window.innerHeight/2) ) + window.innerHeight/2 - - return result diff --git a/src/util.js b/src/util.js new file mode 100644 index 0000000..1ac536b --- /dev/null +++ b/src/util.js @@ -0,0 +1,21 @@ +export function wrap( value, min, rangeSize ) { + rangeSize -= min; + while( value < min ) { + value += rangeSize; + } + + return value % rangeSize; +} + +export function screenXY( vec3, camera ) { + let projector = new THREE.Projector(); + let vector = projector.projectVector( vec3.clone(), camera ); + let result = {}; + + let windowWidth = ( windowWidth < 1280 ) ? 1280 : window.innerWidth; + + result.x = Math.round( vector.x * (windowWidth/2) ) + windowWidth/2; + result.y = Math.round( (0-vector.y) * (window.innerHeight/2) ) + window.innerHeight/2; + + return result; +} From ebdf6efd6d3c0a0d15728a88ff8df06f4f283e05 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 15:16:16 -0400 Subject: [PATCH 170/190] Converted visualize_lines --- src/visualize_lines.coffee | 74 ----------------------------------- src/visualize_lines.js | 80 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 74 deletions(-) delete mode 100644 src/visualize_lines.coffee create mode 100644 src/visualize_lines.js diff --git a/src/visualize_lines.coffee b/src/visualize_lines.coffee deleted file mode 100644 index a3385ba..0000000 --- a/src/visualize_lines.coffee +++ /dev/null @@ -1,74 +0,0 @@ -globeRadius = 1000 -vec3_origin = new THREE.Vector3 0, 0, 0 - -module.exports = - makeConnectionLineGeometry: ( exporter, importer ) -> - if not exporter.countryName? or not importer.countryName? - return undefined - - distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length() - - # how high we want to shoot the curve upwards - anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.7 - - # start/end of the line - start = exporter.center - end = importer.center - - # midpoint for the curve - mid = start.clone().lerp end, 0.5 - midLength = mid.length() - mid.normalize() - mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.45 ) - - # the normal from start to end - normal = (new THREE.Vector3()).subVectors start, end - normal.normalize() - - # The curve looks like this: - # - # midStartAnchor---- mid ----- midEndAnchor - # / \ - # / \ - # / \ - # start/anchor end/anchor - # - # splineCurveA splineCurveB - - distanceHalf = distanceBetweenCountryCenter * 0.5 - - startAnchor = start - midStartAnchor = mid.clone().add( normal.clone().multiplyScalar( distanceHalf ) ) - midEndAnchor = mid.clone().add( normal.clone().multiplyScalar( -distanceHalf ) ) - endAnchor = end - - # now make a bezier curve out of the above like so in the diagram - splineCurveA = new THREE.CubicBezierCurve3 start, startAnchor, midStartAnchor, mid - splineCurveB = new THREE.CubicBezierCurve3 mid, midEndAnchor, endAnchor, end - - # how many vertices do we want on this guy? this is for *each* side - vertexCountDesired = Math.floor( distanceBetweenCountryCenter * 0.02 + 6 ) * 2 - - # collect the vertices - points = splineCurveA.getPoints vertexCountDesired - - # remove the very last point since it will be duplicated on the next half of the curve - points = points.splice 0, points.length - 1 - points = points.concat( splineCurveB.getPoints( vertexCountDesired ) ) - - # add one final point to the center of the earth - # we need this for drawing multiple arcs, but piled into one geometry buffer - points.push vec3_origin - - # create a line geometry out of these - curveGeometry = THREE.Curve.Utils.createLineGeometry points - - return curveGeometry; - - constrain: (v, min, max) -> - if v < min - v = min - else if v > max - v = max - - return v diff --git a/src/visualize_lines.js b/src/visualize_lines.js new file mode 100644 index 0000000..555758a --- /dev/null +++ b/src/visualize_lines.js @@ -0,0 +1,80 @@ +let globeRadius = 1000; +let vec3_origin = new THREE.Vector3( 0, 0, 0 ); + +export function makeConnectionLineGeometry( exporter, importer ) { + if( !exporter.countryName || !importer.countryName ) { + return undefined; + } + + let distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length(); + + // how high we want to shoot the curve upwards + let anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.7; + + // start/end of the line + let start = exporter.center; + let end = importer.center; + + // midpoint for the curve + let mid = start.clone().lerp( end, 0.5 ); + let midLength = mid.length(); + mid.normalize(); + mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.45 ); + + // the normal from start to end + let normal = (new THREE.Vector3()).subVectors( start, end ); + normal.normalize(); + + // The curve looks like this: + // + // midStartAnchor---- mid ----- midEndAnchor + // / \ + // / \ + // / \ + // start/anchor end/anchor + // + // splineCurveA splineCurveB + + let distanceHalf = distanceBetweenCountryCenter * 0.5; + + let startAnchor = start; + let midStartAnchor = mid.clone().add( normal.clone().multiplyScalar( distanceHalf ) ); + let midEndAnchor = mid.clone().add( normal.clone().multiplyScalar( -distanceHalf ) ); + let endAnchor = end; + + // now make a bezier curve out of the above like so in the diagram + let splineCurveA = new THREE.CubicBezierCurve3( start, startAnchor, midStartAnchor, mid ); + let splineCurveB = new THREE.CubicBezierCurve3( mid, midEndAnchor, endAnchor, end ); + + // how many vertices do we want on this guy? this is for *each* side + let vertexCountDesired = Math.floor( distanceBetweenCountryCenter * 0.02 + 6 ) * 2; + + // collect the vertices + let points = splineCurveA.getPoints( vertexCountDesired ); + + // remove the very last point since it will be duplicated on the next half of the curve + points = points.splice( 0, points.length - 1 ); + points = points.concat( splineCurveB.getPoints( vertexCountDesired ) ); + + // add one final point to the center of the earth + // we need this for drawing multiple arcs, but piled into one geometry buffer + points.push( vec3_origin ); + + // create a line geometry out of these + let curveGeometry = new THREE.Geometry(); + points.forEach( (point) => { + curveGeometry.vertices.push( point ); + }); + + return curveGeometry; +} + +export function constrain(v, min, max) { + if( v < min ) { + v = min; + } else if( v > max ) { + v = max; + } + + return v; +} From 721dd4b7e776c487fda7efaa8ac8f0d894292198 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 15:38:17 -0400 Subject: [PATCH 171/190] Converted main --- src/main.coffee | 216 ---------------------------------------------- src/main.js | 225 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 225 insertions(+), 216 deletions(-) delete mode 100644 src/main.coffee create mode 100644 src/main.js diff --git a/src/main.coffee b/src/main.coffee deleted file mode 100644 index ca8ead9..0000000 --- a/src/main.coffee +++ /dev/null @@ -1,216 +0,0 @@ -# 3rd Party libraries -us = require 'underscore' - -# All our dependencies -dataLoading = require './dataloading' -mouseKeyboard = require './mousekeyboard' -visualize = require './visualize' -geopins = require './geopins' -constants = require './constants' - -# React components -Legend = require './components/legend' -Progress = require './components/progress' - -masterContainer = document.getElementById 'visualization' -overlay = document.getElementById 'visualization' -glContainer = document.getElementById 'glContainer' - -# Visualization components that need to be accessible throughout this module -rotating = null -renderer = null -scene = null -camera = null -visualizationMesh = null -progressViz = null - -# Holds all the data we get back from the server -_countryLookup = null -_latLonData = null -_sampleData = null - -# Used with our data pump. Allows us to evenly distribute the points -_minDataTimestamp = null -_maxDataTimestamp = null -_remainingData = null - -startDataPump = -> - # How many times we'll be polling for data in a single "loop" - numPollingIntervals = constants.VIZ_LOOP_LENGTH / constants.VIZ_POLLING_INTERVAL - - # keep track of the current polling interval for the progress viz - currPollingInterval = 0 - - # How much "real time" elapses in the data set - timeRangeInData = _maxDataTimestamp.getTime() - _minDataTimestamp.getTime() - - # How much "real time" we'll consume on each tick of the data pump - tickLength = Math.floor( timeRangeInData / numPollingIntervals ) - - # keep track of our last "start time" - lastTime = _minDataTimestamp.getTime() - - window.setInterval -> - dataToViz = getDataForTick( lastTime, lastTime + tickLength ) - lastTime += tickLength - currPollingInterval++ - - if lastTime >= _maxDataTimestamp.getTime() - lastTime = _minDataTimestamp.getTime() - currPollingInterval = 0 - - visualize.initVisualization( dataToViz ) - progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ) - return - , constants.VIZ_POLLING_INTERVAL - -getDataForTick = ( startTime, endTime ) -> - # We could be smarter about this algorithm and keep track of our last - # index into the data to speed up processing, but given that we'll only - # be operating on a few thousand points at a time, we kept it fairly simple - - # If we're starting at the beginning, all our data is technically "remaining" - if startTime == _minDataTimestamp.getTime() - _remainingData = _sampleData - - # This will split our array into two pieces: those points which fall into - # the given "tick", and those that don't. Since time's advancing we know that - # once a point satisfies this condition we won't use it again until we loop - partitions = us.partition( _remainingData, ( point ) -> - time = point.time.getTime() - return time >= startTime and time <= endTime - ) - - _remainingData = partitions[1] - - return partitions[0] - -# All the initialization stuff for THREE.js -initScene = -> - scene = new THREE.Scene() - scene.matrixAutoUpdate = false - - light1 = new THREE.SpotLight 0xeeeeee, 3 - light1.position.x = 730 - light1.position.y = 520 - light1.position.z = 626 - light1.castShadow = true - scene.add light1 - - light2 = new THREE.SpotLight 0xeeeeee, 1.5 - light2.position.x = -730 - light2.position.y = 520 - light2.position.z = 626 - light2.castShadow = true - scene.add light2 - - light3 = new THREE.PointLight 0x222222, 14.8 - light3.position.x = 0 - light3.position.y = -750 - light3.position.z = 0 - scene.add light3 - - rotating = new THREE.Object3D() - scene.add rotating - - shaderMaterial = new THREE.MeshLambertMaterial { map: THREE.ImageUtils.loadTexture 'images/map_outline.png' } - - # Create the backing (sphere) - sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ) - sphere.doubleSided = false - sphere.rotation.x = Math.PI - sphere.rotation.y = -Math.PI/2 - sphere.rotation.z = Math.PI - sphere.id = "base" - rotating.add sphere - - visualizationMesh = new THREE.Object3D() - rotating.add visualizationMesh - - # Set up our renderer - renderer = new THREE.WebGLRenderer {antialias:false, alpha: true} - renderer.setSize window.innerWidth, window.innerHeight - renderer.autoClear = false - - renderer.sortObjects = false - renderer.generateMipmaps = false - - glContainer.appendChild renderer.domElement - - # Setup our camera - camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ) - camera.position.z = 1400 - camera.position.y = 0 - scene.add camera - - # Event listeners - masterContainer.addEventListener 'mousemove', mouseKeyboard.onDocumentMouseMove.bind( null, camera ), true - masterContainer.addEventListener 'mousedown', mouseKeyboard.onDocumentMouseDown, true - masterContainer.addEventListener 'mouseup', mouseKeyboard.onDocumentMouseUp, false - - masterContainer.addEventListener 'click', mouseKeyboard.onClick, true - masterContainer.addEventListener 'mousewheel', mouseKeyboard.onMouseWheel.bind( null, camera ), false - - # firefox - masterContainer.addEventListener 'DOMMouseScroll', (e) -> - evt = window.event or e - mouseKeyboard.onMouseWheel camera, evt - , false - - windowResize = THREEx.WindowResize renderer, camera - - # Get the globe spinning (defined in mousekeyboard.js) - mouseKeyboard.startAutoRotate() - -animate = -> - mouseKeyboard.updateRotation() - - rotating.rotation.x = mouseKeyboard.rotateX - rotating.rotation.y = mouseKeyboard.rotateY - - requestAnimationFrame animate - renderer.render scene, camera - -# Loads our React components into the scene -reactInit = -> - # Legend - React.render( - React.createElement( Legend, - types: constants.COLOUR_TYPES - clickCallback: visualize.toggleVisualizationType - ) - document.getElementById 'legend' - ) - - # ... and our progress bar. We hold on to a ref so we can update its state as - # we cycle through our data - progressViz = React.render( - React.createElement( Progress, null ) - document.getElementById 'progress' - ) - -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Startup code -#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if not Detector.webgl - Detector.addGetWebGLMessage() -else - initScene() - visualize.initMeshPool( constants.MESH_POOL_SIZE, visualizationMesh ) - - # Render our React components - reactInit() - - dataLoading.loadCountryCodes 'country_iso3166.json', ( isoData ) -> - _countryLookup = isoData - dataLoading.loadWorldPins 'country_lat_lon.json', ( latLonData ) -> - _latLonData = latLonData - dataLoading.loadRandomizedContentData 2000, _countryLookup, ( sampleData ) -> - _sampleData = us.sortBy sampleData, 'time' - _minDataTimestamp = _sampleData[0].time - _maxDataTimestamp = _sampleData[ _sampleData.length - 1 ].time - countryData = geopins.loadGeoData _latLonData, _countryLookup - visualize.buildDataVizGeometries _sampleData, countryData - - animate() - startDataPump() diff --git a/src/main.js b/src/main.js new file mode 100644 index 0000000..9a13b3b --- /dev/null +++ b/src/main.js @@ -0,0 +1,225 @@ +// 3rd Party libraries +import us from 'underscore'; + +// All our dependencies +import dataLoading from './dataloading'; +import mouseKeyboard from './mousekeyboard'; +import visualize from './visualize'; +import geopins from './geopins'; +import constants from './constants'; + +// React components +import Legend from './components/legend'; +import Progress from './components/progress'; + +const masterContainer = document.getElementById( 'visualization' ); +const overlay = document.getElementById( 'visualization' ); +const glContainer = document.getElementById( 'glContainer' ); + +// Visualization components that need to be accessible throughout this module +let rotating = null; +let renderer = null; +let scene = null; +let camera = null; +let visualizationMesh = null; +let progressViz = null; + +// Holds all the data we get back from the server +let _countryLookup = null; +let _latLonData = null; +let _sampleData = null; + +// Used with our data pump. Allows us to evenly distribute the points +let _minDataTimestamp = null; +let _maxDataTimestamp = null; +let _remainingData = null; + +function startDataPump() { + // How many times we'll be polling for data in a single "loop" + let numPollingIntervals = constants.VIZ_LOOP_LENGTH / constants.VIZ_POLLING_INTERVAL; + + // keep track of the current polling interval for the progress viz + let currPollingInterval = 0; + + // How much "real time" elapses in the data set + let timeRangeInData = _maxDataTimestamp.getTime() - _minDataTimestamp.getTime(); + + // How much "real time" we'll consume on each tick of the data pump + let tickLength = Math.floor( timeRangeInData / numPollingIntervals ); + + // keep track of our last "start time" + let lastTime = _minDataTimestamp.getTime(); + + window.setInterval( () => { + let dataToViz = getDataForTick( lastTime, lastTime + tickLength ); + lastTime += tickLength; + currPollingInterval++; + + if( lastTime >= _maxDataTimestamp.getTime() ) { + lastTime = _minDataTimestamp.getTime(); + currPollingInterval = 0; + } + + visualize.initVisualization( dataToViz ); + progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ); + + }, constants.VIZ_POLLING_INTERVAL ); +} + +function getDataForTick( startTime, endTime ) { + // We could be smarter about this algorithm and keep track of our last + // index into the data to speed up processing, but given that we'll only + // be operating on a few thousand points at a time, we kept it fairly simple + + // If we're starting at the beginning, all our data is technically "remaining" + if( startTime == _minDataTimestamp.getTime() ) { + _remainingData = _sampleData; + } + + // This will split our array into two pieces: those points which fall into + // the given "tick", and those that don't. Since time's advancing we know that + // once a point satisfies this condition we won't use it again until we loop + let partitions = us.partition( _remainingData, ( point ) => { + time = point.time.getTime(); + return ( time >= startTime ) && ( time <= endTime ); + }); + + _remainingData = partitions[1]; + + return partitions[0]; +} + +// All the initialization stuff for THREE.js +function initScene() { + scene = new THREE.Scene(); + scene.matrixAutoUpdate = false; + + let light1 = new THREE.SpotLight( 0xeeeeee, 3 ); + light1.position.x = 730; + light1.position.y = 520; + light1.position.z = 626; + light1.castShadow = true; + scene.add( light1 ); + + let light2 = new THREE.SpotLight( 0xeeeeee, 1.5 ); + light2.position.x = -730; + light2.position.y = 520; + light2.position.z = 626; + light2.castShadow = true; + scene.add( light2 ); + + let light3 = new THREE.PointLight( 0x222222, 14.8 ); + light3.position.x = 0; + light3.position.y = -750; + light3.position.z = 0; + scene.add( light3 ); + + rotating = new THREE.Object3D(); + scene.add( rotating ); + + let shaderMaterial = new THREE.MeshLambertMaterial({ + map: THREE.ImageUtils.loadTexture( 'images/map_outline.png' ) + }); + + // Create the backing (sphere) + let sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); + sphere.doubleSided = false; + sphere.rotation.x = Math.PI; + sphere.rotation.y = -Math.PI/2; + sphere.rotation.z = Math.PI; + sphere.id = "base"; + rotating.add( sphere ); + + visualizationMesh = new THREE.Object3D(); + rotating.add( visualizationMesh ); + + // Set up our renderer + renderer = new THREE.WebGLRenderer({ antialias:false, alpha: true }); + renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.autoClear = false; + renderer.sortObjects = false; + renderer.generateMipmaps = false; + glContainer.appendChild( renderer.domElement ); + + // Setup our camera + camera = new THREE.PerspectiveCamera( 12, window.innerWidth / window.innerHeight, 1, 20000 ); + camera.position.z = 1400; + camera.position.y = 0; + scene.add( camera ); + + // Event listeners + masterContainer.addEventListener( 'mousemove', mouseKeyboard.onDocumentMouseMove.bind( null, camera ), true ); + masterContainer.addEventListener( 'mousedown', mouseKeyboard.onDocumentMouseDown, true ); + masterContainer.addEventListener( 'mouseup', mouseKeyboard.onDocumentMouseUp, false ); + masterContainer.addEventListener( 'mousewheel', mouseKeyboard.onMouseWheel.bind( null, camera ), false ); + + // firefox + masterContainer.addEventListener( 'DOMMouseScroll', (e) => { + let evt = window.event || e; + mouseKeyboard.onMouseWheel( camera, evt ); + }, false ); + + THREEx.WindowResize( renderer, camera ); + + // Get the globe spinning (defined in mousekeyboard.js) + mouseKeyboard.startAutoRotate(); +} + +function animate() { + mouseKeyboard.updateRotation(); + + rotating.rotation.x = mouseKeyboard.rotateX; + rotating.rotation.y = mouseKeyboard.rotateY; + + requestAnimationFrame( animate ); + renderer.render( scene, camera ); +} + +// Loads our React components into the scene +function reactInit() { + // Legend + React.render( + React.createElement( Legend, { + types: constants.COLOUR_TYPES, + clickCallback: visualize.toggleVisualizationType + }), + document.getElementById( 'legend' ) + ); + + // ... and our progress bar. We hold on to a ref so we can update its state as + // we cycle through our data + progressViz = React.render( + React.createElement( Progress, null ), + document.getElementById( 'progress' ) + ); +} + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Startup code +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +if( !Detector.webgl ) { + Detector.addGetWebGLMessage(); +} else { + initScene(); + visualize.initMeshPool( constants.MESH_POOL_SIZE, visualizationMesh ); + + // Render our React components + reactInit(); + + dataLoading.loadCountryCodes( 'country_iso3166.json', ( isoData ) => { + _countryLookup = isoData; + dataLoading.loadWorldPins( 'country_lat_lon.json', ( latLonData ) => { + _latLonData = latLonData; + dataLoading.loadRandomizedContentData( 2000, _countryLookup, ( sampleData ) => { + _sampleData = us.sortBy( sampleData, 'time' ); + _minDataTimestamp = _sampleData[0].time; + _maxDataTimestamp = _sampleData[ _sampleData.length - 1 ].time; + let countryData = geopins.loadGeoData( _latLonData, _countryLookup ); + visualize.buildDataVizGeometries( _sampleData, countryData ); + + animate(); + startDataPump(); + }); + }); + }); +} From 48b4dd631b4db2a3c74bc63d7c06b1080e298e3b Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 16:33:07 -0400 Subject: [PATCH 172/190] Converted visualize --- src/visualize.coffee | 313 ------------------------------------ src/visualize.js | 368 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 368 insertions(+), 313 deletions(-) delete mode 100644 src/visualize.coffee create mode 100644 src/visualize.js diff --git a/src/visualize.coffee b/src/visualize.coffee deleted file mode 100644 index 3378f4d..0000000 --- a/src/visualize.coffee +++ /dev/null @@ -1,313 +0,0 @@ -constants = require './constants' -vizLines = require './visualize_lines' - -vec3_origin = new THREE.Vector3 0, 0, 0 -vec3_x_axis = new THREE.Vector3 1, 0, 0 -vec3_y_axis = new THREE.Vector3 0, 1, 0 -vec3_z_axis = new THREE.Vector3 0, 0, 1 - -_meshPool = [] - -# Used to keep track of which types we're not currently displaying -_typeStatus = {} -for type in constants.COLOUR_TYPES - _typeStatus[ type ] = true - -module.exports = - buildDataVizGeometries: ( linearData, countryData ) -> - loadLayer = document.getElementById 'loading' - count = 0 - - for set in linearData - exporterName = set.src.toUpperCase() - importerName = set.dest.toUpperCase() - - exporter = countryData[exporterName] - importer = countryData[importerName] - - # we couldn't find the country, it wasn't in our list... - if not exporter? or not importer? - continue - - # visualize this event - set.lineGeometry = vizLines.makeConnectionLineGeometry exporter, importer - - loadLayer.style.display = 'none' - return - - initMeshPool: ( poolSize, visualizationMesh ) -> - _meshPool.push new ParticleMesh( visualizationMesh ) for i in [0...poolSize] - - initParticleViz: ( linearData ) -> - return null if not linearData.lineGeometry? - # Don't display if we've toggled this type off - return null if not _typeStatus[ linearData.colour ] - - _getMeshFromPool ( meshObj ) -> - # get our colour - color = _getColourFromTypeStr linearData.colour - - # merge it all together - meshObj.linesGeo.merge linearData.lineGeometry - points = linearData.lineGeometry.vertices - point = points[0] - particle = point.clone() - particle.moveIndex = 0 - particle.nextIndex = 1 - particle.lerpN = 0 - particle.path = points - meshObj.particlesGeo.vertices.push particle - - meshObj.traceLineMat.opacity = 1.0 - - meshObj.attributes.alpha.value.push 1.0 - meshObj.attributes.customColor.value.push color - - # Create a trail for the particles by adding extra, slightly offset, particles - for num in [1..constants.NUM_TRAIL_PARTICLES] - trail = particle.clone() - trail.moveIndex = 0 - trail.nextIndex = 1 - trail.lerpN = -1 * constants.PARTICLE_SPEED * num - trail.path = points - meshObj.particlesGeo.vertices.push trail - meshObj.attributes.alpha.value.push( 1.0 - ( constants.TRAIL_OPACITY_MULTIPLIER * num ) ) - meshObj.attributes.customColor.value.push color - - # Set the explosion color, too - meshObj.explosionSphere.material.color = color - meshObj.traceLineMat.color = color - - # since colours have been updated, tell THREE to force an update - meshObj.attributes.alpha.needsUpdate = true - meshObj.attributes.customColor.needsUpdate = true - - meshObj.vizMesh.add meshObj.splineOutline - meshObj.vizMesh.add meshObj.traceLine - meshObj.startParticleUpdates() - - initVisualization: ( linearData ) -> - # build the meshes. One for each entry in our data - for data in linearData - module.exports.initParticleViz data - - toggleVisualizationType: ( type, active ) -> - _typeStatus[ type ] = active - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# HELPER METHODS -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -_getMeshFromPool = ( callback ) -> - if _meshPool.length > 0 - callback _meshPool.shift() - else - window.setTimeout _getMeshFromPool, 500, callback - -_returnMeshToPool = ( mesh ) -> - # clean up the two geometries - mesh.linesGeo.vertices = [] - mesh.particlesGeo.vertices = [] - mesh.pSystem.systemComplete = false - mesh.explosionSphere.complete = false - mesh.explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR - mesh.explosionSphere.finalPos = null - mesh.explosionSphere.rotationAxis = null - mesh.explosionSphere.material.opacity = 1.0 - mesh.attributes.alpha.value = [] - mesh.attributes.customColor.value = [] - - window.clearInterval mesh.particleUpdateId - window.clearInterval mesh.explosionUpdateId - - # have to remove from the scene or else bad things happen - mesh.vizMesh.remove mesh.splineOutline - mesh.vizMesh.remove mesh.traceLine - mesh.vizMesh.remove mesh.explosionSphere - - _meshPool.push mesh - -_getColourFromTypeStr = ( colorStr ) -> - colour = constants.COLOUR_MAP[colorStr] - colour = constants.COLOUR_MAP.r if not colour - - return colour - -class ParticleMesh - constructor: ( @vizMesh ) -> - @particleUpdateId = null - @explosionUpdateId = null - @linesGeo = new THREE.Geometry() - @particlesGeo = new THREE.Geometry() - # Particle size now set in custom shader - # @particleSize = 150 - - @splineOutline = new THREE.Line null, new THREE.LineBasicMaterial( { visible: false } ) - - # Use custom shader to have the trail taper off in transparency - @attributes = - alpha: { type: 'f', value: [] } - customColor: { type: 'c', value: [] } - - @uniforms = - color: { type: 'c', value: new THREE.Color( 0xffffff ) } - texture: { type: 't', value: THREE.ImageUtils.loadTexture "images/particleB.png" } - - @shaderMaterial = new THREE.ShaderMaterial - uniforms: @uniforms - attributes: @attributes - vertexShader: document.getElementById( 'vertexshader' ).textContent - fragmentShader: document.getElementById( 'fragmentshader' ).textContent - blending: THREE.AdditiveBlending - transparent: true - depthTest: true - depthWrite: false - - @pSystem = new THREE.PointCloud @particlesGeo, @shaderMaterial - - @splineOutline.renderDepth = false - @pSystem.dynamic = true - @pSystem.systemComplete = false # So we can know when to re-pool this mesh - @splineOutline.add @pSystem - @splineOutline.geometry = @linesGeo - - # Trace line - @traceLineMat = new THREE.LineBasicMaterial - color: 0xffffff - opacity: 1.0 - transparent: true - - @traceLine = new THREE.Line new THREE.Geometry(), @traceLineMat - @traceLine.geometry.vertices = ( vec3_origin.clone() for num in [1..constants.TRACE_LINE_VERTEX_COUNT] ) - - # Elements for the explosion effect - explosionMat = new THREE.MeshBasicMaterial - color: 0xffffff - transparent: true - opacity: 1.0 - map: THREE.ImageUtils.loadTexture 'images/explosion_texture_2.png' - explosionGeo = new THREE.SphereGeometry 5, 32, 32 - @explosionSphere = new THREE.Mesh explosionGeo, explosionMat - @explosionSphere.complete = false - @explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR - @explosionSphere.finalPos = null - @explosionSphere.rotationAxis = null - - @explosionSphere.update = ( traceLine ) -> - return if @complete - - if not @visible - @visible = true - - if @lerpVal <= 0.0 - @complete = true - @visible = false - traceLine.visible = false - @dispatchEvent { type: 'ExplosionComplete' } - return - - @lerpVal -= constants.EXPLOSION_INCREMENTAL_LERP - @position.set @finalPos.x, @finalPos.y, @finalPos.z - @position.lerp vec3_origin, @lerpVal - - # This will "slurp up" the trace line - for vertex, index in traceLine.geometry.vertices - break if index > traceLine.slurpIndex or traceLine.slurpIndex >= traceLine.geometry.vertices.length - vertex.copy traceLine.geometry.vertices[ traceLine.slurpIndex ] - - traceLine.slurpIndex++ - traceLine.geometry.verticesNeedUpdate = true - traceLine.material.opacity -= constants.TRACE_LINE_OPACITY_LERP - - @rotateOnAxis @rotationAxis, constants.EXPLOSION_ROTATION_ANGLE - - # Don't start fading out until we're half done - if @lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2 - @material.opacity -= constants.EXPLOSION_OPACITY_LERP - - return - - - @pSystem.addEventListener( 'ParticleSystemComplete', @runExplosion.bind( this ) ) - @explosionSphere.addEventListener( 'ExplosionComplete', _returnMeshToPool.bind( this, this ) ) - - # This update method is what actually gets our points moving across the scene. - # Once the point has finished its path, this method will emit a "ParticleSystemComplete" - # event, to allow us to re-pool the mesh. - @pSystem.update = ( traceLine ) -> - # no point doing all the calculations if the particle is already done - return if @systemComplete - - # Ensure we're visible - if not @visible - @visible = true - traceLine.visible = true - - for particle, pIndex in @geometry.vertices - path = particle.path - - particle.lerpN += constants.PARTICLE_SPEED - if particle.lerpN > 1 - particle.lerpN = 0 - particle.moveIndex = particle.nextIndex - particle.nextIndex++ - - if pIndex is 0 - # decrease the opacity of the trace line material so that - # it's at 0.34 when we're done (The explosion routine handles - # the remaining transparency) - traceLine.material.opacity -= (0.7 / path.length) - - if particle.nextIndex >= path.length - particle.moveIndex = 0 - particle.nextIndex = 0 - - # Even though there are multiple particles in the system now, we still - # do things this way as we don't really care if the "trail" has completed - @systemComplete = true - - # Make ourselves invisible. This resolves an issue where a pooled mesh - # would "flicker" when being reset - @visible = false - @dispatchEvent { type: 'ParticleSystemComplete' } - return - - currentPoint = path[particle.moveIndex] - nextPoint = path[particle.nextIndex] - - particle.copy currentPoint - particle.lerp nextPoint, particle.lerpN - - for vertex, index in traceLine.geometry.vertices - if index >= particle.moveIndex - vertex.copy currentPoint - vertex.lerp nextPoint, particle.lerpN - traceLine.geometry.verticesNeedUpdate = true - - @geometry.verticesNeedUpdate = true - - runExplosion: -> - path = @particlesGeo.vertices[0].path - - # The final array element is the origin, hence the -2 offset - finalPt = path[ path.length - 2 ] - color = @attributes.customColor.value[0].getHex() - - # To help "slurp up" the trace line - @traceLine.slurpIndex = 0 - - # Decide which axis this explosion is going to rotate about - choice = Math.floor( Math.random() * 3 ) - switch choice - when 0 then @explosionSphere.rotationAxis = vec3_x_axis - when 1 then @explosionSphere.rotationAxis = vec3_y_axis - when 2 then @explosionSphere.rotationAxis = vec3_z_axis - - @explosionSphere.finalPos = finalPt.clone() - @explosionSphere.position.set finalPt.x, finalPt.y, finalPt.z - @explosionSphere.position.lerp vec3_origin, @explosionSphere.lerpVal - @explosionUpdateId = window.setInterval( @explosionSphere.update.bind( @explosionSphere, @traceLine ), 16 ) - @vizMesh.add @explosionSphere - - startParticleUpdates: -> - # 16ms interval is approx a 60FPS refresh rate - @particleUpdateId = window.setInterval( @pSystem.update.bind( @pSystem, @traceLine ), 16 ) diff --git a/src/visualize.js b/src/visualize.js new file mode 100644 index 0000000..1d13bf0 --- /dev/null +++ b/src/visualize.js @@ -0,0 +1,368 @@ +import visualize from './visualize'; +import constants from './constants'; + +const vec3_origin = new THREE.Vector3( 0, 0, 0 ); +const vec3_x_axis = new THREE.Vector3( 1, 0, 0 ); +const vec3_y_axis = new THREE.Vector3( 0, 1, 0 ); +const vec3_z_axis = new THREE.Vector3( 0, 0, 1 ); + +let _meshPool = []; + +// Used to keep track of which types we're not currently displaying +let _typeStatus = {}; +constants.COLOUR_TYPES.forEach( (type) => { + _typeStatus[ type ] = true; +}); + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Module Exports +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +export function buildDataVizGeometries( linearData, countryData ) { + let loadLayer = document.getElementById( 'loading' ); + let count = 0; + + linearData.forEach( (set) => { + let exporterName = set.src.toUpperCase(); + let importerName = set.dest.toUpperCase(); + + let exporter = countryData[exporterName]; + let importer = countryData[importerName]; + + // we couldn't find the country, it wasn't in our list... + if( !exporter || !importer ) { + return; + } + + // visualize this event + set.lineGeometry = vizLines.makeConnectionLineGeometry( exporter, importer ); + }); + + loadLayer.style.display = 'none'; +} + +export function initMeshPool( poolSize, visualizationMesh ) { + for( let i = 0; i < poolSize; i++ ) { + _meshPool.push( new ParticleMesh( visualizationMesh ) ); + } +} + +export function initParticleViz( linearData ) { + // Return if we have no geometry, or our type has been toggled off + if( !linearData.lineGeometry || !_typeStatus[ linearData.colour ] ) { + return null; + } + + _getMeshFromPool( ( meshObj ) => { + // get our colour + let color = _getColourFromTypeStr( linearData.colour ); + + // merge it all together + meshObj.linesGeo.merge( linearData.lineGeometry ); + let points = linearData.lineGeometry.vertices; + let point = points[0]; + let particle = point.clone(); + particle.moveIndex = 0; + particle.nextIndex = 1; + particle.lerpN = 0; + particle.path = points; + meshObj.particlesGeo.vertices.push( particle ); + + meshObj.traceLineMat.opacity = 1.0; + + meshObj.attributes.alpha.value.push( 1.0 ); + meshObj.attributes.customColor.value.push( color ); + + // Create a trail for the particles by adding extra, slightly offset, particles + for( let num = 0; num < constants.NUM_TRAIL_PARTICLES; num++ ) { + let trail = particle.clone(); + trail.moveIndex = 0; + trail.nextIndex = 1; + trail.lerpN = -1 * constants.PARTICLE_SPEED * num; + trail.path = points; + + meshObj.particlesGeo.vertices.push( trail ); + meshObj.attributes.alpha.value.push( 1.0 - ( constants.TRAIL_OPACITY_MULTIPLIER * num ) ); + meshObj.attributes.customColor.value.push( color ); + } + + // Set the explosion color, too + meshObj.explosionSphere.material.color = color; + meshObj.traceLineMat.color = color; + + // since colours have been updated, tell THREE to force an update + meshObj.attributes.alpha.needsUpdate = true; + meshObj.attributes.customColor.needsUpdate = true; + + meshObj.vizMesh.add( meshObj.splineOutline ); + meshObj.vizMesh.add( meshObj.traceLine ); + meshObj.startParticleUpdates(); + }); +} + +export function initVisualization( linearData ) { + // build the meshes. One for each entry in our data + linearData.forEach( (data) => { + initParticleViz( data ); + }); +} + +export function toggleVisualizationType( type, isActive ) { + _typeStatus[ type ] = isActive; +} + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// HELPER METHODS +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +function _getMeshFromPool( callback ) { + if( _meshPool.length > 0 ) { + callback( _meshPool.shift() ); + } else { + window.setTimeout( _getMeshFromPool, 500, callback ); + } +} + +function _returnMeshToPool( mesh ) { + // clean up the two geometries + mesh.linesGeo.vertices = []; + mesh.particlesGeo.vertices = []; + mesh.pSystem.systemComplete = false; + mesh.explosionSphere.complete = false; + mesh.explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR; + mesh.explosionSphere.finalPos = null; + mesh.explosionSphere.rotationAxis = null; + mesh.explosionSphere.material.opacity = 1.0; + mesh.attributes.alpha.value = []; + mesh.attributes.customColor.value = []; + + window.clearInterval( mesh.particleUpdateId ); + window.clearInterval( mesh.explosionUpdateId ); + + // have to remove from the scene or else bad things happen + mesh.vizMesh.remove( mesh.splineOutline ); + mesh.vizMesh.remove( mesh.traceLine ); + mesh.vizMesh.remove( mesh.explosionSphere ); + + _meshPool.push( mesh ); +} + +function _getColourFromTypeStr( colorStr ) { + let colour = constants.COLOUR_MAP[colorStr]; + if( !colour ) { + colour = constants.COLOUR_MAP.r; + } + + return colour; +} + +class ParticleMesh { + constructor( vizMesh ) { + this.vizMesh = vizMesh; + this.particleUpdateId = null; + this.explosionUpdateId = null; + this.linesGeo = new THREE.Geometry(); + this.particlesGeo = new THREE.Geometry(); + this.splineOutline = new THREE.Line( null, new THREE.LineBasicMaterial( { visible: false } ) ); + + // Use custom shader to have the trail taper off in transparency + this.attributes = { + alpha: { type: 'f', value: [] }, + customColor: { type: 'c', value: [] } + }; + + this.uniforms = { + color: { type: 'c', value: new THREE.Color( 0xffffff ) }, + texture: { type: 't', value: THREE.ImageUtils.loadTexture( "images/particleB.png" ) } + }; + + this.shaderMaterial = new THREE.ShaderMaterial({ + uniforms: this.uniforms, + attributes: this.attributes, + vertexShader: document.getElementById( 'vertexshader' ).textContent, + fragmentShader: document.getElementById( 'fragmentshader' ).textContent, + blending: THREE.AdditiveBlending, + transparent: true, + depthTest: true, + depthWrite: false + }); + + this.pSystem = new THREE.PointCloud( this.particlesGeo, this.shaderMaterial ); + + this.splineOutline.renderDepth = false; + this.pSystem.dynamic = true; + this.pSystem.systemComplete = false; // So we can know when to re-pool this mesh + this.splineOutline.add( this.pSystem ); + this.splineOutline.geometry = this.linesGeo; + + // Trace line + this.traceLineMat = new THREE.LineBasicMaterial({ + color: 0xffffff, + opacity: 1.0, + transparent: true + }); + + this.traceLine = new THREE.Line( new THREE.Geometry(), this.traceLineMat ); + for( let num = 0; num < constants.TRACE_LINE_VERTEX_COUNT; num++ ) { + this.traceLine.geometry.vertices.push( vec3_origin.clone() ); + } + + // Elements for the explosion effect + let explosionMat = new THREE.MeshBasicMaterial({ + color: 0xffffff, + transparent: true, + opacity: 1.0, + map: THREE.ImageUtils.loadTexture( 'images/explosion_texture_2.png' ) + }); + let explosionGeo = new THREE.SphereGeometry( 5, 32, 32 ); + + this.explosionSphere = new THREE.Mesh( explosionGeo, explosionMat ); + this.explosionSphere.complete = false; + this.explosionSphere.lerpVal = constants.EXPLOSION_INITIAL_LERP_FACTOR; + this.explosionSphere.finalPos = null; + this.explosionSphere.rotationAxis = null; + + this.explosionSphere.update = function( traceLine ) { + if( this.complete ) return; + + if( !this.visible ) { + this.visible = true; + } + + if( this.lerpVal <= 0.0 ) { + this.complete = true; + this.visible = false; + traceLine.visible = false; + this.dispatchEvent( { type: 'ExplosionComplete' } ); + return; + } + + this.lerpVal -= constants.EXPLOSION_INCREMENTAL_LERP; + this.position.set( this.finalPos.x, this.finalPos.y, this.finalPos.z ); + this.position.lerp( vec3_origin, this.lerpVal ); + + // This will "slurp up" the trace line + for( let index = 0; index < traceLine.geometry.vertices.length; index++ ) { + if( index > traceLine.slurpIndex || + traceLine.slurpIndex >= traceLine.geometry.vertices.length ) { + break; + } + vertex.copy( traceLine.geometry.vertices[ traceLine.slurpIndex ] ); + } + + traceLine.slurpIndex++; + traceLine.geometry.verticesNeedUpdate = true; + traceLine.material.opacity -= constants.TRACE_LINE_OPACITY_LERP; + + this.rotateOnAxis( this.rotationAxis, constants.EXPLOSION_ROTATION_ANGLE ); + + // Don't start fading out until we're half done + if( this.lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2 ) { + this.material.opacity -= constants.EXPLOSION_OPACITY_LERP; + } + }; + + + this.pSystem.addEventListener( 'ParticleSystemComplete', this.runExplosion.bind( this ) ); + this.explosionSphere.addEventListener( 'ExplosionComplete', _returnMeshToPool.bind( this, this ) ); + + // This update method is what actually gets our points moving across the scene. + // Once the point has finished its path, this method will emit a "ParticleSystemComplete" + // event, to allow us to re-pool the mesh. + this.pSystem.update = function( traceLine ) { + // no point doing all the calculations if the particle is already done + if( this.systemComplete ) return; + + // Ensure we're visible + if( !this.visible ) { + this.visible = true; + traceLine.visible = true; + } + + for( let i = 0; i < this.geometry.vertices.length; i++ ) { + let particle = this.geometry.vertices[i]; + let path = particle.path; + + particle.lerpN += constants.PARTICLE_SPEED; + if( particle.lerpN > 1 ) { + particle.lerpN = 0; + particle.moveIndex = particle.nextIndex; + particle.nextIndex++; + + if( i === 0 ) { + // decrease the opacity of the trace line material so that + // it's at 0.3 when we're done (The explosion routine handles + // the remaining transparency) + traceLine.material.opacity -= (0.7 / path.length); + } + + if( particle.nextIndex >= path.length ) { + particle.moveIndex = 0; + particle.nextIndex = 0; + + // Even though there are multiple particles in the system now, we still + // do things this way as we don't really care if the "trail" has completed + this.systemComplete = true; + + // Make ourselves invisible. This resolves an issue where a pooled mesh + // would "flicker" when being reset + this.visible = false; + this.dispatchEvent( { type: 'ParticleSystemComplete' } ); + return; + } + } + + let currentPoint = path[particle.moveIndex]; + let nextPoint = path[particle.nextIndex]; + + particle.copy( currentPoint ); + particle.lerp( nextPoint, particle.lerpN ); + } + + for( let index = 0; index < traceLine.geometry.vertices.length; index++ ) { + let vertex = traceLine.geometry.vertices[index]; + if( index >= particle.moveIndex ) { + vertex.copy( currentPoint ); + vertex.lerp( nextPoint, particle.lerpN ); + } + } + traceLine.geometry.verticesNeedUpdate = true; + + this.geometry.verticesNeedUpdate = true; + }; + } + + runExplosion() { + let path = this.particlesGeo.vertices[0].path; + + // The final array element is the origin, hence the -2 offset + let finalPt = path[ path.length - 2 ]; + let color = this.attributes.customColor.value[0].getHex(); + + // To help "slurp up" the trace line + this.traceLine.slurpIndex = 0; + + // Decide which axis this explosion is going to rotate about + let choice = Math.floor( Math.random() * 3 ); + switch( choice ) { + case 0: + this.explosionSphere.rotationAxis = vec3_x_axis; + break; + case 1: + this.explosionSphere.rotationAxis = vec3_y_axis; + break; + case 2: + this.explosionSphere.rotationAxis = vec3_z_axis; + break; + } + + this.explosionSphere.finalPos = finalPt.clone(); + this.explosionSphere.position.set( finalPt.x, finalPt.y, finalPt.z ); + this.explosionSphere.position.lerp( vec3_origin, this.explosionSphere.lerpVal ); + this.explosionUpdateId = window.setInterval( this.explosionSphere.update.bind( this.explosionSphere, this.traceLine ), 16 ); + this.vizMesh.add( this.explosionSphere ); + } + + startParticleUpdates() { + // 16ms interval is approx a 60FPS refresh rate + this.particleUpdateId = window.setInterval( this.pSystem.update.bind( this.pSystem, this.traceLine ), 16 ); + } +} From d04f3a0294fabb559fc03de933a0b37e4b17e101 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 16:47:32 -0400 Subject: [PATCH 173/190] Tweaks so build will work --- Gruntfile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 11e4075..277869f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -41,7 +41,8 @@ module.exports = function( grunt ) { babel: { files: { expand: true, - flatten: true, + flatten: false, + ext: '.js', cwd: 'src/', src: ['**/*.js', '**/*.jsx'], dest: 'build/tmp' From 1d2a5452f8896e23457b8e5581a261b5bbb229be Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Fri, 10 Apr 2015 17:06:29 -0400 Subject: [PATCH 174/190] Changes to support proper babel-ification during build --- Gruntfile.js | 17 ++--------------- package.json | 2 +- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 277869f..d3c700f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -38,22 +38,12 @@ module.exports = function( grunt ) { } }, - babel: { - files: { - expand: true, - flatten: false, - ext: '.js', - cwd: 'src/', - src: ['**/*.js', '**/*.jsx'], - dest: 'build/tmp' - } - }, - browserify: { options: { debug: true, destFile: 'build/bundle.js', - src: [ 'build/tmp/**/*.js' ] + src: ['src/**/*.js', 'src/**/*.jsx'], + transform: ['babelify'] }, dev: { @@ -99,7 +89,6 @@ module.exports = function( grunt ) { }, }); - grunt.loadNpmTasks( 'grunt-babel' ); grunt.loadNpmTasks( 'grunt-browserify' ); grunt.loadNpmTasks( 'grunt-contrib-uglify' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); @@ -111,14 +100,12 @@ module.exports = function( grunt ) { 'clean:all', 'bower_concat:all', 'concat:dist', - 'babel', 'browserify:production', 'uglify:all' ]); grunt.registerTask( 'incremental', [ 'clean:incr', - 'babel', 'browserify:production', 'uglify:incr' ]); diff --git a/package.json b/package.json index 36dac02..beb1941 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "underscore": "^1.8.3" }, "devDependencies": { + "babelify": "^6.0.2", "grunt": "^0.4.5", - "grunt-babel": "^5.0.0", "grunt-bower-concat": "^0.4.0", "grunt-browserify": "^3.4.0", "grunt-contrib-clean": "^0.6.0", From 0933fd42b2b9e3dce16f211cfa1ef577e7e3510c Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 09:13:33 -0400 Subject: [PATCH 175/190] Switched back to standalone babel in build. Browserify extension didn't want to work properly. --- Gruntfile.js | 17 +++++++++++++++-- package.json | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index d3c700f..277869f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -38,12 +38,22 @@ module.exports = function( grunt ) { } }, + babel: { + files: { + expand: true, + flatten: false, + ext: '.js', + cwd: 'src/', + src: ['**/*.js', '**/*.jsx'], + dest: 'build/tmp' + } + }, + browserify: { options: { debug: true, destFile: 'build/bundle.js', - src: ['src/**/*.js', 'src/**/*.jsx'], - transform: ['babelify'] + src: [ 'build/tmp/**/*.js' ] }, dev: { @@ -89,6 +99,7 @@ module.exports = function( grunt ) { }, }); + grunt.loadNpmTasks( 'grunt-babel' ); grunt.loadNpmTasks( 'grunt-browserify' ); grunt.loadNpmTasks( 'grunt-contrib-uglify' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); @@ -100,12 +111,14 @@ module.exports = function( grunt ) { 'clean:all', 'bower_concat:all', 'concat:dist', + 'babel', 'browserify:production', 'uglify:all' ]); grunt.registerTask( 'incremental', [ 'clean:incr', + 'babel', 'browserify:production', 'uglify:incr' ]); diff --git a/package.json b/package.json index beb1941..36dac02 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "underscore": "^1.8.3" }, "devDependencies": { - "babelify": "^6.0.2", "grunt": "^0.4.5", + "grunt-babel": "^5.0.0", "grunt-bower-concat": "^0.4.0", "grunt-browserify": "^3.4.0", "grunt-contrib-clean": "^0.6.0", From 3a91fd36a07f4611079e9de4b86798d314331465 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 10:25:12 -0400 Subject: [PATCH 176/190] Going back to using babelify... Hope I can get this working. --- Gruntfile.js | 17 ++--------------- package.json | 2 +- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 277869f..7a03e87 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -38,22 +38,12 @@ module.exports = function( grunt ) { } }, - babel: { - files: { - expand: true, - flatten: false, - ext: '.js', - cwd: 'src/', - src: ['**/*.js', '**/*.jsx'], - dest: 'build/tmp' - } - }, - browserify: { options: { debug: true, destFile: 'build/bundle.js', - src: [ 'build/tmp/**/*.js' ] + src: [ 'src/**/*.js', 'src/**/*.jsx' ], + transform: ['babelify'] }, dev: { @@ -99,7 +89,6 @@ module.exports = function( grunt ) { }, }); - grunt.loadNpmTasks( 'grunt-babel' ); grunt.loadNpmTasks( 'grunt-browserify' ); grunt.loadNpmTasks( 'grunt-contrib-uglify' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); @@ -111,14 +100,12 @@ module.exports = function( grunt ) { 'clean:all', 'bower_concat:all', 'concat:dist', - 'babel', 'browserify:production', 'uglify:all' ]); grunt.registerTask( 'incremental', [ 'clean:incr', - 'babel', 'browserify:production', 'uglify:incr' ]); diff --git a/package.json b/package.json index 36dac02..beb1941 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,8 @@ "underscore": "^1.8.3" }, "devDependencies": { + "babelify": "^6.0.2", "grunt": "^0.4.5", - "grunt-babel": "^5.0.0", "grunt-bower-concat": "^0.4.0", "grunt-browserify": "^3.4.0", "grunt-contrib-clean": "^0.6.0", From 9a77608f556dbcf1cd646a708688fc9596ab86f4 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 10:50:17 -0400 Subject: [PATCH 177/190] Fixed up bad imports and other es6-specific errors --- src/components/legend-item.jsx | 2 +- src/components/legend.jsx | 2 +- src/components/progress.jsx | 2 +- src/dataloading.js | 2 +- src/geopins.js | 2 +- src/main.js | 25 ++++++++++++------------- src/mousekeyboard.js | 2 +- src/visualize.js | 13 ++++++++----- 8 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index dbd931c..65af088 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -1,6 +1,6 @@ // Component representing an individual legend item -import constants from '../constants'; +import * as constants from '../constants'; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition diff --git a/src/components/legend.jsx b/src/components/legend.jsx index 50e3592..30fb8f4 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -1,5 +1,5 @@ // Main component for the interactive legend -import LegendItem from './legend-item'; +import * as LegendItem from './legend-item'; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition diff --git a/src/components/progress.jsx b/src/components/progress.jsx index 2670e32..5600a21 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -5,7 +5,7 @@ * http://jsfiddle.net/oskar/Aapn8/ and * https://github.com/pughpugh/react-countdown-clock *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -import tween from 'react-tween-state'; +import * as tween from 'react-tween-state'; export class Progress extends React.Component { constructor( props ) { diff --git a/src/dataloading.js b/src/dataloading.js index ffbbdb6..38e469c 100644 --- a/src/dataloading.js +++ b/src/dataloading.js @@ -1,4 +1,4 @@ -import constants from './constants'; +import * as constants from './constants'; export function loadWorldPins( latLonFile, callback ) { _getDataFromServer( latLonFile, callback ); diff --git a/src/geopins.js b/src/geopins.js index 4c4c43f..fa5547e 100644 --- a/src/geopins.js +++ b/src/geopins.js @@ -9,7 +9,7 @@ export function loadGeoData( latlonData, countryLookup ) { country.countryName = countryLookup[key]; // take the lat lon from the data and convert this to 3d globe space - center = convertLatLonToVector( country.lat, country.lon ); + let center = convertLatLonToVector( country.lat, country.lon ); country.center = center; countryData[country.countryName] = country; diff --git a/src/main.js b/src/main.js index 9a13b3b..d45c755 100644 --- a/src/main.js +++ b/src/main.js @@ -1,16 +1,16 @@ -// 3rd Party libraries -import us from 'underscore'; +// 3rd Party libraries (keep this in CommonJS syntax since it's not yet es6) +var us = require( 'underscore' ); // All our dependencies -import dataLoading from './dataloading'; -import mouseKeyboard from './mousekeyboard'; -import visualize from './visualize'; -import geopins from './geopins'; -import constants from './constants'; +import * as dataLoading from './dataloading'; +import * as mouseKeyboard from './mousekeyboard'; +import * as visualize from './visualize'; +import * as geopins from './geopins'; +import * as constants from './constants'; // React components -import Legend from './components/legend'; -import Progress from './components/progress'; +// import Legend from './components/legend'; +// import Progress from './components/progress'; const masterContainer = document.getElementById( 'visualization' ); const overlay = document.getElementById( 'visualization' ); @@ -61,7 +61,7 @@ function startDataPump() { } visualize.initVisualization( dataToViz ); - progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ); + // progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ); }, constants.VIZ_POLLING_INTERVAL ); } @@ -80,7 +80,7 @@ function getDataForTick( startTime, endTime ) { // the given "tick", and those that don't. Since time's advancing we know that // once a point satisfies this condition we won't use it again until we loop let partitions = us.partition( _remainingData, ( point ) => { - time = point.time.getTime(); + let time = point.time.getTime(); return ( time >= startTime ) && ( time <= endTime ); }); @@ -127,7 +127,6 @@ function initScene() { sphere.rotation.x = Math.PI; sphere.rotation.y = -Math.PI/2; sphere.rotation.z = Math.PI; - sphere.id = "base"; rotating.add( sphere ); visualizationMesh = new THREE.Object3D(); @@ -204,7 +203,7 @@ if( !Detector.webgl ) { visualize.initMeshPool( constants.MESH_POOL_SIZE, visualizationMesh ); // Render our React components - reactInit(); + // reactInit(); dataLoading.loadCountryCodes( 'country_iso3166.json', ( isoData ) => { _countryLookup = isoData; diff --git a/src/mousekeyboard.js b/src/mousekeyboard.js index f97c8bf..13f3019 100644 --- a/src/mousekeyboard.js +++ b/src/mousekeyboard.js @@ -1,4 +1,4 @@ -import vizLines from './visualize_lines'; +import * as vizLines from './visualize_lines'; // Ugly variable declarations const rotateXMax = 90 * Math.PI/180; diff --git a/src/visualize.js b/src/visualize.js index 1d13bf0..27e6dd6 100644 --- a/src/visualize.js +++ b/src/visualize.js @@ -1,5 +1,5 @@ -import visualize from './visualize'; -import constants from './constants'; +import * as vizLines from './visualize_lines'; +import * as constants from './constants'; const vec3_origin = new THREE.Vector3( 0, 0, 0 ); const vec3_x_axis = new THREE.Vector3( 1, 0, 0 ); @@ -245,6 +245,7 @@ class ParticleMesh { traceLine.slurpIndex >= traceLine.geometry.vertices.length ) { break; } + let vertex = traceLine.geometry.vertices[ index ]; vertex.copy( traceLine.geometry.vertices[ traceLine.slurpIndex ] ); } @@ -277,8 +278,10 @@ class ParticleMesh { traceLine.visible = true; } + // purposely leak these out so we can use it after with the trace line + let particle, currentPoint, nextPoint; for( let i = 0; i < this.geometry.vertices.length; i++ ) { - let particle = this.geometry.vertices[i]; + particle = this.geometry.vertices[i]; let path = particle.path; particle.lerpN += constants.PARTICLE_SPEED; @@ -310,8 +313,8 @@ class ParticleMesh { } } - let currentPoint = path[particle.moveIndex]; - let nextPoint = path[particle.nextIndex]; + currentPoint = path[particle.moveIndex]; + nextPoint = path[particle.nextIndex]; particle.copy( currentPoint ); particle.lerp( nextPoint, particle.lerpN ); From 4bfa7202366a052b8d902b467891a94e7d410a16 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 11:07:00 -0400 Subject: [PATCH 178/190] Incremental checkin trying to get React working properly. --- src/components/legend.jsx | 2 +- src/components/progress.jsx | 3 ++- src/main.js | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/legend.jsx b/src/components/legend.jsx index 30fb8f4..7a706f1 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -1,5 +1,5 @@ // Main component for the interactive legend -import * as LegendItem from './legend-item'; +import * as LegendItem from './legend-item.jsx'; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition diff --git a/src/components/progress.jsx b/src/components/progress.jsx index 5600a21..6b96f0c 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -5,7 +5,8 @@ * http://jsfiddle.net/oskar/Aapn8/ and * https://github.com/pughpugh/react-countdown-clock *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -import * as tween from 'react-tween-state'; +// Keep this in CommonJS syntax as third-party libraries aren't necessarily es6 +var tween = require( 'react-tween-state' ); export class Progress extends React.Component { constructor( props ) { diff --git a/src/main.js b/src/main.js index d45c755..755e66c 100644 --- a/src/main.js +++ b/src/main.js @@ -9,8 +9,8 @@ import * as geopins from './geopins'; import * as constants from './constants'; // React components -// import Legend from './components/legend'; -// import Progress from './components/progress'; +import * as Legend from './components/legend.jsx'; +import * as Progress from './components/progress.jsx'; const masterContainer = document.getElementById( 'visualization' ); const overlay = document.getElementById( 'visualization' ); @@ -61,7 +61,7 @@ function startDataPump() { } visualize.initVisualization( dataToViz ); - // progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ); + progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ); }, constants.VIZ_POLLING_INTERVAL ); } @@ -203,7 +203,7 @@ if( !Detector.webgl ) { visualize.initMeshPool( constants.MESH_POOL_SIZE, visualizationMesh ); // Render our React components - // reactInit(); + reactInit(); dataLoading.loadCountryCodes( 'country_iso3166.json', ( isoData ) => { _countryLookup = isoData; From 0bcdcd6df61a7f57e5e46d28a9b0aa1a46cb5131 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 12:09:12 -0400 Subject: [PATCH 179/190] Fixed up weirdness with React classes --- src/components/legend-item.jsx | 2 +- src/components/legend.jsx | 4 +-- src/components/progress.jsx | 59 +++++++++++++++++----------------- src/main.js | 5 ++- 4 files changed, 34 insertions(+), 36 deletions(-) diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index 65af088..e3c7fdf 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -5,7 +5,7 @@ import * as constants from '../constants'; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -export class LegendItem extends React.Component { +export default class LegendItem extends React.Component { constructor( props ) { super( props ); diff --git a/src/components/legend.jsx b/src/components/legend.jsx index 7a706f1..f2c8bc0 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -1,10 +1,10 @@ // Main component for the interactive legend -import * as LegendItem from './legend-item.jsx'; +import LegendItem from './legend-item.jsx'; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -export class Legend extends React.Component { +export default class Legend extends React.Component { constructor( props ) { super( props ); diff --git a/src/components/progress.jsx b/src/components/progress.jsx index 6b96f0c..2fc048c 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -8,31 +8,28 @@ // Keep this in CommonJS syntax as third-party libraries aren't necessarily es6 var tween = require( 'react-tween-state' ); -export class Progress extends React.Component { - constructor( props ) { - super( props ); - - // FIXME: React's current es6 state doesn't support mixins. We may need to - // convert this class back to the old-school React.createClass() style - this.mixins = [tween.Mixin]; - this.state = { currVal: 0.0 }; - - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Styles - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - this.canvasStyle = { display: 'block' }; - this.strokeStyle = { - radius: 25, - width: 5.0, - color: '#008EAF' - }; - - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Instance Variables - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - this._canvas = null; - this._context = null; - } +const Progress = React.createClass({ + mixins: [tween.Mixin], + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + canvasStyle: { display: 'block' }, + strokeStyle: { + radius: 25, + width: 5.0, + color: '#008EAF' + }, + + /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Instance Variables + *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + _canvas: null, + _context: null, + + getInitialState() { + return { currVal: 0.0 }; + }, /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component Methods @@ -51,11 +48,11 @@ export class Progress extends React.Component { this._context.fill(); this._context.lineWidth = this.strokeStyle.width; this._context.globalAlpha = 0.33; - } + }, componentDidUpdate() { this._updateProgress(); - } + }, handleProgressUpdate( newVal ) { let onEndFunc; @@ -74,7 +71,7 @@ export class Progress extends React.Component { endValue: newVal, onEnd: onEndFunc }); - } + }, /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Behaviours @@ -99,7 +96,7 @@ export class Progress extends React.Component { false // stroke counterclockwise? ); this._context.stroke(); - } + }, /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Final Render @@ -109,4 +106,6 @@ export class Progress extends React.Component { return( ); /* jshint ignore: end */ } -} +}); + +export default Progress; diff --git a/src/main.js b/src/main.js index 755e66c..41e6aad 100644 --- a/src/main.js +++ b/src/main.js @@ -9,11 +9,10 @@ import * as geopins from './geopins'; import * as constants from './constants'; // React components -import * as Legend from './components/legend.jsx'; -import * as Progress from './components/progress.jsx'; +import Legend from './components/legend.jsx'; +import Progress from './components/progress.jsx'; const masterContainer = document.getElementById( 'visualization' ); -const overlay = document.getElementById( 'visualization' ); const glContainer = document.getElementById( 'glContainer' ); // Visualization components that need to be accessible throughout this module From cb32db51eb1d6b7e65c41898da1836373995f84f Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 12:10:47 -0400 Subject: [PATCH 180/190] Updated bundle build. --- public/dataglobe.min.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 86cc414..19597b9 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ -/*! dataglobe 09-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0?m>h:h>m;i=m>=0?++h:--h)n=Math.floor(Math.random()*j.length),g=Math.floor(Math.random()*j.length),f=d.COLOUR_TYPES[Math.floor(Math.random()*d.COLOUR_TYPES.length)],e=Math.floor(Math.random()*d.ONE_WEEK_IN_MILLIS),n===g&&(g=g===j.length-1?0:g+1),l={},l.src=b[j[n]],l.dest=b[j[g]],l.colour=f,l.time=new Date(k-e),o.push(l);return c(o)}},c=function(a,b){var c;return c=new XMLHttpRequest,c.open("GET",a,!0),c.onreadystatechange=function(){var a;return 4===c.readyState&&200===c.status&&(a=JSON.parse(c.responseText),b)?b(a):void 0},c.send(null)}},{"./constants":4}],6:[function(a,b){b.exports={loadGeoData:function(a,c){var d,e,f,g,h;f={},h=a.countries;for(g in h)e=h[g],e.countryCode=g,e.countryName=c[g],d=b.exports.convertLatLonToVector(e.lat,e.lon),e.center=d,f[e.countryName]=e;return f},convertLatLonToVector:function(a,b){var c,d,e,f;return d=100,b-=90,c=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3,f.x=Math.sin(c)*Math.cos(e)*d,f.y=Math.cos(c)*d,f.z=Math.sin(c)*Math.sin(e)*d,f}}},{}],7:[function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C;A=a("underscore"),m=a("./dataloading"),s=a("./mousekeyboard"),C=a("./visualize"),n=a("./geopins"),l=a("./constants"),b=a("./components/legend"),c=a("./components/progress"),r=document.getElementById("visualization"),t=document.getElementById("visualization"),p=document.getElementById("glContainer"),x=null,w=null,y=null,k=null,B=null,u=null,d=null,e=null,i=null,g=null,f=null,h=null,z=function(){var a,b,c,d,e;return c=l.VIZ_LOOP_LENGTH/l.VIZ_POLLING_INTERVAL,a=0,e=f.getTime()-g.getTime(),d=Math.floor(e/c),b=g.getTime(),window.setInterval(function(){var e;e=o(b,b+d),b+=d,a++,b>=f.getTime()&&(b=g.getTime(),a=0),C.initVisualization(e),u.handleProgressUpdate(a/c)},l.VIZ_POLLING_INTERVAL)},o=function(a,b){var c;return a===g.getTime()&&(h=i),c=A.partition(h,function(c){var d;return d=c.time.getTime(),d>=a&&b>=d}),h=c[1],c[0]},q=function(){var a,b,c,d,e,f;return y=new THREE.Scene,y.matrixAutoUpdate=!1,a=new THREE.SpotLight(15658734,3),a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,y.add(a),b=new THREE.SpotLight(15658734,1.5),b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,y.add(b),c=new THREE.PointLight(2236962,14.8),c.position.x=0,c.position.y=-750,c.position.z=0,y.add(c),x=new THREE.Object3D,y.add(x),d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d),e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,e.id="base",x.add(e),B=new THREE.Object3D,x.add(B),w=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),w.setSize(window.innerWidth,window.innerHeight),w.autoClear=!1,w.sortObjects=!1,w.generateMipmaps=!1,p.appendChild(w.domElement),k=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),k.position.z=1400,k.position.y=0,y.add(k),r.addEventListener("mousemove",s.onDocumentMouseMove.bind(null,k),!0),r.addEventListener("mousedown",s.onDocumentMouseDown,!0),r.addEventListener("mouseup",s.onDocumentMouseUp,!1),r.addEventListener("click",s.onClick,!0),r.addEventListener("mousewheel",s.onMouseWheel.bind(null,k),!1),r.addEventListener("DOMMouseScroll",function(a){var b;return b=window.event||a,s.onMouseWheel(k,b)},!1),f=THREEx.WindowResize(w,k),s.startAutoRotate()},j=function(){return s.updateRotation(),x.rotation.x=s.rotateX,x.rotation.y=s.rotateY,requestAnimationFrame(j),w.render(y,k)},v=function(){return React.render(React.createElement(b,{types:l.COLOUR_TYPES,clickCallback:C.toggleVisualizationType}),document.getElementById("legend")),u=React.render(React.createElement(c,null),document.getElementById("progress"))},Detector.webgl?(q(),C.initMeshPool(l.MESH_POOL_SIZE,B),v(),m.loadCountryCodes("country_iso3166.json",function(a){return d=a,m.loadWorldPins("country_lat_lon.json",function(a){return e=a,m.loadRandomizedContentData(2e3,d,function(a){var b;return i=A.sortBy(a,"time"),g=i[0].time,f=i[i.length-1].time,b=n.loadGeoData(e,d),C.buildDataVizGeometries(i,b),j(),z()})})})):Detector.addGetWebGLMessage()},{"./components/legend":2,"./components/progress":3,"./constants":4,"./dataloading":5,"./geopins":6,"./mousekeyboard":8,"./visualize":10,underscore:14}],8:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q;q=a("./visualize_lines"),f=0,g=0,h=0,i=0,j=0,k=0,d=!1,o=0,l=0,m=0,n=.35*Math.PI/180,p=90*Math.PI/180,c=null,e=new THREEx.KeyboardState,b.exports={rotateX:0,rotateY:0,updateRotation:function(){return null!=l&&null!=m&&(n+=.012*(l-this.rotateX),o+=.012*(m-this.rotateY),Math.abs(l-this.rotateX)<.1&&Math.abs(m-this.rotateY)<.1&&(l=void 0,m=void 0)),this.rotateX+=n,this.rotateY+=o,n*=.98,o*=.98,(d||null!=l)&&(n*=.6,o*=.6),this.rotateX<-p&&(this.rotateX=-p,n*=-.95),this.rotateX>p?(this.rotateX=p,n*=-.95):void 0},onDocumentMouseMove:function(a,b){return h=f,i=g,f=b.clientX-.5*window.innerWidth,g=b.clientY-.5*window.innerHeight,d?e.pressed("shift")===!1?(o+=(f-h)/2*Math.PI/180*.3,n+=(g-i)/2*Math.PI/180*.3):(a.position.x-=.5*(f-h),a.position.y+=.5*(g-i)):void 0},onDocumentMouseDown:function(a){-1===a.target.className.indexOf("noMapDrag")&&(d=!0,j=f,k=g,l=void 0,l=void 0,b.exports.stopAutoRotate())},onDocumentMouseUp:function(){var a;d=!1,a=!1,b.exports.startAutoRotate()},onClick:function(){Math.abs(j-f)>3||Math.abs(k-g)>3},handleMWheel:function(a,b){return b.scale.z+=.1*a,b.scale.z=q.constrain(b.scale.z,.7,5)},onMouseWheel:function(a,c){var d;return d=0,c.wheelDelta?d=c.wheelDelta/120:c.detail&&(d=-c.detail/3),null!=d&&b.exports.handleMWheel(d,a),c.returnValue=!1},startAutoRotate:function(){return c=window.setInterval(function(){return o+=.1*Math.PI/180*.3},100)},stopAutoRotate:function(){return window.clearInterval(c)}}},{"./visualize_lines":11}],9:[function(a,b){THREE.Curve.Utils.createLineGeometry=function(a){var b,c,d,e;for(b=new THREE.Geometry,c=0,d=a.length;d>c;c++)e=a[c],b.vertices.push(e);return b},b.exports={wrap:function(a,b,c){for(c-=b;b>a;)a+=c;return a%c},screenXY:function(a,b){var c,d,e,f,g;return d=new THREE.Projector,f=d.projectVector(a.clone(),b),e={},g=window.innerWidth,c=1280,c>g&&(g=c),e.x=Math.round(f.x*(g/2))+g/2,e.y=Math.round((0-f.y)*(window.innerHeight/2))+window.innerHeight/2,e}}},{}],10:[function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;for(i=a("./constants"),r=a("./visualize_lines"),n=new THREE.Vector3(0,0,0),o=new THREE.Vector3(1,0,0),p=new THREE.Vector3(0,1,0),q=new THREE.Vector3(0,0,1),f=[],h={},l=i.COLOUR_TYPES,j=0,k=l.length;k>j;j++)m=l[j],h[m]=!0;b.exports={buildDataVizGeometries:function(a,b){var c,d,e,f,g,h,i,j,k;for(j=document.getElementById("loading"),c=0,h=0,i=a.length;i>h;h++)k=a[h],e=k.src.toUpperCase(),g=k.dest.toUpperCase(),d=b[e],f=b[g],null!=d&&null!=f&&(k.lineGeometry=r.makeConnectionLineGeometry(d,f));j.style.display="none"},initMeshPool:function(a,b){var d,e,g,h;for(h=[],d=e=0,g=a;g>=0?g>e:e>g;d=g>=0?++e:--e)h.push(f.push(new c(b)));return h},initParticleViz:function(a){return null==a.lineGeometry?null:h[a.colour]?e(function(b){var c,e,f,g,h,j,k,l;for(c=d(a.colour),b.linesGeo.merge(a.lineGeometry),j=a.lineGeometry.vertices,h=j[0],g=h.clone(),g.moveIndex=0,g.nextIndex=1,g.lerpN=0,g.path=j,b.particlesGeo.vertices.push(g),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c),f=e=1,k=i.NUM_TRAIL_PARTICLES;k>=1?k>=e:e>=k;f=k>=1?++e:--e)l=g.clone(),l.moveIndex=0,l.nextIndex=1,l.lerpN=-1*i.PARTICLE_SPEED*f,l.path=j,b.particlesGeo.vertices.push(l),b.attributes.alpha.value.push(1-i.TRAIL_OPACITY_MULTIPLIER*f),b.attributes.customColor.value.push(c);return b.explosionSphere.material.color=c,b.traceLineMat.color=c,b.attributes.alpha.needsUpdate=!0,b.attributes.customColor.needsUpdate=!0,b.vizMesh.add(b.splineOutline),b.vizMesh.add(b.traceLine),b.startParticleUpdates()}):null},initVisualization:function(a){var c,d,e,f;for(f=[],d=0,e=a.length;e>d;d++)c=a[d],f.push(b.exports.initParticleViz(c));return f},toggleVisualizationType:function(a,b){return h[a]=b}},e=function(a){return f.length>0?a(f.shift()):window.setTimeout(e,500,a)},g=function(a){return a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),f.push(a)},d=function(a){var b;return b=i.COLOUR_MAP[a],b||(b=i.COLOUR_MAP.r),b},c=function(){function a(a){var b,c,d;this.vizMesh=a,this.particleUpdateId=null,this.explosionUpdateId=null,this.linesGeo=new THREE.Geometry,this.particlesGeo=new THREE.Geometry,this.splineOutline=new THREE.Line(null,new THREE.LineBasicMaterial({visible:!1})),this.attributes={alpha:{type:"f",value:[]},customColor:{type:"c",value:[]}},this.uniforms={color:{type:"c",value:new THREE.Color(16777215)},texture:{type:"t",value:THREE.ImageUtils.loadTexture("images/particleB.png")}},this.shaderMaterial=new THREE.ShaderMaterial({uniforms:this.uniforms,attributes:this.attributes,vertexShader:document.getElementById("vertexshader").textContent,fragmentShader:document.getElementById("fragmentshader").textContent,blending:THREE.AdditiveBlending,transparent:!0,depthTest:!0,depthWrite:!1}),this.pSystem=new THREE.PointCloud(this.particlesGeo,this.shaderMaterial),this.splineOutline.renderDepth=!1,this.pSystem.dynamic=!0,this.pSystem.systemComplete=!1,this.splineOutline.add(this.pSystem),this.splineOutline.geometry=this.linesGeo,this.traceLineMat=new THREE.LineBasicMaterial({color:16777215,opacity:1,transparent:!0}),this.traceLine=new THREE.Line(new THREE.Geometry,this.traceLineMat),this.traceLine.geometry.vertices=function(){var a,b,c;for(c=[],d=a=1,b=i.TRACE_LINE_VERTEX_COUNT;b>=1?b>=a:a>=b;d=b>=1?++a:--a)c.push(n.clone());return c}(),c=new THREE.MeshBasicMaterial({color:16777215,transparent:!0,opacity:1,map:THREE.ImageUtils.loadTexture("images/explosion_texture_2.png")}),b=new THREE.SphereGeometry(5,32,32),this.explosionSphere=new THREE.Mesh(b,c),this.explosionSphere.complete=!1,this.explosionSphere.lerpVal=i.EXPLOSION_INITIAL_LERP_FACTOR,this.explosionSphere.finalPos=null,this.explosionSphere.rotationAxis=null,this.explosionSphere.update=function(a){var b,c,d,e,f;if(!this.complete){if(this.visible||(this.visible=!0),this.lerpVal<=0)return this.complete=!0,this.visible=!1,a.visible=!1,void this.dispatchEvent({type:"ExplosionComplete"});for(this.lerpVal-=i.EXPLOSION_INCREMENTAL_LERP,this.position.set(this.finalPos.x,this.finalPos.y,this.finalPos.z),this.position.lerp(n,this.lerpVal),e=a.geometry.vertices,b=c=0,d=e.length;d>c&&(f=e[b],!(b>a.slurpIndex||a.slurpIndex>=a.geometry.vertices.length));b=++c)f.copy(a.geometry.vertices[a.slurpIndex]);a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=i.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,i.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=i.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=i.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){var b,c,d,e,f,g,h,j,k,l,m,n,o;if(!this.systemComplete){for(this.visible||(this.visible=!0,a.visible=!0),m=this.geometry.vertices,j=d=0,f=m.length;f>d;j=++d){if(k=m[j],l=k.path,k.lerpN+=i.PARTICLE_SPEED,k.lerpN>1&&(k.lerpN=0,k.moveIndex=k.nextIndex,k.nextIndex++,0===j&&(a.material.opacity-=.7/l.length),k.nextIndex>=l.length))return k.moveIndex=0,k.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});b=l[k.moveIndex],h=l[k.nextIndex],k.copy(b),k.lerp(h,k.lerpN)}for(n=a.geometry.vertices,c=e=0,g=n.length;g>e;c=++e)o=n[c],c>=k.moveIndex&&(o.copy(b),o.lerp(h,k.lerpN));return a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return a.prototype.runExplosion=function(){var a,b,c,d;switch(d=this.particlesGeo.vertices[0].path,c=d[d.length-2],b=this.attributes.customColor.value[0].getHex(),this.traceLine.slurpIndex=0,a=Math.floor(3*Math.random())){case 0:this.explosionSphere.rotationAxis=o;break;case 1:this.explosionSphere.rotationAxis=p;break;case 2:this.explosionSphere.rotationAxis=q}return this.explosionSphere.finalPos=c.clone(),this.explosionSphere.position.set(c.x,c.y,c.z),this.explosionSphere.position.lerp(n,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)},a.prototype.startParticleUpdates=function(){return this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)},a}()},{"./constants":4,"./visualize_lines":11}],11:[function(a,b){var c,d;c=1e3,d=new THREE.Vector3(0,0,0),b.exports={makeConnectionLineGeometry:function(a,b){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;return null==a.countryName||null==b.countryName?void 0:(g=a.center.clone().sub(b.center).length(),e=c+.7*g,s=a.center,i=b.center,k=s.clone().lerp(i,.5),m=k.length(),k.normalize(),k.multiplyScalar(m+.45*g),o=(new THREE.Vector3).subVectors(s,i),o.normalize(),h=.5*g,t=s,n=k.clone().add(o.clone().multiplyScalar(h)),l=k.clone().add(o.clone().multiplyScalar(-h)),j=i,q=new THREE.CubicBezierCurve3(s,t,n,k),r=new THREE.CubicBezierCurve3(k,l,j,i),u=2*Math.floor(.02*g+6),p=q.getPoints(u),p=p.splice(0,p.length-1),p=p.concat(r.getPoints(u)),p.push(d),f=THREE.Curve.Utils.createLineGeometry(p))},constrain:function(a,b,c){return b>a?a=b:a>c&&(a=c),a}}},{}],12:[function(a,b){"use strict";var c={linear:function(a,b,c,d){var e=c-b;return a*e/d+b},easeInQuad:function(a,b,c,d){var e=c-b;return e*(a/=d)*a+b},easeOutQuad:function(a,b,c,d){var e=c-b;return-e*(a/=d)*(a-2)+b},easeInOutQuad:function(a,b,c,d){var e=c-b;return(a/=d/2)<1?e/2*a*a+b:-e/2*(--a*(a-2)-1)+b},easeInElastic:function(a,b,c,d){var e=c-b,f=1.70158,g=0,h=e;if(0==a)return b;if(1==(a/=d))return b+e;if(g||(g=.3*d),ha?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],13:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c); -return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}]},{},[1,2,3,4,5,6,7,8,9,10,11]); \ No newline at end of file +/*! dataglobe 13-04-2015 */ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3))}function f(a){-1==a.target.className.indexOf("noMapDrag")&&(w=!0,u=q,v=r,y=void 0,y=void 0,k()) +}function g(){w=!1,j()}function h(a,b){b.scale.z+=.1*a,b.scale.z=n.constrain(b.scale.z,.7,5)}function i(a,b){var c=0;b.wheelDelta?c=b.wheelDelta/120:b.detail&&(c=-b.detail/3),c&&h(c,a),b.returnValue=!1}function j(){A=window.setInterval(function(){x+=.1*Math.PI/180*.3},100)}function k(){window.clearInterval(A)}var l=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.updateRotation=d,c.onDocumentMouseMove=e,c.onDocumentMouseDown=f,c.onDocumentMouseUp=g,c.handleMWheel=h,c.onMouseWheel=i,c.startAutoRotate=j,c.stopAutoRotate=k;var m=a("./visualize_lines"),n=l(m),o=90*Math.PI/180,p=.35*Math.PI/180,q=0,r=0,s=0,t=0,u=0,v=0,w=!1,x=0,y=0,z=0,A=null,B=new THREEx.KeyboardState,C=0;c.rotateX=C;var D=0;c.rotateY=D},{"./visualize_lines":14}],12:[function(a,b,c){"use strict";function d(a,b,c){for(c-=b;b>a;)a+=c;return a%c}function e(a,b){var c=new THREE.Projector,d=c.projectVector(a.clone(),b),e={},f=1280>f?1280:window.innerWidth;return e.x=Math.round(d.x*(f/2))+f/2,e.y=Math.round((0-d.y)*(window.innerHeight/2))+window.innerHeight/2,e}Object.defineProperty(c,"__esModule",{value:!0}),c.wrap=d,c.screenXY=e},{}],13:[function(a,b,c){"use strict";function d(a,b){var c=document.getElementById("loading");a.forEach(function(a){var c=a.src.toUpperCase(),d=a.dest.toUpperCase(),e=b[c],f=b[d];e&&f&&(a.lineGeometry=p.makeConnectionLineGeometry(e,f))}),c.style.display="none"}function e(a,b){for(var c=0;a>c;c++)w.push(new y(b))}function f(a){return a.lineGeometry&&x[a.colour]?void i(function(b){var c=k(a.colour);b.linesGeo.merge(a.lineGeometry);var d=a.lineGeometry.vertices,e=d[0],f=e.clone();f.moveIndex=0,f.nextIndex=1,f.lerpN=0,f.path=d,b.particlesGeo.vertices.push(f),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c);for(var g=0;g0?a(w.shift()):window.setTimeout(i,500,a)}function j(a){a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=r.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),w.push(a)}function k(a){var b=r.COLOUR_MAP[a];return b||(b=r.COLOUR_MAP.r),b}var l=function(a){return a&&a.__esModule?a:{"default":a}},m=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},n=function(){function a(a,b){for(var c=0;ca.slurpIndex||a.slurpIndex>=a.geometry.vertices.length);b++){var c=a.geometry.vertices[b];c.copy(a.geometry.vertices[a.slurpIndex])}a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=r.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,r.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=r.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=r.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",j.bind(this,this)),this.pSystem.update=function(a){if(!this.systemComplete){this.visible||(this.visible=!0,a.visible=!0);for(var b=void 0,c=void 0,d=void 0,e=0;e1&&(b.lerpN=0,b.moveIndex=b.nextIndex,b.nextIndex++,0===e&&(a.material.opacity-=.7/f.length),b.nextIndex>=f.length))return b.moveIndex=0,b.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});c=f[b.moveIndex],d=f[b.nextIndex],b.copy(c),b.lerp(d,b.lerpN)}for(var g=0;g=b.moveIndex&&(h.copy(c),h.lerp(d,b.lerpN))}a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return n(a,[{key:"runExplosion",value:function(){{var a=this.particlesGeo.vertices[0].path,b=a[a.length-2];this.attributes.customColor.value[0].getHex()}this.traceLine.slurpIndex=0;var c=Math.floor(3*Math.random());switch(c){case 0:this.explosionSphere.rotationAxis=t;break;case 1:this.explosionSphere.rotationAxis=u;break;case 2:this.explosionSphere.rotationAxis=v}this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(s,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)}},{key:"startParticleUpdates",value:function(){this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)}}]),a}()},{"./constants":7,"./visualize_lines":14}],14:[function(a,b,c){"use strict";function d(a,b){if(!a.countryName||!b.countryName)return void 0;var c=a.center.clone().sub(b.center).length(),d=a.center,e=b.center,g=d.clone().lerp(e,.5),h=g.length();g.normalize(),g.multiplyScalar(h+.45*c);var i=(new THREE.Vector3).subVectors(d,e);i.normalize();var j=.5*c,k=d,l=g.clone().add(i.clone().multiplyScalar(j)),m=g.clone().add(i.clone().multiplyScalar(-j)),n=e,o=new THREE.CubicBezierCurve3(d,k,l,g),p=new THREE.CubicBezierCurve3(g,m,n,e),q=2*Math.floor(.02*c+6),r=o.getPoints(q);r=r.splice(0,r.length-1),r=r.concat(p.getPoints(q)),r.push(f);var s=new THREE.Geometry;return r.forEach(function(a){s.vertices.push(a)}),s}function e(a,b,c){return b>a?a=b:a>c&&(a=c),a}Object.defineProperty(c,"__esModule",{value:!0}),c.makeConnectionLineGeometry=d,c.constrain=e;var f=new THREE.Vector3(0,0,0)},{}]},{},[7,8,9,10,11,12,13,14,4,5,6]); \ No newline at end of file From 83a7f62c30ff33a6a2b25b021d8bda460a2a8fff Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 12:12:46 -0400 Subject: [PATCH 181/190] Fixed issue with LegendItem click handler --- public/dataglobe.min.js | 2 +- src/components/legend-item.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 19597b9..0c63c1a 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 13-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3))}function f(a){-1==a.target.className.indexOf("noMapDrag")&&(w=!0,u=q,v=r,y=void 0,y=void 0,k()) +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3))}function f(a){-1==a.target.className.indexOf("noMapDrag")&&(w=!0,u=q,v=r,y=void 0,y=void 0,k()) }function g(){w=!1,j()}function h(a,b){b.scale.z+=.1*a,b.scale.z=n.constrain(b.scale.z,.7,5)}function i(a,b){var c=0;b.wheelDelta?c=b.wheelDelta/120:b.detail&&(c=-b.detail/3),c&&h(c,a),b.returnValue=!1}function j(){A=window.setInterval(function(){x+=.1*Math.PI/180*.3},100)}function k(){window.clearInterval(A)}var l=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.updateRotation=d,c.onDocumentMouseMove=e,c.onDocumentMouseDown=f,c.onDocumentMouseUp=g,c.handleMWheel=h,c.onMouseWheel=i,c.startAutoRotate=j,c.stopAutoRotate=k;var m=a("./visualize_lines"),n=l(m),o=90*Math.PI/180,p=.35*Math.PI/180,q=0,r=0,s=0,t=0,u=0,v=0,w=!1,x=0,y=0,z=0,A=null,B=new THREEx.KeyboardState,C=0;c.rotateX=C;var D=0;c.rotateY=D},{"./visualize_lines":14}],12:[function(a,b,c){"use strict";function d(a,b,c){for(c-=b;b>a;)a+=c;return a%c}function e(a,b){var c=new THREE.Projector,d=c.projectVector(a.clone(),b),e={},f=1280>f?1280:window.innerWidth;return e.x=Math.round(d.x*(f/2))+f/2,e.y=Math.round((0-d.y)*(window.innerHeight/2))+window.innerHeight/2,e}Object.defineProperty(c,"__esModule",{value:!0}),c.wrap=d,c.screenXY=e},{}],13:[function(a,b,c){"use strict";function d(a,b){var c=document.getElementById("loading");a.forEach(function(a){var c=a.src.toUpperCase(),d=a.dest.toUpperCase(),e=b[c],f=b[d];e&&f&&(a.lineGeometry=p.makeConnectionLineGeometry(e,f))}),c.style.display="none"}function e(a,b){for(var c=0;a>c;c++)w.push(new y(b))}function f(a){return a.lineGeometry&&x[a.colour]?void i(function(b){var c=k(a.colour);b.linesGeo.merge(a.lineGeometry);var d=a.lineGeometry.vertices,e=d[0],f=e.clone();f.moveIndex=0,f.nextIndex=1,f.lerpN=0,f.path=d,b.particlesGeo.vertices.push(f),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c);for(var g=0;g0?a(w.shift()):window.setTimeout(i,500,a)}function j(a){a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=r.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),w.push(a)}function k(a){var b=r.COLOUR_MAP[a];return b||(b=r.COLOUR_MAP.r),b}var l=function(a){return a&&a.__esModule?a:{"default":a}},m=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},n=function(){function a(a,b){for(var c=0;ca.slurpIndex||a.slurpIndex>=a.geometry.vertices.length);b++){var c=a.geometry.vertices[b];c.copy(a.geometry.vertices[a.slurpIndex])}a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=r.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,r.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=r.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=r.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",j.bind(this,this)),this.pSystem.update=function(a){if(!this.systemComplete){this.visible||(this.visible=!0,a.visible=!0);for(var b=void 0,c=void 0,d=void 0,e=0;e1&&(b.lerpN=0,b.moveIndex=b.nextIndex,b.nextIndex++,0===e&&(a.material.opacity-=.7/f.length),b.nextIndex>=f.length))return b.moveIndex=0,b.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});c=f[b.moveIndex],d=f[b.nextIndex],b.copy(c),b.lerp(d,b.lerpN)}for(var g=0;g=b.moveIndex&&(h.copy(c),h.lerp(d,b.lerpN))}a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return n(a,[{key:"runExplosion",value:function(){{var a=this.particlesGeo.vertices[0].path,b=a[a.length-2];this.attributes.customColor.value[0].getHex()}this.traceLine.slurpIndex=0;var c=Math.floor(3*Math.random());switch(c){case 0:this.explosionSphere.rotationAxis=t;break;case 1:this.explosionSphere.rotationAxis=u;break;case 2:this.explosionSphere.rotationAxis=v}this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(s,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)}},{key:"startParticleUpdates",value:function(){this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)}}]),a}()},{"./constants":7,"./visualize_lines":14}],14:[function(a,b,c){"use strict";function d(a,b){if(!a.countryName||!b.countryName)return void 0;var c=a.center.clone().sub(b.center).length(),d=a.center,e=b.center,g=d.clone().lerp(e,.5),h=g.length();g.normalize(),g.multiplyScalar(h+.45*c);var i=(new THREE.Vector3).subVectors(d,e);i.normalize();var j=.5*c,k=d,l=g.clone().add(i.clone().multiplyScalar(j)),m=g.clone().add(i.clone().multiplyScalar(-j)),n=e,o=new THREE.CubicBezierCurve3(d,k,l,g),p=new THREE.CubicBezierCurve3(g,m,n,e),q=2*Math.floor(.02*c+6),r=o.getPoints(q);r=r.splice(0,r.length-1),r=r.concat(p.getPoints(q)),r.push(f);var s=new THREE.Geometry;return r.forEach(function(a){s.vertices.push(a)}),s}function e(a,b,c){return b>a?a=b:a>c&&(a=c),a}Object.defineProperty(c,"__esModule",{value:!0}),c.makeConnectionLineGeometry=d,c.constrain=e;var f=new THREE.Vector3(0,0,0)},{}]},{},[7,8,9,10,11,12,13,14,4,5,6]); \ No newline at end of file diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index e3c7fdf..a5d2fda 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -93,7 +93,7 @@ export default class LegendItem extends React.Component { /* jshint ignore: start */ return (
  • - +
    - {itemText}
  • From 4d74d16f2216284fb560a23263212b27504a415c Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 12:19:14 -0400 Subject: [PATCH 182/190] Switched 's in the Legend out for more semantically-correct markup --- public/dataglobe.min.js | 4 ++-- src/components/legend-item.jsx | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index 0c63c1a..cd3d54e 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 13-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3))}function f(a){-1==a.target.className.indexOf("noMapDrag")&&(w=!0,u=q,v=r,y=void 0,y=void 0,k()) -}function g(){w=!1,j()}function h(a,b){b.scale.z+=.1*a,b.scale.z=n.constrain(b.scale.z,.7,5)}function i(a,b){var c=0;b.wheelDelta?c=b.wheelDelta/120:b.detail&&(c=-b.detail/3),c&&h(c,a),b.returnValue=!1}function j(){A=window.setInterval(function(){x+=.1*Math.PI/180*.3},100)}function k(){window.clearInterval(A)}var l=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.updateRotation=d,c.onDocumentMouseMove=e,c.onDocumentMouseDown=f,c.onDocumentMouseUp=g,c.handleMWheel=h,c.onMouseWheel=i,c.startAutoRotate=j,c.stopAutoRotate=k;var m=a("./visualize_lines"),n=l(m),o=90*Math.PI/180,p=.35*Math.PI/180,q=0,r=0,s=0,t=0,u=0,v=0,w=!1,x=0,y=0,z=0,A=null,B=new THREEx.KeyboardState,C=0;c.rotateX=C;var D=0;c.rotateY=D},{"./visualize_lines":14}],12:[function(a,b,c){"use strict";function d(a,b,c){for(c-=b;b>a;)a+=c;return a%c}function e(a,b){var c=new THREE.Projector,d=c.projectVector(a.clone(),b),e={},f=1280>f?1280:window.innerWidth;return e.x=Math.round(d.x*(f/2))+f/2,e.y=Math.round((0-d.y)*(window.innerHeight/2))+window.innerHeight/2,e}Object.defineProperty(c,"__esModule",{value:!0}),c.wrap=d,c.screenXY=e},{}],13:[function(a,b,c){"use strict";function d(a,b){var c=document.getElementById("loading");a.forEach(function(a){var c=a.src.toUpperCase(),d=a.dest.toUpperCase(),e=b[c],f=b[d];e&&f&&(a.lineGeometry=p.makeConnectionLineGeometry(e,f))}),c.style.display="none"}function e(a,b){for(var c=0;a>c;c++)w.push(new y(b))}function f(a){return a.lineGeometry&&x[a.colour]?void i(function(b){var c=k(a.colour);b.linesGeo.merge(a.lineGeometry);var d=a.lineGeometry.vertices,e=d[0],f=e.clone();f.moveIndex=0,f.nextIndex=1,f.lerpN=0,f.path=d,b.particlesGeo.vertices.push(f),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c);for(var g=0;g0?a(w.shift()):window.setTimeout(i,500,a)}function j(a){a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=r.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),w.push(a)}function k(a){var b=r.COLOUR_MAP[a];return b||(b=r.COLOUR_MAP.r),b}var l=function(a){return a&&a.__esModule?a:{"default":a}},m=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},n=function(){function a(a,b){for(var c=0;ca.slurpIndex||a.slurpIndex>=a.geometry.vertices.length);b++){var c=a.geometry.vertices[b];c.copy(a.geometry.vertices[a.slurpIndex])}a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=r.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,r.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=r.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=r.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",j.bind(this,this)),this.pSystem.update=function(a){if(!this.systemComplete){this.visible||(this.visible=!0,a.visible=!0);for(var b=void 0,c=void 0,d=void 0,e=0;e1&&(b.lerpN=0,b.moveIndex=b.nextIndex,b.nextIndex++,0===e&&(a.material.opacity-=.7/f.length),b.nextIndex>=f.length))return b.moveIndex=0,b.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});c=f[b.moveIndex],d=f[b.nextIndex],b.copy(c),b.lerp(d,b.lerpN)}for(var g=0;g=b.moveIndex&&(h.copy(c),h.lerp(d,b.lerpN))}a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return n(a,[{key:"runExplosion",value:function(){{var a=this.particlesGeo.vertices[0].path,b=a[a.length-2];this.attributes.customColor.value[0].getHex()}this.traceLine.slurpIndex=0;var c=Math.floor(3*Math.random());switch(c){case 0:this.explosionSphere.rotationAxis=t;break;case 1:this.explosionSphere.rotationAxis=u;break;case 2:this.explosionSphere.rotationAxis=v}this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(s,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)}},{key:"startParticleUpdates",value:function(){this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)}}]),a}()},{"./constants":7,"./visualize_lines":14}],14:[function(a,b,c){"use strict";function d(a,b){if(!a.countryName||!b.countryName)return void 0;var c=a.center.clone().sub(b.center).length(),d=a.center,e=b.center,g=d.clone().lerp(e,.5),h=g.length();g.normalize(),g.multiplyScalar(h+.45*c);var i=(new THREE.Vector3).subVectors(d,e);i.normalize();var j=.5*c,k=d,l=g.clone().add(i.clone().multiplyScalar(j)),m=g.clone().add(i.clone().multiplyScalar(-j)),n=e,o=new THREE.CubicBezierCurve3(d,k,l,g),p=new THREE.CubicBezierCurve3(g,m,n,e),q=2*Math.floor(.02*c+6),r=o.getPoints(q);r=r.splice(0,r.length-1),r=r.concat(p.getPoints(q)),r.push(f);var s=new THREE.Geometry;return r.forEach(function(a){s.vertices.push(a)}),s}function e(a,b,c){return b>a?a=b:a>c&&(a=c),a}Object.defineProperty(c,"__esModule",{value:!0}),c.makeConnectionLineGeometry=d,c.constrain=e;var f=new THREE.Vector3(0,0,0)},{}]},{},[7,8,9,10,11,12,13,14,4,5,6]); \ No newline at end of file +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3)) +}function f(a){-1==a.target.className.indexOf("noMapDrag")&&(w=!0,u=q,v=r,y=void 0,y=void 0,k())}function g(){w=!1,j()}function h(a,b){b.scale.z+=.1*a,b.scale.z=n.constrain(b.scale.z,.7,5)}function i(a,b){var c=0;b.wheelDelta?c=b.wheelDelta/120:b.detail&&(c=-b.detail/3),c&&h(c,a),b.returnValue=!1}function j(){A=window.setInterval(function(){x+=.1*Math.PI/180*.3},100)}function k(){window.clearInterval(A)}var l=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.updateRotation=d,c.onDocumentMouseMove=e,c.onDocumentMouseDown=f,c.onDocumentMouseUp=g,c.handleMWheel=h,c.onMouseWheel=i,c.startAutoRotate=j,c.stopAutoRotate=k;var m=a("./visualize_lines"),n=l(m),o=90*Math.PI/180,p=.35*Math.PI/180,q=0,r=0,s=0,t=0,u=0,v=0,w=!1,x=0,y=0,z=0,A=null,B=new THREEx.KeyboardState,C=0;c.rotateX=C;var D=0;c.rotateY=D},{"./visualize_lines":14}],12:[function(a,b,c){"use strict";function d(a,b,c){for(c-=b;b>a;)a+=c;return a%c}function e(a,b){var c=new THREE.Projector,d=c.projectVector(a.clone(),b),e={},f=1280>f?1280:window.innerWidth;return e.x=Math.round(d.x*(f/2))+f/2,e.y=Math.round((0-d.y)*(window.innerHeight/2))+window.innerHeight/2,e}Object.defineProperty(c,"__esModule",{value:!0}),c.wrap=d,c.screenXY=e},{}],13:[function(a,b,c){"use strict";function d(a,b){var c=document.getElementById("loading");a.forEach(function(a){var c=a.src.toUpperCase(),d=a.dest.toUpperCase(),e=b[c],f=b[d];e&&f&&(a.lineGeometry=p.makeConnectionLineGeometry(e,f))}),c.style.display="none"}function e(a,b){for(var c=0;a>c;c++)w.push(new y(b))}function f(a){return a.lineGeometry&&x[a.colour]?void i(function(b){var c=k(a.colour);b.linesGeo.merge(a.lineGeometry);var d=a.lineGeometry.vertices,e=d[0],f=e.clone();f.moveIndex=0,f.nextIndex=1,f.lerpN=0,f.path=d,b.particlesGeo.vertices.push(f),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c);for(var g=0;g0?a(w.shift()):window.setTimeout(i,500,a)}function j(a){a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=r.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),w.push(a)}function k(a){var b=r.COLOUR_MAP[a];return b||(b=r.COLOUR_MAP.r),b}var l=function(a){return a&&a.__esModule?a:{"default":a}},m=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},n=function(){function a(a,b){for(var c=0;ca.slurpIndex||a.slurpIndex>=a.geometry.vertices.length);b++){var c=a.geometry.vertices[b];c.copy(a.geometry.vertices[a.slurpIndex])}a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=r.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,r.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=r.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=r.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",j.bind(this,this)),this.pSystem.update=function(a){if(!this.systemComplete){this.visible||(this.visible=!0,a.visible=!0);for(var b=void 0,c=void 0,d=void 0,e=0;e1&&(b.lerpN=0,b.moveIndex=b.nextIndex,b.nextIndex++,0===e&&(a.material.opacity-=.7/f.length),b.nextIndex>=f.length))return b.moveIndex=0,b.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});c=f[b.moveIndex],d=f[b.nextIndex],b.copy(c),b.lerp(d,b.lerpN)}for(var g=0;g=b.moveIndex&&(h.copy(c),h.lerp(d,b.lerpN))}a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return n(a,[{key:"runExplosion",value:function(){{var a=this.particlesGeo.vertices[0].path,b=a[a.length-2];this.attributes.customColor.value[0].getHex()}this.traceLine.slurpIndex=0;var c=Math.floor(3*Math.random());switch(c){case 0:this.explosionSphere.rotationAxis=t;break;case 1:this.explosionSphere.rotationAxis=u;break;case 2:this.explosionSphere.rotationAxis=v}this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(s,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)}},{key:"startParticleUpdates",value:function(){this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)}}]),a}()},{"./constants":7,"./visualize_lines":14}],14:[function(a,b,c){"use strict";function d(a,b){if(!a.countryName||!b.countryName)return void 0;var c=a.center.clone().sub(b.center).length(),d=a.center,e=b.center,g=d.clone().lerp(e,.5),h=g.length();g.normalize(),g.multiplyScalar(h+.45*c);var i=(new THREE.Vector3).subVectors(d,e);i.normalize();var j=.5*c,k=d,l=g.clone().add(i.clone().multiplyScalar(j)),m=g.clone().add(i.clone().multiplyScalar(-j)),n=e,o=new THREE.CubicBezierCurve3(d,k,l,g),p=new THREE.CubicBezierCurve3(g,m,n,e),q=2*Math.floor(.02*c+6),r=o.getPoints(q);r=r.splice(0,r.length-1),r=r.concat(p.getPoints(q)),r.push(f);var s=new THREE.Geometry;return r.forEach(function(a){s.vertices.push(a)}),s}function e(a,b,c){return b>a?a=b:a>c&&(a=c),a}Object.defineProperty(c,"__esModule",{value:!0}),c.makeConnectionLineGeometry=d,c.constrain=e;var f=new THREE.Vector3(0,0,0)},{}]},{},[7,8,9,10,11,12,13,14,4,5,6]); \ No newline at end of file diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index a5d2fda..0d6b00d 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -21,6 +21,7 @@ export default class LegendItem extends React.Component { this.toggleLinkStyle = { textDecoration: 'none', fontWeight: 'normal', + cursor: 'pointer', // Transition for when we become inactive WebkitTransition: 'color 500ms ease-out', MozTransition: 'color 500ms ease-out', @@ -93,9 +94,9 @@ export default class LegendItem extends React.Component { /* jshint ignore: start */ return (
  • - +
  • ); /* jshint ignore: end */ From ed8bdbb790ebee860063064757a9a9301084b239 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 12:22:44 -0400 Subject: [PATCH 183/190] Updated readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1402f09..a92c150 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,6 @@ Data does not need to be in any particular order; the visualization takes care o ## TODOs * [ ] Allow source/destination data to be specified as lat/long, rather than country names -* [ ] Consider updating repo to use es6 with Babel, rather than CoffeeScript +* [x] Consider updating repo to use es6 with Babel, rather than CoffeeScript * [x] Highlight the destination country when the particle "hits" it * [x] Create subtle trail effect for particles From d286ad3ef30c39e3f94ac98f7dd4bfaafe88b99e Mon Sep 17 00:00:00 2001 From: dpetker Date: Mon, 13 Apr 2015 13:00:17 -0400 Subject: [PATCH 184/190] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a92c150..4cace64 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This fork attempts to make the globe data-agnostic so that users can simply prov ## Building -To build this application you'll need an up-to-date copy of [Node.js](http://nodejs.org/), [Grunt CLI](http://gruntjs.com/), [Bower](http://bower.io/), and [CoffeeScript](http://coffeescript.org/). Once all these are installed, simply run the following from within the `dataglobe` directory: +To build this application you'll need an up-to-date copy of [Node.js](http://nodejs.org/), [Grunt CLI](http://gruntjs.com/), and [Bower](http://bower.io/). Once all these are installed, simply run the following from within the `dataglobe` directory: ```bash $ npm install From ee32afe58a4145041b9a5b5911ee99156f11467c Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Mon, 13 Apr 2015 15:11:22 -0400 Subject: [PATCH 185/190] Fix issue where non-JS timestamps wouldn't get converted. --- public/dataglobe.min.js | 2 +- src/main.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js index cd3d54e..434238d 100644 --- a/public/dataglobe.min.js +++ b/public/dataglobe.min.js @@ -1,3 +1,3 @@ /*! dataglobe 13-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3)) +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){a=v.map(a,function(a){return typeof a.time===Date?a:(a.time=new Date(a.time),a)}),G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3)) }function f(a){-1==a.target.className.indexOf("noMapDrag")&&(w=!0,u=q,v=r,y=void 0,y=void 0,k())}function g(){w=!1,j()}function h(a,b){b.scale.z+=.1*a,b.scale.z=n.constrain(b.scale.z,.7,5)}function i(a,b){var c=0;b.wheelDelta?c=b.wheelDelta/120:b.detail&&(c=-b.detail/3),c&&h(c,a),b.returnValue=!1}function j(){A=window.setInterval(function(){x+=.1*Math.PI/180*.3},100)}function k(){window.clearInterval(A)}var l=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.updateRotation=d,c.onDocumentMouseMove=e,c.onDocumentMouseDown=f,c.onDocumentMouseUp=g,c.handleMWheel=h,c.onMouseWheel=i,c.startAutoRotate=j,c.stopAutoRotate=k;var m=a("./visualize_lines"),n=l(m),o=90*Math.PI/180,p=.35*Math.PI/180,q=0,r=0,s=0,t=0,u=0,v=0,w=!1,x=0,y=0,z=0,A=null,B=new THREEx.KeyboardState,C=0;c.rotateX=C;var D=0;c.rotateY=D},{"./visualize_lines":14}],12:[function(a,b,c){"use strict";function d(a,b,c){for(c-=b;b>a;)a+=c;return a%c}function e(a,b){var c=new THREE.Projector,d=c.projectVector(a.clone(),b),e={},f=1280>f?1280:window.innerWidth;return e.x=Math.round(d.x*(f/2))+f/2,e.y=Math.round((0-d.y)*(window.innerHeight/2))+window.innerHeight/2,e}Object.defineProperty(c,"__esModule",{value:!0}),c.wrap=d,c.screenXY=e},{}],13:[function(a,b,c){"use strict";function d(a,b){var c=document.getElementById("loading");a.forEach(function(a){var c=a.src.toUpperCase(),d=a.dest.toUpperCase(),e=b[c],f=b[d];e&&f&&(a.lineGeometry=p.makeConnectionLineGeometry(e,f))}),c.style.display="none"}function e(a,b){for(var c=0;a>c;c++)w.push(new y(b))}function f(a){return a.lineGeometry&&x[a.colour]?void i(function(b){var c=k(a.colour);b.linesGeo.merge(a.lineGeometry);var d=a.lineGeometry.vertices,e=d[0],f=e.clone();f.moveIndex=0,f.nextIndex=1,f.lerpN=0,f.path=d,b.particlesGeo.vertices.push(f),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c);for(var g=0;g0?a(w.shift()):window.setTimeout(i,500,a)}function j(a){a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=r.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),w.push(a)}function k(a){var b=r.COLOUR_MAP[a];return b||(b=r.COLOUR_MAP.r),b}var l=function(a){return a&&a.__esModule?a:{"default":a}},m=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},n=function(){function a(a,b){for(var c=0;ca.slurpIndex||a.slurpIndex>=a.geometry.vertices.length);b++){var c=a.geometry.vertices[b];c.copy(a.geometry.vertices[a.slurpIndex])}a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=r.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,r.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=r.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=r.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",j.bind(this,this)),this.pSystem.update=function(a){if(!this.systemComplete){this.visible||(this.visible=!0,a.visible=!0);for(var b=void 0,c=void 0,d=void 0,e=0;e1&&(b.lerpN=0,b.moveIndex=b.nextIndex,b.nextIndex++,0===e&&(a.material.opacity-=.7/f.length),b.nextIndex>=f.length))return b.moveIndex=0,b.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});c=f[b.moveIndex],d=f[b.nextIndex],b.copy(c),b.lerp(d,b.lerpN)}for(var g=0;g=b.moveIndex&&(h.copy(c),h.lerp(d,b.lerpN))}a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return n(a,[{key:"runExplosion",value:function(){{var a=this.particlesGeo.vertices[0].path,b=a[a.length-2];this.attributes.customColor.value[0].getHex()}this.traceLine.slurpIndex=0;var c=Math.floor(3*Math.random());switch(c){case 0:this.explosionSphere.rotationAxis=t;break;case 1:this.explosionSphere.rotationAxis=u;break;case 2:this.explosionSphere.rotationAxis=v}this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(s,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)}},{key:"startParticleUpdates",value:function(){this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)}}]),a}()},{"./constants":7,"./visualize_lines":14}],14:[function(a,b,c){"use strict";function d(a,b){if(!a.countryName||!b.countryName)return void 0;var c=a.center.clone().sub(b.center).length(),d=a.center,e=b.center,g=d.clone().lerp(e,.5),h=g.length();g.normalize(),g.multiplyScalar(h+.45*c);var i=(new THREE.Vector3).subVectors(d,e);i.normalize();var j=.5*c,k=d,l=g.clone().add(i.clone().multiplyScalar(j)),m=g.clone().add(i.clone().multiplyScalar(-j)),n=e,o=new THREE.CubicBezierCurve3(d,k,l,g),p=new THREE.CubicBezierCurve3(g,m,n,e),q=2*Math.floor(.02*c+6),r=o.getPoints(q);r=r.splice(0,r.length-1),r=r.concat(p.getPoints(q)),r.push(f);var s=new THREE.Geometry;return r.forEach(function(a){s.vertices.push(a)}),s}function e(a,b,c){return b>a?a=b:a>c&&(a=c),a}Object.defineProperty(c,"__esModule",{value:!0}),c.makeConnectionLineGeometry=d,c.constrain=e;var f=new THREE.Vector3(0,0,0)},{}]},{},[7,8,9,10,11,12,13,14,4,5,6]); \ No newline at end of file diff --git a/src/main.js b/src/main.js index 41e6aad..4a23e05 100644 --- a/src/main.js +++ b/src/main.js @@ -209,6 +209,16 @@ if( !Detector.webgl ) { dataLoading.loadWorldPins( 'country_lat_lon.json', ( latLonData ) => { _latLonData = latLonData; dataLoading.loadRandomizedContentData( 2000, _countryLookup, ( sampleData ) => { + // need to convert all the timestamps to JS dates + sampleData = us.map( sampleData, function( point ) { + if( typeof point.time === Date ) { + return point; + } else { + point.time = new Date( point.time ); + return point; + } + }); + _sampleData = us.sortBy( sampleData, 'time' ); _minDataTimestamp = _sampleData[0].time; _maxDataTimestamp = _sampleData[ _sampleData.length - 1 ].time; From 532876a8fe8f9b8f6630a92f720b564b1ef11c7f Mon Sep 17 00:00:00 2001 From: dpetker Date: Tue, 14 Apr 2015 11:39:01 -0400 Subject: [PATCH 186/190] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4cace64..97fd1ba 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Data does not need to be in any particular order; the visualization takes care o ## TODOs * [ ] Allow source/destination data to be specified as lat/long, rather than country names +* [ ] Implement touch/pointer events for use on tablets/phones * [x] Consider updating repo to use es6 with Babel, rather than CoffeeScript * [x] Highlight the destination country when the particle "hits" it * [x] Create subtle trail effect for particles From e74963e0fdb7623fcfbf4f2b5990bb4d1e96dccf Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 15 Apr 2015 11:22:46 -0400 Subject: [PATCH 187/190] Added a FIXME tag around improvements we should make to how data is served to the visualization --- src/main.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main.js b/src/main.js index 4a23e05..c96c740 100644 --- a/src/main.js +++ b/src/main.js @@ -204,6 +204,13 @@ if( !Detector.webgl ) { // Render our React components reactInit(); + /* + FIXME: We really shouldn't be doing all this loading and data manipulation + client-side. The better solution is for a server-side process to combine + everything together so that our data source contains nothing but a lat/long. + That way, all we need to do is convert the lat/long to a vector in the scene's + co-ordinate space and then start visualizing it. + */ dataLoading.loadCountryCodes( 'country_iso3166.json', ( isoData ) => { _countryLookup = isoData; dataLoading.loadWorldPins( 'country_lat_lon.json', ( latLonData ) => { From cfc3df9ba24110cbb1c2b91d823604829fff1347 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Wed, 23 Sep 2015 16:24:58 -0400 Subject: [PATCH 188/190] Start migration to eslint based off AirBnB style guide --- .eslintrc | 4 + Gruntfile.js | 7 + package.json | 5 + public/dataglobe.min.js | 3 - public/thirdparty.min.js | 18 -- src/components/legend-item.jsx | 78 +++++---- src/components/legend.jsx | 33 ++-- src/components/progress.jsx | 73 ++++---- src/constants.js | 4 +- src/dataloading.js | 64 +++---- src/geopins.js | 38 ++-- src/main.js | 100 ++++++----- src/mousekeyboard.js | 54 +++--- src/util.js | 22 +-- src/visualize.js | 307 +++++++++++++++++---------------- src/visualize_lines.js | 49 +++--- 16 files changed, 432 insertions(+), 427 deletions(-) create mode 100644 .eslintrc delete mode 100644 public/dataglobe.min.js delete mode 100644 public/thirdparty.min.js diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..34ddf06 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,4 @@ +{ + "parser": "babel-eslint", + "extends": "eslint-config-airbnb" +} diff --git a/Gruntfile.js b/Gruntfile.js index 7a03e87..78574fd 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -11,6 +11,10 @@ module.exports = function( grunt ) { incr: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/public/<%= pkg.name %>.min.js' ] }, + eslint: { + target: [ 'src/**/*.js', 'src/**/*.jsx' ] + }, + bower_concat: { all: { dest: 'build/bower.js', @@ -95,9 +99,11 @@ module.exports = function( grunt ) { grunt.loadNpmTasks( 'grunt-contrib-clean' ); grunt.loadNpmTasks( 'grunt-bower-concat' ); grunt.loadNpmTasks( 'grunt-contrib-concat' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.registerTask( 'default', [ 'clean:all', + 'eslint', 'bower_concat:all', 'concat:dist', 'browserify:production', @@ -106,6 +112,7 @@ module.exports = function( grunt ) { grunt.registerTask( 'incremental', [ 'clean:incr', + 'eslint', 'browserify:production', 'uglify:incr' ]); diff --git a/package.json b/package.json index beb1941..eba2eea 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,11 @@ "underscore": "^1.8.3" }, "devDependencies": { + "babel-eslint": "^4.1.3", "babelify": "^6.0.2", + "eslint": "^1.5.1", + "eslint-config-airbnb": "0.0.8", + "eslint-plugin-react": "^3.4.2", "grunt": "^0.4.5", "grunt-bower-concat": "^0.4.0", "grunt-browserify": "^3.4.0", @@ -25,6 +29,7 @@ "grunt-contrib-concat": "^0.5.1", "grunt-contrib-uglify": "^0.8.0", "grunt-contrib-watch": "^0.6.1", + "grunt-eslint": "^17.2.0", "underscore": "^1.8.2" } } diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js deleted file mode 100644 index 434238d..0000000 --- a/public/dataglobe.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! dataglobe 13-04-2015 */ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},f=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=Math.floor(Math.random()*e.length),j=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===i&&(i=i===e.length-1?0:i+1);var m={};m.src=b[e[h]],m.dest=b[e[i]],m.colour=j,m.time=new Date(f-l),d.push(m)}c(d)}function h(a,b){var c=new XMLHttpRequest;c.open("GET",a,!0),c.onreadystatechange=function(){if(4===c.readyState&&200===c.status){var a=JSON.parse(c.responseText);b&&b(a)}},c.send(null)}var i=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=d,c.loadCountryCodes=e,c.loadContentData=f,c.loadRandomizedContentData=g;var j=a("./constants"),k=i(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c={};return Object.keys(a.countries).forEach(function(d){var f=a.countries[d];f.countryCode=d,f.countryName=b[d];var g=e(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}function e(a,b){var c=100;b-=90;var d=Math.PI/2-a*Math.PI/180-.01*Math.PI,e=2*Math.PI-b*Math.PI/180+.06*Math.PI,f=new THREE.Vector3;return f.x=Math.sin(d)*Math.cos(e)*c,f.y=Math.cos(d)*c,f.z=Math.sin(d)*Math.sin(e)*c,f}Object.defineProperty(c,"__esModule",{value:!0}),c.loadGeoData=d,c.convertLatLonToVector=e},{}],10:[function(a){"use strict";function b(){var a=q.VIZ_LOOP_LENGTH/q.VIZ_POLLING_INTERVAL,b=0,d=I.getTime()-H.getTime(),e=Math.floor(d/a),f=H.getTime();window.setInterval(function(){var d=c(f,f+e);f+=e,b++,f>=I.getTime()&&(f=H.getTime(),b=0),m.initVisualization(d),D.handleProgressUpdate(b/a)},q.VIZ_POLLING_INTERVAL)}function c(a,b){a==H.getTime()&&(J=G);var c=v.partition(J,function(c){var d=c.time.getTime();return d>=a&&b>=d});return J=c[1],c[0]}function d(){A=new THREE.Scene,A.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,A.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,A.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,A.add(c),y=new THREE.Object3D,A.add(y);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,y.add(e),C=new THREE.Object3D,y.add(C),z=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),z.setSize(window.innerWidth,window.innerHeight),z.autoClear=!1,z.sortObjects=!1,z.generateMipmaps=!1,x.appendChild(z.domElement),B=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),B.position.z=1400,B.position.y=0,A.add(B),w.addEventListener("mousemove",k.onDocumentMouseMove.bind(null,B),!0),w.addEventListener("mousedown",k.onDocumentMouseDown,!0),w.addEventListener("mouseup",k.onDocumentMouseUp,!1),w.addEventListener("mousewheel",k.onMouseWheel.bind(null,B),!1),w.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;k.onMouseWheel(B,b)},!1),THREEx.WindowResize(z,B),k.startAutoRotate()}function e(){k.updateRotation(),y.rotation.x=k.rotateX,y.rotation.y=k.rotateY,requestAnimationFrame(e),z.render(A,B)}function f(){React.render(React.createElement(s["default"],{types:q.COLOUR_TYPES,clickCallback:m.toggleVisualizationType}),document.getElementById("legend")),D=React.render(React.createElement(u["default"],null),document.getElementById("progress"))}var g=function(a){return a&&a.__esModule?a:{"default":a}},h=a("./dataloading"),i=g(h),j=a("./mousekeyboard"),k=g(j),l=a("./visualize"),m=g(l),n=a("./geopins"),o=g(n),p=a("./constants"),q=g(p),r=a("./components/legend.jsx"),s=g(r),t=a("./components/progress.jsx"),u=g(t),v=a("underscore"),w=document.getElementById("visualization"),x=document.getElementById("glContainer"),y=null,z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null;Detector.webgl?(d(),m.initMeshPool(q.MESH_POOL_SIZE,C),f(),i.loadCountryCodes("country_iso3166.json",function(a){E=a,i.loadWorldPins("country_lat_lon.json",function(a){F=a,i.loadRandomizedContentData(2e3,E,function(a){a=v.map(a,function(a){return typeof a.time===Date?a:(a.time=new Date(a.time),a)}),G=v.sortBy(a,"time"),H=G[0].time,I=G[G.length-1].time;var c=o.loadGeoData(F,E);m.buildDataVizGeometries(G,c),e(),b()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(){y&&z&&(p+=.012*(y-C),x+=.012*(z-D),Math.abs(y-C)<.1&&Math.abs(z-D)<.1&&(y=void 0,z=void 0)),c.rotateX=C+=p,c.rotateY=D+=x,p*=.98,x*=.98,(w||y)&&(p*=.6,x*=.6),-o>C&&(c.rotateX=C=-o,p*=-.95),C>o&&(c.rotateX=C=o,p*=-.95)}function e(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,w&&(B.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(x+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3)) -}function f(a){-1==a.target.className.indexOf("noMapDrag")&&(w=!0,u=q,v=r,y=void 0,y=void 0,k())}function g(){w=!1,j()}function h(a,b){b.scale.z+=.1*a,b.scale.z=n.constrain(b.scale.z,.7,5)}function i(a,b){var c=0;b.wheelDelta?c=b.wheelDelta/120:b.detail&&(c=-b.detail/3),c&&h(c,a),b.returnValue=!1}function j(){A=window.setInterval(function(){x+=.1*Math.PI/180*.3},100)}function k(){window.clearInterval(A)}var l=function(a){return a&&a.__esModule?a:{"default":a}};Object.defineProperty(c,"__esModule",{value:!0}),c.updateRotation=d,c.onDocumentMouseMove=e,c.onDocumentMouseDown=f,c.onDocumentMouseUp=g,c.handleMWheel=h,c.onMouseWheel=i,c.startAutoRotate=j,c.stopAutoRotate=k;var m=a("./visualize_lines"),n=l(m),o=90*Math.PI/180,p=.35*Math.PI/180,q=0,r=0,s=0,t=0,u=0,v=0,w=!1,x=0,y=0,z=0,A=null,B=new THREEx.KeyboardState,C=0;c.rotateX=C;var D=0;c.rotateY=D},{"./visualize_lines":14}],12:[function(a,b,c){"use strict";function d(a,b,c){for(c-=b;b>a;)a+=c;return a%c}function e(a,b){var c=new THREE.Projector,d=c.projectVector(a.clone(),b),e={},f=1280>f?1280:window.innerWidth;return e.x=Math.round(d.x*(f/2))+f/2,e.y=Math.round((0-d.y)*(window.innerHeight/2))+window.innerHeight/2,e}Object.defineProperty(c,"__esModule",{value:!0}),c.wrap=d,c.screenXY=e},{}],13:[function(a,b,c){"use strict";function d(a,b){var c=document.getElementById("loading");a.forEach(function(a){var c=a.src.toUpperCase(),d=a.dest.toUpperCase(),e=b[c],f=b[d];e&&f&&(a.lineGeometry=p.makeConnectionLineGeometry(e,f))}),c.style.display="none"}function e(a,b){for(var c=0;a>c;c++)w.push(new y(b))}function f(a){return a.lineGeometry&&x[a.colour]?void i(function(b){var c=k(a.colour);b.linesGeo.merge(a.lineGeometry);var d=a.lineGeometry.vertices,e=d[0],f=e.clone();f.moveIndex=0,f.nextIndex=1,f.lerpN=0,f.path=d,b.particlesGeo.vertices.push(f),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c);for(var g=0;g0?a(w.shift()):window.setTimeout(i,500,a)}function j(a){a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=r.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),w.push(a)}function k(a){var b=r.COLOUR_MAP[a];return b||(b=r.COLOUR_MAP.r),b}var l=function(a){return a&&a.__esModule?a:{"default":a}},m=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},n=function(){function a(a,b){for(var c=0;ca.slurpIndex||a.slurpIndex>=a.geometry.vertices.length);b++){var c=a.geometry.vertices[b];c.copy(a.geometry.vertices[a.slurpIndex])}a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=r.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,r.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=r.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=r.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",j.bind(this,this)),this.pSystem.update=function(a){if(!this.systemComplete){this.visible||(this.visible=!0,a.visible=!0);for(var b=void 0,c=void 0,d=void 0,e=0;e1&&(b.lerpN=0,b.moveIndex=b.nextIndex,b.nextIndex++,0===e&&(a.material.opacity-=.7/f.length),b.nextIndex>=f.length))return b.moveIndex=0,b.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});c=f[b.moveIndex],d=f[b.nextIndex],b.copy(c),b.lerp(d,b.lerpN)}for(var g=0;g=b.moveIndex&&(h.copy(c),h.lerp(d,b.lerpN))}a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return n(a,[{key:"runExplosion",value:function(){{var a=this.particlesGeo.vertices[0].path,b=a[a.length-2];this.attributes.customColor.value[0].getHex()}this.traceLine.slurpIndex=0;var c=Math.floor(3*Math.random());switch(c){case 0:this.explosionSphere.rotationAxis=t;break;case 1:this.explosionSphere.rotationAxis=u;break;case 2:this.explosionSphere.rotationAxis=v}this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(s,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)}},{key:"startParticleUpdates",value:function(){this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)}}]),a}()},{"./constants":7,"./visualize_lines":14}],14:[function(a,b,c){"use strict";function d(a,b){if(!a.countryName||!b.countryName)return void 0;var c=a.center.clone().sub(b.center).length(),d=a.center,e=b.center,g=d.clone().lerp(e,.5),h=g.length();g.normalize(),g.multiplyScalar(h+.45*c);var i=(new THREE.Vector3).subVectors(d,e);i.normalize();var j=.5*c,k=d,l=g.clone().add(i.clone().multiplyScalar(j)),m=g.clone().add(i.clone().multiplyScalar(-j)),n=e,o=new THREE.CubicBezierCurve3(d,k,l,g),p=new THREE.CubicBezierCurve3(g,m,n,e),q=2*Math.floor(.02*c+6),r=o.getPoints(q);r=r.splice(0,r.length-1),r=r.concat(p.getPoints(q)),r.push(f);var s=new THREE.Geometry;return r.forEach(function(a){s.vertices.push(a)}),s}function e(a,b,c){return b>a?a=b:a>c&&(a=c),a}Object.defineProperty(c,"__esModule",{value:!0}),c.makeConnectionLineGeometry=d,c.constrain=e;var f=new THREE.Vector3(0,0,0)},{}]},{},[7,8,9,10,11,12,13,14,4,5,6]); \ No newline at end of file diff --git a/public/thirdparty.min.js b/public/thirdparty.min.js deleted file mode 100644 index 4dd1c83..0000000 --- a/public/thirdparty.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! dataglobe 20-03-2015 */ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.React=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g8&&11>=w),z=32,A=String.fromCharCode(z),B=m.topLevelTypes,C={beforeInput:{phasedRegistrationNames:{bubbled:s({onBeforeInput:null}),captured:s({onBeforeInputCapture:null})},dependencies:[B.topCompositionEnd,B.topKeyPress,B.topTextInput,B.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:s({onCompositionEnd:null}),captured:s({onCompositionEndCapture:null})},dependencies:[B.topBlur,B.topCompositionEnd,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:s({onCompositionStart:null}),captured:s({onCompositionStartCapture:null})},dependencies:[B.topBlur,B.topCompositionStart,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:s({onCompositionUpdate:null}),captured:s({onCompositionUpdateCapture:null})},dependencies:[B.topBlur,B.topCompositionUpdate,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]}},D=!1,E=null,F={eventTypes:C,extractEvents:function(a,b,c,d){return[i(a,b,c,d),l(a,b,c,d)]}};b.exports=F},{139:139,15:15,20:20,21:21,22:22,91:91,95:95}],4:[function(a,b){"use strict";function c(a,b){return a+b.charAt(0).toUpperCase()+b.substring(1)}var d={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},e=["Webkit","ms","Moz","O"];Object.keys(d).forEach(function(a){e.forEach(function(b){d[c(b,a)]=d[a]})});var f={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},g={isUnitlessNumber:d,shorthandPropertyExpansions:f};b.exports=g},{}],5:[function(a,b){"use strict";var c=a(4),d=a(21),e=(a(106),a(111)),f=a(131),g=a(141),h=(a(150),g(function(a){return f(a)})),i="cssFloat";d.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(i="styleFloat");var j={createMarkupForStyles:function(a){var b="";for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];null!=d&&(b+=h(c)+":",b+=e(c,d)+";")}return b||null},setValueForStyles:function(a,b){var d=a.style;for(var f in b)if(b.hasOwnProperty(f)){var g=e(f,b[f]);if("float"===f&&(f=i),g)d[f]=g;else{var h=c.shorthandPropertyExpansions[f];if(h)for(var j in h)d[j]="";else d[f]=""}}}};b.exports=j},{106:106,111:111,131:131,141:141,150:150,21:21,4:4}],6:[function(a,b){"use strict";function c(){this._callbacks=null,this._contexts=null}var d=a(28),e=a(27),f=a(133);e(c.prototype,{enqueue:function(a,b){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(a),this._contexts.push(b)},notifyAll:function(){var a=this._callbacks,b=this._contexts;if(a){f(a.length===b.length),this._callbacks=null,this._contexts=null;for(var c=0,d=a.length;d>c;c++)a[c].call(b[c]);a.length=0,b.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),d.addPoolingTo(c),b.exports=c},{133:133,27:27,28:28}],7:[function(a,b){"use strict";function c(a){return"SELECT"===a.nodeName||"INPUT"===a.nodeName&&"file"===a.type}function d(a){var b=w.getPooled(B.change,D,a);t.accumulateTwoPhaseDispatches(b),v.batchedUpdates(e,b)}function e(a){s.enqueueEvents(a),s.processEventQueue()}function f(a,b){C=a,D=b,C.attachEvent("onchange",d)}function g(){C&&(C.detachEvent("onchange",d),C=null,D=null)}function h(a,b,c){return a===A.topChange?c:void 0}function i(a,b,c){a===A.topFocus?(g(),f(b,c)):a===A.topBlur&&g()}function j(a,b){C=a,D=b,E=a.value,F=Object.getOwnPropertyDescriptor(a.constructor.prototype,"value"),Object.defineProperty(C,"value",I),C.attachEvent("onpropertychange",l)}function k(){C&&(delete C.value,C.detachEvent("onpropertychange",l),C=null,D=null,E=null,F=null)}function l(a){if("value"===a.propertyName){var b=a.srcElement.value;b!==E&&(E=b,d(a))}}function m(a,b,c){return a===A.topInput?c:void 0}function n(a,b,c){a===A.topFocus?(k(),j(b,c)):a===A.topBlur&&k()}function o(a){return a!==A.topSelectionChange&&a!==A.topKeyUp&&a!==A.topKeyDown||!C||C.value===E?void 0:(E=C.value,D)}function p(a){return"INPUT"===a.nodeName&&("checkbox"===a.type||"radio"===a.type)}function q(a,b,c){return a===A.topClick?c:void 0}var r=a(15),s=a(17),t=a(20),u=a(21),v=a(85),w=a(93),x=a(134),y=a(136),z=a(139),A=r.topLevelTypes,B={change:{phasedRegistrationNames:{bubbled:z({onChange:null}),captured:z({onChangeCapture:null})},dependencies:[A.topBlur,A.topChange,A.topClick,A.topFocus,A.topInput,A.topKeyDown,A.topKeyUp,A.topSelectionChange]}},C=null,D=null,E=null,F=null,G=!1;u.canUseDOM&&(G=x("change")&&(!("documentMode"in document)||document.documentMode>8));var H=!1;u.canUseDOM&&(H=x("input")&&(!("documentMode"in document)||document.documentMode>9));var I={get:function(){return F.get.call(this)},set:function(a){E=""+a,F.set.call(this,a)}},J={eventTypes:B,extractEvents:function(a,b,d,e){var f,g;if(c(b)?G?f=h:g=i:y(b)?H?f=m:(f=o,g=n):p(b)&&(f=q),f){var j=f(a,b,d);if(j){var k=w.getPooled(B.change,j,e);return t.accumulateTwoPhaseDispatches(k),k}}g&&g(a,b,d)}};b.exports=J},{134:134,136:136,139:139,15:15,17:17,20:20,21:21,85:85,93:93}],8:[function(a,b){"use strict";var c=0,d={createReactRootIndex:function(){return c++}};b.exports=d},{}],9:[function(a,b){"use strict";function c(a,b,c){a.insertBefore(b,a.childNodes[c]||null)}var d=a(12),e=a(70),f=a(145),g=a(133),h={dangerouslyReplaceNodeWithMarkup:d.dangerouslyReplaceNodeWithMarkup,updateTextContent:f,processUpdates:function(a,b){for(var h,i=null,j=null,k=0;kb||d.hasOverloadedBooleanValue[a]&&b===!1}var d=a(10),e=a(143),f=(a(150),{createMarkupForID:function(a){return d.ID_ATTRIBUTE_NAME+"="+e(a)},createMarkupForProperty:function(a,b){if(d.isStandardName.hasOwnProperty(a)&&d.isStandardName[a]){if(c(a,b))return"";var f=d.getAttributeName[a];return d.hasBooleanValue[a]||d.hasOverloadedBooleanValue[a]&&b===!0?f:f+"="+e(b)}return d.isCustomAttribute(a)?null==b?"":a+"="+e(b):null},setValueForProperty:function(a,b,e){if(d.isStandardName.hasOwnProperty(b)&&d.isStandardName[b]){var f=d.getMutationMethod[b];if(f)f(a,e);else if(c(b,e))this.deleteValueForProperty(a,b);else if(d.mustUseAttribute[b])a.setAttribute(d.getAttributeName[b],""+e);else{var g=d.getPropertyName[b];d.hasSideEffects[b]&&""+a[g]==""+e||(a[g]=e)}}else d.isCustomAttribute(b)&&(null==e?a.removeAttribute(b):a.setAttribute(b,""+e))},deleteValueForProperty:function(a,b){if(d.isStandardName.hasOwnProperty(b)&&d.isStandardName[b]){var c=d.getMutationMethod[b];if(c)c(a,void 0);else if(d.mustUseAttribute[b])a.removeAttribute(d.getAttributeName[b]);else{var e=d.getPropertyName[b],f=d.getDefaultValueForProperty(a.nodeName,e);d.hasSideEffects[b]&&""+a[e]===f||(a[e]=f)}}else d.isCustomAttribute(b)&&a.removeAttribute(b)}});b.exports=f},{10:10,143:143,150:150}],12:[function(a,b){"use strict";function c(a){return a.substring(1,a.indexOf(" "))}var d=a(21),e=a(110),f=a(112),g=a(125),h=a(133),i=/^(<[^ \/>]+)/,j="data-danger-index",k={dangerouslyRenderMarkup:function(a){h(d.canUseDOM);for(var b,k={},l=0;li;i++){var k=h[i];if(k){var l=k.extractEvents(a,b,d,f);l&&(g=e(g,l))}}return g},enqueueEvents:function(a){a&&(i=e(i,a))},processEventQueue:function(){var a=i;i=null,f(a,j),g(!i)},__purge:function(){h={}},__getListenerBank:function(){return h}};b.exports=l},{103:103,118:118,133:133,18:18,19:19}],18:[function(a,b){"use strict";function c(){if(g)for(var a in h){var b=h[a],c=g.indexOf(a);if(f(c>-1),!i.plugins[c]){f(b.extractEvents),i.plugins[c]=b;var e=b.eventTypes;for(var j in e)f(d(e[j],b,j))}}}function d(a,b,c){f(!i.eventNameDispatchConfigs.hasOwnProperty(c)),i.eventNameDispatchConfigs[c]=a;var d=a.phasedRegistrationNames;if(d){for(var g in d)if(d.hasOwnProperty(g)){var h=d[g];e(h,b,c)}return!0}return a.registrationName?(e(a.registrationName,b,c),!0):!1}function e(a,b,c){f(!i.registrationNameModules[a]),i.registrationNameModules[a]=b,i.registrationNameDependencies[a]=b.eventTypes[c].dependencies}var f=a(133),g=null,h={},i={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(a){f(!g),g=Array.prototype.slice.call(a),c()},injectEventPluginsByName:function(a){var b=!1;for(var d in a)if(a.hasOwnProperty(d)){var e=a[d];h.hasOwnProperty(d)&&h[d]===e||(f(!h[d]),h[d]=e,b=!0)}b&&c()},getPluginModuleForEvent:function(a){var b=a.dispatchConfig;if(b.registrationName)return i.registrationNameModules[b.registrationName]||null;for(var c in b.phasedRegistrationNames)if(b.phasedRegistrationNames.hasOwnProperty(c)){var d=i.registrationNameModules[b.phasedRegistrationNames[c]];if(d)return d}return null},_resetEventPlugins:function(){g=null;for(var a in h)h.hasOwnProperty(a)&&delete h[a];i.plugins.length=0;var b=i.eventNameDispatchConfigs;for(var c in b)b.hasOwnProperty(c)&&delete b[c];var d=i.registrationNameModules;for(var e in d)d.hasOwnProperty(e)&&delete d[e]}};b.exports=i},{133:133}],19:[function(a,b){"use strict";function c(a){return a===p.topMouseUp||a===p.topTouchEnd||a===p.topTouchCancel}function d(a){return a===p.topMouseMove||a===p.topTouchMove}function e(a){return a===p.topMouseDown||a===p.topTouchStart}function f(a,b){var c=a._dispatchListeners,d=a._dispatchIDs;if(Array.isArray(c))for(var e=0;ea&&c[a]===e[a];a++);var g=d-a;for(b=1;g>=b&&c[d-b]===e[f-b];b++);var h=b>1?1-b:void 0;return this._fallbackText=e.slice(a,h),this._fallbackText}}),d.addPoolingTo(c),b.exports=c},{128:128,27:27,28:28}],23:[function(a,b){"use strict";var c,d=a(10),e=a(21),f=d.injection.MUST_USE_ATTRIBUTE,g=d.injection.MUST_USE_PROPERTY,h=d.injection.HAS_BOOLEAN_VALUE,i=d.injection.HAS_SIDE_EFFECTS,j=d.injection.HAS_NUMERIC_VALUE,k=d.injection.HAS_POSITIVE_NUMERIC_VALUE,l=d.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(e.canUseDOM){var m=document.implementation;c=m&&m.hasFeature&&m.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var n={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:f|h,allowTransparency:f,alt:null,async:h,autoComplete:null,autoPlay:h,cellPadding:null,cellSpacing:null,charSet:f,checked:g|h,classID:f,className:c?f:g,cols:f|k,colSpan:null,content:null,contentEditable:null,contextMenu:f,controls:g|h,coords:null,crossOrigin:null,data:null,dateTime:f,defer:h,dir:null,disabled:f|h,download:l,draggable:null,encType:null,form:f,formAction:f,formEncType:f,formMethod:f,formNoValidate:h,formTarget:f,frameBorder:f,headers:null,height:f,hidden:f|h,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:g,label:null,lang:null,list:f,loop:g|h,manifest:f,marginHeight:null,marginWidth:null,max:null,maxLength:f,media:f,mediaGroup:null,method:null,min:null,multiple:g|h,muted:g|h,name:null,noValidate:h,open:h,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:g|h,rel:null,required:h,role:f,rows:f|k,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:f|h,selected:g|h,shape:null,size:f|k,sizes:f,span:k,spellCheck:null,src:null,srcDoc:g,srcSet:f,start:j,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:g|i,width:f,wmode:f,autoCapitalize:null,autoCorrect:null,itemProp:f,itemScope:f|h,itemType:f,itemID:f,itemRef:f,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};b.exports=n},{10:10,21:21}],24:[function(a,b){"use strict";function c(a){i(null==a.props.checkedLink||null==a.props.valueLink)}function d(a){c(a),i(null==a.props.value&&null==a.props.onChange)}function e(a){c(a),i(null==a.props.checked&&null==a.props.onChange)}function f(a){this.props.valueLink.requestChange(a.target.value)}function g(a){this.props.checkedLink.requestChange(a.target.checked)}var h=a(76),i=a(133),j={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},k={Mixin:{propTypes:{value:function(a,b){return!a[b]||j[a.type]||a.onChange||a.readOnly||a.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(a,b){return!a[b]||a.onChange||a.readOnly||a.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:h.func}},getValue:function(a){return a.props.valueLink?(d(a),a.props.valueLink.value):a.props.value},getChecked:function(a){return a.props.checkedLink?(e(a),a.props.checkedLink.value):a.props.checked},getOnChange:function(a){return a.props.valueLink?(d(a),f):a.props.checkedLink?(e(a),g):a.props.onChange}};b.exports=k},{133:133,76:76}],25:[function(a,b){"use strict";function c(a){a.remove()}var d=a(30),e=a(103),f=a(118),g=a(133),h={trapBubbledEvent:function(a,b){g(this.isMounted());var c=this.getDOMNode();g(c);var f=d.trapBubbledEvent(a,b,c);this._localEventListeners=e(this._localEventListeners,f)},componentWillUnmount:function(){this._localEventListeners&&f(this._localEventListeners,c)}};b.exports=h},{103:103,118:118,133:133,30:30}],26:[function(a,b){"use strict";var c=a(15),d=a(112),e=c.topLevelTypes,f={eventTypes:null,extractEvents:function(a,b,c,f){if(a===e.topTouchStart){var g=f.target;g&&!g.onclick&&(g.onclick=d)}}};b.exports=f},{112:112,15:15}],27:[function(a,b){"use strict";function c(a){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var b=Object(a),c=Object.prototype.hasOwnProperty,d=1;dk;k++){var m=h[k];g.hasOwnProperty(m)&&g[m]||(m===i.topWheel?j("wheel")?p.ReactEventListener.trapBubbledEvent(i.topWheel,"wheel",e):j("mousewheel")?p.ReactEventListener.trapBubbledEvent(i.topWheel,"mousewheel",e):p.ReactEventListener.trapBubbledEvent(i.topWheel,"DOMMouseScroll",e):m===i.topScroll?j("scroll",!0)?p.ReactEventListener.trapCapturedEvent(i.topScroll,"scroll",e):p.ReactEventListener.trapBubbledEvent(i.topScroll,"scroll",p.ReactEventListener.WINDOW_HANDLE):m===i.topFocus||m===i.topBlur?(j("focus",!0)?(p.ReactEventListener.trapCapturedEvent(i.topFocus,"focus",e),p.ReactEventListener.trapCapturedEvent(i.topBlur,"blur",e)):j("focusin")&&(p.ReactEventListener.trapBubbledEvent(i.topFocus,"focusin",e),p.ReactEventListener.trapBubbledEvent(i.topBlur,"focusout",e)),g[i.topBlur]=!0,g[i.topFocus]=!0):n.hasOwnProperty(m)&&p.ReactEventListener.trapBubbledEvent(m,n[m],e),g[m]=!0)}},trapBubbledEvent:function(a,b,c){return p.ReactEventListener.trapBubbledEvent(a,b,c)},trapCapturedEvent:function(a,b,c){return p.ReactEventListener.trapCapturedEvent(a,b,c)},ensureScrollValueMonitoring:function(){if(!l){var a=h.refreshScrollValues; -p.ReactEventListener.monitorScrollValue(a),l=!0}},eventNameDispatchConfigs:e.eventNameDispatchConfigs,registrationNameModules:e.registrationNameModules,putListener:e.putListener,getListener:e.getListener,deleteListener:e.deleteListener,deleteAllListeners:e.deleteAllListeners});b.exports=p},{102:102,134:134,15:15,17:17,18:18,27:27,59:59}],31:[function(a,b){"use strict";var c=a(79),d=a(116),e=a(132),f=a(147),g={instantiateChildren:function(a){var b=d(a);for(var c in b)if(b.hasOwnProperty(c)){var f=b[c],g=e(f,null);b[c]=g}return b},updateChildren:function(a,b,g,h){var i=d(b);if(!i&&!a)return null;var j;for(j in i)if(i.hasOwnProperty(j)){var k=a&&a[j],l=k&&k._currentElement,m=i[j];if(f(l,m))c.receiveComponent(k,m,g,h),i[j]=k;else{k&&c.unmountComponent(k,j);var n=e(m,null);i[j]=n}}for(j in a)!a.hasOwnProperty(j)||i&&i.hasOwnProperty(j)||c.unmountComponent(a[j]);return i},unmountChildren:function(a){for(var b in a){var d=a[b];c.unmountComponent(d)}}};b.exports=g},{116:116,132:132,147:147,79:79}],32:[function(a,b){"use strict";function c(a,b){this.forEachFunction=a,this.forEachContext=b}function d(a,b,c,d){var e=a;e.forEachFunction.call(e.forEachContext,b,d)}function e(a,b,e){if(null==a)return a;var f=c.getPooled(b,e);m(a,d,f),c.release(f)}function f(a,b,c){this.mapResult=a,this.mapFunction=b,this.mapContext=c}function g(a,b,c,d){var e=a,f=e.mapResult,g=!f.hasOwnProperty(c);if(g){var h=e.mapFunction.call(e.mapContext,b,d);f[c]=h}}function h(a,b,c){if(null==a)return a;var d={},e=f.getPooled(d,b,c);return m(a,g,e),f.release(e),l.create(d)}function i(){return null}function j(a){return m(a,i,null)}var k=a(28),l=a(61),m=a(149),n=(a(150),k.twoArgumentPooler),o=k.threeArgumentPooler;k.addPoolingTo(c,n),k.addPoolingTo(f,o);var p={forEach:e,map:h,count:j};b.exports=p},{149:149,150:150,28:28,61:61}],33:[function(a,b){"use strict";function c(a,b){var c=x.hasOwnProperty(b)?x[b]:null;z.hasOwnProperty(b)&&r(c===v.OVERRIDE_BASE),a.hasOwnProperty(b)&&r(c===v.DEFINE_MANY||c===v.DEFINE_MANY_MERGED)}function d(a,b){if(b){r("function"!=typeof b),r(!l.isValidElement(b));var d=a.prototype;b.hasOwnProperty(u)&&y.mixins(a,b.mixins);for(var e in b)if(b.hasOwnProperty(e)&&e!==u){var f=b[e];if(c(d,e),y.hasOwnProperty(e))y[e](a,f);else{var i=x.hasOwnProperty(e),j=d.hasOwnProperty(e),k=f&&f.__reactDontBind,m="function"==typeof f,n=m&&!i&&!j&&!k;if(n)d.__reactAutoBindMap||(d.__reactAutoBindMap={}),d.__reactAutoBindMap[e]=f,d[e]=f;else if(j){var o=x[e];r(i&&(o===v.DEFINE_MANY_MERGED||o===v.DEFINE_MANY)),o===v.DEFINE_MANY_MERGED?d[e]=g(d[e],f):o===v.DEFINE_MANY&&(d[e]=h(d[e],f))}else d[e]=f}}}}function e(a,b){if(b)for(var c in b){var d=b[c];if(b.hasOwnProperty(c)){var e=c in y;r(!e);var f=c in a;r(!f),a[c]=d}}}function f(a,b){r(a&&b&&"object"==typeof a&&"object"==typeof b);for(var c in b)b.hasOwnProperty(c)&&(r(void 0===a[c]),a[c]=b[c]);return a}function g(a,b){return function(){var c=a.apply(this,arguments),d=b.apply(this,arguments);if(null==c)return d;if(null==d)return c;var e={};return f(e,c),f(e,d),e}}function h(a,b){return function(){a.apply(this,arguments),b.apply(this,arguments)}}function i(a,b){var c=b.bind(a);return c}function j(a){for(var b in a.__reactAutoBindMap)if(a.__reactAutoBindMap.hasOwnProperty(b)){var c=a.__reactAutoBindMap[b];a[b]=i(a,m.guard(c,a.constructor.displayName+"."+b))}}var k=a(34),l=(a(39),a(55)),m=a(58),n=a(65),o=a(66),p=(a(75),a(74),a(84)),q=a(27),r=a(133),s=a(138),t=a(139),u=(a(150),t({mixins:null})),v=s({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),w=[],x={mixins:v.DEFINE_MANY,statics:v.DEFINE_MANY,propTypes:v.DEFINE_MANY,contextTypes:v.DEFINE_MANY,childContextTypes:v.DEFINE_MANY,getDefaultProps:v.DEFINE_MANY_MERGED,getInitialState:v.DEFINE_MANY_MERGED,getChildContext:v.DEFINE_MANY_MERGED,render:v.DEFINE_ONCE,componentWillMount:v.DEFINE_MANY,componentDidMount:v.DEFINE_MANY,componentWillReceiveProps:v.DEFINE_MANY,shouldComponentUpdate:v.DEFINE_ONCE,componentWillUpdate:v.DEFINE_MANY,componentDidUpdate:v.DEFINE_MANY,componentWillUnmount:v.DEFINE_MANY,updateComponent:v.OVERRIDE_BASE},y={displayName:function(a,b){a.displayName=b},mixins:function(a,b){if(b)for(var c=0;c";return this._createOpenTagMarkupAndPutListeners(b)+this._createContentMarkup(b,d)+e},_createOpenTagMarkupAndPutListeners:function(a){var b=this._currentElement.props,c="<"+this._tag;for(var e in b)if(b.hasOwnProperty(e)){var f=b[e];if(null!=f)if(u.hasOwnProperty(e))d(this._rootNodeID,e,f,a);else{e===w&&(f&&(f=this._previousStyleCopy=o({},b.style)),f=g.createMarkupForStyles(f));var h=i.createMarkupForProperty(e,f);h&&(c+=" "+h)}}if(a.renderToStaticMarkup)return c+">";var j=i.createMarkupForID(this._rootNodeID);return c+" "+j+">"},_createContentMarkup:function(a,b){var c="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(c="\n");var d=this._currentElement.props,e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html)return c+e.__html}else{var f=v[typeof d.children]?d.children:null,g=null!=f?null:d.children;if(null!=f)return c+p(f);if(null!=g){var h=this.mountChildren(g,a,b);return c+h.join("")}}return c},receiveComponent:function(a,b,c){var d=this._currentElement;this._currentElement=a,this.updateComponent(b,d,a,c)},updateComponent:function(a,b,d,e){c(this._currentElement.props),this._updateDOMProperties(b.props,a),this._updateDOMChildren(b.props,a,e)},_updateDOMProperties:function(a,b){var c,e,f,g=this._currentElement.props;for(c in a)if(!g.hasOwnProperty(c)&&a.hasOwnProperty(c))if(c===w){var i=this._previousStyleCopy;for(e in i)i.hasOwnProperty(e)&&(f=f||{},f[e]="");this._previousStyleCopy=null}else u.hasOwnProperty(c)?s(this._rootNodeID,c):(h.isStandardName[c]||h.isCustomAttribute(c))&&y.deletePropertyByID(this._rootNodeID,c);for(c in g){var j=g[c],k=c===w?this._previousStyleCopy:a[c];if(g.hasOwnProperty(c)&&j!==k)if(c===w)if(j&&(j=this._previousStyleCopy=o({},j)),k){for(e in k)!k.hasOwnProperty(e)||j&&j.hasOwnProperty(e)||(f=f||{},f[e]="");for(e in j)j.hasOwnProperty(e)&&k[e]!==j[e]&&(f=f||{},f[e]=j[e])}else f=j;else u.hasOwnProperty(c)?d(this._rootNodeID,c,j,b):(h.isStandardName[c]||h.isCustomAttribute(c))&&y.updatePropertyByID(this._rootNodeID,c,j)}f&&y.updateStylesByID(this._rootNodeID,f)},_updateDOMChildren:function(a,b,c){var d=this._currentElement.props,e=v[typeof a.children]?a.children:null,f=v[typeof d.children]?d.children:null,g=a.dangerouslySetInnerHTML&&a.dangerouslySetInnerHTML.__html,h=d.dangerouslySetInnerHTML&&d.dangerouslySetInnerHTML.__html,i=null!=e?null:a.children,j=null!=f?null:d.children,k=null!=e||null!=g,l=null!=f||null!=h;null!=i&&null==j?this.updateChildren(null,b,c):k&&!l&&this.updateTextContent(""),null!=f?e!==f&&this.updateTextContent(""+f):null!=h?g!==h&&y.updateInnerHTMLByID(this._rootNodeID,h):null!=j&&this.updateChildren(j,b,c)},unmountComponent:function(){this.unmountChildren(),j.deleteAllListeners(this._rootNodeID),k.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},n.measureMethods(f,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),o(f.prototype,f.Mixin,m.Mixin),f.injection={injectIDOperations:function(a){f.BackendIDOperations=y=a}},b.exports=f},{10:10,11:11,114:114,133:133,134:134,139:139,150:150,27:27,30:30,35:35,5:5,68:68,69:69,73:73}],43:[function(a,b){"use strict";var c=a(15),d=a(25),e=a(29),f=a(33),g=a(55),h=g.createFactory("form"),i=f.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[e,d],render:function(){return h(this.props)},componentDidMount:function(){this.trapBubbledEvent(c.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(c.topLevelTypes.topSubmit,"submit")}});b.exports=i},{15:15,25:25,29:29,33:33,55:55}],44:[function(a,b){"use strict";var c=a(5),d=a(9),e=a(11),f=a(68),g=a(73),h=a(133),i=a(144),j={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},k={updatePropertyByID:function(a,b,c){var d=f.getNode(a);h(!j.hasOwnProperty(b)),null!=c?e.setValueForProperty(d,b,c):e.deleteValueForProperty(d,b)},deletePropertyByID:function(a,b,c){var d=f.getNode(a);h(!j.hasOwnProperty(b)),e.deleteValueForProperty(d,b,c)},updateStylesByID:function(a,b){var d=f.getNode(a);c.setValueForStyles(d,b)},updateInnerHTMLByID:function(a,b){var c=f.getNode(a);i(c,b)},updateTextContentByID:function(a,b){var c=f.getNode(a);d.updateTextContent(c,b)},dangerouslyReplaceNodeWithMarkupByID:function(a,b){var c=f.getNode(a);d.dangerouslyReplaceNodeWithMarkup(c,b)},dangerouslyProcessChildrenUpdates:function(a,b){for(var c=0;cl;l++){var p=i[l];if(p!==g&&p.form===g.form){var q=j.getID(p);m(q);var r=o[q];m(r),k.asap(c,r)}}}return b}});b.exports=p},{11:11,133:133,2:2,24:24,27:27,29:29,33:33,55:55,68:68,85:85}],48:[function(a,b){"use strict";var c=a(29),d=a(33),e=a(55),f=(a(150),e.createFactory("option")),g=d.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[c],componentWillMount:function(){},render:function(){return f(this.props,this.props.children)}});b.exports=g},{150:150,29:29,33:33,55:55}],49:[function(a,b){"use strict";function c(){if(this._pendingUpdate){this._pendingUpdate=!1;var a=g.getValue(this);null!=a&&this.isMounted()&&e(this,a)}}function d(a,b){if(null==a[b])return null;if(a.multiple){if(!Array.isArray(a[b]))return new Error("The `"+b+"` prop supplied to must be a scalar value if `multiple` is false.")}function e(a,b){var c,d,e,f=a.getDOMNode().options;if(a.props.multiple){for(c={},d=0,e=b.length;e>d;d++)c[""+b[d]]=!0;for(d=0,e=f.length;e>d;d++){var g=c.hasOwnProperty(f[d].value);f[d].selected!==g&&(f[d].selected=g)}}else{for(c=""+b,d=0,e=f.length;e>d;d++)if(f[d].value===c)return void(f[d].selected=!0);f.length&&(f[0].selected=!0)}}var f=a(2),g=a(24),h=a(29),i=a(33),j=a(55),k=a(85),l=a(27),m=j.createFactory("select"),n=i.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[f,g.Mixin,h],propTypes:{defaultValue:d,value:d},render:function(){var a=l({},this.props);return a.onChange=this._handleChange,a.value=null,m(a,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var a=g.getValue(this);null!=a?e(this,a):null!=this.props.defaultValue&&e(this,this.props.defaultValue)},componentDidUpdate:function(a){var b=g.getValue(this);null!=b?(this._pendingUpdate=!1,e(this,b)):!a.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?e(this,this.props.defaultValue):e(this,this.props.multiple?[]:""))},_handleChange:function(a){var b,d=g.getOnChange(this);return d&&(b=d.call(this,a)),this._pendingUpdate=!0,k.asap(c,this),b}});b.exports=n},{2:2,24:24,27:27,29:29,33:33,55:55,85:85}],50:[function(a,b){"use strict";function c(a,b,c,d){return a===c&&b===d}function d(a){var b=document.selection,c=b.createRange(),d=c.text.length,e=c.duplicate();e.moveToElementText(a),e.setEndPoint("EndToStart",c);var f=e.text.length,g=f+d;return{start:f,end:g}}function e(a){var b=window.getSelection&&window.getSelection();if(!b||0===b.rangeCount)return null;var d=b.anchorNode,e=b.anchorOffset,f=b.focusNode,g=b.focusOffset,h=b.getRangeAt(0),i=c(b.anchorNode,b.anchorOffset,b.focusNode,b.focusOffset),j=i?0:h.toString().length,k=h.cloneRange();k.selectNodeContents(a),k.setEnd(h.startContainer,h.startOffset);var l=c(k.startContainer,k.startOffset,k.endContainer,k.endOffset),m=l?0:k.toString().length,n=m+j,o=document.createRange();o.setStart(d,e),o.setEnd(f,g);var p=o.collapsed;return{start:p?n:m,end:p?m:n}}function f(a,b){var c,d,e=document.selection.createRange().duplicate();"undefined"==typeof b.end?(c=b.start,d=c):b.start>b.end?(c=b.end,d=b.start):(c=b.start,d=b.end),e.moveToElementText(a),e.moveStart("character",c),e.setEndPoint("EndToStart",e),e.moveEnd("character",d-c),e.select()}function g(a,b){if(window.getSelection){var c=window.getSelection(),d=a[j()].length,e=Math.min(b.start,d),f="undefined"==typeof b.end?e:Math.min(b.end,d);if(!c.extend&&e>f){var g=f;f=e,e=g}var h=i(a,e),k=i(a,f);if(h&&k){var l=document.createRange();l.setStart(h.node,h.offset),c.removeAllRanges(),e>f?(c.addRange(l),c.extend(k.node,k.offset)):(l.setEnd(k.node,k.offset),c.addRange(l))}}}var h=a(21),i=a(126),j=a(128),k=h.canUseDOM&&"selection"in document&&!("getSelection"in window),l={getOffsets:k?d:e,setOffsets:k?f:g};b.exports=l},{126:126,128:128,21:21}],51:[function(a,b){"use strict";var c=a(11),d=a(35),e=a(42),f=a(27),g=a(114),h=function(){};f(h.prototype,{construct:function(a){this._currentElement=a,this._stringText=""+a,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(a,b){this._rootNodeID=a;var d=g(this._stringText);return b.renderToStaticMarkup?d:""+d+""},receiveComponent:function(a){if(a!==this._currentElement){this._currentElement=a;var b=""+a;b!==this._stringText&&(this._stringText=b,e.BackendIDOperations.updateTextContentByID(this._rootNodeID,b))}},unmountComponent:function(){d.unmountIDFromEnvironment(this._rootNodeID)}}),b.exports=h},{11:11,114:114,27:27,35:35,42:42}],52:[function(a,b){"use strict";function c(){this.isMounted()&&this.forceUpdate()}var d=a(2),e=a(11),f=a(24),g=a(29),h=a(33),i=a(55),j=a(85),k=a(27),l=a(133),m=(a(150),i.createFactory("textarea")),n=h.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[d,f.Mixin,g],getInitialState:function(){var a=this.props.defaultValue,b=this.props.children;null!=b&&(l(null==a),Array.isArray(b)&&(l(b.length<=1),b=b[0]),a=""+b),null==a&&(a="");var c=f.getValue(this);return{initialValue:""+(null!=c?c:a)}},render:function(){var a=k({},this.props);return l(null==a.dangerouslySetInnerHTML),a.defaultValue=null,a.value=null,a.onChange=this._handleChange,m(a,this.state.initialValue)},componentDidUpdate:function(){var a=f.getValue(this);if(null!=a){var b=this.getDOMNode();e.setValueForProperty(b,"value",""+a)}},_handleChange:function(a){var b,d=f.getOnChange(this);return d&&(b=d.call(this,a)),j.asap(c,this),b}});b.exports=n},{11:11,133:133,150:150,2:2,24:24,27:27,29:29,33:33,55:55,85:85}],53:[function(a,b){"use strict";function c(){this.reinitializeTransaction()}var d=a(85),e=a(101),f=a(27),g=a(112),h={initialize:g,close:function(){l.isBatchingUpdates=!1}},i={initialize:g,close:d.flushBatchedUpdates.bind(d)},j=[i,h];f(c.prototype,e.Mixin,{getTransactionWrappers:function(){return j}});var k=new c,l={isBatchingUpdates:!1,batchedUpdates:function(a,b,c,d,e){var f=l.isBatchingUpdates;l.isBatchingUpdates=!0,f?a(b,c,d,e):k.perform(a,null,b,c,d,e)}};b.exports=l},{101:101,112:112,27:27,85:85}],54:[function(a,b){"use strict";function c(a){return n.createClass({tagName:a.toUpperCase(),render:function(){return new B(a,null,null,null,null,this.props)}})}function d(){D.EventEmitter.injectReactEventListener(C),D.EventPluginHub.injectEventPluginOrder(h),D.EventPluginHub.injectInstanceHandle(E),D.EventPluginHub.injectMount(F),D.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:J,EnterLeaveEventPlugin:i,ChangeEventPlugin:f,MobileSafariClickEventPlugin:l,SelectEventPlugin:H,BeforeInputEventPlugin:e}),D.NativeComponent.injectGenericComponentClass(q),D.NativeComponent.injectTextComponentClass(A),D.NativeComponent.injectAutoWrapper(c),D.Class.injectMixin(m),D.NativeComponent.injectComponentClasses({button:r,form:s,iframe:v,img:t,input:w,option:x,select:y,textarea:z,html:L("html"),head:L("head"),body:L("body")}),D.DOMProperty.injectDOMPropertyConfig(k),D.DOMProperty.injectDOMPropertyConfig(K),D.EmptyComponent.injectEmptyComponent("noscript"),D.Updates.injectReconcileTransaction(G),D.Updates.injectBatchingStrategy(p),D.RootIndex.injectCreateReactRootIndex(j.canUseDOM?g.createReactRootIndex:I.createReactRootIndex),D.Component.injectEnvironment(o),D.DOMComponent.injectIDOperations(u)}var e=a(3),f=a(7),g=a(8),h=a(13),i=a(14),j=a(21),k=a(23),l=a(26),m=a(29),n=a(33),o=a(35),p=a(53),q=a(42),r=a(41),s=a(43),t=a(46),u=a(44),v=a(45),w=a(47),x=a(48),y=a(49),z=a(52),A=a(51),B=a(55),C=a(60),D=a(62),E=a(64),F=a(68),G=a(78),H=a(87),I=a(88),J=a(89),K=a(86),L=a(109);b.exports={inject:d}},{109:109,13:13,14:14,21:21,23:23,26:26,29:29,3:3,33:33,35:35,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,51:51,52:52,53:53,55:55,60:60,62:62,64:64,68:68,7:7,78:78,8:8,86:86,87:87,88:88,89:89}],55:[function(a,b){"use strict";var c=a(38),d=a(39),e=a(27),f=(a(150),{key:!0,ref:!0}),g=function(a,b,c,d,e,f){this.type=a,this.key=b,this.ref=c,this._owner=d,this._context=e,this.props=f};g.prototype={_isReactElement:!0},g.createElement=function(a,b,e){var h,i={},j=null,k=null;if(null!=b){k=void 0===b.ref?null:b.ref,j=void 0===b.key?null:""+b.key;for(h in b)b.hasOwnProperty(h)&&!f.hasOwnProperty(h)&&(i[h]=b[h]) -}var l=arguments.length-2;if(1===l)i.children=e;else if(l>1){for(var m=Array(l),n=0;l>n;n++)m[n]=arguments[n+2];i.children=m}if(a&&a.defaultProps){var o=a.defaultProps;for(h in o)"undefined"==typeof i[h]&&(i[h]=o[h])}return new g(a,j,k,d.current,c.current,i)},g.createFactory=function(a){var b=g.createElement.bind(null,a);return b.type=a,b},g.cloneAndReplaceProps=function(a,b){var c=new g(a.type,a.key,a.ref,a._owner,a._context,b);return c},g.cloneElement=function(a,b,c){var h,i=e({},a.props),j=a.key,k=a.ref,l=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,l=d.current),void 0!==b.key&&(j=""+b.key);for(h in b)b.hasOwnProperty(h)&&!f.hasOwnProperty(h)&&(i[h]=b[h])}var m=arguments.length-2;if(1===m)i.children=c;else if(m>1){for(var n=Array(m),o=0;m>o;o++)n[o]=arguments[o+2];i.children=n}return new g(a.type,j,k,l,a._context,i)},g.isValidElement=function(a){var b=!(!a||!a._isReactElement);return b},b.exports=g},{150:150,27:27,38:38,39:39}],56:[function(a,b){"use strict";function c(){if(r.current){var a=r.current.getName();if(a)return" Check the render method of `"+a+"`."}return""}function d(a){var b=a&&a.getPublicInstance();if(!b)return void 0;var c=b.constructor;return c?c.displayName||c.name||void 0:void 0}function e(){var a=r.current;return a&&d(a)||void 0}function f(a,b){a._store.validated||null!=a.key||(a._store.validated=!0,h('Each child in an array or iterator should have a unique "key" prop.',a,b))}function g(a,b,c){x.test(a)&&h("Child objects should have non-numeric keys so ordering is preserved.",b,c)}function h(a,b,c){var f=e(),g="string"==typeof c?c:c.displayName||c.name,h=f||g,i=v[a]||(v[a]={});if(!i.hasOwnProperty(h)){i[h]=!0;var j="";if(b&&b._owner&&b._owner!==r.current){var k=d(b._owner);j=" It was passed a child from "+k+"."}}}function i(a,b){if(Array.isArray(a))for(var c=0;c");var h="";e&&(h=" The element was created by "+e+".")}}function l(a,b){return a!==a?b!==b:0===a&&0===b?1/a===1/b:a===b}function m(a){if(a._store){var b=a._store.originalProps,c=a.props;for(var d in c)c.hasOwnProperty(d)&&(b.hasOwnProperty(d)&&l(b[d],c[d])||(k(d,a),b[d]=c[d]))}}function n(a){if(null!=a.type){var b=s.getComponentClassForElement(a),c=b.displayName||b.name;b.propTypes&&j(c,b.propTypes,a.props,q.prop),"function"==typeof b.getDefaultProps}}var o=a(55),p=a(61),q=a(75),r=(a(74),a(39)),s=a(71),t=a(124),u=a(133),v=(a(150),{}),w={},x=/^\d+$/,y={},z={checkAndWarnForMutatedProps:m,createElement:function(a){var b=o.createElement.apply(this,arguments);if(null==b)return b;for(var c=2;ce;e++){b=a.ancestors[e];var g=k.getID(b)||"";p._handleTopLevel(a.topLevelType,b,g,a.nativeEvent)}}function f(a){var b=o(window);a(b)}var g=a(16),h=a(21),i=a(28),j=a(64),k=a(68),l=a(85),m=a(27),n=a(123),o=a(129);m(d.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),i.addPoolingTo(d,i.twoArgumentPooler);var p={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:h.canUseDOM?window:null,setHandleTopLevel:function(a){p._handleTopLevel=a},setEnabled:function(a){p._enabled=!!a},isEnabled:function(){return p._enabled},trapBubbledEvent:function(a,b,c){var d=c;return d?g.listen(d,b,p.dispatchEvent.bind(null,a)):null},trapCapturedEvent:function(a,b,c){var d=c;return d?g.capture(d,b,p.dispatchEvent.bind(null,a)):null},monitorScrollValue:function(a){var b=f.bind(null,a);g.listen(window,"scroll",b)},dispatchEvent:function(a,b){if(p._enabled){var c=d.getPooled(a,b);try{l.batchedUpdates(e,c)}finally{d.release(c)}}}};b.exports=p},{123:123,129:129,16:16,21:21,27:27,28:28,64:64,68:68,85:85}],61:[function(a,b){"use strict";var c=(a(55),a(150),{create:function(a){return a},extract:function(a){return a},extractIfFragment:function(a){return a}});b.exports=c},{150:150,55:55}],62:[function(a,b){"use strict";var c=a(10),d=a(17),e=a(36),f=a(33),g=a(57),h=a(30),i=a(71),j=a(42),k=a(73),l=a(81),m=a(85),n={Component:e.injection,Class:f.injection,DOMComponent:j.injection,DOMProperty:c.injection,EmptyComponent:g.injection,EventPluginHub:d.injection,EventEmitter:h.injection,NativeComponent:i.injection,Perf:k.injection,RootIndex:l.injection,Updates:m.injection};b.exports=n},{10:10,17:17,30:30,33:33,36:36,42:42,57:57,71:71,73:73,81:81,85:85}],63:[function(a,b){"use strict";function c(a){return e(document.documentElement,a)}var d=a(50),e=a(107),f=a(117),g=a(119),h={hasSelectionCapabilities:function(a){return a&&("INPUT"===a.nodeName&&"text"===a.type||"TEXTAREA"===a.nodeName||"true"===a.contentEditable)},getSelectionInformation:function(){var a=g();return{focusedElem:a,selectionRange:h.hasSelectionCapabilities(a)?h.getSelection(a):null}},restoreSelection:function(a){var b=g(),d=a.focusedElem,e=a.selectionRange;b!==d&&c(d)&&(h.hasSelectionCapabilities(d)&&h.setSelection(d,e),f(d))},getSelection:function(a){var b;if("selectionStart"in a)b={start:a.selectionStart,end:a.selectionEnd};else if(document.selection&&"INPUT"===a.nodeName){var c=document.selection.createRange();c.parentElement()===a&&(b={start:-c.moveStart("character",-a.value.length),end:-c.moveEnd("character",-a.value.length)})}else b=d.getOffsets(a);return b||{start:0,end:0}},setSelection:function(a,b){var c=b.start,e=b.end;if("undefined"==typeof e&&(e=c),"selectionStart"in a)a.selectionStart=c,a.selectionEnd=Math.min(e,a.value.length);else if(document.selection&&"INPUT"===a.nodeName){var f=a.createTextRange();f.collapse(!0),f.moveStart("character",c),f.moveEnd("character",e-c),f.select()}else d.setOffsets(a,b)}};b.exports=h},{107:107,117:117,119:119,50:50}],64:[function(a,b){"use strict";function c(a){return m+a.toString(36)}function d(a,b){return a.charAt(b)===m||b===a.length}function e(a){return""===a||a.charAt(0)===m&&a.charAt(a.length-1)!==m}function f(a,b){return 0===b.indexOf(a)&&d(b,a.length)}function g(a){return a?a.substr(0,a.lastIndexOf(m)):""}function h(a,b){if(l(e(a)&&e(b)),l(f(a,b)),a===b)return a;var c,g=a.length+n;for(c=g;c=g;g++)if(d(a,g)&&d(b,g))f=g;else if(a.charAt(g)!==b.charAt(g))break;var h=a.substr(0,f);return l(e(h)),h}function j(a,b,c,d,e,i){a=a||"",b=b||"",l(a!==b);var j=f(b,a);l(j||f(a,b));for(var k=0,m=j?g:h,n=a;;n=m(n,b)){var p;if(e&&n===a||i&&n===b||(p=c(n,j,d)),p===!1||n===b)break;l(k++1){var b=a.indexOf(m,1);return b>-1?a.substr(0,b):a}return null},traverseEnterLeave:function(a,b,c,d,e){var f=i(a,b);f!==a&&j(a,f,c,d,!1,!0),f!==b&&j(f,b,c,e,!0,!1)},traverseTwoPhase:function(a,b,c){a&&(j("",a,b,c,!0,!1),j(a,"",b,c,!1,!0))},traverseAncestors:function(a,b,c){j("",a,b,c,!0,!1)},_getFirstCommonAncestorID:i,_getNextDescendantID:h,isAncestorIDOf:f,SEPARATOR:m};b.exports=p},{133:133,81:81}],65:[function(a,b){"use strict";var c={remove:function(a){a._reactInternalInstance=void 0},get:function(a){return a._reactInternalInstance},has:function(a){return void 0!==a._reactInternalInstance},set:function(a,b){a._reactInternalInstance=b}};b.exports=c},{}],66:[function(a,b){"use strict";var c={currentlyMountingInstance:null,currentlyUnmountingInstance:null};b.exports=c},{}],67:[function(a,b){"use strict";var c=a(104),d={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(a){var b=c(a);return a.replace(">"," "+d.CHECKSUM_ATTR_NAME+'="'+b+'">')},canReuseMarkup:function(a,b){var e=b.getAttribute(d.CHECKSUM_ATTR_NAME);e=e&&parseInt(e,10);var f=c(a);return f===e}};b.exports=d},{104:104}],68:[function(a,b){"use strict";function c(a,b){for(var c=Math.min(a.length,b.length),d=0;c>d;d++)if(a.charAt(d)!==b.charAt(d))return d;return a.length===b.length?-1:c}function d(a){var b=C(a);return b&&Q.getID(b)}function e(a){var b=f(a);if(b)if(J.hasOwnProperty(b)){var c=J[b];c!==a&&(E(!j(c,b)),J[b]=a)}else J[b]=a;return b}function f(a){return a&&a.getAttribute&&a.getAttribute(I)||""}function g(a,b){var c=f(a);c!==b&&delete J[c],a.setAttribute(I,b),J[b]=a}function h(a){return J.hasOwnProperty(a)&&j(J[a],a)||(J[a]=Q.findReactNodeByID(a)),J[a]}function i(a){var b=u.get(a)._rootNodeID;return s.isNullComponentID(b)?null:(J.hasOwnProperty(b)&&j(J[b],b)||(J[b]=Q.findReactNodeByID(b)),J[b])}function j(a,b){if(a){E(f(a)===b);var c=Q.findReactContainerForID(b);if(c&&B(c,a))return!0}return!1}function k(a){delete J[a]}function l(a){var b=J[a];return b&&j(b,a)?void(P=b):!1}function m(a){P=null,t.traverseAncestors(a,l);var b=P;return P=null,b}function n(a,b,c,d,e){var f=x.mountComponent(a,b,d,A);a._isTopLevel=!0,Q._mountImageIntoNode(f,c,e)}function o(a,b,c,d){var e=z.ReactReconcileTransaction.getPooled();e.perform(n,null,a,b,c,e,d),z.ReactReconcileTransaction.release(e)}var p=a(10),q=a(30),r=(a(39),a(55)),s=(a(56),a(57)),t=a(64),u=a(65),v=a(67),w=a(73),x=a(79),y=a(84),z=a(85),A=a(113),B=a(107),C=a(127),D=a(132),E=a(133),F=a(144),G=a(147),H=(a(150),t.SEPARATOR),I=p.ID_ATTRIBUTE_NAME,J={},K=1,L=9,M={},N={},O=[],P=null,Q={_instancesByReactRootID:M,scrollMonitor:function(a,b){b()},_updateRootComponent:function(a,b,c,d){return Q.scrollMonitor(c,function(){y.enqueueElementInternal(a,b),d&&y.enqueueCallbackInternal(a,d)}),a},_registerComponent:function(a,b){E(b&&(b.nodeType===K||b.nodeType===L)),q.ensureScrollValueMonitoring();var c=Q.registerContainer(b);return M[c]=a,c},_renderNewRootComponent:function(a,b,c){var d=D(a,null),e=Q._registerComponent(d,b);return z.batchedUpdates(o,d,e,b,c),d},render:function(a,b,c){E(r.isValidElement(a));var e=M[d(b)];if(e){var f=e._currentElement;if(G(f,a))return Q._updateRootComponent(e,a,b,c).getPublicInstance();Q.unmountComponentAtNode(b)}var g=C(b),h=g&&Q.isRenderedByReact(g),i=h&&!e,j=Q._renderNewRootComponent(a,b,i).getPublicInstance();return c&&c.call(j),j},constructAndRenderComponent:function(a,b,c){var d=r.createElement(a,b);return Q.render(d,c)},constructAndRenderComponentByID:function(a,b,c){var d=document.getElementById(c);return E(d),Q.constructAndRenderComponent(a,b,d)},registerContainer:function(a){var b=d(a);return b&&(b=t.getReactRootIDFromNodeID(b)),b||(b=t.createReactRootID()),N[b]=a,b},unmountComponentAtNode:function(a){E(a&&(a.nodeType===K||a.nodeType===L));var b=d(a),c=M[b];return c?(Q.unmountComponentFromNode(c,a),delete M[b],delete N[b],!0):!1},unmountComponentFromNode:function(a,b){for(x.unmountComponent(a),b.nodeType===L&&(b=b.documentElement);b.lastChild;)b.removeChild(b.lastChild)},findReactContainerForID:function(a){var b=t.getReactRootIDFromNodeID(a),c=N[b];return c},findReactNodeByID:function(a){var b=Q.findReactContainerForID(a);return Q.findComponentRoot(b,a)},isRenderedByReact:function(a){if(1!==a.nodeType)return!1;var b=Q.getID(a);return b?b.charAt(0)===H:!1},getFirstReactDOM:function(a){for(var b=a;b&&b.parentNode!==b;){if(Q.isRenderedByReact(b))return b;b=b.parentNode}return null},findComponentRoot:function(a,b){var c=O,d=0,e=m(b)||a;for(c[0]=e.firstChild,c.length=1;d>",v=g(),w=l(),x={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),any:e(),arrayOf:f,element:v,instanceOf:h,node:w,objectOf:j,oneOf:i,oneOfType:k,shape:m};b.exports=x},{112:112,55:55,61:61,74:74}],77:[function(a,b){"use strict";function c(){this.listenersToPut=[]}var d=a(28),e=a(30),f=a(27);f(c.prototype,{enqueuePutListener:function(a,b,c){this.listenersToPut.push({rootNodeID:a,propKey:b,propValue:c})},putListeners:function(){for(var a=0;ac;c++){var d=q[c],e=d._pendingCallbacks;if(d._pendingCallbacks=null,m.performUpdateIfNecessary(d,a.reconcileTransaction),e)for(var g=0;g":">","<":"<",'"':""","'":"'"},f=/[&><"']/g;b.exports=d},{}],115:[function(a,b){"use strict";function c(a){return null==a?null:g(a)?a:d.has(a)?e.getNodeFromInstance(a):(f(null==a.render||"function"!=typeof a.render),void f(!1))}var d=(a(39),a(65)),e=a(68),f=a(133),g=a(135);a(150),b.exports=c},{133:133,135:135,150:150,39:39,65:65,68:68}],116:[function(a,b){"use strict";function c(a,b,c){var d=a,e=!d.hasOwnProperty(c);e&&null!=b&&(d[c]=b)}function d(a){if(null==a)return a;var b={};return e(a,c,b),b}var e=a(149);a(150),b.exports=d},{149:149,150:150}],117:[function(a,b){"use strict";function c(a){try{a.focus()}catch(b){}}b.exports=c},{}],118:[function(a,b){"use strict";var c=function(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)};b.exports=c},{}],119:[function(a,b){function c(){try{return document.activeElement||document.body}catch(a){return document.body}}b.exports=c},{}],120:[function(a,b){"use strict";function c(a){var b,c=a.keyCode;return"charCode"in a?(b=a.charCode,0===b&&13===c&&(b=13)):b=c,b>=32||13===b?b:0}b.exports=c},{}],121:[function(a,b){"use strict";function c(a){if(a.key){var b=e[a.key]||a.key;if("Unidentified"!==b)return b}if("keypress"===a.type){var c=d(a);return 13===c?"Enter":String.fromCharCode(c)}return"keydown"===a.type||"keyup"===a.type?f[a.keyCode]||"Unidentified":""}var d=a(120),e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};b.exports=c},{120:120}],122:[function(a,b){"use strict";function c(a){var b=this,c=b.nativeEvent;if(c.getModifierState)return c.getModifierState(a);var d=e[a];return d?!!c[d]:!1}function d(){return c}var e={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};b.exports=d},{}],123:[function(a,b){"use strict";function c(a){var b=a.target||a.srcElement||window;return 3===b.nodeType?b.parentNode:b}b.exports=c},{}],124:[function(a,b){"use strict";function c(a){var b=a&&(d&&a[d]||a[e]);return"function"==typeof b?b:void 0}var d="function"==typeof Symbol&&Symbol.iterator,e="@@iterator";b.exports=c},{}],125:[function(a,b){function c(a){return e(!!f),l.hasOwnProperty(a)||(a="*"),g.hasOwnProperty(a)||(f.innerHTML="*"===a?"":"<"+a+">",g[a]=!f.firstChild),g[a]?l[a]:null}var d=a(21),e=a(133),f=d.canUseDOM?document.createElement("div"):null,g={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},h=[1,'"],i=[1,"","
    "],j=[3,"","
    "],k=[1,"",""],l={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:h,option:h,caption:i,colgroup:i,tbody:i,tfoot:i,thead:i,td:j,th:j,circle:k,defs:k,ellipse:k,g:k,line:k,linearGradient:k,path:k,polygon:k,polyline:k,radialGradient:k,rect:k,stop:k,text:k};b.exports=c},{133:133,21:21}],126:[function(a,b){"use strict";function c(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function d(a){for(;a;){if(a.nextSibling)return a.nextSibling;a=a.parentNode}}function e(a,b){for(var e=c(a),f=0,g=0;e;){if(3===e.nodeType){if(g=f+e.textContent.length,b>=f&&g>=b)return{node:e,offset:b-f};f=g}e=c(d(e))}}b.exports=e},{}],127:[function(a,b){"use strict";function c(a){return a?a.nodeType===d?a.documentElement:a.firstChild:null}var d=9;b.exports=c},{}],128:[function(a,b){"use strict";function c(){return!e&&d.canUseDOM&&(e="textContent"in document.documentElement?"textContent":"innerText"),e}var d=a(21),e=null;b.exports=c},{21:21}],129:[function(a,b){"use strict";function c(a){return a===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:a.scrollLeft,y:a.scrollTop}}b.exports=c},{}],130:[function(a,b){function c(a){return a.replace(d,"-$1").toLowerCase()}var d=/([A-Z])/g;b.exports=c},{}],131:[function(a,b){"use strict";function c(a){return d(a).replace(e,"-ms-")}var d=a(130),e=/^ms-/;b.exports=c},{130:130}],132:[function(a,b){"use strict";function c(a){return"function"==typeof a&&"function"==typeof a.prototype.mountComponent&&"function"==typeof a.prototype.receiveComponent}function d(a,b){var d;if((null===a||a===!1)&&(a=f.emptyElement),"object"==typeof a){var e=a;d=b===e.type&&"string"==typeof e.type?g.createInternalComponent(e):c(e.type)?new e.type(e):new j}else"string"==typeof a||"number"==typeof a?d=g.createInstanceForText(a):i(!1);return d.construct(a),d._mountIndex=0,d._mountImage=null,d}var e=a(37),f=a(57),g=a(71),h=a(27),i=a(133),j=(a(150),function(){});h(j.prototype,e.Mixin,{_instantiateReactComponent:d}),b.exports=d},{133:133,150:150,27:27,37:37,57:57,71:71}],133:[function(a,b){"use strict";var c=function(a,b,c,d,e,f,g,h){if(!a){var i;if(void 0===b)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var j=[c,d,e,f,g,h],k=0;i=new Error("Invariant Violation: "+b.replace(/%s/g,function(){return j[k++]}))}throw i.framesToPop=1,i}};b.exports=c},{}],134:[function(a,b){"use strict";function c(a,b){if(!e.canUseDOM||b&&!("addEventListener"in document))return!1;var c="on"+a,f=c in document;if(!f){var g=document.createElement("div");g.setAttribute(c,"return;"),f="function"==typeof g[c]}return!f&&d&&"wheel"===a&&(f=document.implementation.hasFeature("Events.wheel","3.0")),f}var d,e=a(21);e.canUseDOM&&(d=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),b.exports=c},{21:21}],135:[function(a,b){function c(a){return!(!a||!("function"==typeof Node?a instanceof Node:"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName))}b.exports=c},{}],136:[function(a,b){"use strict";function c(a){return a&&("INPUT"===a.nodeName&&d[a.type]||"TEXTAREA"===a.nodeName)}var d={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};b.exports=c},{}],137:[function(a,b){function c(a){return d(a)&&3==a.nodeType}var d=a(135);b.exports=c},{135:135}],138:[function(a,b){"use strict";var c=a(133),d=function(a){var b,d={};c(a instanceof Object&&!Array.isArray(a));for(b in a)a.hasOwnProperty(b)&&(d[b]=b);return d};b.exports=d},{133:133}],139:[function(a,b){var c=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return b;return null};b.exports=c},{}],140:[function(a,b){"use strict";function c(a,b,c){if(!a)return null;var e={};for(var f in a)d.call(a,f)&&(e[f]=b.call(c,a[f],f,a));return e}var d=Object.prototype.hasOwnProperty;b.exports=c},{}],141:[function(a,b){"use strict";function c(a){var b={};return function(c){return b.hasOwnProperty(c)||(b[c]=a.call(this,c)),b[c]}}b.exports=c},{}],142:[function(a,b){"use strict";function c(a){return e(d.isValidElement(a)),a}var d=a(55),e=a(133);b.exports=c},{133:133,55:55}],143:[function(a,b){"use strict";function c(a){return'"'+d(a)+'"'}var d=a(114);b.exports=c},{114:114}],144:[function(a,b){"use strict";var c=a(21),d=/^[ \r\n\t\f]/,e=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,f=function(a,b){a.innerHTML=b};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(f=function(a,b){MSApp.execUnsafeLocalFunction(function(){a.innerHTML=b})}),c.canUseDOM){var g=document.createElement("div");g.innerHTML=" ",""===g.innerHTML&&(f=function(a,b){if(a.parentNode&&a.parentNode.replaceChild(a,a),d.test(b)||"<"===b[0]&&e.test(b)){a.innerHTML=""+b;var c=a.firstChild;1===c.data.length?a.removeChild(c):c.deleteData(0,1)}else a.innerHTML=b})}b.exports=f},{21:21}],145:[function(a,b){"use strict";var c=a(21),d=a(114),e=a(144),f=function(a,b){a.textContent=b};c.canUseDOM&&("textContent"in document.documentElement||(f=function(a,b){e(a,d(b))})),b.exports=f},{114:114,144:144,21:21}],146:[function(a,b){"use strict";function c(a,b){if(a===b)return!0;var c;for(c in a)if(a.hasOwnProperty(c)&&(!b.hasOwnProperty(c)||a[c]!==b[c]))return!1;for(c in b)if(b.hasOwnProperty(c)&&!a.hasOwnProperty(c))return!1;return!0}b.exports=c},{}],147:[function(a,b){"use strict";function c(a,b){if(null!=a&&null!=b){var c=typeof a,d=typeof b;if("string"===c||"number"===c)return"string"===d||"number"===d;if("object"===d&&a.type===b.type&&a.key===b.key){var e=a._owner===b._owner;return e}}return!1}a(150),b.exports=c},{150:150}],148:[function(a,b){function c(a){var b=a.length;if(d(!Array.isArray(a)&&("object"==typeof a||"function"==typeof a)),d("number"==typeof b),d(0===b||b-1 in a),a.hasOwnProperty)try{return Array.prototype.slice.call(a)}catch(c){}for(var e=Array(b),f=0;b>f;f++)e[f]=a[f];return e}var d=a(133);b.exports=c},{133:133}],149:[function(a,b){"use strict";function c(a){return p[a]}function d(a,b){return a&&null!=a.key?f(a.key):b.toString(36)}function e(a){return(""+a).replace(q,c)}function f(a){return"$"+e(a)}function g(a,b,c,e,h){var k=typeof a;if(("undefined"===k||"boolean"===k)&&(a=null),null===a||"string"===k||"number"===k||i.isValidElement(a))return e(h,a,""===b?n+d(a,0):b,c),1;var p,q,r,s=0;if(Array.isArray(a))for(var t=0;ta?-1:a>0?1:+a}),THREE.log=function(){console.log.apply(console,arguments)},THREE.warn=function(){console.warn.apply(console,arguments)},THREE.error=function(){console.error.apply(console,arguments)},THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.NoShading=0,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.Projector=function(){THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(a,b){THREE.warn("THREE.Projector: .projectVector() is now vector.project()."),a.project(b)},this.unprojectVector=function(a,b){THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),a.unproject(b)},this.pickingRay=function(){THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){return a instanceof THREE.Color?this.copy(a):"number"==typeof a?this.setHex(a):"string"==typeof a&&this.setStyle(a),this},setHex:function(a){return a=Math.floor(a),this.r=(a>>16&255)/255,this.g=(a>>8&255)/255,this.b=(255&a)/255,this},setRGB:function(a,b,c){return this.r=a,this.g=b,this.b=c,this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b,c=2*c-b,this.r=d(c,b,a+1/3),this.g=d(c,b,a),this.b=d(c,b,a-1/3)}return this},setStyle:function(a){return/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a)?(a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this):/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a)?(a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r=Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this):/^\#([0-9a-f]{6})$/i.test(a)?(a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this):/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a)?(a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this):/^(\w+)$/i.test(a)?(this.setHex(THREE.ColorKeywords[a]),this):void 0},copy:function(a){return this.r=a.r,this.g=a.g,this.b=a.b,this},copyGammaToLinear:function(a,b){return void 0===b&&(b=2),this.r=Math.pow(a.r,b),this.g=Math.pow(a.g,b),this.b=Math.pow(a.b,b),this},copyLinearToGamma:function(a,b){void 0===b&&(b=2);var c=b>0?1/b:1;return this.r=Math.pow(a.r,c),this.g=Math.pow(a.g,c),this.b=Math.pow(a.b,c),this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;return this.r=a*a,this.g=b*b,this.b=c*c,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b,c=this.r,d=this.g,e=this.b,f=Math.max(c,d,e),g=Math.min(c,d,e),h=(g+f)/2;if(g===f)g=b=0;else{var i=f-g,g=.5>=h?i/(f+g):i/(2-f-g);switch(f){case c:b=(d-e)/i+(e>d?6:0);break;case d:b=(e-c)/i+2;break;case e:b=(c-d)/i+4}b/=6}return a.h=b,a.s=g,a.l=h,a},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(a,b,c){var d=this.getHSL();return d.h+=a,d.s+=b,d.l+=c,this.setHSL(d.h,d.s,d.l),this},add:function(a){return this.r+=a.r,this.g+=a.g,this.b+=a.b,this},addColors:function(a,b){return this.r=a.r+b.r,this.g=a.g+b.g,this.b=a.b+b.b,this},addScalar:function(a){return this.r+=a,this.g+=a,this.b+=a,this},multiply:function(a){return this.r*=a.r,this.g*=a.g,this.b*=a.b,this},multiplyScalar:function(a){return this.r*=a,this.g*=a,this.b*=a,this},lerp:function(a,b){return this.r+=(a.r-this.r)*b,this.g+=(a.g-this.g)*b,this.b+=(a.b-this.b)*b,this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a){return this.r=a[0],this.g=a[1],this.b=a[2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.r,a[b+1]=this.g,a[b+2]=this.b,a},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}},THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},THREE.Quaternion=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._w=void 0!==d?d:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get w(){return this._w},set w(a){this._w=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._w=d,this.onChangeCallback(),this},copy:function(a){return this._x=a.x,this._y=a.y,this._z=a.z,this._w=a.w,this.onChangeCallback(),this},setFromEuler:function(a,b){if(!1==a instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);return"XYZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"YXZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"ZXY"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"ZYX"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"YZX"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):"XZY"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h),!1!==b&&this.onChangeCallback(),this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);return this._x=a.x*d,this._y=a.y*d,this._z=a.z*d,this._w=Math.cos(c),this.onChangeCallback(),this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],i=b[6],b=b[10],j=c+f+b;return j>0?(c=.5/Math.sqrt(j+1),this._w=.25/c,this._x=(i-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(i-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+i)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+i)/c,this._z=.25*c),this.onChangeCallback(),this -},setFromUnitVectors:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3),b=c.dot(d)+1,1e-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d),this._x=a.x,this._y=a.y,this._z=a.z,this._w=b,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();return 0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a),this.onChangeCallback(),this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,i=b._z,j=b._w;return this._x=c*j+f*g+d*i-e*h,this._y=d*j+f*h+e*g-c*i,this._z=e*j+f*i+c*h-d*g,this._w=f*j-c*g-d*h-e*i,this.onChangeCallback(),this},multiplyVector3:function(a){return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;if(0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a),g>=1)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),i=Math.sqrt(1-g*g);return.001>Math.abs(i)?(this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this):(g=Math.sin((1-b)*h)/i,h=Math.sin(b*h)/i,this._w=f*g+this._w*h,this._x=c*g+this._x*h,this._y=d*g+this._y*h,this._z=e*g+this._z*h,this.onChangeCallback(),this)},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){return void 0===b&&(b=0),this._x=a[b],this._y=a[b+1],this._z=a[b+2],this._w=a[b+3],this.onChangeCallback(),this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._w,a},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}},THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)},THREE.Vector2=function(a,b){this.x=a||0,this.y=b||0},THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){return this.x=a,this.y=b,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this)},addScalar:function(a){return this.x+=a,this.y+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this)},subScalar:function(a){return this.x-=a,this.y-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this},divide:function(a){return this.x/=a.x,this.y/=a.y,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0,this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2),a.set(c,c),b.set(d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;return a=this.y-a.y,b*b+a*a},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this},clone:function(){return new THREE.Vector2(this.x,this.y)}},THREE.Vector3=function(a,b,c){this.x=a||0,this.y=b||0,this.z=c||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){return this.x=a,this.y=b,this.z=c,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this.z+=a.z,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this.z-=a.z,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b)):(this.x*=a.x,this.y*=a.y,this.z*=a.z,this)},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this},multiplyVectors:function(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this},applyEuler:function(){var a;return function(b){return!1==b instanceof THREE.Euler&&THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromEuler(b)),this}}(),applyAxisAngle:function(){var a;return function(b,c){return void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromAxisAngle(b,c)),this}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[3]*c+a[6]*d,this.y=a[1]*b+a[4]*c+a[7]*d,this.z=a[2]*b+a[5]*c+a[8]*d,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d+a[12],this.y=a[1]*b+a[5]*c+a[9]*d+a[13],this.z=a[2]*b+a[6]*c+a[10]*d+a[14],this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);return this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e,this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e,this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e,this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,i=a*c+g*b-e*d,j=a*d+e*c-f*b,b=-e*b-f*c-g*d;return this.x=h*a+b*-e+i*-g-j*-f,this.y=i*a+b*-f+j*-e-h*-g,this.z=j*a+b*-g+h*-f-i*-e,this},project:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld)),this.applyProjection(a)}}(),unproject:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix)),this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d,this.y=a[1]*b+a[5]*c+a[9]*d,this.z=a[2]*b+a[6]*c+a[10]*d,this.normalize(),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0,this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this.zb.z&&(this.z=b.z),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3),a.set(c,c,c),b.set(d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},cross:function(a,b){if(void 0!==b)return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;return this.x=d*a.z-e*a.y,this.y=e*a.x-c*a.z,this.z=c*a.y-d*a.x,this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;return this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f,this},projectOnVector:function(){var a,b;return function(c){return void 0===a&&(a=new THREE.Vector3),a.copy(c).normalize(),b=this.dot(a),this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),a.copy(this).projectOnVector(b),this.sub(a)}}(),reflect:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){return a=this.dot(a)/(this.length()*a.length()),Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;return a=this.z-a.z,b*b+c*c+a*a},setEulerFromRotationMatrix:function(){THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){return this.x=a.elements[12],this.y=a.elements[13],this.z=a.elements[14],this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();return a=this.set(a.elements[8],a.elements[9],a.elements[10]).length(),this.x=b,this.y=c,this.z=a,this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;return this.x=d[c],this.y=d[c+1],this.z=d[c+2],this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this.z=a[b+2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}},THREE.Vector4=function(a,b,c,d){this.x=a||0,this.y=b||0,this.z=c||0,this.w=void 0!==d?d:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){return this.x=a,this.y=b,this.z=c,this.w=d,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,this},setW:function(a){return this.w=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this.w=void 0!==a.w?a.w:1,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this.z+=a.z,this.w+=a.w,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this.w+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this.z-=a.z,this.w-=a.w,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this.w-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this.w*=a,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e,this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e,this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e,this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1),this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);return 1e-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b),this},setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],i=a[9];c=a[2],b=a[6];var j=a[10];return.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(i-b)?.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(i+b)&&.1>Math.abs(e+h+j-3)?(this.set(1,0,0,0),this):(a=Math.PI,e=(e+1)/2,h=(h+1)/2,j=(j+1)/2,d=(d+g)/4,f=(f+c)/4,i=(i+b)/4,e>h&&e>j?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>j?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),b=d/c,d=i/c):.01>j?(c=b=.707106781,d=0):(d=Math.sqrt(j),b=f/d,c=i/d),this.set(b,c,d,a),this):(a=Math.sqrt((b-i)*(b-i)+(f-c)*(f-c)+(g-d)*(g-d)),.001>Math.abs(a)&&(a=1),this.x=(b-i)/a,this.y=(f-c)/a,this.z=(g-d)/a,this.w=Math.acos((e+h+j-1)/2),this)},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this.w>a.w&&(this.w=a.w),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this.zb.z&&(this.z=b.z),this.wb.w&&(this.w=b.w),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4),a.set(c,c,c,c),b.set(d,d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this.w+=(a.w-this.w)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this.z=a[b+2],this.w=a[b+3],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a[b+3]=this.w,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this.w=a.array[b+3],this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._order=d||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._order=d||this._order,this.onChangeCallback(),this},copy:function(a){return this._x=a._x,this._y=a._y,this._z=a._z,this._order=a._order,this.onChangeCallback(),this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],i=e[5],j=e[9],k=e[2],l=e[6],e=e[10];return b=b||this._order,"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-j,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(l,i),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(j,-1,1)),.99999>Math.abs(j)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,i)):(this._y=Math.atan2(-k,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(-k,e),this._z=Math.atan2(-f,i)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(k,-1,1)),.99999>Math.abs(k)?(this._x=Math.atan2(l,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,i))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-j,i),this._y=Math.atan2(-k,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(l,i),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-j,e),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b),this._order=b,!1!==c&&this.onChangeCallback(),this},setFromQuaternion:function(){var a;return function(b,c,d){return void 0===a&&(a=new THREE.Matrix4),a.makeRotationFromQuaternion(b),this.setFromRotationMatrix(a,c,d),this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this),this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){return this._x=a[0],this._y=a[1],this._z=a[2],void 0!==a[3]&&(this._order=a[3]),this.onChangeCallback(),this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._order,a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3,this.end=void 0!==b?b:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){return this.start.copy(a),this.end.copy(b),this},copy:function(a){return this.start.copy(a.start),this.end.copy(a.end),this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start),b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;return d&&(e=THREE.Math.clamp(e,0,1)),e}}(),closestPointToPoint:function(a,b,c){return a=this.closestPointToPointParameter(a,b),c=c||new THREE.Vector3,this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){return this.start.applyMatrix4(a),this.end.applyMatrix4(a),this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}},THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(1/0,1/0),this.max=void 0!==b?b:new THREE.Vector2(-1/0,-1/0)},THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){return this.min.copy(a),this.max.copy(b),this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;c>b;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector2;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},empty:function(){return this.max.xthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}},THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==b?b:new THREE.Vector3(-1/0,-1/0,-1/0)},THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){return this.min.copy(a),this.max.copy(b),this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;c>b;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector3;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),setFromObject:function(){var a=new THREE.Vector3;return function(b){var c=this;return b.updateMatrixWorld(!0),this.makeEmpty(),b.traverse(function(b){var d=b.geometry;if(void 0!==d)if(d instanceof THREE.Geometry)for(var e=d.vertices,d=0,f=e.length;f>d;d++)a.copy(e[d]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a);else if(d instanceof THREE.BufferGeometry&&void 0!==d.attributes.position)for(e=d.attributes.position.array,d=0,f=e.length;f>d;d+=3)a.set(e[d],e[d+1],e[d+2]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a)}),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return this.max.xthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){return b=b||new THREE.Sphere,b.center=this.center(),b.radius=.5*this.size(a).length(),b}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){return a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b),a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b),a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b),a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b),a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b),a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b),a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b),a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b),this.makeEmpty(),this.setFromPoints(a),this}}(),translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0e;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;return b[0]*=a,b[3]*=a,b[6]*=a,b[1]*=a,b[4]*=a,b[7]*=a,b[2]*=a,b[5]*=a,b[8]*=a,this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],a=a[8];return b*f*a-b*g*i-c*e*a+c*g*h+d*e*i-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;if(d[0]=c[10]*c[5]-c[6]*c[9],d[1]=-c[10]*c[1]+c[2]*c[9],d[2]=c[6]*c[1]-c[2]*c[5],d[3]=-c[10]*c[4]+c[6]*c[8],d[4]=c[10]*c[0]-c[2]*c[8],d[5]=-c[6]*c[0]+c[2]*c[4],d[6]=c[9]*c[4]-c[5]*c[8],d[7]=-c[9]*c[0]+c[1]*c[8],d[8]=c[5]*c[0]-c[1]*c[4],c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6],0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0"); -return THREE.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/c),this},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[3],b[3]=a,a=b[2],b[2]=b[6],b[6]=a,a=b[5],b[5]=b[7],b[7]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a},getNormalMatrix:function(a){return this.getInverse(a).transpose(),this},transposeIntoArray:function(a){var b=this.elements;return a[0]=b[0],a[1]=b[3],a[2]=b[6],a[3]=b[1],a[4]=b[4],a[5]=b[7],a[6]=b[2],a[7]=b[5],a[8]=b[8],this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}},THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0e;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),a.transformDirection(this)},crossVector:function(a){return THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],i=a[13],j=a[2],k=a[6],l=a[10],m=a[14];return a[3]*(+e*h*k-d*i*k-e*g*l+c*i*l+d*g*m-c*h*m)+a[7]*(+b*h*m-b*i*l+e*f*l-d*f*m+d*i*j-e*h*j)+a[11]*(+b*i*k-b*g*m-e*f*k+c*f*m+e*g*j-c*i*j)+a[15]*(-d*g*j-b*h*k+b*g*l+d*f*k-c*f*l+c*h*j)},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[4],b[4]=a,a=b[2],b[2]=b[8],b[8]=a,a=b[6],b[6]=b[9],b[9]=a,a=b[3],b[3]=b[12],b[12]=a,a=b[7],b[7]=b[13],b[13]=a,a=b[11],b[11]=b[14],b[14]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a[b+9]=c[9],a[b+10]=c[10],a[b+11]=c[11],a[b+12]=c[12],a[b+13]=c[13],a[b+14]=c[14],a[b+15]=c[15],a},getPosition:function(){var a=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;return b[12]=a.x,b[13]=a.y,b[14]=a.z,this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],i=d[1],j=d[5],k=d[9],l=d[13],m=d[2],n=d[6],o=d[10],p=d[14],q=d[3],r=d[7],s=d[11],d=d[15];if(c[0]=k*p*r-l*o*r+l*n*s-j*p*s-k*n*d+j*o*d,c[4]=h*o*r-g*p*r-h*n*s+f*p*s+g*n*d-f*o*d,c[8]=g*l*r-h*k*r+h*j*s-f*l*s-g*j*d+f*k*d,c[12]=h*k*n-g*l*n-h*j*o+f*l*o+g*j*p-f*k*p,c[1]=l*o*q-k*p*q-l*m*s+i*p*s+k*m*d-i*o*d,c[5]=g*p*q-h*o*q+h*m*s-e*p*s-g*m*d+e*o*d,c[9]=h*k*q-g*l*q-h*i*s+e*l*s+g*i*d-e*k*d,c[13]=g*l*m-h*k*m+h*i*o-e*l*o-g*i*p+e*k*p,c[2]=j*p*q-l*n*q+l*m*r-i*p*r-j*m*d+i*n*d,c[6]=h*n*q-f*p*q-h*m*r+e*p*r+f*m*d-e*n*d,c[10]=f*l*q-h*j*q+h*i*r-e*l*r-f*i*d+e*j*d,c[14]=h*j*m-f*l*m-h*i*n+e*l*n+f*i*p-e*j*p,c[3]=k*n*q-j*o*q-k*m*r+i*o*r+j*m*s-i*n*s,c[7]=f*o*q-g*n*q+g*m*r-e*o*r-f*m*s+e*n*s,c[11]=g*j*q-f*k*q-g*i*r+e*k*r+f*i*s-e*j*s,c[15]=f*k*m-g*j*m+g*i*n-e*k*n-f*i*o+e*j*o,c=e*c[0]+i*c[4]+m*c[8]+q*c[12],0==c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/c),this},translate:function(){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=this.elements,c=a.x,d=a.y;return a=a.z,b[0]*=c,b[4]*=d,b[8]*=a,b[1]*=c,b[5]*=d,b[9]*=a,b[2]*=c,b[6]*=d,b[10]*=a,b[3]*=c,b[7]*=d,b[11]*=a,this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){return this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1),this},makeRotationX:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1),this},makeRotationY:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1),this},makeRotationZ:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,i=e*f,j=e*g;return this.set(i*f+c,i*g-d*h,i*h+d*g,0,i*g+d*h,j*g+c,j*h-d*f,0,i*h-d*g,j*h+d*f,e*h*h+c,0,0,0,0,1),this},makeScale:function(a,b,c){return this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1),this},compose:function(a,b,c){return this.makeRotationFromQuaternion(b),this.scale(c),this.setPosition(a),this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),i=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g),c.x=f[12],c.y=f[13],c.z=f[14],b.elements.set(this.elements),c=1/g;var f=1/h,j=1/i;return b.elements[0]*=c,b.elements[1]*=c,b.elements[2]*=c,b.elements[4]*=f,b.elements[5]*=f,b.elements[6]*=f,b.elements[8]*=j,b.elements[9]*=j,b.elements[10]*=j,d.setFromRotationMatrix(b),e.x=g,e.y=h,e.z=i,this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;return g[0]=2*e/(b-a),g[4]=0,g[8]=(b+a)/(b-a),g[12]=0,g[1]=0,g[5]=2*e/(d-c),g[9]=(d+c)/(d-c),g[13]=0,g[2]=0,g[6]=0,g[10]=-(f+e)/(f-e),g[14]=-2*f*e/(f-e),g[3]=0,g[7]=0,g[11]=-1,g[15]=0,this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,i=c-d,j=f-e;return g[0]=2/h,g[4]=0,g[8]=0,g[12]=-((b+a)/h),g[1]=0,g[5]=2/i,g[9]=0,g[13]=-((c+d)/i),g[2]=0,g[6]=0,g[10]=-2/j,g[14]=-((f+e)/j),g[3]=0,g[7]=0,g[11]=0,g[15]=1,this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}},THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3,this.direction=void 0!==b?b:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){return this.origin.copy(a),this.direction.copy(b),this},copy:function(a){return this.origin.copy(a.origin),this.direction.copy(a.direction),this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){return this.origin.copy(this.at(b,a)),this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);return 0>c?this.origin.distanceTo(b):(a.copy(this.direction).multiplyScalar(c).add(this.origin),a.distanceTo(b))}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5),b.copy(e).sub(d).normalize(),c.copy(this.origin).sub(a);var h,i=.5*d.distanceTo(e),j=-this.direction.dot(b),k=c.dot(this.direction),l=-c.dot(b),m=c.lengthSq(),n=Math.abs(1-j*j);return n>0?(d=j*l-k,e=j*k-l,h=i*n,d>=0?e>=-h?h>=e?(i=1/n,d*=i,e*=i,j=d*(d+j*e+2*k)+e*(j*d+e+2*l)+m):(e=i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m):(e=-i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m):-h>=e?(d=Math.max(0,-(-j*i+k)),e=d>0?-i:Math.min(Math.max(-i,-l),i),j=-d*d+e*(e+2*l)+m):h>=e?(d=0,e=Math.min(Math.max(-i,-l),i),j=e*(e+2*l)+m):(d=Math.max(0,-(j*i+k)),e=d>0?i:Math.min(Math.max(-i,-l),i),j=-d*d+e*(e+2*l)+m)):(e=j>0?-i:i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m),f&&f.copy(this.direction).multiplyScalar(d).add(this.origin),g&&g.copy(b).multiplyScalar(e).add(a),j}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;return e>f?null:(f=Math.sqrt(f-e),e=d-f,d+=f,0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c))}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);return 0==b?0==a.distanceToPoint(this.origin)?0:null:(a=-(this.origin.dot(a.normal)+a.constant)/b,a>=0?a:null)},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x,f=1/this.direction.y,g=1/this.direction.z;var h=this.origin;return d>=0?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x),f>=0?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y),c>f||e>d?null:((e>c||c!==c)&&(c=e),(d>f||d!==d)&&(d=f),g>=0?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*g,g*=a.min.z-h.z),c>g||e>d?null:((e>c||c!==c)&&(c=e),(d>g||d!==d)&&(d=g),0>d?null:this.at(c>=0?c:d,b)))},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,i){if(b.subVectors(f,e),c.subVectors(g,e),d.crossVectors(b,c),f=this.direction.dot(d),f>0){if(h)return null;h=1}else{if(!(0>f))return null;h=-1,f=-f}return a.subVectors(this.origin,e),e=h*this.direction.dot(c.crossVectors(a,c)),0>e?null:(g=h*this.direction.dot(b.cross(a)),0>g||e+g>f?null:(e=-h*a.dot(d),0>e?null:this.at(e/f,i)))}}(),applyMatrix4:function(a){return this.direction.add(this.origin).applyMatrix4(a),this.origin.applyMatrix4(a),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}},THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3,this.radius=void 0!==b?b:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){return this.center.copy(a),this.radius=b,this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;g>f;f++)e=Math.max(e,d.distanceToSquared(b[f]));return this.radius=Math.sqrt(e),this}}(),copy:function(a){return this.center.copy(a.center),this.radius=a.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;return d.copy(a),c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center)),d},getBoundingBox:function(a){return a=a||new THREE.Box3,a.set(this.center,this.center),a.expandByScalar(this.radius),a},applyMatrix4:function(a){return this.center.applyMatrix4(a),this.radius*=a.getMaxScaleOnAxis(),this},translate:function(a){return this.center.add(a),this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}},THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;return g[0].copy(a),g[1].copy(b),g[2].copy(c),g[3].copy(d),g[4].copy(e),g[5].copy(f),this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],i=c[6],j=c[7],k=c[8],l=c[9],m=c[10],n=c[11],o=c[12],p=c[13],q=c[14],c=c[15];return b[0].setComponents(f-a,j-g,n-k,c-o).normalize(),b[1].setComponents(f+a,j+g,n+k,c+o).normalize(),b[2].setComponents(f+d,j+h,n+l,c+p).normalize(),b[3].setComponents(f-d,j-h,n-l,c-p).normalize(),b[4].setComponents(f-e,j-i,n-m,c-q).normalize(),b[5].setComponents(f+e,j+i,n+m,c+q).normalize(),this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;return null===c.boundingSphere&&c.computeBoundingSphere(),a.copy(c.boundingSphere),a.applyMatrix4(b.matrixWorld),this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}},THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0),this.constant=void 0!==b?b:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){return this.normal.copy(a),this.constant=b,this},setComponents:function(a,b,c,d){return this.normal.set(a,b,c),this.constant=d,this},setFromNormalAndCoplanarPoint:function(a,b){return this.normal.copy(a),this.constant=-b.dot(this.normal),this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){return d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize(),this.setFromNormalAndCoplanarPoint(d,c),this}}(),copy:function(a){return this.normal.copy(a.normal),this.constant=a.constant,this},normalize:function(){var a=1/this.normal.length();return this.normal.multiplyScalar(a),this.constant*=a,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);return a=this.distanceToPoint(a.end),0>b&&a>0||0>a&&b>0},intersectLine:function(){var a=new THREE.Vector3;return function(b,c){var d=c||new THREE.Vector3,e=b.delta(a),f=this.normal.dot(e);return 0!=f?(f=-(b.start.dot(this.normal)+this.constant)/f,0>f||f>1?void 0:d.copy(e).multiplyScalar(f).add(b.start)):0==this.distanceToPoint(b.start)?d.copy(b.start):void 0}}(),coplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),f=a.copy(this.normal).applyMatrix3(f),g=this.coplanarPoint(b);return g.applyMatrix4(d),this.setFromNormalAndCoplanarPoint(f,g),this}}(),translate:function(a){return this.constant-=a.dot(this.normal),this},equals:function(a){return a.normal.equals(this.normal)&&a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}},THREE.Math={generateUUID:function(){var a,b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),c=Array(36),d=0;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?c[e]="-":14==e?c[e]="4":(2>=d&&(d=33554432+16777216*Math.random()|0),a=15&d,d>>=4,c[e]=b[19==e?3&a|8:a]);return c.join("")}}(),clamp:function(a,b,c){return b>a?b:a>c?c:a},clampBottom:function(a,b){return b>a?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*(3-2*a))},smootherstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*a*(a*(6*a-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a}},THREE.Spline=function(a){function b(a,b,c,d,e,f,g){return a=.5*(c-a),d=.5*(d-b),(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c,d,e,f,g,h,i,j,k,l=[],m={x:0,y:0,z:0};this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:d+1,l[3]=d>this.points.length-3?this.points.length-1:d+2,h=this.points[l[0]],i=this.points[l[1]],j=this.points[l[2]],k=this.points[l[3]],f=e*e,g=e*f,m.x=b(h.x,i.x,j.x,k.x,e,f,g),m.y=b(h.y,i.y,j.y,k.y,e,f,g),m.z=b(h.z,i.z,j.z,k.z,e,f,g),m},this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;c>a;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d},this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],i=0;for(h[0]=0,a||(a=100),c=this.points.length*a,f.copy(this.points[0]),a=1;c>a;a++)b=a/c,d=this.getPoint(b),g.copy(d),i+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=i,e=b);return h[h.length]=i,{chunks:h,total:i}},this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],i=new THREE.Vector3,j=this.getLength();for(h.push(i.copy(this.points[0]).clone()),b=1;bc;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(i.copy(d).clone());h.push(i.copy(this.points[b]).clone())}this.points=h}},THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3,this.b=void 0!==b?b:new THREE.Vector3,this.c=void 0!==c?c:new THREE.Vector3},THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){return e=e||new THREE.Vector3,e.subVectors(d,c),a.subVectors(b,c),e.cross(a),b=e.lengthSq(),b>0?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e),b.subVectors(f,e),c.subVectors(d,e),d=a.dot(a),e=a.dot(b),f=a.dot(c);var i=b.dot(b);g=b.dot(c);var j=d*i-e*e;return h=h||new THREE.Vector3,0==j?h.set(-2,-1,-1):(j=1/j,i=(i*f-e*g)*j,d=(d*g-e*f)*j,h.set(1-i-d,d,i))}}(),THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){return b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a),0<=b.x&&0<=b.y&&1>=b.x+b.y}}(),THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this},setFromPointsAndIndices:function(a,b,c,d){return this.a.copy(a[b]),this.b.copy(a[c]),this.c.copy(a[d]),this},copy:function(a){return this.a.copy(a.a),this.b.copy(a.b),this.c.copy(a.c),this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){return a.subVectors(this.c,this.b),b.subVectors(this.a,this.b),.5*a.cross(b).length()}}(),midpoint:function(a){return(a||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},clone:function(){return(new THREE.Triangle).copy(this)}},THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running&&this.start(),this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),a=.001*(b-this.oldTime);this.oldTime=b,this.elapsedTime+=a}return a}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener,a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]),-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;d>e;e++)c[e]=b[e];for(e=0;d>e;e++)c[e].call(this,a)}}}},function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c),this.near=d||0,this.far=e||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=function(a,b){return a.distance-b.distance},c=function(a,b,d,e){if(a.raycast(b,d),!0===e){a=a.children,e=0;for(var f=a.length;f>e;e++)c(a[e],b,d,!0)}};a.Raycaster.prototype={constructor:a.Raycaster,precision:1e-4,linePrecision:1,set:function(a,b){this.ray.set(a,b)},setFromCamera:function(b,c){c instanceof a.PerspectiveCamera?(this.ray.origin.copy(c.position),this.ray.direction.set(b.x,b.y,.5).unproject(c).sub(c.position).normalize()):c instanceof a.OrthographicCamera?(this.ray.origin.set(b.x,b.y,-1).unproject(c),this.ray.direction.set(0,0,-1).transformDirection(c.matrixWorld)):a.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(a,d){var e=[];return c(a,this,e,d),e.sort(b),e},intersectObjects:function(d,e){var f=[];if(!1==d instanceof Array)return a.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),f;for(var g=0,h=d.length;h>g;g++)c(d[g],this,f,e);return f.sort(b),f}}}(THREE),THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)}),c.onChange(function(){b.setFromQuaternion(c,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){return THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(a){THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=a},get useQuaternion(){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){return a.setFromAxisAngle(b,c),this.quaternion.multiply(a),this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){return a.copy(b).applyQuaternion(this.quaternion),this.position.add(a.multiplyScalar(c)),this}}(),translate:function(a,b){return THREE.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0); -return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up),this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1c;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){return a=a||new THREE.Vector3,this.updateMatrixWorld(!0),a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){return c=c||new THREE.Quaternion,this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,c,b),c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Euler,this.getWorldQuaternion(a),b.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;return function(c){return c=c||new THREE.Vector3,this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,b,c),c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Vector3,this.getWorldQuaternion(a),b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;c>b;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;c>b;b++)this.children[b].traverseVisible(a)}},traverseAncestors:function(a){this.parent&&(a(this.parent),this.parent.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix(),(!0===this.matrixWorldNeedsUpdate||!0===a)&&(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0);for(var b=0,c=this.children.length;c>b;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(){var a={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},b={},c={},d=function(b){if(void 0===a.materials&&(a.materials=[]),void 0===c[b.uuid]){var d=b.toJSON();delete d.metadata,c[b.uuid]=d,a.materials.push(d)}return b.uuid},e=function(c){var f={};if(f.uuid=c.uuid,f.type=c.type,""!==c.name&&(f.name=c.name),"{}"!==JSON.stringify(c.userData)&&(f.userData=c.userData),!0!==c.visible&&(f.visible=c.visible),c instanceof THREE.PerspectiveCamera)f.fov=c.fov,f.aspect=c.aspect,f.near=c.near,f.far=c.far;else if(c instanceof THREE.OrthographicCamera)f.left=c.left,f.right=c.right,f.top=c.top,f.bottom=c.bottom,f.near=c.near,f.far=c.far;else if(c instanceof THREE.AmbientLight)f.color=c.color.getHex();else if(c instanceof THREE.DirectionalLight)f.color=c.color.getHex(),f.intensity=c.intensity;else if(c instanceof THREE.PointLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance,f.decay=c.decay;else if(c instanceof THREE.SpotLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance,f.angle=c.angle,f.exponent=c.exponent,f.decay=c.decay;else if(c instanceof THREE.HemisphereLight)f.color=c.color.getHex(),f.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh||c instanceof THREE.Line||c instanceof THREE.PointCloud){var g=c.geometry;if(void 0===a.geometries&&(a.geometries=[]),void 0===b[g.uuid]){var h=g.toJSON();delete h.metadata,b[g.uuid]=h,a.geometries.push(h)}f.geometry=g.uuid,f.material=d(c.material),c instanceof THREE.Line&&(f.mode=c.mode)}else c instanceof THREE.Sprite&&(f.material=d(c.material));if(f.matrix=c.matrix.toArray(),0b;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(b=0,c=this.vertexColors.length;c>b;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(b=0,c=this.vertexTangents.length;c>b;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}},THREE.Face4=function(a,b,c,d,e,f,g){return THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(a,b,c,e,f,g)},THREE.BufferAttribute=function(a,b){this.array=a,this.itemSize=b,this.needsUpdate=!1},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},copyAt:function(a,b,c){a*=this.itemSize,c*=b.itemSize;for(var d=0,e=this.itemSize;e>d;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){return void 0===b&&(b=0),this.array.set(a,b),this},setX:function(a,b){return this.array[a*this.itemSize]=b,this},setY:function(a,b){return this.array[a*this.itemSize+1]=b,this},setZ:function(a,b){return this.array[a*this.itemSize+2]=b,this},setXY:function(a,b,c){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this},setXYZ:function(a,b,c,d){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this},setXYZW:function(a,b,c,d,e){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this.array[a+3]=e,this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},THREE.Int8Attribute=function(a,b){return THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8Attribute=function(a,b){return THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8ClampedAttribute=function(a,b){return THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int16Attribute=function(a,b){return THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint16Attribute=function(a,b){return THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int32Attribute=function(a,b){return THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint32Attribute=function(a,b){return THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float32Attribute=function(a,b){return THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float64Attribute=function(a,b){return THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b),this.updateRange={offset:0,count:-1}},THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute,THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)},THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.offsets=this.drawcalls=[],this.boundingSphere=this.boundingBox=null},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1==b instanceof THREE.BufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0),b=this.attributes.normal,void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(a)),a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0d;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}(void 0===b||0===b.length)&&(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;f>e;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;f>e;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g),isNaN(this.boundingSphere.radius)&&THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;e>d;d++)c[d]=0;var f,g,h,c=a.normal.array,i=new THREE.Vector3,j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var n=a.index.array,o=0p;++p){e=o[p].start,f=o[p].count;for(var r=o[p].index,d=e,e=e+f;e>d;d+=3)f=3*(r+n[d]),g=3*(r+n[d+1]),h=3*(r+n[d+2]),i.fromArray(b,f),j.fromArray(b,g),k.fromArray(b,h),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[f]+=l.x,c[f+1]+=l.y,c[f+2]+=l.z,c[g]+=l.x,c[g+1]+=l.y,c[g+2]+=l.z,c[h]+=l.x,c[h+1]+=l.y,c[h+2]+=l.z}else for(d=0,e=b.length;e>d;d+=9)i.fromArray(b,d),j.fromArray(b,d+3),k.fromArray(b,d+6),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[d]=l.x,c[d+1]=l.y,c[d+2]=l.z,c[d+3]=l.x,c[d+4]=l.y,c[d+5]=l.z,c[d+6]=l.x,c[d+7]=l.y,c[d+8]=l.z;this.normalizeNormals(),a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){B.fromArray(d,3*a),C.fromArray(d,3*b),D.fromArray(d,3*c),E.fromArray(f,2*a),F.fromArray(f,2*b),G.fromArray(f,2*c),l=C.x-B.x,m=D.x-B.x,n=C.y-B.y,o=D.y-B.y,p=C.z-B.z,q=D.z-B.z,r=F.x-E.x,s=G.x-E.x,t=F.y-E.y,u=G.y-E.y,v=1/(r*u-s*t),H.set((u*l-t*m)*v,(u*n-t*o)*v,(u*p-t*q)*v),I.set((r*m-s*l)*v,(r*o-s*n)*v,(r*q-s*p)*v),i[a].add(H),i[b].add(H),i[c].add(H),j[a].add(I),j[b].add(I),j[c].add(I)}function b(a){Q.fromArray(e,3*a),R.copy(Q),M=i[a],O.copy(M),O.sub(Q.multiplyScalar(Q.dot(M))).normalize(),P.crossVectors(R,M),N=P.dot(j[a]),L=0>N?-1:1,h[4*a]=O.x,h[4*a+1]=O.y,h[4*a+2]=O.z,h[4*a+3]=L}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,i=[],j=[],k=0;g>k;k++)i[k]=new THREE.Vector3,j[k]=new THREE.Vector3;var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=new THREE.Vector3,C=new THREE.Vector3,D=new THREE.Vector3,E=new THREE.Vector2,F=new THREE.Vector2,G=new THREE.Vector2,H=new THREE.Vector3,I=new THREE.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var J=this.drawcalls,k=0;for(x=J.length;x>k;++k){w=J[k].start,y=J[k].count;var K=J[k].index,g=w;for(w+=y;w>g;g+=3)y=K+c[g],z=K+c[g+1],A=K+c[g+2],a(y,z,A)}var L,M,N,O=new THREE.Vector3,P=new THREE.Vector3,Q=new THREE.Vector3,R=new THREE.Vector3,k=0;for(x=J.length;x>k;++k)for(w=J[k].start,y=J[k].count,K=J[k].index,g=w,w+=y;w>g;g+=3)y=K+c[g],z=K+c[g+1],A=K+c[g+2],b(y),b(z),b(A)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],i=h[0],j=0,k=0,l=new Int32Array(6),m=new Int32Array(c.length),n=new Int32Array(c.length),o=0;oc;c++){for(var p=k=0;3>p;p++)o=b[3*c+p],-1==m[o]?(l[2*p]=o,l[2*p+1]=-1,k++):m[o]i.index+a)for(i={start:f,count:0,index:g},h.push(i),k=0;6>k;k+=2)p=l[k+1],p>-1&&pk;k+=2)o=l[k],p=l[k+1],-1===p&&(p=g++),m[o]=p,n[p]=o,e[f++]=p-i.index,i.count++}return this.reorderBuffers(e,n,g),this.drawcalls=this.offsets=h},merge:function(a,b){if(!1!=a instanceof THREE.BufferGeometry){void 0===b&&(b=0);var c,d=this.attributes;for(c in d)if(void 0!==a.attributes[c])for(var e=d[c].array,f=a.attributes[c],g=f.array,h=0,f=f.itemSize*b;he;e+=3)a=d[e],b=d[e+1],c=d[e+2],a=1/Math.sqrt(a*a+b*b+c*c),d[e]*=a,d[e+1]*=a,d[e+2]*=a},reorderBuffers:function(a,b,c){var d,e={};for(d in this.attributes)"index"!=d&&(e[d]=new this.attributes[d].array.constructor(this.attributes[d].itemSize*c));for(var f=0;c>f;f++){var g=b[f];for(d in this.attributes)if("index"!=d)for(var h=this.attributes[d].array,i=this.attributes[d].itemSize,j=e[d],k=0;i>k;k++)j[f*i+k]=h[g*i+k]}this.attributes.index.array=a;for(d in this.attributes)"index"!=d&&(this.attributes[d].array=e[d],this.attributes[d].numItems=this.attributes[d].itemSize*c)},toJSON:function(){var a,b={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},c=this.attributes,d=this.offsets,e=this.boundingSphere;for(a in c){var f=c[a],g=Array.prototype.slice.call(f.array);b.data.attributes[a]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}return 0a;a++){var d=this.offsets[a];b.offsets.push({start:d.start,index:d.index,count:d.count})}return b},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.hasTangents=!1,this.dynamic=!0,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;d>c;c++)this.vertices[c].applyMatrix4(a);for(c=0,d=this.faces.length;d>c;c++){a=this.faces[c],a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;f>e;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,i=[],j=[],k=c=0;ck;k+=3)l(o+e[k],o+e[k+1],o+e[k+2]);else for(c=0;cc;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g),b.subVectors(f,g),a.cross(b),a.normalize(),e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;for(d=Array(this.vertices.length),b=0,c=this.vertices.length;c>b;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,i=new THREE.Vector3;for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),i.subVectors(e,f),h.cross(i),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);for(b=0,c=this.vertices.length;c>b;b++)d[b].normalize();for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;for(c=0,d=this.faces.length;d>c;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;b>a;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;for(f.faces=this.faces,a=0,b=this.morphTargets.length;b>a;a++){if(!this.morphNormals[a]){this.morphNormals[a]={},this.morphNormals[a].faceNormals=[],this.morphNormals[a].vertexNormals=[],e=this.morphNormals[a].faceNormals;var g,h,i=this.morphNormals[a].vertexNormals;for(c=0,d=this.faces.length;d>c;c++)g=new THREE.Vector3,h={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(g),i.push(h)}for(i=this.morphNormals[a],f.vertices=this.morphTargets[a].vertices,f.computeFaceNormals(),f.computeVertexNormals(),c=0,d=this.faces.length;d>c;c++)e=this.faces[c],g=i.faceNormals[c],h=i.vertexNormals[c],g.copy(e.normal),h.a.copy(e.vertexNormals[0]),h.b.copy(e.vertexNormals[1]),h.c.copy(e.vertexNormals[2])}for(c=0,d=this.faces.length;d>c;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=[],s=[];c=new THREE.Vector3;var t=new THREE.Vector3,u=new THREE.Vector3,v=new THREE.Vector3,w=new THREE.Vector3;for(a=0,b=this.vertices.length;b>a;a++)r[a]=new THREE.Vector3,s[a]=new THREE.Vector3;for(a=0,b=this.faces.length;b>a;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,q=e.b,e=e.c,g=this.vertices[d],h=this.vertices[q],i=this.vertices[e],j=f[0],k=f[1],l=f[2],f=h.x-g.x,m=i.x-g.x,n=h.y-g.y,o=i.y-g.y,h=h.z-g.z,g=i.z-g.z,i=k.x-j.x,p=l.x-j.x,k=k.y-j.y,j=l.y-j.y,l=1/(i*j-p*k),c.set((j*f-k*m)*l,(j*n-k*o)*l,(j*h-k*g)*l),t.set((i*m-p*f)*l,(i*o-p*n)*l,(i*g-p*h)*l),r[d].add(c),r[q].add(c),r[e].add(c),s[d].add(t),s[q].add(t),s[e].add(t);for(t=["a","b","c","d"],a=0,b=this.faces.length;b>a;a++)for(e=this.faces[a],c=0;cd?-1:1,e.vertexTangents[c]=new THREE.Vector4(u.x,u.y,u.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;d>c;c++)c>0&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1==a instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,i=a.faces,j=this.faceVertexUvs[0];a=a.faceVertexUvs[0],void 0===c&&(c=0),void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var k=0,l=g.length;l>k;k++){var m=g[k].clone();void 0!==b&&m.applyMatrix4(b),f.push(m)}for(k=0,l=i.length;l>k;k++){var n,g=i[k],o=g.vertexNormals,p=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);for(m.normal.copy(g.normal),void 0!==d&&m.normal.applyMatrix3(d).normalize(),b=0,f=o.length;f>b;b++)n=o[b].clone(),void 0!==d&&n.applyMatrix3(d).normalize(),m.vertexNormals.push(n);for(m.color.copy(g.color),b=0,f=p.length;f>b;b++)n=p[b],m.vertexColors.push(n.clone());m.materialIndex=g.materialIndex+c,h.push(m)}for(k=0,l=a.length;l>k;k++)if(c=a[k],d=[],void 0!==c){for(b=0,f=c.length;f>b;b++)d.push(c[b].clone());j.push(d)}}},mergeMesh:function(a){!1==a instanceof THREE.Mesh?THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a,b,c,d={},e=[],f=[],g=Math.pow(10,4);for(b=0,c=this.vertices.length;c>b;b++)a=this.vertices[b],a=Math.round(a.x*g)+"_"+Math.round(a.y*g)+"_"+Math.round(a.z*g),void 0===d[a]?(d[a]=b,e.push(this.vertices[b]),f[b]=e.length-1):f[b]=f[d[a]];for(d=[],b=0,c=this.faces.length;c>b;b++)for(g=this.faces[b],g.a=f[g.a],g.b=f[g.b],g.c=f[g.c],g=[g.a,g.b,g.c],a=0;3>a;a++)if(g[a]==g[(a+1)%3]){d.push(b);break}for(b=d.length-1;b>=0;b--)for(g=d[b],this.faces.splice(g,1),f=0,c=this.faceVertexUvs.length;c>f;f++)this.faceVertexUvs[f].splice(g,1);return b=this.vertices.length-e.length,this.vertices=e,b},toJSON:function(){function a(a,b,c){return c?a|1<c;c++)a.vertices.push(b[c].clone());for(b=this.faces,c=0,d=b.length;d>c;c++)a.faces.push(b[c].clone());for(c=0,d=this.faceVertexUvs.length;d>c;c++){b=this.faceVertexUvs[c],void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;f>e;e++){for(var g=b[e],h=[],i=0,j=g.length;j>i;i++)h.push(g[i].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Vector3,this.getWorldQuaternion(a),b.set(0,0,-1).applyQuaternion(a)}}(),THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up),this.quaternion.setFromRotationMatrix(a)}}(),THREE.Camera.prototype.clone=function(a){return void 0===a&&(a=new THREE.Camera),THREE.Object3D.prototype.clone.call(this,a),a.matrixWorldInverse.copy(this.matrixWorldInverse),a.projectionMatrix.copy(this.projectionMatrix),a},THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this),this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0),d.lookAt(new THREE.Vector3(1,0,0)),this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0),e.lookAt(new THREE.Vector3(-1,0,0)),this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1),f.lookAt(new THREE.Vector3(0,1,0)),this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1),g.lookAt(new THREE.Vector3(0,-1,0)),this.add(g);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0),h.lookAt(new THREE.Vector3(0,0,1)),this.add(h);var i=new THREE.PerspectiveCamera(90,1,a,b);i.up.set(0,-1,0),i.lookAt(new THREE.Vector3(0,0,-1)),this.add(i),this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(a,b){var c=this.renderTarget,j=c.generateMipmaps;c.generateMipmaps=!1,c.activeCubeFace=0,a.render(b,d,c),c.activeCubeFace=1,a.render(b,e,c),c.activeCubeFace=2,a.render(b,f,c),c.activeCubeFace=3,a.render(b,g,c),c.activeCubeFace=4,a.render(b,h,c),c.generateMipmaps=j,c.activeCubeFace=5,a.render(b,i,c)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=a,this.right=b,this.top=c,this.bottom=d,this.near=void 0!==e?e:.1,this.far=void 0!==f?f:2e3,this.updateProjectionMatrix() -},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)},THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.left=this.left,a.right=this.right,a.top=this.top,a.bottom=this.bottom,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==a?a:50,this.aspect=void 0!==b?b:1,this.near=void 0!==c?c:.1,this.far=void 0!==d?d:2e3,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24),this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a))),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a,this.fullHeight=b,this.x=c,this.y=d,this.width=e,this.height=f,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var a=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var b=this.fullWidth/this.fullHeight,a=Math.tan(THREE.Math.degToRad(.5*a))*this.near,c=-a,d=b*c,b=Math.abs(b*a-d),c=Math.abs(a-c);this.projectionMatrix.makeFrustum(d+this.x*b/this.fullWidth,d+(this.x+this.width)*b/this.fullWidth,a-(this.y+this.height)*c/this.fullHeight,a-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(a,this.aspect,this.near,this.far)},THREE.PerspectiveCamera.prototype.clone=function(){var a=new THREE.PerspectiveCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.fov=this.fov,a.aspect=this.aspect,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.Light=function(a){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(a)},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.clone=function(a){return void 0===a&&(a=new THREE.Light),THREE.Object3D.prototype.clone.call(this,a),a.color.copy(this.color),a},THREE.AmbientLight=function(a){THREE.Light.call(this,a),this.type="AmbientLight"},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;return THREE.Light.prototype.clone.call(this,a),a},THREE.AreaLight=function(a,b){THREE.Light.call(this,a),this.type="AreaLight",this.normal=new THREE.Vector3(0,-1,0),this.right=new THREE.Vector3(1,0,0),this.intensity=void 0!==b?b:1,this.height=this.width=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},THREE.AreaLight.prototype=Object.create(THREE.Light.prototype),THREE.AreaLight.prototype.constructor=THREE.AreaLight,THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraTop=this.shadowCameraRight=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowCascade=!1,this.shadowCascadeOffset=new THREE.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraLeft=this.shadowCameraLeft,a.shadowCameraRight=this.shadowCameraRight,a.shadowCameraTop=this.shadowCameraTop,a.shadowCameraBottom=this.shadowCameraBottom,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a.shadowCascade=this.shadowCascade,a.shadowCascadeOffset.copy(this.shadowCascadeOffset),a.shadowCascadeCount=this.shadowCascadeCount,a.shadowCascadeBias=this.shadowCascadeBias.slice(0),a.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),a.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),a.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),a.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),a},THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new THREE.Color(b),this.intensity=void 0!==c?c:1},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.clone=function(){var a=new THREE.HemisphereLight;return THREE.Light.prototype.clone.call(this,a),a.groundColor.copy(this.groundColor),a.intensity=this.intensity,a},THREE.PointLight=function(a,b,c,d){THREE.Light.call(this,a),this.type="PointLight",this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.decay=void 0!==d?d:1},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,THREE.PointLight.prototype.clone=function(){var a=new THREE.PointLight;return THREE.Light.prototype.clone.call(this,a),a.intensity=this.intensity,a.distance=this.distance,a.decay=this.decay,a},THREE.SpotLight=function(a,b,c,d,e,f){THREE.Light.call(this,a),this.type="SpotLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.angle=void 0!==d?d:Math.PI/3,this.exponent=void 0!==e?e:10,this.decay=void 0!==f?f:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.distance=this.distance,a.angle=this.angle,a.exponent=this.exponent,a.decay=this.decay,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraFov=this.shadowCameraFov,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a},THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null,this.imageLoader=new THREE.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");return a.style.position="absolute",a.style.right="0px",a.style.top="0px",a.style.fontSize="0.8em",a.style.textAlign="left",a.style.background="rgba(0,0,0,0.25)",a.style.color="#fff",a.style.width="120px",a.style.padding="0.5em 0.5em 0.5em 0.5em",a.style.zIndex=1e3,a.innerHTML="Loading ...",a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+"%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){return a=a.split("/"),1===a.length?"./":(a.pop(),a.join("/")+"/")},initMaterials:function(a,b){for(var c=[],d=0;db;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){return a=Math.log(a)/Math.LN2,Math.pow(2,Math.round(a))}function d(a,d,e,g,h,i,j){var k,l=b+e,m=THREE.Loader.Handlers.get(l);null!==m?k=m.load(l):(k=new THREE.Texture,m=f.imageLoader,m.crossOrigin=f.crossOrigin,m.load(l,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b,e.height=d,e.getContext("2d").drawImage(a,0,0,b,d),k.image=e}else k.image=a;k.needsUpdate=!0})),k.sourceFile=e,g&&(k.repeat.set(g[0],g[1]),1!==g[0]&&(k.wrapS=THREE.RepeatWrapping),1!==g[1]&&(k.wrapT=THREE.RepeatWrapping)),h&&k.offset.set(h[0],h[1]),i&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[i[0]]&&(k.wrapS=e[i[0]]),void 0!==e[i[1]]&&(k.wrapT=e[i[1]])),j&&(k.anisotropy=j),a[d]=k}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var i=a.shading.toLowerCase();"phong"===i?g="MeshPhongMaterial":"basic"===i&&(g="MeshBasicMaterial")}return void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]),void 0!==a.transparent&&(h.transparent=a.transparent),void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0),void 0!==a.depthTest&&(h.depthTest=a.depthTest),void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite),void 0!==a.visible&&(h.visible=a.visible),void 0!==a.flipSided&&(h.side=THREE.BackSide),void 0!==a.doubleSided&&(h.side=THREE.DoubleSide),void 0!==a.wireframe&&(h.wireframe=a.wireframe),void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors)),a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor),a.colorSpecular&&(h.specular=e(a.colorSpecular)),a.colorEmissive&&(h.emissive=e(a.colorEmissive)),void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency),void 0!==a.opacity&&(h.opacity=a.opacity),a.specularCoef&&(h.shininess=a.specularCoef),a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy),a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy),a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy),a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy),a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy),a.mapAlpha&&b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy),a.mapBumpScale&&(h.bumpScale=a.mapBumpScale),a.mapNormalFactor&&(h.normalScale=new THREE.Vector2(a.mapNormalFactor,a.mapNormalFactor)),g=new THREE[g](h),void 0!==a.DbgName&&(g.name=a.DbgName),g}},THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;c>b;b+=2){var d=this.handlers[b+1];if(this.handlers[b].test(a))return d}return null}},THREE.XHRLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);void 0!==f?b&&b(f):(f=new XMLHttpRequest,f.open("GET",a,!0),f.addEventListener("load",function(){THREE.Cache.add(a,this.response),b&&b(this.response),e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&f.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(f.responseType=this.responseType),f.send(null),e.manager.itemStart(a))},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.ImageLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);return void 0===f?(f=document.createElement("img"),f.addEventListener("load",function(){THREE.Cache.add(a,this),b&&b(this),e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&f.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),f.src=a,e.manager.itemStart(a),f):void b(f)},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.JSONLoader=function(a){THREE.Loader.call(this,a),this.withCredentials=!1},THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype),THREE.JSONLoader.prototype.constructor=THREE.JSONLoader,THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"==typeof c?c:this.extractUrlBase(a),this.onLoadStart(),this.loadAjaxJSON(this,a,b,c)},THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),i=h.metadata;if(void 0!==i){if("object"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");if("scene"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.")}h=a.parse(h,d),c(h.geometry,h.materials)}else THREE.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))},f.open("GET",b,!0),f.withCredentials=this.withCredentials,f.send(null)},THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;return function(b){var d,e,f,g,h,i,j,k,l,m,n,o,p,q=a.faces;i=a.vertices;var r=a.normals,s=a.colors,t=0;if(void 0!==a.uvs){for(d=0;dd;d++)c.faceVertexUvs[d]=[]}for(g=0,h=i.length;h>g;)d=new THREE.Vector3,d.x=i[g++]*b,d.y=i[g++]*b,d.z=i[g++]*b,c.vertices.push(d);for(g=0,h=q.length;h>g;)if(b=q[g++],l=1&b,f=2&b,d=8&b,j=16&b,m=32&b,i=64&b,b&=128,l){if(l=new THREE.Face3,l.a=q[g],l.b=q[g+1],l.c=q[g+3],n=new THREE.Face3,n.a=q[g+1],n.b=q[g+2],n.c=q[g+3],g+=4,f&&(f=q[g++],l.materialIndex=f,n.materialIndex=f),f=c.faces.length,d)for(d=0;t>d;d++)for(o=a.uvs[d],c.faceVertexUvs[d][f]=[],c.faceVertexUvs[d][f+1]=[],e=0;4>e;e++)k=q[g++],p=o[2*k],k=o[2*k+1],p=new THREE.Vector2(p,k),2!==e&&c.faceVertexUvs[d][f].push(p),0!==e&&c.faceVertexUvs[d][f+1].push(p);if(j&&(j=3*q[g++],l.normal.set(r[j++],r[j++],r[j]),n.normal.copy(l.normal)),m)for(d=0;4>d;d++)j=3*q[g++],m=new THREE.Vector3(r[j++],r[j++],r[j]),2!==d&&l.vertexNormals.push(m),0!==d&&n.vertexNormals.push(m);if(i&&(i=q[g++],i=s[i],l.color.setHex(i),n.color.setHex(i)),b)for(d=0;4>d;d++)i=q[g++],i=s[i],2!==d&&l.vertexColors.push(new THREE.Color(i)),0!==d&&n.vertexColors.push(new THREE.Color(i));c.faces.push(l),c.faces.push(n)}else{if(l=new THREE.Face3,l.a=q[g++],l.b=q[g++],l.c=q[g++],f&&(f=q[g++],l.materialIndex=f),f=c.faces.length,d)for(d=0;t>d;d++)for(o=a.uvs[d],c.faceVertexUvs[d][f]=[],e=0;3>e;e++)k=q[g++],p=o[2*k],k=o[2*k+1],p=new THREE.Vector2(p,k),c.faceVertexUvs[d][f].push(p);if(j&&(j=3*q[g++],l.normal.set(r[j++],r[j++],r[j])),m)for(d=0;3>d;d++)j=3*q[g++],m=new THREE.Vector3(r[j++],r[j++],r[j]),l.vertexNormals.push(m);if(i&&(i=q[g++],l.color.setHex(s[i])),b)for(d=0;3>d;d++)i=q[g++],l.vertexColors.push(new THREE.Color(s[i]));c.faces.push(l)}}(d),function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,e=a.skinWeights.length;e>d;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],b>1?a.skinWeights[d+1]:0,b>2?a.skinWeights[d+2]:0,b>3?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,e=a.skinIndices.length;e>d;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],b>1?a.skinIndices[d+1]:0,b>2?a.skinIndices[d+2]:0,b>3?a.skinIndices[d+3]:0));c.bones=a.bones,c.bones&&0d;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],h=c.morphTargets[d].vertices,i=a.morphTargets[d].vertices,f=0,g=i.length;g>f;f+=3){var j=new THREE.Vector3;j.x=i[f]*b,j.y=i[f+1]*b,j.z=i[f+2]*b,h.push(j)}}if(void 0!==a.morphColors)for(d=0,e=a.morphColors.length;e>d;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],g=c.morphColors[d].colors,h=a.morphColors[d].colors,b=0,f=h.length;f>b;b+=3)i=new THREE.Color(16755200),i.setRGB(h[b],h[b+1],h[b+2]),g.push(i)}(d),c.computeFaceNormals(),c.computeBoundingSphere(),void 0===a.materials||0===a.materials.length?{geometry:c}:(d=this.initMaterials(a.materials,b),this.needsTangents(d)&&c.computeTangents(),{geometry:c,materials:d})},THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a,this.onProgress=b,this.onError=c,this.itemStart=function(){f++},this.itemEnd=function(a){e++,void 0!==d.onProgress&&d.onProgress(a,e,f),e===f&&void 0!==d.onLoad&&d.onLoad()}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b,c=new THREE.BufferGeometry,d=a.data.attributes;for(b in d){var e=d[b],f=new self[e.type](e.array);c.addAttribute(b,new THREE.BufferAttribute(f,e.itemSize))}return d=a.data.offsets,void 0!==d&&(c.offsets=JSON.parse(JSON.stringify(d))),a=a.data.boundingSphere,void 0!==a&&(d=new THREE.Vector3,void 0!==a.center&&d.fromArray(a.center),c.boundingSphere=new THREE.Sphere(d,a.radius)),c}},THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];if(void 0!==a.color&&b.color.setHex(a.color),void 0!==a.emissive&&b.emissive.setHex(a.emissive),void 0!==a.specular&&b.specular.setHex(a.specular),void 0!==a.shininess&&(b.shininess=a.shininess),void 0!==a.uniforms&&(b.uniforms=a.uniforms),void 0!==a.vertexShader&&(b.vertexShader=a.vertexShader),void 0!==a.fragmentShader&&(b.fragmentShader=a.fragmentShader),void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors),void 0!==a.shading&&(b.shading=a.shading),void 0!==a.blending&&(b.blending=a.blending),void 0!==a.side&&(b.side=a.side),void 0!==a.opacity&&(b.opacity=a.opacity),void 0!==a.transparent&&(b.transparent=a.transparent),void 0!==a.wireframe&&(b.wireframe=a.wireframe),void 0!==a.size&&(b.size=a.size),void 0!==a.sizeAttenuation&&(b.sizeAttenuation=a.sizeAttenuation),void 0!==a.materials)for(var c=0,d=a.materials.length;d>c;c++)b.materials.push(this.parse(a.materials[c]));return b}},THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(a,b,c,d){""===this.texturePath&&(this.texturePath=a.substring(0,a.lastIndexOf("/")+1));var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){e.parse(JSON.parse(a),b)},c,d)},setTexturePath:function(a){this.texturePath=a},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a,b){var c=this.parseGeometries(a.geometries),d=this.parseImages(a.images,function(){void 0!==b&&b(e)}),d=this.parseTextures(a.textures,d),d=this.parseMaterials(a.materials,d),e=this.parseObject(a.object,c,d);return void 0!==a.images&&0!==a.images.length||void 0===b||b(e),e},parseGeometries:function(a){var b={};if(void 0!==a)for(var c=new THREE.JSONLoader,d=new THREE.BufferGeometryLoader,e=0,f=a.length;f>e;e++){var g,h=a[e];switch(h.type){case"PlaneGeometry":case"PlaneBufferGeometry":g=new THREE[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case"BoxGeometry":case"CubeGeometry":g=new THREE.BoxGeometry(h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case"CircleGeometry":g=new THREE.CircleGeometry(h.radius,h.segments);break;case"CylinderGeometry":g=new THREE.CylinderGeometry(h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded);break;case"SphereGeometry":g=new THREE.SphereGeometry(h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case"IcosahedronGeometry":g=new THREE.IcosahedronGeometry(h.radius,h.detail);break;case"TorusGeometry":g=new THREE.TorusGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case"TorusKnotGeometry":g=new THREE.TorusKnotGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.p,h.q,h.heightScale);break;case"BufferGeometry":g=d.parse(h);break;case"Geometry":g=c.parse(h.data).geometry}g.uuid=h.uuid,void 0!==h.name&&(g.name=h.name),b[h.uuid]=g}return b},parseMaterials:function(a,b){var c={};if(void 0!==a)for(var d=function(a){return void 0===b[a]&&THREE.warn("THREE.ObjectLoader: Undefined texture",a),b[a]},e=new THREE.MaterialLoader,f=0,g=a.length;g>f;f++){var h=a[f],i=e.parse(h);i.uuid=h.uuid,void 0!==h.name&&(i.name=h.name),void 0!==h.map&&(i.map=d(h.map)),void 0!==h.bumpMap&&(i.bumpMap=d(h.bumpMap),h.bumpScale&&(i.bumpScale=new THREE.Vector2(h.bumpScale,h.bumpScale))),void 0!==h.alphaMap&&(i.alphaMap=d(h.alphaMap)),void 0!==h.envMap&&(i.envMap=d(h.envMap)),void 0!==h.normalMap&&(i.normalMap=d(h.normalMap),h.normalScale&&(i.normalScale=new THREE.Vector2(h.normalScale,h.normalScale))),void 0!==h.lightMap&&(i.lightMap=d(h.lightMap)),void 0!==h.specularMap&&(i.specularMap=d(h.specularMap)),c[h.uuid]=i}return c},parseImages:function(a,b){var c=this,d={};if(void 0!==a&&0g;g++){var i=a[g],j=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i.url)?i.url:c.texturePath+i.url;d[i.uuid]=e(j)}}return d},parseTextures:function(a,b){var c={};if(void 0!==a)for(var d=0,e=a.length;e>d;d++){var f=a[d];void 0===f.image&&THREE.warn('THREE.ObjectLoader: No "image" speficied for',f.uuid),void 0===b[f.image]&&THREE.warn("THREE.ObjectLoader: Undefined image",f.image);var g=new THREE.Texture(b[f.image]);g.needsUpdate=!0,g.uuid=f.uuid,void 0!==f.name&&(g.name=f.name),void 0!==f.repeat&&(g.repeat=new THREE.Vector2(f.repeat[0],f.repeat[1])),void 0!==f.minFilter&&(g.minFilter=THREE[f.minFilter]),void 0!==f.magFilter&&(g.magFilter=THREE[f.magFilter]),void 0!==f.anisotropy&&(g.anisotropy=f.anisotropy),f.wrap instanceof Array&&(g.wrapS=THREE[f.wrap[0]],g.wrapT=THREE[f.wrap[1]]),c[f.uuid]=g}return c},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e;e=function(a){return void 0===c[a]&&THREE.warn("THREE.ObjectLoader: Undefined geometry",a),c[a]};var f=function(a){return void 0===d[a]&&THREE.warn("THREE.ObjectLoader: Undefined material",a),d[a]};switch(b.type){case"Scene":e=new THREE.Scene;break;case"PerspectiveCamera":e=new THREE.PerspectiveCamera(b.fov,b.aspect,b.near,b.far);break;case"OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case"AmbientLight":e=new THREE.AmbientLight(b.color);break;case"DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case"PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance,b.decay);break;case"SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay);break;case"HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case"Mesh":e=new THREE.Mesh(e(b.geometry),f(b.material));break;case"Line":e=new THREE.Line(e(b.geometry),f(b.material),b.mode);break;case"PointCloud":e=new THREE.PointCloud(e(b.geometry),f(b.material));break;case"Sprite":e=new THREE.Sprite(f(b.material));break;case"Group":e=new THREE.Group;break;default:e=new THREE.Object3D}if(e.uuid=b.uuid,void 0!==b.name&&(e.name=b.name),void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale)),void 0!==b.visible&&(e.visible=b.visible),void 0!==b.userData&&(e.userData=b.userData),void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()},THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin),e.load(a,function(a){a=new THREE.Texture(a),a.needsUpdate=!0,void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(){this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){var e=this,f=new THREE.DataTexture,g=new THREE.XHRLoader;return g.setResponseType("arraybuffer"),g.load(a,function(a){(a=e._parser(a))&&(void 0!==a.image?f.image=a.image:void 0!==a.data&&(f.image.width=a.width,f.image.height=a.height,f.image.data=a.data),f.wrapS=void 0!==a.wrapS?a.wrapS:THREE.ClampToEdgeWrapping,f.wrapT=void 0!==a.wrapT?a.wrapT:THREE.ClampToEdgeWrapping,f.magFilter=void 0!==a.magFilter?a.magFilter:THREE.LinearFilter,f.minFilter=void 0!==a.minFilter?a.minFilter:THREE.LinearMipMapLinearFilter,f.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(f.format=a.format),void 0!==a.type&&(f.type=a.type),void 0!==a.mipmaps&&(f.mipmaps=a.mipmaps),1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.needsUpdate=!0,b&&b(f,a))},c,d),f}},THREE.CompressedTextureLoader=function(){this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],f=new THREE.CompressedTexture;f.image=e;var g=new THREE.XHRLoader;if(g.setResponseType("arraybuffer"),a instanceof Array){var h=0;c=function(c){g.load(a[c],function(a){a=d._parser(a,!0),e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps},h+=1,6===h&&(1==a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=a.format,f.needsUpdate=!0,b&&b(f))})};for(var i=0,j=a.length;j>i;++i)c(i)}else g.load(a,function(a){if(a=d._parser(a,!0),a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,g=0;c>g;g++){e[g]={mipmaps:[]};for(var h=0;hthis.opacity&&(a.opacity=this.opacity),!1!==this.transparent&&(a.transparent=this.transparent),!1!==this.wireframe&&(a.wireframe=this.wireframe),a -},clone:function(a){return void 0===a&&(a=new THREE.Material),a.name=this.name,a.side=this.side,a.opacity=this.opacity,a.transparent=this.transparent,a.blending=this.blending,a.blendSrc=this.blendSrc,a.blendDst=this.blendDst,a.blendEquation=this.blendEquation,a.blendSrcAlpha=this.blendSrcAlpha,a.blendDstAlpha=this.blendDstAlpha,a.blendEquationAlpha=this.blendEquationAlpha,a.depthTest=this.depthTest,a.depthWrite=this.depthWrite,a.polygonOffset=this.polygonOffset,a.polygonOffsetFactor=this.polygonOffsetFactor,a.polygonOffsetUnits=this.polygonOffsetUnits,a.alphaTest=this.alphaTest,a.overdraw=this.overdraw,a.visible=this.visible,a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(a){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(a)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.linecap=this.linecap,a.linejoin=this.linejoin,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.LineDashedMaterial=function(a){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(a)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.scale=this.scale,a.dashSize=this.dashSize,a.gapSize=this.gapSize,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.MeshBasicMaterial=function(a){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a},THREE.MeshLambertMaterial=function(a){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.wrapAround=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshPhongMaterial=function(a){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.specular=new THREE.Color(1118481),this.shininess=30,this.wrapAround=this.metal=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.bumpMap=this.lightMap=this.map=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.envMap=this.alphaMap=this.specularMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.specular.copy(this.specular),a.shininess=this.shininess,a.metal=this.metal,a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.bumpMap=this.bumpMap,a.bumpScale=this.bumpScale,a.normalMap=this.normalMap,a.normalScale.copy(this.normalScale),a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshDepthMaterial=function(a){THREE.Material.call(this),this.type="MeshDepthMaterial",this.wireframe=this.morphTargets=!1,this.wireframeLinewidth=1,this.setValues(a)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(a)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=a instanceof Array?a:[]},THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;c>b;b++)a.materials.push(this.materials[b].toJSON());return a},clone:function(){for(var a=new THREE.MeshFaceMaterial,b=0;bg){var i=b.closestPointToPoint(a);i.applyMatrix4(e.matrixWorld);var j=c.ray.origin.distanceTo(i);d.push({distance:j,distanceToRay:g,point:i.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var j=f.attributes,k=j.position.array;if(void 0!==j.index){var j=j.index.array,l=f.offsets;0===l.length&&(l=[{start:0,count:j.length,index:0}]);for(var m=0,n=l.length;n>m;++m)for(var o=l[m].start,p=l[m].index,f=o,o=o+l[m].count;o>f;f++){var q=p+j[f];i.fromArray(k,3*q),g(i,q)}}else for(j=k.length/3,f=0;j>f;f++)i.set(k[3*f],k[3*f+1],k[3*f+2]),g(i,f)}else for(i=this.geometry.vertices,f=0;fg;g+=l){var t=s+n[g+1];h.fromArray(m,3*(s+n[g])),i.fromArray(m,3*t),t=b.distanceSqToSegment(h,i,k,j),t>f||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:p,face:null,faceIndex:null,object:this}))}}else for(m=m.position.array,g=0;gf||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,i=h.length,g=0;i-1>g;g+=l)t=b.distanceSqToSegment(h[g],h[g+1],k,j),t>f||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),THREE.Line.prototype.clone=function(a){return void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Mesh=function(a,b){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==a?a:new THREE.Geometry,this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0a;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){return void 0!==this.morphTargetDictionary[a]?this.morphTargetDictionary[a]:(THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var i=this.geometry;if(null===i.boundingSphere&&i.computeBoundingSphere(),c.copy(i.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===i.boundingBox||!1!==b.isIntersectionBox(i.boundingBox)))if(i instanceof THREE.BufferGeometry){var j=this.material;if(void 0!==j){var k,l,m=i.attributes,n=g.precision;if(void 0!==m.index){var o=m.index.array,p=m.position.array,q=i.offsets;0===q.length&&(q=[{start:0,count:o.length,index:0}]);for(var r=0,s=q.length;s>r;++r)for(var m=q[r].start,t=q[r].index,i=m,u=m+q[r].count;u>i;i+=3){m=t+o[i],k=t+o[i+1],l=t+o[i+2],d.fromArray(p,3*m),e.fromArray(p,3*k),f.fromArray(p,3*l);var v=j.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide);if(null!==v){v.applyMatrix4(this.matrixWorld);var w=g.ray.origin.distanceTo(v);n>w||wg.far||h.push({distance:w,point:v,face:new THREE.Face3(m,k,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(p=m.position.array,o=i=0,u=p.length;u>i;i+=3,o+=9)m=i,k=i+1,l=i+2,d.fromArray(p,o),e.fromArray(p,o+3),f.fromArray(p,o+6),v=j.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),w=g.ray.origin.distanceTo(v),n>w||wg.far||h.push({distance:w,point:v,face:new THREE.Face3(m,k,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(i instanceof THREE.Geometry)for(o=this.material instanceof THREE.MeshFaceMaterial,p=!0===o?this.material.materials:null,n=g.precision,q=i.vertices,r=0,s=i.faces.length;s>r;r++)if(t=i.faces[r],j=!0===o?p[t.materialIndex]:this.material,void 0!==j){if(m=q[t.a],k=q[t.b],l=q[t.c],!0===j.morphTargets){v=i.morphTargets,w=this.morphTargetInfluences,d.set(0,0,0),e.set(0,0,0),f.set(0,0,0);for(var u=0,x=v.length;x>u;u++){var y=w[u];if(0!==y){var z=v[u].vertices;d.x+=(z[t.a].x-m.x)*y,d.y+=(z[t.a].y-m.y)*y,d.z+=(z[t.a].z-m.z)*y,e.x+=(z[t.b].x-k.x)*y,e.y+=(z[t.b].y-k.y)*y,e.z+=(z[t.b].z-k.z)*y,f.x+=(z[t.c].x-l.x)*y,f.y+=(z[t.c].y-l.y)*y,f.z+=(z[t.c].z-l.z)*y}}d.add(m),e.add(k),f.add(l),m=d,k=e,l=f}v=j.side===THREE.BackSide?b.intersectTriangle(l,k,m,!0):b.intersectTriangle(m,k,l,j.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),w=g.ray.origin.distanceTo(v),n>w||wg.far||h.push({distance:w,point:v,face:t,faceIndex:r,object:this}))}}}(),THREE.Mesh.prototype.clone=function(a,b){return void 0===a&&(a=new THREE.Mesh(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,a,b),a},THREE.Bone=function(a){THREE.Object3D.call(this),this.type="Bone",this.skin=a},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Skeleton=function(a,b,c){if(this.useVertexTexture=void 0!==c?c:!0,this.identityMatrix=new THREE.Matrix4,a=a||[],this.bones=a.slice(0),this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256b;b++)this.boneInverses.push(new THREE.Matrix4)},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;b>a;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld),this.boneInverses.push(c)}},THREE.Skeleton.prototype.pose=function(){for(var a,b=0,c=this.bones.length;c>b;b++)(a=this.bones[b])&&a.matrixWorld.getInverse(this.boneInverses[b]);for(b=0,c=this.bones.length;c>b;b++)(a=this.bones[b])&&(a.parent?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))},THREE.Skeleton.prototype.update=function(){var a=new THREE.Matrix4;return function(){for(var b=0,c=this.bones.length;c>b;b++)a.multiplyMatrices(this.bones[b]?this.bones[b].matrixWorld:this.identityMatrix,this.boneInverses[b]),a.flattenToArrayOffset(this.boneMatrices,16*b);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.SkinnedMesh=function(a,b,c){if(THREE.Mesh.call(this,a,b),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4,a=[],this.geometry&&void 0!==this.geometry.bones){for(var d,e,f,g,h=0,i=this.geometry.bones.length;i>h;++h)d=this.geometry.bones[h],e=d.pos,f=d.rotq,g=d.scl,b=new THREE.Bone(this),a.push(b),b.name=d.name,b.position.set(e[0],e[1],e[2]),b.quaternion.set(f[0],f[1],f[2],f[3]),void 0!==g?b.scale.set(g[0],g[1],g[2]):b.scale.set(1,1,1);for(h=0,i=this.geometry.bones.length;i>h;++h)d=this.geometry.bones[h],-1!==d.parent?a[d.parent].add(a[h]):this.add(a[h])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(a,void 0,c))},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(a,b){this.skeleton=a,void 0===b&&(this.updateMatrixWorld(!0),b=this.matrixWorld),this.bindMatrix.copy(b),this.bindMatrixInverse.getInverse(b)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var a=0;ae;e++){var g=a.morphTargets[e].name.match(d);if(g&&1h.end&&(h.end=e),b||(b=g)}}a.firstAnimation=b},THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[a]={start:b,end:c}},THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1e3,this.time=0):THREE.warn("THREE.MorphAnimMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a,this.mirroredLoop?(this.time>this.duration||0>this.time)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)):(this.time%=this.duration,0>this.time&&(this.time+=this.duration)),a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1),a!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a),b=this.time%b/b,this.directionBackwards&&(b=1-b),this.morphTargetInfluences[this.currentKeyframe]=b,this.morphTargetInfluences[this.lastKeyframe]=1-b},THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;f>e;e++)d[e]=0;a>-1&&(d[a]=1-c),b>-1&&(d[b]=c)},THREE.MorphAnimMesh.prototype.clone=function(a){return void 0===a&&(a=new THREE.MorphAnimMesh(this.geometry,this.material)),a.duration=this.duration,a.mirroredLoop=this.mirroredLoop,a.time=this.time,a.lastKeyframe=this.lastKeyframe,a.currentKeyframe=this.currentKeyframe,a.direction=this.direction,a.directionBackwards=this.directionBackwards,THREE.Mesh.prototype.clone.call(this,a),a},THREE.LOD=function(){THREE.Object3D.call(this),this.objects=[]},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0),b=Math.abs(b);for(var c=0;cb&&!(ad&&c>=this.objects[d].distance;d++)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;for(;e>d;d++)this.objects[d].object.visible=!1}}}(),THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD),THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;c>b;b++){var d=this.objects[b].object.clone();d.visible=0===b,a.addLevel(d,this.objects[b].distance)}return a},THREE.Sprite=function(){var a=new Uint16Array([0,1,2,0,2,3]),b=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),c=new Float32Array([0,0,1,0,1,1,0,1]),d=new THREE.BufferGeometry;return d.addAttribute("index",new THREE.BufferAttribute(a,1)),d.addAttribute("position",new THREE.BufferAttribute(b,3)),d.addAttribute("uv",new THREE.BufferAttribute(c,2)),function(a){THREE.Object3D.call(this),this.type="Sprite",this.geometry=d,this.material=void 0!==a?a:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3; -return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(a){return void 0===a&&(a=new THREE.Sprite(this.material)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==a&&this.add(a,b,c,d,e)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1),void 0===c&&(c=0),void 0===f&&(f=1),void 0===e&&(e=new THREE.Color(16777215)),void 0===d&&(d=THREE.NormalBlending),c=Math.min(c,Math.max(0,c)),this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})},THREE.LensFlare.prototype.updateLensFlares=function(){var a,b,c=this.lensFlares.length,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;c>a;a++)b=this.lensFlares[a],b.x=this.positionScreen.x+d*b.distance,b.y=this.positionScreen.y+e*b.distance,b.wantedRotation=b.x*Math.PI*.25,b.rotation+=.25*(b.wantedRotation-b.rotation)},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.overrideMaterial=this.fog=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.clone=function(a){return void 0===a&&(a=new THREE.Scene),THREE.Object3D.prototype.clone.call(this,a),null!==this.fog&&(a.fog=this.fog.clone()),null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone()),a.autoUpdate=this.autoUpdate,a.matrixAutoUpdate=this.matrixAutoUpdate,a},THREE.Fog=function(a,b,c){this.name="",this.color=new THREE.Color(a),this.near=void 0!==b?b:1,this.far=void 0!==c?c:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(a,b){this.name="",this.color=new THREE.Color(a),this.density=void 0!==b?b:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2 square( in vec2 a ) { return vec2( a.x*a.x, a.y*a.y ); }\nvec3 square( in vec3 a ) { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4 square( in vec4 a ) { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2 saturate( in vec2 a ) { return clamp( a, 0.0, 1.0 ); }\nvec3 saturate( in vec3 a ) { return clamp( a, 0.0, 1.0 ); }\nvec4 saturate( in vec4 a ) { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a ) { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a ) { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a ) { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2 whiteCompliment( in vec2 a ) { return saturate( vec2(1.0) - a ); }\nvec3 whiteCompliment( in vec3 a ) { return saturate( vec3(1.0) - a ); }\nvec4 whiteCompliment( in vec4 a ) { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n float distance = dot( planeNormal, point-pointOnPlane );\n return point - distance * planeNormal;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n if ( decayExponent > 0.0 ) {\n return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n }\n return 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n return pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n return pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n if ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n vLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n directionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n directionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n #endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n lVector = normalize( lVector );\n float dotProduct = dot( transformedNormal, lVector );\n\n vec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n pointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n pointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n #endif\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n float dotProduct = dot( transformedNormal, lVector );\n vec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n spotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n spotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n #endif\n\n }\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n float dotProduct = dot( transformedNormal, lVector );\n\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n #endif\n\n }\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n vLightBack += ambientLightColor;\n\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n uniform vec4 offsetRepeat;\n uniform sampler2D map;\n\n#endif\n",THREE.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n vec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n vec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n uniform sampler2D map;\n\n#endif",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n #ifdef USE_MORPHNORMALS\n\n vec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n #else\n\n vec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n varying float vFragDepth;\n\n #endif\n\n uniform float logDepthBufFC;\n\n#endif",THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n\n#endif",THREE.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n vec3 normal = normalize( vNormal );\n\n #ifdef DOUBLE_SIDED\n\n normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n #endif\n\n#else\n\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n normal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float pointDiffuseWeightFull = max( dotProduct, 0.0 );\n float pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float pointDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n // specular\n\n vec3 pointHalfVector = normalize( lVector + viewPosition );\n float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n float pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float spotDiffuseWeightFull = max( dotProduct, 0.0 );\n float spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float spotDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n // specular\n\n vec3 spotHalfVector = normalize( lVector + viewPosition );\n float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n float spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n }\n\n }\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n // diffuse\n\n float dotProduct = dot( normal, dirVector );\n\n #ifdef WRAP_AROUND\n\n float dirDiffuseWeightFull = max( dotProduct, 0.0 );\n float dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float dirDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n // specular\n\n vec3 dirHalfVector = normalize( dirVector + viewPosition );\n float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n float dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n /*\n // fresnel term from skin shader\n const float F0 = 0.128;\n\n float base = 1.0 - dot( viewPosition, dirHalfVector );\n float exponential = pow( base, 5.0 );\n\n float fresnel = exponential + F0 * ( 1.0 - exponential );\n */\n\n /*\n // fresnel term from fresnel shader\n const float mFresnelBias = 0.08;\n const float mFresnelScale = 0.3;\n const float mFresnelPower = 5.0;\n\n float fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n */\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n // dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n vec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n totalDiffuseLight += hemiColor;\n\n // specular (sky light)\n\n vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n float hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n // specular (ground light)\n\n vec3 lVectorGround = -lVector;\n\n vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n float hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n float dotProductGround = dot( normal, lVectorGround );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n vec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n totalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n }\n\n#endif\n\n#ifdef METAL\n\n outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n uniform vec3 fogColor;\n\n #ifdef FOG_EXP2\n\n uniform float fogDensity;\n\n #else\n\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n vec3 morphedNormal = vec3( 0.0 );\n\n morphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n morphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n morphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n morphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n morphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n\n // Per-Pixel Tangent Space Normal Mapping\n // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n\n }\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n uniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n }\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n vWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n vec4 texelColor = texture2D( map, vUv );\n\n texelColor.xyz = inputToLinear( texelColor.xyz );\n\n diffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n vUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n vColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n #ifdef USE_MORPHTARGETS\n\n vec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n #endif\n\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n outgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif",THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n",THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n uniform vec4 offsetRepeat;\n\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n // Transforming Normal Vectors with the Inverse Transformation\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n #else\n\n vec3 reflectVec = vReflect;\n\n #endif\n\n #ifdef DOUBLE_SIDED\n float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n #else\n float flipNormal = 1.0;\n #endif\n\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n vec4 envColor = texture2D( envMap, sampleUV );\n\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #endif\n\n envColor.xyz = inputToLinear( envColor.xyz );\n\n #ifdef ENVMAP_BLENDING_MULTIPLY\n\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_MIX )\n\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_ADD )\n\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n #endif\n\n#endif\n",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n uniform sampler2D specularMap;\n\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n vFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n #endif\n\n#endif",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n #ifndef USE_MORPHNORMALS\n\n uniform float morphTargetInfluences[ 8 ];\n\n #else\n\n uniform float morphTargetInfluences[ 4 ];\n\n #endif\n\n#endif",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n\n#else\n\n specularStrength = 1.0;\n\n#endif",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n #else\n\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n #endif\n\n #ifdef FOG_EXP2\n\n float fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n fogFactor = whiteCompliment( fogFactor );\n\n #else\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n #endif\n \n outgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n\n // Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n // http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n vec2 dHdxy_fwd() {\n\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n return vec2( dBx, dBy );\n\n }\n\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n vec3 vSigmaX = dFdx( surf_pos );\n vec3 vSigmaY = dFdy( surf_pos );\n vec3 vN = surf_norm; // normalized\n\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n\n float fDet = dot( vSigmaX, R1 );\n\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n\n }\n\n#endif\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n vec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n vec3 objectNormal = morphedNormal;\n\n#else\n\n vec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n objectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n\n#endif\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n outgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n uniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n diffuseColor.rgb *= vColor;\n\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n vec3 morphed = vec3( 0.0 );\n morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n #ifndef USE_MORPHNORMALS\n\n morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n #endif\n\n morphed += position;\n\n#endif",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n vec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vReflect = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n #ifdef SHADOWMAP_DEBUG\n\n vec3 frustumColors[3];\n frustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n frustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n frustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n #endif\n\n #ifdef SHADOWMAP_CASCADE\n\n int inFrustumCount = 0;\n\n #endif\n\n float fDepth;\n vec3 shadowColor = vec3( 1.0 );\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n // if ( something && something ) breaks ATI OpenGL shader compiler\n // if ( all( something, something ) ) using this instead\n\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n\n // don't shadow pixels outside of light frustum\n // use just first frustum (for cascades)\n // don't shadow pixels behind far plane of light frustum\n\n #ifdef SHADOWMAP_CASCADE\n\n inFrustumCount += int( inFrustum );\n bvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n #else\n\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n #endif\n\n bool frustumTest = all( frustumTestVec );\n\n if ( frustumTest ) {\n\n shadowCoord.z += shadowBias[ i ];\n\n #if defined( SHADOWMAP_TYPE_PCF )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n /*\n // nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n // must enroll loop manually\n\n for ( float y = -1.25; y <= 1.25; y += 1.25 )\n for ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n // doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n //vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n shadow += 1.0;\n\n }\n\n shadow /= 9.0;\n\n */\n\n const float shadowDelta = 1.0 / 9.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.25 * xPixelOffset;\n float dy0 = -1.25 * yPixelOffset;\n float dx1 = 1.25 * xPixelOffset;\n float dy1 = 1.25 * yPixelOffset;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.0 * xPixelOffset;\n float dy0 = -1.0 * yPixelOffset;\n float dx1 = 1.0 * xPixelOffset;\n float dy1 = 1.0 * yPixelOffset;\n\n mat3 shadowKernel;\n mat3 depthKernel;\n\n depthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n depthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n depthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n depthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n depthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n depthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n depthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n depthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n depthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n vec3 shadowZ = vec3( shadowCoord.z );\n shadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n shadowKernel[0] *= vec3(0.25);\n\n shadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n shadowKernel[1] *= vec3(0.25);\n\n shadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n shadowKernel[2] *= vec3(0.25);\n\n vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n shadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n shadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n vec4 shadowValues;\n shadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n shadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n shadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n shadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n shadow = dot( shadowValues, vec4( 1.0 ) );\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #else\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n\n // spot with multiple shadows is darker\n\n shadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n // spot with multiple shadows has the same color as single shadow spot\n\n // shadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n #endif\n\n }\n\n\n #ifdef SHADOWMAP_DEBUG\n\n #ifdef SHADOWMAP_CASCADE\n\n if ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n #else\n\n if ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n #endif\n\n #endif\n\n }\n\n // NOTE: I am unsure if this is correct in linear space. -bhouston, Dec 29, 2014\n shadowColor = inputToLinear( shadowColor );\n\n outgoingLight = outgoingLight * shadowColor;\n\n#endif\n",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n #ifdef USE_SKINNING\n\n vec4 worldPosition = modelMatrix * skinned;\n\n #elif defined( USE_MORPHTARGETS )\n\n vec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n uniform sampler2D shadowMap[ MAX_SHADOWS ];\n uniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n uniform float shadowDarkness[ MAX_SHADOWS ];\n uniform float shadowBias[ MAX_SHADOWS ];\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n float unpackDepth( const in vec4 rgba_depth ) {\n\n const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n float depth = dot( rgba_depth, bit_shift );\n return depth;\n\n }\n\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n\n #ifdef BONE_TEXTURE\n\n uniform sampler2D boneTexture;\n uniform int boneTextureWidth;\n uniform int boneTextureHeight;\n\n mat4 getBoneMatrix( const in float i ) {\n\n float j = i * 4.0;\n float x = mod( j, float( boneTextureWidth ) );\n float y = floor( j / float( boneTextureWidth ) );\n\n float dx = 1.0 / float( boneTextureWidth );\n float dy = 1.0 / float( boneTextureHeight );\n\n y = dy * ( y + 0.5 );\n\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n mat4 bone = mat4( v1, v2, v3, v4 );\n\n return bone;\n\n }\n\n #else\n\n uniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n mat4 getBoneMatrix( const in float i ) {\n\n mat4 bone = boneGlobalMatrices[ int(i) ];\n return bone;\n\n }\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n uniform float logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n #extension GL_EXT_frag_depth : enable\n varying float vFragDepth;\n\n #endif\n\n#endif",THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n uniform sampler2D alphaMap;\n\n#endif\n",THREE.UniformsUtils={merge:function(a){for(var b={},c=0;c dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment," outgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n #else\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n #endif\n float color = 1.0 - smoothstep( mNear, mFar, depth );\n gl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n vec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n res -= res.xxyz * bit_mask;\n return res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT\n gl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n #else\n gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n #endif\n}"].join("\n")}},THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3),e.size=f,e.array=new Float32Array(c*f),e.buffer=W.createBuffer(),e.buffer.belongsToAttribute=d,e.needsUpdate=!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function d(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,g=b.length;g>f;f++){var h=b[f],i=e[h];if(i>=0){var j=c[h];void 0!==j?(h=j.itemSize,W.bindBuffer(W.ARRAY_BUFFER,j.buffer),rb.enableAttribute(i),W.vertexAttribPointer(i,h,W.FLOAT,!1,0,d*h*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[h].length?W.vertexAttrib2fv(i,a.defaultAttributeValues[h]):3===a.defaultAttributeValues[h].length&&W.vertexAttrib3fv(i,a.defaultAttributeValues[h]))}}rb.disableUnusedAttributes()}function e(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function f(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function g(a,b){return b[0]-a[0]}function h(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",Mb));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",Nb),c instanceof THREE.BufferGeometry)X.info.memory.geometries++;else if(a instanceof THREE.Mesh)l(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=W.createBuffer(),c.__webglColorBuffer=W.createBuffer(),c.__webglLineDistanceBuffer=W.createBuffer(),X.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__lineDistanceArray=new Float32Array(1*d),c.__webglLineCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0,c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=W.createBuffer(),c.__webglColorBuffer=W.createBuffer(),X.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh){if(c instanceof THREE.BufferGeometry)m(Q,c,a);else if(c instanceof THREE.Geometry)for(var c=Tb[c.id],d=0,e=c.length;e>d;d++)m(Q,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?m(Q,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&R.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)P.push(a);else if(a instanceof THREE.Sprite)U.push(a);else if(a instanceof THREE.LensFlare)V.push(a);else if((c=Q[a.id])&&(!1===a.frustumCulled||!0===jb.intersectsObject(a)))for(d=0,e=c.length;e>d;d++){var f=c[d],g=f,i=g.object,j=g.buffer,k=i.geometry,i=i.material;i instanceof THREE.MeshFaceMaterial?(i=i.materials[k instanceof THREE.BufferGeometry?0:j.materialIndex],g.material=i,i.transparent?T.push(g):S.push(g)):i&&(g.material=i,i.transparent?T.push(g):S.push(g)),f.render=!0,!0===X.sortObjects&&(lb.setFromMatrixPosition(a.matrixWorld),lb.applyProjection(kb),f.z=lb.z)}}for(d=0,e=a.children.length;e>d;d++)h(a.children[d])}}function i(a,b,c,d,e){for(var f,g=0,h=a.length;h>g;g++){f=a[g];var i=f.object,j=f.buffer;if(u(i,b),e)f=e;else{if(f=f.material,!f)continue;q(f)}X.setMaterialFaces(f),j instanceof THREE.BufferGeometry?X.renderBufferDirect(b,c,d,f,j,i):X.renderBuffer(b,c,d,f,j,i)}}function j(a,b,c,d,e,f){for(var g,h=0,i=a.length;i>h;h++){g=a[h];var j=g.object;if(j.visible){if(f)g=f;else{if(g=g[b],!g)continue;q(g)}X.renderImmediateObject(c,d,e,g,j)}}}function k(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function l(a,b){var d=a.material,e=!1;if(void 0===Tb[b.id]||!0===b.groupsNeedUpdate){delete Q[a.id];for(var f,g,h=Tb,i=b.id,d=d instanceof THREE.MeshFaceMaterial,j=sb.get("OES_element_index_uint")?4294967296:65535,e={},k=b.morphTargets.length,l=b.morphNormals.length,n={},o=[],p=0,q=b.faces.length;q>p;p++){f=b.faces[p];var r=d?f.materialIndex:0;r in e||(e[r]={hash:r,counter:0}),f=e[r].hash+"_"+e[r].counter,f in n||(g={id:Ub++,faces3:[],materialIndex:r,vertices:0,numMorphTargets:k,numMorphNormals:l},n[f]=g,o.push(g)),n[f].vertices+3>j&&(e[r].counter+=1,f=e[r].hash+"_"+e[r].counter,f in n||(g={id:Ub++,faces3:[],materialIndex:r,vertices:0,numMorphTargets:k,numMorphNormals:l},n[f]=g,o.push(g))),n[f].faces3.push(p),n[f].vertices+=3}h[i]=o,b.groupsNeedUpdate=!1}for(h=Tb[b.id],i=0,d=h.length;d>i;i++){if(j=h[i],void 0===j.__webglVertexBuffer){if(e=j,e.__webglVertexBuffer=W.createBuffer(),e.__webglNormalBuffer=W.createBuffer(),e.__webglTangentBuffer=W.createBuffer(),e.__webglColorBuffer=W.createBuffer(),e.__webglUVBuffer=W.createBuffer(),e.__webglUV2Buffer=W.createBuffer(),e.__webglSkinIndicesBuffer=W.createBuffer(),e.__webglSkinWeightsBuffer=W.createBuffer(),e.__webglFaceBuffer=W.createBuffer(),e.__webglLineBuffer=W.createBuffer(),l=e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],k=0;l>k;k++)e.__webglMorphTargetsBuffers.push(W.createBuffer());if(l=e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],k=0;l>k;k++)e.__webglMorphNormalsBuffers.push(W.createBuffer());if(X.info.memory.geometries++,e=j,p=a,q=p.geometry,l=e.faces3,k=3*l.length,n=1*l.length,o=3*l.length,l=c(p,e),e.__vertexArray=new Float32Array(3*k),e.__normalArray=new Float32Array(3*k),e.__colorArray=new Float32Array(3*k),e.__uvArray=new Float32Array(2*k),121845?Uint32Array:Uint16Array,e.__typeArray=p,e.__faceArray=new p(3*n),e.__lineArray=new p(2*o),q=e.numMorphTargets)for(e.__morphTargetsArrays=[],p=0;q>p;p++)e.__morphTargetsArrays.push(new Float32Array(3*k));if(q=e.numMorphNormals)for(e.__morphNormalsArrays=[],p=0;q>p;p++)e.__morphNormalsArrays.push(new Float32Array(3*k));if(e.__webglFaceCount=3*n,e.__webglLineCount=2*o,l.attributes)for(n in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),n=void 0,l.attributes){var s,o=l.attributes[n],p={};for(s in o)p[s]=o[s];(!p.__webglInitialized||p.createUniqueBuffers)&&(p.__webglInitialized=!0,q=1,"v2"===p.type?q=2:"v3"===p.type?q=3:"v4"===p.type?q=4:"c"===p.type&&(q=3),p.size=q,p.array=new Float32Array(k*q),p.buffer=W.createBuffer(),p.buffer.belongsToAttribute=n,o.needsUpdate=!0,p.__original=o),e.__webglCustomAttributesList.push(p)}e.__inittedArrays=!0,b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=!0,e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&m(Q,j,a)}a.__webglActive=!0}function m(a,b,c){var d=c.id;a[d]=a[d]||[],a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function n(a){var b=a.geometry;if(b instanceof THREE.BufferGeometry)for(var d=b.attributes,e=b.attributesKeys,f=0,g=e.length;g>f;f++){var h=e[f],i=d[h],j="index"===h?W.ELEMENT_ARRAY_BUFFER:W.ARRAY_BUFFER;void 0===i.buffer?(i.buffer=W.createBuffer(),W.bindBuffer(j,i.buffer),W.bufferData(j,i.array,i instanceof THREE.DynamicBufferAttribute?W.DYNAMIC_DRAW:W.STATIC_DRAW),i.needsUpdate=!1):!0===i.needsUpdate&&(W.bindBuffer(j,i.buffer),void 0===i.updateRange||-1===i.updateRange.count?W.bufferSubData(j,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(W.bufferSubData(j,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),i.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===b.groupsNeedUpdate&&l(a,b);for(var k=Tb[b.id],f=0,m=k.length;m>f;f++){var n=k[f],q=c(a,n),r=q.attributes&&o(q);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||r){var s=n,t=a,u=W.DYNAMIC_DRAW,v=!b.dynamic,w=q;if(s.__inittedArrays){var x=!1==w instanceof THREE.MeshPhongMaterial&&w.shading===THREE.FlatShading,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,ab=void 0,bb=void 0,cb=void 0,db=void 0,eb=void 0,fb=void 0,gb=void 0,hb=void 0,ib=void 0,jb=void 0,kb=void 0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=void 0,yb=s.__vertexArray,zb=s.__uvArray,Ab=s.__uv2Array,Bb=s.__normalArray,Cb=s.__tangentArray,Db=s.__colorArray,Eb=s.__skinIndexArray,Fb=s.__skinWeightArray,Gb=s.__morphTargetsArrays,Hb=s.__morphNormalsArrays,Ib=s.__webglCustomAttributesList,Jb=void 0,Kb=s.__faceArray,Lb=s.__lineArray,Mb=t.geometry,Nb=Mb.elementsNeedUpdate,Ob=Mb.uvsNeedUpdate,Pb=Mb.normalsNeedUpdate,Qb=Mb.tangentsNeedUpdate,Rb=Mb.colorsNeedUpdate,Sb=Mb.morphTargetsNeedUpdate,Ub=Mb.vertices,Vb=s.faces3,Wb=Mb.faces,Xb=Mb.faceVertexUvs[0],Yb=Mb.faceVertexUvs[1],Zb=Mb.skinIndices,$b=Mb.skinWeights,_b=Mb.morphTargets,ac=Mb.morphNormals;if(Mb.verticesNeedUpdate){for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Ub[B.a],K=Ub[B.b],L=Ub[B.c],yb[mb]=J.x,yb[mb+1]=J.y,yb[mb+2]=J.z,yb[mb+3]=K.x,yb[mb+4]=K.y,yb[mb+5]=K.z,yb[mb+6]=L.x,yb[mb+7]=L.y,yb[mb+8]=L.z,mb+=9;W.bindBuffer(W.ARRAY_BUFFER,s.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,yb,u)}if(Sb)for(fb=0,gb=_b.length;gb>fb;fb++){for(y=vb=0,z=Vb.length;z>y;y++)jb=Vb[y],B=Wb[jb],J=_b[fb].vertices[B.a],K=_b[fb].vertices[B.b],L=_b[fb].vertices[B.c],hb=Gb[fb],hb[vb]=J.x,hb[vb+1]=J.y,hb[vb+2]=J.z,hb[vb+3]=K.x,hb[vb+4]=K.y,hb[vb+5]=K.z,hb[vb+6]=L.x,hb[vb+7]=L.y,hb[vb+8]=L.z,w.morphNormals&&(x?R=Q=P=ac[fb].faceNormals[jb]:(kb=ac[fb].vertexNormals[jb],P=kb.a,Q=kb.b,R=kb.c),ib=Hb[fb],ib[vb]=P.x,ib[vb+1]=P.y,ib[vb+2]=P.z,ib[vb+3]=Q.x,ib[vb+4]=Q.y,ib[vb+5]=Q.z,ib[vb+6]=R.x,ib[vb+7]=R.y,ib[vb+8]=R.z),vb+=9;W.bindBuffer(W.ARRAY_BUFFER,s.__webglMorphTargetsBuffers[fb]),W.bufferData(W.ARRAY_BUFFER,Gb[fb],u),w.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglMorphNormalsBuffers[fb]),W.bufferData(W.ARRAY_BUFFER,Hb[fb],u))}if($b.length){for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],V=$b[B.a],X=$b[B.b],Y=$b[B.c],Fb[ub]=V.x,Fb[ub+1]=V.y,Fb[ub+2]=V.z,Fb[ub+3]=V.w,Fb[ub+4]=X.x,Fb[ub+5]=X.y,Fb[ub+6]=X.z,Fb[ub+7]=X.w,Fb[ub+8]=Y.x,Fb[ub+9]=Y.y,Fb[ub+10]=Y.z,Fb[ub+11]=Y.w,Z=Zb[B.a],$=Zb[B.b],_=Zb[B.c],Eb[ub]=Z.x,Eb[ub+1]=Z.y,Eb[ub+2]=Z.z,Eb[ub+3]=Z.w,Eb[ub+4]=$.x,Eb[ub+5]=$.y,Eb[ub+6]=$.z,Eb[ub+7]=$.w,Eb[ub+8]=_.x,Eb[ub+9]=_.y,Eb[ub+10]=_.z,Eb[ub+11]=_.w,ub+=12;ub>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglSkinIndicesBuffer),W.bufferData(W.ARRAY_BUFFER,Eb,u),W.bindBuffer(W.ARRAY_BUFFER,s.__webglSkinWeightsBuffer),W.bufferData(W.ARRAY_BUFFER,Fb,u))}if(Rb){for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],E=B.vertexColors,F=B.color,3===E.length&&w.vertexColors===THREE.VertexColors?(S=E[0],T=E[1],U=E[2]):U=T=S=F,Db[tb]=S.r,Db[tb+1]=S.g,Db[tb+2]=S.b,Db[tb+3]=T.r,Db[tb+4]=T.g,Db[tb+5]=T.b,Db[tb+6]=U.r,Db[tb+7]=U.g,Db[tb+8]=U.b,tb+=9;tb>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,Db,u))}if(Qb&&Mb.hasTangents){for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],G=B.vertexTangents,M=G[0],N=G[1],O=G[2],Cb[rb]=M.x,Cb[rb+1]=M.y,Cb[rb+2]=M.z,Cb[rb+3]=M.w,Cb[rb+4]=N.x,Cb[rb+5]=N.y,Cb[rb+6]=N.z,Cb[rb+7]=N.w,Cb[rb+8]=O.x,Cb[rb+9]=O.y,Cb[rb+10]=O.z,Cb[rb+11]=O.w,rb+=12;W.bindBuffer(W.ARRAY_BUFFER,s.__webglTangentBuffer),W.bufferData(W.ARRAY_BUFFER,Cb,u)}if(Pb){for(y=0,z=Vb.length;z>y;y++)if(B=Wb[Vb[y]],C=B.vertexNormals,D=B.normal,3===C.length&&!1===x)for(ab=0;3>ab;ab++)cb=C[ab],Bb[qb]=cb.x,Bb[qb+1]=cb.y,Bb[qb+2]=cb.z,qb+=3;else for(ab=0;3>ab;ab++)Bb[qb]=D.x,Bb[qb+1]=D.y,Bb[qb+2]=D.z,qb+=3;W.bindBuffer(W.ARRAY_BUFFER,s.__webglNormalBuffer),W.bufferData(W.ARRAY_BUFFER,Bb,u)}if(Ob&&Xb){for(y=0,z=Vb.length;z>y;y++)if(A=Vb[y],H=Xb[A],void 0!==H)for(ab=0;3>ab;ab++)db=H[ab],zb[nb]=db.x,zb[nb+1]=db.y,nb+=2;nb>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglUVBuffer),W.bufferData(W.ARRAY_BUFFER,zb,u))}if(Ob&&Yb){for(y=0,z=Vb.length;z>y;y++)if(A=Vb[y],I=Yb[A],void 0!==I)for(ab=0;3>ab;ab++)eb=I[ab],Ab[ob]=eb.x,Ab[ob+1]=eb.y,ob+=2;ob>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglUV2Buffer),W.bufferData(W.ARRAY_BUFFER,Ab,u))}if(Nb){for(y=0,z=Vb.length;z>y;y++)Kb[pb]=lb,Kb[pb+1]=lb+1,Kb[pb+2]=lb+2,pb+=3,Lb[sb]=lb,Lb[sb+1]=lb+1,Lb[sb+2]=lb,Lb[sb+3]=lb+2,Lb[sb+4]=lb+1,Lb[sb+5]=lb+2,sb+=6,lb+=3;W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,s.__webglFaceBuffer),W.bufferData(W.ELEMENT_ARRAY_BUFFER,Kb,u),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,s.__webglLineBuffer),W.bufferData(W.ELEMENT_ARRAY_BUFFER,Lb,u)}if(Ib)for(ab=0,bb=Ib.length;bb>ab;ab++)if(Jb=Ib[ab],Jb.__original.needsUpdate){if(wb=0,1===Jb.size){if(void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],Jb.array[wb]=Jb.value[B.a],Jb.array[wb+1]=Jb.value[B.b],Jb.array[wb+2]=Jb.value[B.c],wb+=3;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)xb=Jb.value[Vb[y]],Jb.array[wb]=xb,Jb.array[wb+1]=xb,Jb.array[wb+2]=xb,wb+=3}else if(2===Jb.size){if(void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Jb.value[B.a],K=Jb.value[B.b],L=Jb.value[B.c],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=K.x,Jb.array[wb+3]=K.y,Jb.array[wb+4]=L.x,Jb.array[wb+5]=L.y,wb+=6;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)L=K=J=xb=Jb.value[Vb[y]],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=K.x,Jb.array[wb+3]=K.y,Jb.array[wb+4]=L.x,Jb.array[wb+5]=L.y,wb+=6}else if(3===Jb.size){var bc;if(bc="c"===Jb.type?["r","g","b"]:["x","y","z"],void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Jb.value[B.a],K=Jb.value[B.b],L=Jb.value[B.c],Jb.array[wb]=J[bc[0]],Jb.array[wb+1]=J[bc[1]],Jb.array[wb+2]=J[bc[2]],Jb.array[wb+3]=K[bc[0]],Jb.array[wb+4]=K[bc[1]],Jb.array[wb+5]=K[bc[2]],Jb.array[wb+6]=L[bc[0]],Jb.array[wb+7]=L[bc[1]],Jb.array[wb+8]=L[bc[2]],wb+=9;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)L=K=J=xb=Jb.value[Vb[y]],Jb.array[wb]=J[bc[0]],Jb.array[wb+1]=J[bc[1]],Jb.array[wb+2]=J[bc[2]],Jb.array[wb+3]=K[bc[0]],Jb.array[wb+4]=K[bc[1]],Jb.array[wb+5]=K[bc[2]],Jb.array[wb+6]=L[bc[0]],Jb.array[wb+7]=L[bc[1]],Jb.array[wb+8]=L[bc[2]],wb+=9; -else if("faceVertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)xb=Jb.value[Vb[y]],J=xb[0],K=xb[1],L=xb[2],Jb.array[wb]=J[bc[0]],Jb.array[wb+1]=J[bc[1]],Jb.array[wb+2]=J[bc[2]],Jb.array[wb+3]=K[bc[0]],Jb.array[wb+4]=K[bc[1]],Jb.array[wb+5]=K[bc[2]],Jb.array[wb+6]=L[bc[0]],Jb.array[wb+7]=L[bc[1]],Jb.array[wb+8]=L[bc[2]],wb+=9}else if(4===Jb.size)if(void 0===Jb.boundTo||"vertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)B=Wb[Vb[y]],J=Jb.value[B.a],K=Jb.value[B.b],L=Jb.value[B.c],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=J.z,Jb.array[wb+3]=J.w,Jb.array[wb+4]=K.x,Jb.array[wb+5]=K.y,Jb.array[wb+6]=K.z,Jb.array[wb+7]=K.w,Jb.array[wb+8]=L.x,Jb.array[wb+9]=L.y,Jb.array[wb+10]=L.z,Jb.array[wb+11]=L.w,wb+=12;else if("faces"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)L=K=J=xb=Jb.value[Vb[y]],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=J.z,Jb.array[wb+3]=J.w,Jb.array[wb+4]=K.x,Jb.array[wb+5]=K.y,Jb.array[wb+6]=K.z,Jb.array[wb+7]=K.w,Jb.array[wb+8]=L.x,Jb.array[wb+9]=L.y,Jb.array[wb+10]=L.z,Jb.array[wb+11]=L.w,wb+=12;else if("faceVertices"===Jb.boundTo)for(y=0,z=Vb.length;z>y;y++)xb=Jb.value[Vb[y]],J=xb[0],K=xb[1],L=xb[2],Jb.array[wb]=J.x,Jb.array[wb+1]=J.y,Jb.array[wb+2]=J.z,Jb.array[wb+3]=J.w,Jb.array[wb+4]=K.x,Jb.array[wb+5]=K.y,Jb.array[wb+6]=K.z,Jb.array[wb+7]=K.w,Jb.array[wb+8]=L.x,Jb.array[wb+9]=L.y,Jb.array[wb+10]=L.z,Jb.array[wb+11]=L.w,wb+=12;W.bindBuffer(W.ARRAY_BUFFER,Jb.buffer),W.bufferData(W.ARRAY_BUFFER,Jb.array,u)}v&&(delete s.__inittedArrays,delete s.__colorArray,delete s.__normalArray,delete s.__tangentArray,delete s.__uvArray,delete s.__uv2Array,delete s.__faceArray,delete s.__vertexArray,delete s.__lineArray,delete s.__skinIndexArray,delete s.__skinWeightArray)}}}b.verticesNeedUpdate=!1,b.morphTargetsNeedUpdate=!1,b.elementsNeedUpdate=!1,b.uvsNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.tangentsNeedUpdate=!1,q.attributes&&p(q)}else if(a instanceof THREE.Line){if(q=c(a,b),r=q.attributes&&o(q),b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||r){var cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc=W.DYNAMIC_DRAW,pc=b.vertices,qc=b.colors,rc=b.lineDistances,sc=pc.length,tc=qc.length,uc=rc.length,vc=b.__vertexArray,wc=b.__colorArray,xc=b.__lineDistanceArray,yc=b.colorsNeedUpdate,zc=b.lineDistancesNeedUpdate,Ac=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(cc=0;sc>cc;cc++)fc=pc[cc],gc=3*cc,vc[gc]=fc.x,vc[gc+1]=fc.y,vc[gc+2]=fc.z;W.bindBuffer(W.ARRAY_BUFFER,b.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,vc,oc)}if(yc){for(dc=0;tc>dc;dc++)hc=qc[dc],gc=3*dc,wc[gc]=hc.r,wc[gc+1]=hc.g,wc[gc+2]=hc.b;W.bindBuffer(W.ARRAY_BUFFER,b.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,wc,oc)}if(zc){for(ec=0;uc>ec;ec++)xc[ec]=rc[ec];W.bindBuffer(W.ARRAY_BUFFER,b.__webglLineDistanceBuffer),W.bufferData(W.ARRAY_BUFFER,xc,oc)}if(Ac)for(ic=0,jc=Ac.length;jc>ic;ic++)if(nc=Ac[ic],nc.needsUpdate&&(void 0===nc.boundTo||"vertices"===nc.boundTo)){if(gc=0,lc=nc.value.length,1===nc.size)for(kc=0;lc>kc;kc++)nc.array[kc]=nc.value[kc];else if(2===nc.size)for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.x,nc.array[gc+1]=mc.y,gc+=2;else if(3===nc.size)if("c"===nc.type)for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.r,nc.array[gc+1]=mc.g,nc.array[gc+2]=mc.b,gc+=3;else for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.x,nc.array[gc+1]=mc.y,nc.array[gc+2]=mc.z,gc+=3;else if(4===nc.size)for(kc=0;lc>kc;kc++)mc=nc.value[kc],nc.array[gc]=mc.x,nc.array[gc+1]=mc.y,nc.array[gc+2]=mc.z,nc.array[gc+3]=mc.w,gc+=4;W.bindBuffer(W.ARRAY_BUFFER,nc.buffer),W.bufferData(W.ARRAY_BUFFER,nc.array,oc),nc.needsUpdate=!1}}b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,b.lineDistancesNeedUpdate=!1,q.attributes&&p(q)}else if(a instanceof THREE.PointCloud){if(q=c(a,b),r=q.attributes&&o(q),b.verticesNeedUpdate||b.colorsNeedUpdate||r){var Bc,Cc,Dc,Ec,Fc,Gc,Hc,Ic,Jc,Kc,Lc,Mc=W.DYNAMIC_DRAW,Nc=b.vertices,Oc=Nc.length,Pc=b.colors,Qc=Pc.length,Rc=b.__vertexArray,Sc=b.__colorArray,Tc=b.colorsNeedUpdate,Uc=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(Bc=0;Oc>Bc;Bc++)Dc=Nc[Bc],Ec=3*Bc,Rc[Ec]=Dc.x,Rc[Ec+1]=Dc.y,Rc[Ec+2]=Dc.z;W.bindBuffer(W.ARRAY_BUFFER,b.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,Rc,Mc)}if(Tc){for(Cc=0;Qc>Cc;Cc++)Fc=Pc[Cc],Ec=3*Cc,Sc[Ec]=Fc.r,Sc[Ec+1]=Fc.g,Sc[Ec+2]=Fc.b;W.bindBuffer(W.ARRAY_BUFFER,b.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,Sc,Mc)}if(Uc)for(Gc=0,Hc=Uc.length;Hc>Gc;Gc++){if(Lc=Uc[Gc],Lc.needsUpdate&&(void 0===Lc.boundTo||"vertices"===Lc.boundTo))if(Jc=Lc.value.length,Ec=0,1===Lc.size)for(Ic=0;Jc>Ic;Ic++)Lc.array[Ic]=Lc.value[Ic];else if(2===Lc.size)for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.x,Lc.array[Ec+1]=Kc.y,Ec+=2;else if(3===Lc.size)if("c"===Lc.type)for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.r,Lc.array[Ec+1]=Kc.g,Lc.array[Ec+2]=Kc.b,Ec+=3;else for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.x,Lc.array[Ec+1]=Kc.y,Lc.array[Ec+2]=Kc.z,Ec+=3;else if(4===Lc.size)for(Ic=0;Jc>Ic;Ic++)Kc=Lc.value[Ic],Lc.array[Ec]=Kc.x,Lc.array[Ec+1]=Kc.y,Lc.array[Ec+2]=Kc.z,Lc.array[Ec+3]=Kc.w,Ec+=4;W.bindBuffer(W.ARRAY_BUFFER,Lc.buffer),W.bufferData(W.ARRAY_BUFFER,Lc.array,Mc),Lc.needsUpdate=!1}}b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,q.attributes&&p(q)}}function o(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function p(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function q(a){!0===a.transparent?rb.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):rb.setBlending(THREE.NoBlending),rb.setDepthTest(a.depthTest),rb.setDepthWrite(a.depthWrite),rb.setColorWrite(a.colorWrite),rb.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function r(a,b,c,d,e){var f,g,h,i;if(cb=0,d.needsUpdate){d.program&&Sb(d),d.addEventListener("dispose",Qb);var j=Vb[d.type];if(j){var k=THREE.ShaderLib[j];d.__webglShader={uniforms:THREE.UniformsUtils.clone(k.uniforms),vertexShader:k.vertexShader,fragmentShader:k.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var l=0,m=0,n=0,o=0,p=0,q=b.length;q>p;p++){var r=b[p];r.onlyShadow||!1===r.visible||(r instanceof THREE.DirectionalLight&&l++,r instanceof THREE.PointLight&&m++,r instanceof THREE.SpotLight&&n++,r instanceof THREE.HemisphereLight&&o++)}f=l,g=m,h=n,i=o;for(var u,y=0,z=0,A=b.length;A>z;z++){var D=b[z];D.castShadow&&(D instanceof THREE.SpotLight&&y++,D instanceof THREE.DirectionalLight&&!D.shadowCascade&&y++)}u=y;var E;if(Bb&&e&&e.skeleton&&e.skeleton.useVertexTexture)E=1024;else{var G=W.getParameter(W.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((G-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(H=Math.min(e.skeleton.bones.length,H),H0,shadowMapType:X.shadowMapType,shadowMapDebug:X.shadowMapDebug,shadowMapCascade:X.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},J=[];if(j?J.push(j):(J.push(d.fragmentShader),J.push(d.vertexShader)),void 0!==d.defines)for(var K in d.defines)J.push(K),J.push(d.defines[K]);for(K in I)J.push(K),J.push(I[K]);for(var L,N=J.join(),O=0,P=Y.length;P>O;O++){var Q=Y[O];if(Q.code===N){L=Q,L.usedTimes++;break}}void 0===L&&(L=new THREE.WebGLProgram(X,N,d,I),Y.push(L),X.info.memory.programs=Y.length),d.program=L;var R=L.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var S,T="morphTarget",U=0;Ujb;jb++)pb=b[jb],pb.onlyShadow||(qb=pb.color,tb=pb.intensity,ub=pb.distance,pb instanceof THREE.AmbientLight?pb.visible&&(vb+=qb.r,wb+=qb.g,xb+=qb.b):pb instanceof THREE.DirectionalLight?(_b+=1,pb.visible&&(mb.setFromMatrixPosition(pb.matrixWorld),lb.setFromMatrixPosition(pb.target.matrixWorld),mb.sub(lb),mb.normalize(),dc=3*Xb,Db[dc]=mb.x,Db[dc+1]=mb.y,Db[dc+2]=mb.z,v(Cb,dc,qb,tb),Xb+=1)):pb instanceof THREE.PointLight?(ac+=1,pb.visible&&(ec=3*Yb,v(Eb,ec,qb,tb),lb.setFromMatrixPosition(pb.matrixWorld),Fb[ec]=lb.x,Fb[ec+1]=lb.y,Fb[ec+2]=lb.z,Hb[Yb]=ub,Ib[Yb]=0===pb.distance?0:pb.decay,Yb+=1)):pb instanceof THREE.SpotLight?(bc+=1,pb.visible&&(fc=3*Zb,v(Jb,fc,qb,tb),mb.setFromMatrixPosition(pb.matrixWorld),Kb[fc]=mb.x,Kb[fc+1]=mb.y,Kb[fc+2]=mb.z,Lb[Zb]=ub,lb.setFromMatrixPosition(pb.target.matrixWorld),mb.sub(lb),mb.normalize(),Mb[fc]=mb.x,Mb[fc+1]=mb.y,Mb[fc+2]=mb.z,Nb[Zb]=Math.cos(pb.angle),Pb[Zb]=pb.exponent,Rb[Zb]=0===pb.distance?0:pb.decay,Zb+=1)):pb instanceof THREE.HemisphereLight&&(cc+=1,pb.visible&&(mb.setFromMatrixPosition(pb.matrixWorld),mb.normalize(),gc=3*$b,Wb[gc]=mb.x,Wb[gc+1]=mb.y,Wb[gc+2]=mb.z,rb=pb.color,sb=pb.groundColor,v(Tb,gc,rb,tb),v(Ub,gc,sb,tb),$b+=1)));for(jb=3*Xb,kb=Math.max(Cb.length,3*_b);kb>jb;jb++)Cb[jb]=0;for(jb=3*Yb,kb=Math.max(Eb.length,3*ac);kb>jb;jb++)Eb[jb]=0;for(jb=3*Zb,kb=Math.max(Jb.length,3*bc);kb>jb;jb++)Jb[jb]=0;for(jb=3*$b,kb=Math.max(Tb.length,3*cc);kb>jb;jb++)Tb[jb]=0;for(jb=3*$b,kb=Math.max(Ub.length,3*cc);kb>jb;jb++)Ub[jb]=0;yb.directional.length=Xb,yb.point.length=Yb,yb.spot.length=Zb,yb.hemi.length=$b,yb.ambient[0]=vb,yb.ambient[1]=wb,yb.ambient[2]=xb,nb=!1}if(eb){var hc=ob;hb.ambientLightColor.value=hc.ambient,hb.directionalLightColor.value=hc.directional.colors,hb.directionalLightDirection.value=hc.directional.positions,hb.pointLightColor.value=hc.point.colors,hb.pointLightPosition.value=hc.point.positions,hb.pointLightDistance.value=hc.point.distances,hb.pointLightDecay.value=hc.point.decays,hb.spotLightColor.value=hc.spot.colors,hb.spotLightPosition.value=hc.spot.positions,hb.spotLightDistance.value=hc.spot.distances,hb.spotLightDirection.value=hc.spot.directions,hb.spotLightAngleCos.value=hc.spot.anglesCos,hb.spotLightExponent.value=hc.spot.exponents,hb.spotLightDecay.value=hc.spot.decays,hb.hemisphereLightSkyColor.value=hc.hemi.skyColors,hb.hemisphereLightGroundColor.value=hc.hemi.groundColors,hb.hemisphereLightDirection.value=hc.hemi.positions,s(hb,!0)}else s(hb,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){hb.opacity.value=d.opacity,hb.diffuse.value=d.color,hb.map.value=d.map,hb.lightMap.value=d.lightMap,hb.specularMap.value=d.specularMap,hb.alphaMap.value=d.alphaMap,d.bumpMap&&(hb.bumpMap.value=d.bumpMap,hb.bumpScale.value=d.bumpScale),d.normalMap&&(hb.normalMap.value=d.normalMap,hb.normalScale.value.copy(d.normalScale));var ic;if(d.map?ic=d.map:d.specularMap?ic=d.specularMap:d.normalMap?ic=d.normalMap:d.bumpMap?ic=d.bumpMap:d.alphaMap&&(ic=d.alphaMap),void 0!==ic){var jc=ic.offset,kc=ic.repeat;hb.offsetRepeat.value.set(jc.x,jc.y,kc.x,kc.y)}hb.envMap.value=d.envMap,hb.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,hb.reflectivity.value=d.reflectivity,hb.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)hb.diffuse.value=d.color,hb.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)hb.diffuse.value=d.color,hb.opacity.value=d.opacity,hb.dashSize.value=d.dashSize,hb.totalSize.value=d.dashSize+d.gapSize,hb.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(hb.psColor.value=d.color,hb.opacity.value=d.opacity,hb.size.value=d.size,hb.scale.value=C.height/2,hb.map.value=d.map,null!==d.map){var lc=d.map.offset,mc=d.map.repeat;hb.offsetRepeat.value.set(lc.x,lc.y,mc.x,mc.y)}}else d instanceof THREE.MeshPhongMaterial?(hb.shininess.value=d.shininess,hb.emissive.value=d.emissive,hb.specular.value=d.specular,d.wrapAround&&hb.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(hb.emissive.value=d.emissive,d.wrapAround&&hb.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(hb.mNear.value=a.near,hb.mFar.value=a.far,hb.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(hb.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&hb.shadowMatrix)for(var nc=0,oc=0,pc=b.length;pc>oc;oc++){var qc=b[oc];qc.castShadow&&(qc instanceof THREE.SpotLight||qc instanceof THREE.DirectionalLight&&!qc.shadowCascade)&&(hb.shadowMap.value[nc]=qc.shadowMap,hb.shadowMapSize.value[nc]=qc.shadowMapSize,hb.shadowMatrix.value[nc]=qc.shadowMatrix,hb.shadowDarkness.value[nc]=qc.shadowDarkness,hb.shadowBias.value[nc]=qc.shadowBias,nc++)}for(var rc,sc,tc,uc=d.uniformsList,vc=0,wc=uc.length;wc>vc;vc++){var xc=uc[vc][0];if(!1!==xc.needsUpdate){var yc=xc.type,zc=xc.value,Ac=uc[vc][1];switch(yc){case"1i":W.uniform1i(Ac,zc);break;case"1f":W.uniform1f(Ac,zc);break;case"2f":W.uniform2f(Ac,zc[0],zc[1]);break;case"3f":W.uniform3f(Ac,zc[0],zc[1],zc[2]);break;case"4f":W.uniform4f(Ac,zc[0],zc[1],zc[2],zc[3]);break;case"1iv":W.uniform1iv(Ac,zc);break;case"3iv":W.uniform3iv(Ac,zc);break;case"1fv":W.uniform1fv(Ac,zc);break;case"2fv":W.uniform2fv(Ac,zc);break;case"3fv":W.uniform3fv(Ac,zc);break;case"4fv":W.uniform4fv(Ac,zc);break;case"Matrix3fv":W.uniformMatrix3fv(Ac,!1,zc);break;case"Matrix4fv":W.uniformMatrix4fv(Ac,!1,zc);break;case"i":W.uniform1i(Ac,zc);break;case"f":W.uniform1f(Ac,zc);break;case"v2":W.uniform2f(Ac,zc.x,zc.y);break;case"v3":W.uniform3f(Ac,zc.x,zc.y,zc.z);break;case"v4":W.uniform4f(Ac,zc.x,zc.y,zc.z,zc.w);break;case"c":W.uniform3f(Ac,zc.r,zc.g,zc.b);break;case"iv1":W.uniform1iv(Ac,zc);break;case"iv":W.uniform3iv(Ac,zc);break;case"fv1":W.uniform1fv(Ac,zc);break;case"fv":W.uniform3fv(Ac,zc);break;case"v2v":void 0===xc._array&&(xc._array=new Float32Array(2*zc.length));for(var Bc=0,Cc=zc.length;Cc>Bc;Bc++)tc=2*Bc,xc._array[tc]=zc[Bc].x,xc._array[tc+1]=zc[Bc].y;W.uniform2fv(Ac,xc._array);break;case"v3v":for(void 0===xc._array&&(xc._array=new Float32Array(3*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)tc=3*Bc,xc._array[tc]=zc[Bc].x,xc._array[tc+1]=zc[Bc].y,xc._array[tc+2]=zc[Bc].z;W.uniform3fv(Ac,xc._array);break;case"v4v":for(void 0===xc._array&&(xc._array=new Float32Array(4*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)tc=4*Bc,xc._array[tc]=zc[Bc].x,xc._array[tc+1]=zc[Bc].y,xc._array[tc+2]=zc[Bc].z,xc._array[tc+3]=zc[Bc].w;W.uniform4fv(Ac,xc._array);break;case"m3":W.uniformMatrix3fv(Ac,!1,zc.elements);break;case"m3v":for(void 0===xc._array&&(xc._array=new Float32Array(9*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)zc[Bc].flattenToArrayOffset(xc._array,9*Bc);W.uniformMatrix3fv(Ac,!1,xc._array);break;case"m4":W.uniformMatrix4fv(Ac,!1,zc.elements);break;case"m4v":for(void 0===xc._array&&(xc._array=new Float32Array(16*zc.length)),Bc=0,Cc=zc.length;Cc>Bc;Bc++)zc[Bc].flattenToArrayOffset(xc._array,16*Bc);W.uniformMatrix4fv(Ac,!1,xc._array);break;case"t":if(rc=zc,sc=t(),W.uniform1i(Ac,sc),!rc)continue;if(rc instanceof THREE.CubeTexture||rc.image instanceof Array&&6===rc.image.length){var Dc=rc,Ec=sc;if(6===Dc.image.length)if(Dc.needsUpdate){Dc.image.__webglTextureCube||(Dc.addEventListener("dispose",Ob),Dc.image.__webglTextureCube=W.createTexture(),X.info.memory.textures++),W.activeTexture(W.TEXTURE0+Ec),W.bindTexture(W.TEXTURE_CUBE_MAP,Dc.image.__webglTextureCube),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,Dc.flipY);for(var Fc=Dc instanceof THREE.CompressedTexture,Gc=Dc.image[0]instanceof THREE.DataTexture,Hc=[],Ic=0;6>Ic;Ic++)Hc[Ic]=!X.autoScaleCubemaps||Fc||Gc?Gc?Dc.image[Ic].image:Dc.image[Ic]:x(Dc.image[Ic],zb);var Jc=Hc[0],Kc=THREE.Math.isPowerOfTwo(Jc.width)&&THREE.Math.isPowerOfTwo(Jc.height),Lc=B(Dc.format),Mc=B(Dc.type);for(w(W.TEXTURE_CUBE_MAP,Dc,Kc),Ic=0;6>Ic;Ic++)if(Fc)for(var Nc,Oc=Hc[Ic].mipmaps,Pc=0,Qc=Oc.length;Qc>Pc;Pc++)Nc=Oc[Pc],Dc.format!==THREE.RGBAFormat&&Dc.format!==THREE.RGBFormat?-1Bc;Bc++)xc._array[Bc]=t();for(W.uniform1iv(Ac,xc._array),Bc=0,Cc=xc.value.length;Cc>Bc;Bc++)rc=xc.value[Bc],sc=xc._array[Bc],rc&&X.setTexture(rc,sc);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+yc)}}}}return W.uniformMatrix4fv(gb.modelViewMatrix,!1,e._modelViewMatrix.elements),gb.normalMatrix&&W.uniformMatrix3fv(gb.normalMatrix,!1,e._normalMatrix.elements),null!==gb.modelMatrix&&W.uniformMatrix4fv(gb.modelMatrix,!1,e.matrixWorld.elements),fb}function s(a,b){a.ambientLightColor.needsUpdate=b,a.directionalLightColor.needsUpdate=b,a.directionalLightDirection.needsUpdate=b,a.pointLightColor.needsUpdate=b,a.pointLightPosition.needsUpdate=b,a.pointLightDistance.needsUpdate=b,a.pointLightDecay.needsUpdate=b,a.spotLightColor.needsUpdate=b,a.spotLightPosition.needsUpdate=b,a.spotLightDistance.needsUpdate=b,a.spotLightDirection.needsUpdate=b,a.spotLightAngleCos.needsUpdate=b,a.spotLightExponent.needsUpdate=b,a.spotLightDecay.needsUpdate=b,a.hemisphereLightSkyColor.needsUpdate=b,a.hemisphereLightGroundColor.needsUpdate=b,a.hemisphereLightDirection.needsUpdate=b}function t(){var a=cb;return a>=wb&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+wb),cb+=1,a}function u(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function v(a,b,c,d){a[b]=c.r*d,a[b+1]=c.g*d,a[b+2]=c.b*d}function w(a,b,c){c?(W.texParameteri(a,W.TEXTURE_WRAP_S,B(b.wrapS)),W.texParameteri(a,W.TEXTURE_WRAP_T,B(b.wrapT)),W.texParameteri(a,W.TEXTURE_MAG_FILTER,B(b.magFilter)),W.texParameteri(a,W.TEXTURE_MIN_FILTER,B(b.minFilter))):(W.texParameteri(a,W.TEXTURE_WRAP_S,W.CLAMP_TO_EDGE),W.texParameteri(a,W.TEXTURE_WRAP_T,W.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),W.texParameteri(a,W.TEXTURE_MAG_FILTER,A(b.magFilter)),W.texParameteri(a,W.TEXTURE_MIN_FILTER,A(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )")),(c=sb.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");return d.width=Math.floor(a.width*c),d.height=Math.floor(a.height*c),d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height),THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a),d}return a}function y(a,b){W.bindRenderbuffer(W.RENDERBUFFER,a),b.depthBuffer&&!b.stencilBuffer?(W.renderbufferStorage(W.RENDERBUFFER,W.DEPTH_COMPONENT16,b.width,b.height),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(W.renderbufferStorage(W.RENDERBUFFER,W.DEPTH_STENCIL,b.width,b.height),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_STENCIL_ATTACHMENT,W.RENDERBUFFER,a)):W.renderbufferStorage(W.RENDERBUFFER,W.RGBA4,b.width,b.height)}function z(a){a instanceof THREE.WebGLRenderTargetCube?(W.bindTexture(W.TEXTURE_CUBE_MAP,a.__webglTexture),W.generateMipmap(W.TEXTURE_CUBE_MAP),W.bindTexture(W.TEXTURE_CUBE_MAP,null)):(W.bindTexture(W.TEXTURE_2D,a.__webglTexture),W.generateMipmap(W.TEXTURE_2D),W.bindTexture(W.TEXTURE_2D,null))}function A(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?W.NEAREST:W.LINEAR}function B(a){var b;if(a===THREE.RepeatWrapping)return W.REPEAT;if(a===THREE.ClampToEdgeWrapping)return W.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return W.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return W.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return W.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return W.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return W.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return W.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return W.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return W.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return W.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return W.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return W.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return W.BYTE;if(a===THREE.ShortType)return W.SHORT;if(a===THREE.UnsignedShortType)return W.UNSIGNED_SHORT;if(a===THREE.IntType)return W.INT;if(a===THREE.UnsignedIntType)return W.UNSIGNED_INT;if(a===THREE.FloatType)return W.FLOAT;if(b=sb.get("OES_texture_half_float"),null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return W.ALPHA;if(a===THREE.RGBFormat)return W.RGB;if(a===THREE.RGBAFormat)return W.RGBA;if(a===THREE.LuminanceFormat)return W.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return W.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return W.FUNC_ADD;if(a===THREE.SubtractEquation)return W.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return W.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return W.ZERO;if(a===THREE.OneFactor)return W.ONE;if(a===THREE.SrcColorFactor)return W.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return W.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return W.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return W.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return W.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return W.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return W.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return W.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return W.SRC_ALPHA_SATURATE;if(b=sb.get("WEBGL_compressed_texture_s3tc"),null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(b=sb.get("WEBGL_compressed_texture_pvrtc"),null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(b=sb.get("EXT_blend_minmax"),null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION),a=a||{};var C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),D=void 0!==a.context?a.context:null,E=1,F=void 0!==a.precision?a.precision:"highp",G=void 0!==a.alpha?a.alpha:!1,H=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,K=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,L=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,N=new THREE.Color(0),O=0,P=[],Q={},R=[],S=[],T=[],U=[],V=[];this.domElement=C,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1,this.shadowMapType=THREE.PCFShadowMap,this.shadowMapCullFace=THREE.CullFaceFront,this.shadowMapCascade=this.shadowMapDebug=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var W,X=this,Y=[],Z=null,$=null,_=-1,ab="",bb=null,cb=0,db=0,eb=0,fb=C.width,gb=C.height,hb=0,ib=0,jb=new THREE.Frustum,kb=new THREE.Matrix4,lb=new THREE.Vector3,mb=new THREE.Vector3,nb=!0,ob={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var pb={alpha:G,depth:H,stencil:I,antialias:J,premultipliedAlpha:K,preserveDrawingBuffer:L};if(W=D||C.getContext("webgl",pb)||C.getContext("experimental-webgl",pb),null===W){if(null!==C.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}C.addEventListener("webglcontextlost",function(a){a.preventDefault(),vb(),ub(),Q={}},!1)}catch(qb){THREE.error("THREE.WebGLRenderer: "+qb)}var rb=new THREE.WebGLState(W,B);void 0===W.getShaderPrecisionFormat&&(W.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var sb=new THREE.WebGLExtensions(W);sb.get("OES_texture_float"),sb.get("OES_texture_float_linear"),sb.get("OES_texture_half_float"),sb.get("OES_texture_half_float_linear"),sb.get("OES_standard_derivatives"),M&&sb.get("EXT_frag_depth");var tb=function(a,b,c,d){!0===K&&(a*=d,b*=d,c*=d),W.clearColor(a,b,c,d)},ub=function(){W.clearColor(0,0,0,1),W.clearDepth(1),W.clearStencil(0),W.enable(W.DEPTH_TEST),W.depthFunc(W.LEQUAL),W.frontFace(W.CCW),W.cullFace(W.BACK),W.enable(W.CULL_FACE),W.enable(W.BLEND),W.blendEquation(W.FUNC_ADD),W.blendFunc(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA),W.viewport(db,eb,fb,gb),tb(N.r,N.g,N.b,O)},vb=function(){bb=Z=null,ab="",_=-1,nb=!0,rb.reset()};ub(),this.context=W,this.state=rb;var wb=W.getParameter(W.MAX_TEXTURE_IMAGE_UNITS),xb=W.getParameter(W.MAX_VERTEX_TEXTURE_IMAGE_UNITS),yb=W.getParameter(W.MAX_TEXTURE_SIZE),zb=W.getParameter(W.MAX_CUBE_MAP_TEXTURE_SIZE),Ab=xb>0,Bb=Ab&&sb.get("OES_texture_float"),Cb=W.getShaderPrecisionFormat(W.VERTEX_SHADER,W.HIGH_FLOAT),Db=W.getShaderPrecisionFormat(W.VERTEX_SHADER,W.MEDIUM_FLOAT),Eb=W.getShaderPrecisionFormat(W.FRAGMENT_SHADER,W.HIGH_FLOAT),Fb=W.getShaderPrecisionFormat(W.FRAGMENT_SHADER,W.MEDIUM_FLOAT),Gb=function(){var a;return function(){if(void 0!==a)return a;if(a=[],sb.get("WEBGL_compressed_texture_pvrtc")||sb.get("WEBGL_compressed_texture_s3tc"))for(var b=W.getParameter(W.COMPRESSED_TEXTURE_FORMATS),c=0;c=0;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit,delete a._modelViewMatrix,delete a._normalMatrix,delete a.__webglActive})},Nb=function(a){if(a=a.target,a.removeEventListener("dispose",Nb),delete a.__webglInit,a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(W.deleteBuffer(c.buffer),delete c.buffer)}X.info.memory.geometries--}else if(b=Tb[a.id],void 0!==b){for(var c=0,d=b.length;d>c;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;g>f;f++)W.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){for(f=0,g=e.numMorphNormals;g>f;f++)W.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Rb(e)}delete Tb[a.id]}else Rb(a);ab=""},Ob=function(a){a=a.target,a.removeEventListener("dispose",Ob),a.image&&a.image.__webglTextureCube?(W.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(W.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit),X.info.memory.textures--},Pb=function(a){if(a=a.target,a.removeEventListener("dispose",Pb),a&&void 0!==a.__webglTexture){if(W.deleteTexture(a.__webglTexture),delete a.__webglTexture,a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)W.deleteFramebuffer(a.__webglFramebuffer[b]),W.deleteRenderbuffer(a.__webglRenderbuffer[b]);else W.deleteFramebuffer(a.__webglFramebuffer),W.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer,delete a.__webglRenderbuffer}X.info.memory.textures--},Qb=function(a){a=a.target,a.removeEventListener("dispose",Qb),Sb(a)},Rb=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),c=0,d=b.length;d>c;c++){var e=b[c];void 0!==a[e]&&(W.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)W.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}X.info.memory.geometries--},Sb=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;for(a=0,c=Y.length;c>a;a++)if(d=Y[a],d.program===b){d.usedTimes--,0===d.usedTimes&&(e=!0);break}if(!0===e){for(e=[],a=0,c=Y.length;c>a;a++)d=Y[a],d.program!==b&&e.push(d);Y=e,W.deleteProgram(b),X.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){if(rb.initAttributes(),a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=W.createBuffer()),a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=W.createBuffer()),a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=W.createBuffer()),a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=W.createBuffer()),a.hasPositions&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,a.positionArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.position),W.vertexAttribPointer(b.attributes.position,3,W.FLOAT,!1,0,0)),a.hasNormals){if(W.bindBuffer(W.ARRAY_BUFFER,a.__webglNormalBuffer),!1==c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,i,j,k,l,m,n,o=3*a.count;for(n=0;o>n;n+=9)m=a.normalArray,d=m[n],e=m[n+1],f=m[n+2],g=m[n+3],i=m[n+4],k=m[n+5],h=m[n+6],j=m[n+7],l=m[n+8],d=(d+g+h)/3,e=(e+i+j)/3,f=(f+k+l)/3,m[n]=d,m[n+1]=e,m[n+2]=f,m[n+3]=d,m[n+4]=e,m[n+5]=f,m[n+6]=d,m[n+7]=e,m[n+8]=f}W.bufferData(W.ARRAY_BUFFER,a.normalArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.normal),W.vertexAttribPointer(b.attributes.normal,3,W.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglUvBuffer),W.bufferData(W.ARRAY_BUFFER,a.uvArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.uv),W.vertexAttribPointer(b.attributes.uv,2,W.FLOAT,!1,0,0)),a.hasColors&&c.vertexColors!==THREE.NoColors&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,a.colorArray,W.DYNAMIC_DRAW),rb.enableAttribute(b.attributes.color),W.vertexAttribPointer(b.attributes.color,3,W.FLOAT,!1,0,0)),rb.disableUnusedAttributes(),W.drawArrays(W.TRIANGLES,0,a.count),a.count=0},this.renderBufferDirect=function(a,b,c,e,f,g){if(!1!==e.visible)if(n(g),a=r(a,b,c,e,g),b=!1,c="direct_"+f.id+"_"+a.id+"_"+(e.wireframe?1:0),c!==ab&&(ab=c,b=!0),b&&rb.initAttributes(),g instanceof THREE.Mesh){g=!0===e.wireframe?W.LINES:W.TRIANGLES;var h=f.attributes.index;if(h){var i,j;if(h.array instanceof Uint32Array&&sb.get("OES_element_index_uint")?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.vertices+=h.array.length,X.info.render.faces+=h.array.length/3;else{b=!0;for(var k=0,l=c.length;l>k;k++){var m=c[k].index;b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.vertices+=c[k].count,X.info.render.faces+=c[k].count/3}}}else b&&d(e,a,f,0),e=f.attributes.position,W.drawArrays(g,0,e.array.length/e.itemSize),X.info.render.calls++,X.info.render.vertices+=e.array.length/e.itemSize,X.info.render.faces+=e.array.length/(3*e.itemSize)}else if(g instanceof THREE.PointCloud)if(g=W.POINTS,h=f.attributes.index)if(h.array instanceof Uint32Array&&sb.get("OES_element_index_uint")?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.points+=h.array.length;else for(1k;k++)m=c[k].index,b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.points+=c[k].count;else if(b&&d(e,a,f,0),e=f.attributes.position,c=f.offsets,0===c.length)W.drawArrays(g,0,e.array.length/3),X.info.render.calls++,X.info.render.points+=e.array.length/3;else for(k=0,l=c.length;l>k;k++)W.drawArrays(g,c[k].index,c[k].count),X.info.render.calls++,X.info.render.points+=c[k].count;else if(g instanceof THREE.Line)if(g=g.mode===THREE.LineStrip?W.LINE_STRIP:W.LINES,rb.setLineWidth(e.linewidth*E),h=f.attributes.index)if(h.array instanceof Uint32Array?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.vertices+=h.array.length;else for(1k;k++)m=c[k].index,b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.vertices+=c[k].count;else if(b&&d(e,a,f,0),e=f.attributes.position,c=f.offsets,0===c.length)W.drawArrays(g,0,e.array.length/3),X.info.render.calls++,X.info.render.vertices+=e.array.length/3;else for(k=0,l=c.length;l>k;k++)W.drawArrays(g,c[k].index,c[k].count),X.info.render.calls++,X.info.render.vertices+=c[k].count},this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){if(n(f),c=r(a,b,c,d,f),b=c.attributes,a=!1,c=e.id+"_"+c.id+"_"+(d.wireframe?1:0),c!==ab&&(ab=c,a=!0),a&&rb.initAttributes(),!d.morphTargets&&0<=b.position)a&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglVertexBuffer),rb.enableAttribute(b.position),W.vertexAttribPointer(b.position,3,W.FLOAT,!1,0,0));else if(f.morphTargetBase){if(c=d.program.attributes,-1!==f.morphTargetBase&&0<=c.position?(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),rb.enableAttribute(c.position),W.vertexAttribPointer(c.position,3,W.FLOAT,!1,0,0)):0<=c.position&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglVertexBuffer),rb.enableAttribute(c.position),W.vertexAttribPointer(c.position,3,W.FLOAT,!1,0,0)),f.morphTargetForcedOrder.length)for(var h,i=0,j=f.morphTargetForcedOrder,k=f.morphTargetInfluences;i=0&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[j[i]]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),h=c["morphNormal"+i],h>=0&&d.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[j[i]]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=k[j[i]],i++;else{for(j=[],k=f.morphTargetInfluences,i=f.geometry.morphTargets,k.length>i.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),k.length=i.length),i=0,h=k.length;h>i;i++)j.push([k[i],i]);j.length>d.numSupportedMorphTargets?(j.sort(g),j.length=d.numSupportedMorphTargets):j.length>d.numSupportedMorphNormals?j.sort(g):0===j.length&&j.push([0,0]);for(var i=0,l=d.numSupportedMorphTargets;l>i;i++)if(j[i]){var m=j[i][1];h=c["morphTarget"+i],h>=0&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[m]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),h=c["morphNormal"+i],h>=0&&d.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[m]),rb.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=k[m]}else f.__webglMorphTargetInfluences[i]=0}null!==d.program.uniforms.morphTargetInfluences&&W.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,k=e.__webglCustomAttributesList.length;k>c;c++)j=e.__webglCustomAttributesList[c],0<=b[j.buffer.belongsToAttribute]&&(W.bindBuffer(W.ARRAY_BUFFER,j.buffer),rb.enableAttribute(b[j.buffer.belongsToAttribute]),W.vertexAttribPointer(b[j.buffer.belongsToAttribute],j.size,W.FLOAT,!1,0,0));0<=b.color&&(0d;d++){var m=R[d],n=m.object;n.visible&&(u(n,b),k(m))}a.overrideMaterial?(d=a.overrideMaterial,q(d),i(S,b,P,g,d),i(T,b,P,g,d),j(R,"",b,P,g,d)):(rb.setBlending(THREE.NoBlending),i(S,b,P,g,null),j(R,"opaque",b,P,g,null),i(T,b,P,g,null),j(R,"transparent",b,P,g,null)),Kb.render(a,b),Lb.render(a,b,hb,ib),c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&z(c),rb.setDepthTest(!0),rb.setDepthWrite(!0),rb.setColorWrite(!0)}},this.renderImmediateObject=function(a,b,c,d,e){var f=r(a,b,c,d,e);ab="",X.setMaterialFaces(d),e.immediateRenderCallback?e.immediateRenderCallback(f,W,jb):e.render(function(a){X.renderBufferImmediate(a,f,d)})};var Tb={},Ub=0,Vb={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?W.disable(W.CULL_FACE):(W.frontFace(b===THREE.FrontFaceDirectionCW?W.CW:W.CCW),W.cullFace(a===THREE.CullFaceBack?W.BACK:a===THREE.CullFaceFront?W.FRONT:W.FRONT_AND_BACK),W.enable(W.CULL_FACE))},this.setMaterialFaces=function(a){rb.setDoubleSided(a.side===THREE.DoubleSide),rb.setFlipSided(a.side===THREE.BackSide)},this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Ob),a.__webglTexture=W.createTexture(),X.info.memory.textures++),W.bindTexture(W.TEXTURE_2D,a.__webglTexture),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,a.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,a.unpackAlignment),a.image=x(a.image,yb);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=B(a.format),e=B(a.type);w(W.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0g;g++)b=f[g],W.texImage2D(W.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else W.texImage2D(W.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;h>g;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1g;g++)b=f[g],W.texImage2D(W.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else W.texImage2D(W.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&W.generateMipmap(W.TEXTURE_2D),a.needsUpdate=!1,a.onUpdate&&a.onUpdate()},this.setTexture=function(a,b){W.activeTexture(W.TEXTURE0+b),a.needsUpdate?X.uploadTexture(a):W.bindTexture(W.TEXTURE_2D,a.__webglTexture)},this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0),void 0===a.stencilBuffer&&(a.stencilBuffer=!0),a.addEventListener("dispose",Pb),a.__webglTexture=W.createTexture(),X.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=B(a.format),e=B(a.type);if(b){a.__webglFramebuffer=[],a.__webglRenderbuffer=[],W.bindTexture(W.TEXTURE_CUBE_MAP,a.__webglTexture),w(W.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=W.createFramebuffer(),a.__webglRenderbuffer[f]=W.createRenderbuffer(),W.texImage2D(W.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=W.TEXTURE_CUBE_MAP_POSITIVE_X+f;W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer[f]),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,h,g.__webglTexture,0),y(a.__webglRenderbuffer[f],a)}c&&W.generateMipmap(W.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=W.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:W.createRenderbuffer(),W.bindTexture(W.TEXTURE_2D,a.__webglTexture),w(W.TEXTURE_2D,a,c),W.texImage2D(W.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=W.TEXTURE_2D,W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_STENCIL_ATTACHMENT,W.RENDERBUFFER,a.__webglRenderbuffer):y(a.__webglRenderbuffer,a),c&&W.generateMipmap(W.TEXTURE_2D);b?W.bindTexture(W.TEXTURE_CUBE_MAP,null):W.bindTexture(W.TEXTURE_2D,null),W.bindRenderbuffer(W.RENDERBUFFER,null),W.bindFramebuffer(W.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=fb,a=gb,d=db,e=eb),b!==$&&(W.bindFramebuffer(W.FRAMEBUFFER,b),W.viewport(d,e,c,a),$=b),hb=c,ib=a},this.readRenderTargetPixels=function(a,b,c,d,e,f){if(a instanceof THREE.WebGLRenderTarget){if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==$&&(W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer),g=!0),W.checkFramebufferStatus(W.FRAMEBUFFER)===W.FRAMEBUFFER_COMPLETE?W.readPixels(b,c,d,e,W.RGBA,W.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),g&&W.bindFramebuffer(W.FRAMEBUFFER,$)}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},THREE.WebGLRenderTarget=function(a,b,c){this.width=a,this.height=b,c=c||{},this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter,this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.format=void 0!==c.format?c.format:THREE.RGBAFormat,this.type=void 0!==c.type?c.type:THREE.UnsignedByteType,this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0,this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0,this.generateMipmaps=!0,this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a,this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);return a.wrapS=this.wrapS,a.wrapT=this.wrapT,a.magFilter=this.magFilter,a.minFilter=this.minFilter,a.anisotropy=this.anisotropy,a.offset.copy(this.offset),a.repeat.copy(this.repeat),a.format=this.format,a.type=this.type,a.depthBuffer=this.depthBuffer,a.stencilBuffer=this.stencilBuffer,a.generateMipmaps=this.generateMipmaps,a.shareDepthFrom=this.shareDepthFrom,a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c),this.activeCubeFace=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case"EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}return null===d&&THREE.warn("THREE.WebGLRenderer: "+c+" extension not supported."),b[c]=d}},THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,i=d.attributes,j=d.__webglShader.vertexShader,k=d.__webglShader.fragmentShader,l=d.index0AttributeName;void 0===l&&!0===e.morphTargets&&(l="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var n="ENVMAP_TYPE_CUBE",o="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:n="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:n="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:n="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:o="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:p="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:p="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:p="ENVMAP_BLENDING_ADD"}}var q,r,s=0l;l++)m=h[l],u[m]=f.getUniformLocation(g,m);for(this.uniforms=u,l="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" "),h=0;hv;v++)u=e[v],i[u]=f.getAttribLocation(g,u);return this.attributes=i,this.attributesKeys=Object.keys(this.attributes),this.id=a++,this.code=c,this.usedTimes=1,this.program=g,this.vertexShader=j,this.fragmentShader=k,this}}(),THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var b=0;ba;a++)c[a]=0},this.enableAttribute=function(b){c[b]=1,0===d[b]&&(a.enableVertexAttribArray(b),d[b]=1)},this.disableUnusedAttributes=function(){for(var b=0,e=d.length;e>b;b++)d[b]!==c[b]&&(a.disableVertexAttribArray(b),d[b]=0)},this.setBlending=function(c,d,l,m,n,o,p){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),e=c),c===THREE.CustomBlending?(n=n||d,o=o||l,p=p||m,(d!==f||n!==i)&&(a.blendEquationSeparate(b(d),b(n)),f=d,i=n),(l!==g||m!==h||o!==j||p!==k)&&(a.blendFuncSeparate(b(l),b(m),b(o),b(p)),g=l,h=m,j=o,k=p)):k=j=i=h=g=f=null},this.setDepthTest=function(b){l!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),l=b)},this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)},this.setColorWrite=function(b){n!==b&&(a.colorMask(b,b,b,b),n=b)},this.setDoubleSided=function(b){o!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),o=b)},this.setFlipSided=function(b){p!==b&&(a.frontFace(b?a.CW:a.CCW),p=b)},this.setLineWidth=function(b){b!==q&&(a.lineWidth(b),q=b)},this.setPolygonOffset=function(b,c,d){r!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),r=b),!b||s===c&&t===d||(a.polygonOffset(c,d),s=c,t=d)},this.reset=function(){for(var a=0;aE;E++)if(A=16/w,B.set(A*x,A),G=b[E],t.set(G.matrixWorld.elements[12],G.matrixWorld.elements[13],G.matrixWorld.elements[14]),t.applyMatrix4(u.matrixWorldInverse),t.applyProjection(u.projectionMatrix),C.copy(t),D.x=C.x*y+y,D.y=C.y*z+z,p||0H;H++){var J=G.lensFlares[H];.001g;g++){var i=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld),p.push(i)}for(g=0,h=b.children.length;h>g;g++)e(a,b.children[g],d)}}var f,g,h,i,j=a.context,k=new THREE.Frustum,l=new THREE.Matrix4,m=new THREE.Vector3,n=new THREE.Vector3,o=new THREE.Vector3,p=[],q=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(q.uniforms);f=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader}),g=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0}),h=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,skinning:!0}),i=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0,skinning:!0}),f._shadowPass=!0,g._shadowPass=!0,h._shadowPass=!0,i._shadowPass=!0,this.render=function(c,q){if(!1!==a.shadowMapEnabled){var r,s,t,u,v,w,x,y,z=[];for(u=0,j.clearColor(1,1,1,1),j.disable(j.BLEND),j.enable(j.CULL_FACE),j.frontFace(j.CCW),j.cullFace(a.shadowMapCullFace===THREE.CullFaceFront?j.FRONT:j.BACK),a.state.setDepthTest(!0),r=0,s=b.length;s>r;r++)if(t=b[r],t.castShadow)if(t instanceof THREE.DirectionalLight&&t.shadowCascade)for(v=0;vC;C++)y[C]=new THREE.Vector3,w[C]=new THREE.Vector3;y=x.shadowCascadeNearZ[B],x=x.shadowCascadeFarZ[B],w[0].set(-1,-1,y),w[1].set(1,-1,y),w[2].set(-1,1,y),w[3].set(1,1,y),w[4].set(-1,-1,x),w[5].set(1,-1,x),w[6].set(-1,1,x),w[7].set(1,1,x),A.originalCamera=q,w=new THREE.Gyroscope,w.position.copy(t.shadowCascadeOffset),w.add(A),w.add(A.target),q.add(w),t.shadowCascadeArray[v]=A}B=t,y=v,x=B.shadowCascadeArray[y],x.position.copy(B.position),x.target.position.copy(B.target.position),x.lookAt(x.target),x.shadowCameraVisible=B.shadowCameraVisible,x.shadowDarkness=B.shadowDarkness,x.shadowBias=B.shadowCascadeBias[y],w=B.shadowCascadeNearZ[y],B=B.shadowCascadeFarZ[y],x=x.pointsFrustum,x[0].z=w,x[1].z=w,x[2].z=w,x[3].z=w,x[4].z=B,x[5].z=B,x[6].z=B,x[7].z=B,z[u]=A,u++}else z[u]=t,u++;for(r=0,s=z.length;s>r;r++){if(t=z[r],t.shadowMap||(v=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&(v=THREE.NearestFilter),t.shadowMap=new THREE.WebGLRenderTarget(t.shadowMapWidth,t.shadowMapHeight,{minFilter:v,magFilter:v,format:THREE.RGBAFormat}),t.shadowMapSize=new THREE.Vector2(t.shadowMapWidth,t.shadowMapHeight),t.shadowMatrix=new THREE.Matrix4),!t.shadowCamera){if(t instanceof THREE.SpotLight)t.shadowCamera=new THREE.PerspectiveCamera(t.shadowCameraFov,t.shadowMapWidth/t.shadowMapHeight,t.shadowCameraNear,t.shadowCameraFar);else{if(!(t instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",t);continue}t.shadowCamera=new THREE.OrthographicCamera(t.shadowCameraLeft,t.shadowCameraRight,t.shadowCameraTop,t.shadowCameraBottom,t.shadowCameraNear,t.shadowCameraFar)}c.add(t.shadowCamera),!0===c.autoUpdate&&c.updateMatrixWorld()}if(t.shadowCameraVisible&&!t.cameraHelper&&(t.cameraHelper=new THREE.CameraHelper(t.shadowCamera),c.add(t.cameraHelper)),t.isVirtual&&A.originalCamera==q){for(v=q,u=t.shadowCamera,w=t.pointsFrustum,x=t.pointsWorld,m.set(1/0,1/0,1/0),n.set(-1/0,-1/0,-1/0),B=0;8>B;B++)y=x[B],y.copy(w[B]),y.unproject(v),y.applyMatrix4(u.matrixWorldInverse),y.xn.x&&(n.x=y.x),y.yn.y&&(n.y=y.y),y.zn.z&&(n.z=y.z);u.left=m.x,u.right=n.x,u.top=n.y,u.bottom=m.y,u.updateProjectionMatrix()}for(u=t.shadowMap,w=t.shadowMatrix,v=t.shadowCamera,v.position.setFromMatrixPosition(t.matrixWorld),o.setFromMatrixPosition(t.target.matrixWorld),v.lookAt(o),v.updateMatrixWorld(),v.matrixWorldInverse.getInverse(v.matrixWorld),t.cameraHelper&&(t.cameraHelper.visible=t.shadowCameraVisible),t.shadowCameraVisible&&t.cameraHelper.update(),w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(v.projectionMatrix),w.multiply(v.matrixWorldInverse),l.multiplyMatrices(v.projectionMatrix,v.matrixWorldInverse),k.setFromMatrix(l),a.setRenderTarget(u),a.clear(),p.length=0,e(c,c,v),t=0,u=p.length;u>t;t++)x=p[t],w=x.object,x=x.buffer,B=w.material instanceof THREE.MeshFaceMaterial?w.material.materials[0]:w.material,y=void 0!==w.geometry.morphTargets&&0t;t++)x=d[t],w=x.object,w.visible&&w.castShadow&&(w._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,w.matrixWorld),a.renderImmediateObject(v,b,null,f,w))}r=a.getClearColor(),s=a.getClearAlpha(),j.clearColor(r.r,r.g,r.b,s),j.enable(j.BLEND),a.shadowMapCullFace===THREE.CullFaceFront&&j.cullFace(j.BACK),a.resetGLState()}}},THREE.SpritePlugin=function(a,b){function c(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=a.context,z=new THREE.Vector3,A=new THREE.Quaternion,B=new THREE.Vector3;this.render=function(C,D){if(0!==b.length){if(void 0===w){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),F=new Uint16Array([0,1,2,0,2,3]);u=y.createBuffer(),v=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,u),y.bufferData(y.ARRAY_BUFFER,E,y.STATIC_DRAW),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.bufferData(y.ELEMENT_ARRAY_BUFFER,F,y.STATIC_DRAW);var E=y.createProgram(),F=y.createShader(y.VERTEX_SHADER),G=y.createShader(y.FRAGMENT_SHADER);y.shaderSource(F,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),y.shaderSource(G,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),y.compileShader(F),y.compileShader(G),y.attachShader(E,F),y.attachShader(E,G),y.linkProgram(E),w=E,s=y.getAttribLocation(w,"position"),t=y.getAttribLocation(w,"uv"),d=y.getUniformLocation(w,"uvOffset"),e=y.getUniformLocation(w,"uvScale"),f=y.getUniformLocation(w,"rotation"),g=y.getUniformLocation(w,"scale"),h=y.getUniformLocation(w,"color"),i=y.getUniformLocation(w,"map"),j=y.getUniformLocation(w,"opacity"),k=y.getUniformLocation(w,"modelViewMatrix"),l=y.getUniformLocation(w,"projectionMatrix"),m=y.getUniformLocation(w,"fogType"),n=y.getUniformLocation(w,"fogDensity"),o=y.getUniformLocation(w,"fogNear"),p=y.getUniformLocation(w,"fogFar"),q=y.getUniformLocation(w,"fogColor"),r=y.getUniformLocation(w,"alphaTest"),E=document.createElement("canvas"),E.width=8,E.height=8,F=E.getContext("2d"),F.fillStyle="white",F.fillRect(0,0,8,8),x=new THREE.Texture(E),x.needsUpdate=!0}y.useProgram(w),y.enableVertexAttribArray(s),y.enableVertexAttribArray(t),y.disable(y.CULL_FACE),y.enable(y.BLEND),y.bindBuffer(y.ARRAY_BUFFER,u),y.vertexAttribPointer(s,2,y.FLOAT,!1,16,0),y.vertexAttribPointer(t,2,y.FLOAT,!1,16,8),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.uniformMatrix4fv(l,!1,D.projectionMatrix.elements),y.activeTexture(y.TEXTURE0),y.uniform1i(i,0),F=E=0,(G=C.fog)?(y.uniform3f(q,G.color.r,G.color.g,G.color.b),G instanceof THREE.Fog?(y.uniform1f(o,G.near),y.uniform1f(p,G.far),y.uniform1i(m,1),F=E=1):G instanceof THREE.FogExp2&&(y.uniform1f(n,G.density),y.uniform1i(m,2),F=E=2)):(y.uniform1i(m,0),F=E=0);for(var G=0,H=b.length;H>G;G++){var I=b[G];I._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,I.matrixWorld),I.z=-I._modelViewMatrix.elements[14]}b.sort(c);for(var J=[],G=0,H=b.length;H>G;G++){var I=b[G],K=I.material;y.uniform1f(r,K.alphaTest),y.uniformMatrix4fv(k,!1,I._modelViewMatrix.elements),I.matrixWorld.decompose(z,A,B),J[0]=B.x,J[1]=B.y,I=0,C.fog&&K.fog&&(I=F),E!==I&&(y.uniform1i(m,I),E=I),null!==K.map?(y.uniform2f(d,K.map.offset.x,K.map.offset.y),y.uniform2f(e,K.map.repeat.x,K.map.repeat.y)):(y.uniform2f(d,0,0),y.uniform2f(e,1,1)),y.uniform1f(j,K.opacity),y.uniform3f(h,K.color.r,K.color.g,K.color.b),y.uniform1f(f,K.rotation),y.uniform2fv(g,J),a.state.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst),a.state.setDepthTest(K.depthTest),a.state.setDepthWrite(K.depthWrite),K.map&&K.map.image&&K.map.image.width?a.setTexture(K.map,0):a.setTexture(x,0),y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}y.enable(y.CULL_FACE),a.resetGLState()}}},THREE.GeometryUtils={merge:function(a,b,c){THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry),a.merge(b,d,c)},center:function(a){return THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),a.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);return e.load(a,function(a){f.image=a,f.needsUpdate=!0,c&&c(f)},void 0,function(a){d&&d(a)}),f.sourceFile=a,f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a,g+=1,6===g&&(f.needsUpdate=!0,c&&c(f))},void 0,d)};for(var h=0,i=a.length;i>h;++h)b(h);return f},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");f.width=d,f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,i=g.createImageData(d,e),j=i.data,k=0;d>k;k++)for(var l=0;e>l;l++){var m=0>l-1?0:l-1,n=l+1>e-1?e-1:l+1,o=0>k-1?0:k-1,p=k+1>d-1?d-1:k+1,q=[],r=[0,0,h[4*(l*d+k)]/255*b];for(q.push([-1,0,h[4*(l*d+o)]/255*b]),q.push([-1,-1,h[4*(m*d+o)]/255*b]),q.push([0,-1,h[4*(m*d+k)]/255*b]),q.push([1,-1,h[4*(m*d+p)]/255*b]),q.push([1,0,h[4*(l*d+p)]/255*b]),q.push([1,1,h[4*(n*d+p)]/255*b]),q.push([0,1,h[4*(n*d+k)]/255*b]),q.push([-1,1,h[4*(n*d+o)]/255*b]),m=[],o=q.length,n=0;o>n;n++){var p=q[n],s=q[(n+1)%o],p=[p[0]-r[0],p[1]-r[1],p[2]-r[2]],s=[s[0]-r[0],s[1]-r[1],s[2]-r[2]];m.push(c([p[1]*s[2]-p[2]*s[1],p[2]*s[0]-p[0]*s[2],p[0]*s[1]-p[1]*s[0]]))}for(q=[0,0,0],n=0;nh;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;return a=new THREE.DataTexture(e,a,b,THREE.RGBFormat),a.needsUpdate=!0,a}},THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;e>d;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld),b.remove(a),c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld),a.applyMatrix(d),b.remove(a),c.add(a)}},THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(a){var b=a.familyName.toLowerCase();return this.faces[b]=this.faces[b]||{},this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{},this.faces[b][a.cssFontWeight][a.cssFontStyle]=a,this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;f>a;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=[],r=b.glyphs[a]||b.glyphs["?"];if(r){if(r.o)for(b=r._cachedOutline||(r._cachedOutline=r.o.split(" ")),i=b.length,a=0;i>a;)switch(h=b[a++]){case"m":h=b[a++]*c+d,j=b[a++]*c,e.moveTo(h,j);break;case"l":h=b[a++]*c+d,j=b[a++]*c,e.lineTo(h,j);break;case"q":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,e.quadraticCurveTo(m,n,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++){var s=f/g;THREE.Shape.Utils.b2(s,k,m,h),THREE.Shape.Utils.b2(s,l,n,j)}break;case"b":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,o=b[a++]*c+d,p=b[a++]*c,e.bezierCurveTo(m,n,o,p,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++)s=f/g,THREE.Shape.Utils.b3(s,k,m,o,h),THREE.Shape.Utils.b3(s,l,n,p,j)}return{offset:r.ha*c,path:e}}}},THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";for(THREE.FontUtils.size=void 0!==b.size?b.size:100,THREE.FontUtils.divisions=c,THREE.FontUtils.face=d,THREE.FontUtils.weight=e,THREE.FontUtils.style=f,c=THREE.FontUtils.drawText(a).paths,d=[],e=0,f=c.length;f>e;e++)Array.prototype.push.apply(d,c[e].toShapes());return d},function(a){var b=function(a){for(var b=a.length,c=0,d=b-1,e=0;b>e;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c};return a.Triangulate=function(a,c){var d=a.length;if(3>d)return null;var e,f,g,h=[],i=[],j=[];if(0f;f++)i[f]=f;else for(f=0;d>f;f++)i[f]=d-1-f;var k=2*d;for(f=d-1;d>2;){if(0>=k--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}e=f,e>=d&&(e=0),f=e+1,f>=d&&(f=0),g=f+1,g>=d&&(g=0);var l;a:{var m=l=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,m=a[i[e]].x,n=a[i[e]].y,o=a[i[f]].x,p=a[i[f]].y,q=a[i[g]].x,r=a[i[g]].y;if(1e-10>(o-m)*(r-n)-(p-n)*(q-m))l=!1;else{var u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,C=B=A=t=s=void 0,u=q-o,v=r-p,w=m-q,x=n-r,y=o-m,z=p-n;for(l=0;d>l;l++)if(s=a[i[l]].x,t=a[i[l]].y,!(s===m&&t===n||s===o&&t===p||s===q&&t===r)&&(A=s-m,B=t-n,C=s-o,D=t-p,s-=q,t-=r,C=u*D-v*C,A=y*B-z*A,B=w*t-x*s,C>=-1e-10&&B>=-1e-10&&A>=-1e-10)){l=!1;break a}l=!0}}if(l){for(h.push([a[i[e]],a[i[f]],a[i[g]]]),j.push([i[e],i[f],i[g]]),e=f,g=f+1;d>g;e++,g++)i[e]=i[g];d--,k=2*d}}return c?j:h},a.Triangulate.area=b,a}(THREE.FontUtils),self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace},THREE.typeface_js=self._typeface_js,THREE.Audio=function(a){THREE.Object3D.call(this),this.type="Audio",this.context=a.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;return c.open("GET",a,!0),c.responseType="arraybuffer",c.onload=function(){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a,b.autoplay&&b.play()})},c.send(),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)THREE.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer,a.loop=this.source.loop,a.onended=this.source.onended,a.connect(this.panner),a.start(0,this.startTime),this.isPlaying=!0,this.source=a}},THREE.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},THREE.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(a){this.source.loop=a},THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a},THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a},THREE.Audio.prototype.setVolume=function(a){this.gain.gain.value=a},THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b),a.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(a.x,a.y,a.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g){THREE.Object3D.prototype.updateMatrixWorld.call(this,g),g=this.context.listener;var h=this.up;this.matrixWorld.decompose(a,b,c),d.set(0,0,-1).applyQuaternion(b),e.subVectors(a,f),g.setPosition(a.x,a.y,a.z),g.setOrientation(d.x,d.y,d.z,h.x,h.y,h.z),g.setVelocity(e.x,e.y,e.z),f.copy(a)}}(),THREE.Curve=function(){},THREE.Curve.prototype.getPoint=function(){return THREE.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},THREE.Curve.prototype.getPointAt=function(a){return a=this.getUtoTmapping(a),this.getPoint(a)},THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPoint(b/a));return c},THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPointAt(b/a));return c},THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]},THREE.Curve.prototype.getLengths=function(a){if(a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b,c,d=[],e=this.getPoint(0),f=0;for(d.push(0),c=1;a>=c;c++)b=this.getPoint(c/a),f+=b.distanceTo(e),d.push(f),e=b;return this.cacheArcLengths=d},THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},THREE.Curve.prototype.getUtoTmapping=function(a,b){var c,d=this.getLengths(),e=0,f=d.length;c=b?b:a*d[f-1];for(var g,h=0,i=f-1;i>=h;)if(e=Math.floor(h+(i-h)/2),g=d[e]-c,0>g)h=e+1;else{if(!(g>0)){i=e;break}i=e-1}return e=i,d[e]==c?e/(f-1):(h=d[e],d=(e+(c-h)/(d[e+1]-h))/(f-1))},THREE.Curve.prototype.getTangent=function(a){var b=a-1e-4;return a+=1e-4,0>b&&(b=0),a>1&&(a=1),b=this.getPoint(b),this.getPoint(a).clone().sub(b).normalize()},THREE.Curve.prototype.getTangentAt=function(a){return a=this.getUtoTmapping(a),this.getTangent(a)},THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a),d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}},THREE.Curve.create=function(a,b){return a.prototype=Object.create(THREE.Curve.prototype),a.prototype.constructor=a,a.prototype.getPoint=b,a},THREE.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(a){this.curves.push(a)},THREE.CurvePath.prototype.checkConnection=function(){},THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))},THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null},THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a,b=[],c=0,d=this.curves.length;for(a=0;d>a;a++)c+=this.curves[a].getLength(),b.push(c);return this.cacheLengths=b},THREE.CurvePath.prototype.getBoundingBox=function(){var a,b,c,d,e,f,g=this.getPoints();a=b=Number.NEGATIVE_INFINITY,d=e=Number.POSITIVE_INFINITY;var h,i,j,k,l=g[0]instanceof THREE.Vector3;for(k=l?new THREE.Vector3:new THREE.Vector2,i=0,j=g.length;j>i;i++)h=g[i],h.x>a?a=h.x:h.xb?b=h.y:h.yc?c=h.z:h.zc;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c,d,e=this.getSpacedPoints(a);for(b||(b=this.bends),c=0,d=b.length;d>c;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c,d,e,f,g,h,i=this.getBoundingBox();for(c=0,d=a.length;d>c;c++)e=a[c],f=e.x,g=e.y,h=f/i.maxX,h=b.getUtoTmapping(h,f),f=b.getPoint(h),h=b.getTangent(h),h.set(-h.y,h.x).multiplyScalar(g),e.x=f.x+h.x,e.y=f.y+h.y;return a},THREE.Gyroscope=function(){THREE.Object3D.call(this)},THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype),THREE.Gyroscope.prototype.constructor=THREE.Gyroscope,THREE.Gyroscope.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Quaternion,f=new THREE.Vector3;return function(g){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||g)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(d,e,f),this.matrix.decompose(a,b,c),this.matrixWorld.compose(d,b,f)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,g=!0);for(var h=0,i=this.children.length;i>h;h++)this.children[h].updateMatrixWorld(g)}}(),THREE.Path=function(a){THREE.CurvePath.call(this),this.actions=[],a&&this.fromPoints(a)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},THREE.Path.prototype.fromPoints=function(a){this.moveTo(a[0].x,a[0].y); -for(var b=1,c=a.length;c>b;b++)this.lineTo(a[b].x,a[b].y)},THREE.Path.prototype.moveTo=function(){var a=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:a})},THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),d=this.actions[this.actions.length-1].args,d=new THREE.LineCurve(new THREE.Vector2(d[d.length-2],d[d.length-1]),new THREE.Vector2(a,b));this.curves.push(d),this.actions.push({action:THREE.PathActions.LINE_TO,args:c})},THREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args,f=new THREE.QuadraticBezierCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d));this.curves.push(f),this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:e})},THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args,h=new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,f));this.curves.push(h),this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:g})},THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a),c=new THREE.SplineCurve(c),this.curves.push(c),this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})},THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)},THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)},THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)},THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(i),i=i.getPoint(1),h.push(i.x),h.push(i.y),this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})},THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;a>c;c++)b.push(this.getPoint(c/a));return b},THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[];for(c=0,d=this.actions.length;d>c;c++)switch(e=this.actions[c],f=e.action,e=e.args,f){case THREE.PathActions.MOVE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.LINE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:for(g=e[2],h=e[3],k=e[0],l=e[1],0=e;e++)o=e/a,f=THREE.Shape.Utils.b2(o,m,k,g),o=THREE.Shape.Utils.b2(o,n,l,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.BEZIER_CURVE_TO:for(g=e[4],h=e[5],k=e[0],l=e[1],i=e[2],j=e[3],0=e;e++)o=e/a,f=THREE.Shape.Utils.b3(o,m,k,i,g),o=THREE.Shape.Utils.b3(o,n,l,j,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.CSPLINE_THRU:for(f=this.actions[c-1].args,o=[new THREE.Vector2(f[f.length-2],f[f.length-1])],f=a*e[0].length,o=o.concat(e[0]),o=new THREE.SplineCurve(o),e=1;f>=e;e++)p.push(o.getPointAt(e/f));break;case THREE.PathActions.ARC:for(g=e[0],h=e[1],l=e[2],i=e[3],f=e[4],k=!!e[5],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+l*Math.sin(o),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.ELLIPSE:for(g=e[0],h=e[1],l=e[2],j=e[3],i=e[4],f=e[5],k=!!e[6],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+j*Math.sin(o),p.push(new THREE.Vector2(f,o))}return c=p[p.length-1],1e-10>Math.abs(c.x-p[0].x)&&1e-10>Math.abs(c.y-p[0].y)&&p.splice(p.length-1,1),b&&p.push(p[0]),p},THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions,f.curves=e.curves,b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;c>f;e=f++){var g=b[e],h=b[f],i=h.x-g.x,j=h.y-g.y;if(1e-10j&&(g=b[f],i=-i,h=b[e],j=-j),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{if(e=j*(a.x-g.x)-i*(a.y-g.y),0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;for(b=0,c=a.length;c>b;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);return 0!=g.actions.length&&f.push(g),f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,i=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,i.push(h),i;var j=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),j=a?!j:j;h=[];var k,l=[],m=[],n=0;l[n]=void 0,m[n]=[];var o,p;for(o=0,p=e.length;p>o;o++)g=e[o],k=g.getPoints(),f=THREE.Shape.Utils.isClockWise(k),(f=a?!f:f)?(!j&&l[n]&&n++,l[n]={s:new THREE.Shape,p:k},l[n].s.actions=g.actions,l[n].s.curves=g.curves,j&&n++,m[n]=[]):m[n].push({h:g,p:k[0]});if(!l[0])return c(e);if(1g;g++)h[g]=[];for(g=0,e=l.length;e>g;g++)for(f=m[g],j=0;jo;o++)for(h=l[o].s,i.push(h),g=m[o],e=0,f=g.length;f>e;e++)h.holes.push(g[e].h);return i},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)},THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)},THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d},THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d},THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}},THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)},THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}},THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x0){if(0>n||n>m)return[];if(i=j*k-i*l,0>i||i>m)return[]}else{if(n>0||m>n)return[];if(i=j*k-i*l,i>0||m>i)return[]}return 0==i?!f||0!=n&&n!=m?[a]:[]:i==m?!f||0!=n&&n!=m?[b]:[]:0==n?[d]:n==m?[e]:(f=i/m,[{x:a.x+f*g,y:a.y+f*h}])}return 0!=n||j*k!=i*l?[]:(h=0==g&&0==h,i=0==i&&0==j,h&&i?a.x!=d.x||a.y!=d.y?[]:[a]:h?c(d,e,a)?[a]:[]:i?c(a,b,d)?[d]:[]:(0!=g?(a.x=i?m>a?[]:a==m?f?[]:[b]:d>=a?[b,h]:[b,j]:i>d?[]:i==d?f?[]:[g]:d>=a?[g,h]:[g,j]))}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x,c=c.y-a.y;var g=d.x-a.x;return d=d.y-a.y,a=e*c-f*b,e=e*d-f*g,1e-100?e>=0&&b>=0:e>=0||b>=0):e>0}var f,g,h,i,j,k={};for(h=a.concat(),f=0,g=b.length;g>f;f++)Array.prototype.push.apply(h,b[f]);for(f=0,g=h.length;g>f;f++)j=h[f].x+":"+h[f].y,void 0!==k[j]&&THREE.warn("THREE.Shape: Duplicate point",j),k[j]=f;f=function(a,b){function c(a,b){var c=q.length-1,d=a-1;0>d&&(d=c);var f=a+1;return f>c&&(f=0),(c=e(q[a],q[d],q[f],h[b]))?(c=h.length-1,d=b-1,0>d&&(d=c),f=b+1,f>c&&(f=0),(c=e(h[b],h[d],h[f],q[a]))?!0:!1):!1}function f(a,b){var c,e;for(c=0;ct;t++)r.push(t);n=0;for(var u=2*r.length;0u){console.log("Infinite Loop! Holes left:"+r.length+", Probably Hole outside Shape!");break}for(j=n;j=0)break;s[m]=!0}if(i>=0)break}}return q}(a,b);var l=THREE.FontUtils.Triangulate(f,!1);for(f=0,g=l.length;g>f;f++)for(i=l[f],h=0;3>h;h++)j=i[h].x+":"+i[h].y,j=k[j],void 0!==j&&(i[h]=j);return l.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}},THREE.LineCurve=function(a,b){this.v1=a,this.v2=b},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);return b.multiplyScalar(a).add(this.v1),b},THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)},THREE.LineCurve.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a,this.v1=b,this.v2=c},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b},THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;return b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y),b.normalize()},THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;return b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new THREE.Vector2(b,a)},THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;return b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b=new THREE.Vector2(b,a),b.normalize(),b},THREE.SplineCurve=function(a){this.points=void 0==a?[]:a},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector2;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c},THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a,this.aY=b,this.xRadius=c,this.yRadius=d,this.aStartAngle=e,this.aEndAngle=f,this.aClockwise=g},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;return 0>b&&(b+=2*Math.PI),b>2*Math.PI&&(b-=2*Math.PI),a=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b,b=new THREE.Vector2,b.x=this.aX+this.xRadius*Math.cos(a),b.y=this.aY+this.yRadius*Math.sin(a),b},THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a,this.v2=b},function(a){var b=new THREE.Vector3;return b.subVectors(this.v2,this.v1),b.multiplyScalar(a),b.add(this.v1),b}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a,this.v1=b,this.v2=c},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z),b}),THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z),b}),THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(c>0?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){THREE.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){THREE.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){THREE.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;ba.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){for(d={},c=0;ca;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var d=this.data.name,e=c.animationCache.animations,f=e[d];for(void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f),c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.timee.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e,f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a].animationCache;void 0!==c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c,d,e,g,h,i,j=[],k=[];return c=(a.length-1)*b,d=Math.floor(c),c-=d,j[0]=0===d?d:d-1,j[1]=d,j[2]=d>a.length-2?d:d+1,j[3]=d>a.length-3?d:d+2,d=a[j[0]],g=a[j[1]],h=a[j[2]],i=a[j[3]],j=c*c,e=c*j,k[0]=f(d[0],g[0],h[0],i[0],c,j,e),k[1]=f(d[1],g[1],h[1],i[1],c,j,e),k[2]=f(d[2],g[2],h[2],i[2],c,j,e),k},f=function(a,b,c,d,e,f,g){return a=.5*(c-a),d=.5*(d-b),(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length,(this.currentTime>f||0>this.currentTime)&&(this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop()),f=0;for(var g=this.hierarchy.length;g>f;f++)for(var h=this.hierarchy[f],i=h.animationCache.animations[this.data.name],j=h.animationCache.blending,k=0;3>k;k++){var l=this.keyTypes[k],m=i.prevKey[l],n=i.nextKey[l];if(0this.timeScale&&m.time>=this.currentTime){for(m=this.data.hierarchy[f].keys[0],n=this.getNextKeyWith(l,f,1);n.timem.index;)m=n,n=this.getNextKeyWith(l,f,n.index+1);i.prevKey[l]=m,i.nextKey[l]=n}var o=(this.currentTime-m.time)/(n.time-m.time),p=m[l],q=n[l];0>o&&(o=0),o>1&&(o=1),"pos"===l?this.interpolationType===THREE.AnimationHandler.LINEAR?(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.positionWeight),h.position.lerp(c,m),j.positionWeight+=this.weight):(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)&&(a[0]=this.getPrevKeyWith("pos",f,m.index-1).pos,a[1]=p,a[2]=q,a[3]=this.getNextKeyWith("pos",f,n.index+1).pos,o=.33*o+.33,n=e(a,o),m=this.weight/(this.weight+j.positionWeight),j.positionWeight+=this.weight,l=h.position,l.x+=(n[0]-l.x)*m,l.y+=(n[1]-l.y)*m,l.z+=(n[2]-l.z)*m,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(o=e(a,1.01*o),b.set(o[0],o[1],o[2]),b.sub(l),b.y=0,b.normalize(),o=Math.atan2(b.x,b.z),h.rotation.set(0,o,0))):"rot"===l?(THREE.Quaternion.slerp(p,q,d,o),0===j.quaternionWeight?(h.quaternion.copy(d),j.quaternionWeight=this.weight):(m=this.weight/(this.weight+j.quaternionWeight),THREE.Quaternion.slerp(h.quaternion,d,h.quaternion,m),j.quaternionWeight+=this.weight)):"scl"===l&&(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.scaleWeight),h.scale.lerp(c,m),j.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c0?c:0:c>=0?c:c+d.length;c>=0;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}},THREE.KeyFrameAnimation=function(a){this.root=a.node,this.data=THREE.AnimationHandler.init(a),this.hierarchy=THREE.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.loop=this.isPaused=!0,a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;ea;a++)b=this.hierarchy[a],c=this.data.hierarchy[a],void 0===c.animationCache&&(c.animationCache={},c.animationCache.prevKey=null,c.animationCache.nextKey=null,c.animationCache.originalMatrix=b.matrix),b=this.data.hierarchy[a].keys,b.length&&(c.animationCache.prevKey=b[0],c.animationCache.nextKey=b[1],this.startTime=Math.min(b[0].time,this.startTime),this.endTime=Math.max(b[b.length-1].time,this.endTime));this.update(0)}this.isPaused=!1,THREE.AnimationHandler.play(this)},stop:function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.stop(this);for(var a=0;aa&&(this.currentTime%=a),this.currentTime=Math.min(this.currentTime,a),a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a],d=this.data.hierarchy[a],e=d.keys,d=d.animationCache;if(e.length){var f=d.prevKey,g=d.nextKey;if(g.time<=this.currentTime){for(;g.timef.index;)f=g,g=e[f.index+1];d.prevKey=f,d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time),this.data.hierarchy[a].node.updateMatrix(),c.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(a,b,c){for(b=this.data.hierarchy[b].keys,c%=b.length;c=0?c:c+b.length;c>=0;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]}},THREE.MorphAnimation=function(a){this.mesh=a,this.frames=a.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.currentFrame=this.lastFrame=0,this.isPlaying=!1},THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration),a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!=this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b),c[b]=this.currentTime%a/a,c[this.lastFrame]=1-c[b]}}},THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,i){var j,k=h.widthSegments,l=h.heightSegments,m=e/2,n=f/2,o=h.vertices.length;"x"===a&&"y"===b||"y"===a&&"x"===b?j="z":"x"===a&&"z"===b||"z"===a&&"x"===b?(j="y",l=h.depthSegments):("z"===a&&"y"===b||"y"===a&&"z"===b)&&(j="x",k=h.depthSegments);var p=k+1,q=l+1,r=e/k,s=f/l,t=new THREE.Vector3;for(t[j]=g>0?1:-1,e=0;q>e;e++)for(f=0;p>f;f++){var u=new THREE.Vector3;u[a]=(f*r-m)*c,u[b]=(e*s-n)*d,u[j]=g,h.vertices.push(u)}for(e=0;l>e;e++)for(f=0;k>f;f++)n=f+p*e,a=f+p*(e+1),b=f+1+p*(e+1),c=f+1+p*e,d=new THREE.Vector2(f/k,1-e/l),g=new THREE.Vector2(f/k,1-(e+1)/l),j=new THREE.Vector2((f+1)/k,1-(e+1)/l),m=new THREE.Vector2((f+1)/k,1-e/l),n=new THREE.Face3(n+o,a+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([d,g,m]),n=new THREE.Face3(a+o,b+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([g.clone(),j,m.clone()])}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f},this.widthSegments=d||1,this.heightSegments=e||1,this.depthSegments=f||1;var h=this;d=a/2,e=b/2,f=c/2,g("z","y",-1,-1,c,b,d,0),g("z","y",1,-1,c,b,-d,1),g("x","z",1,1,a,c,e,2),g("x","z",1,-1,a,c,-e,3),g("x","y",1,-1,a,b,f,4),g("x","y",-1,-1,a,b,-f,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d},a=a||50,b=void 0!==b?Math.max(3,b):8,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);for(this.vertices.push(e),f.push(g),e=0;b>=e;e++){var h=new THREE.Vector3,i=c+e/b*d;h.x=a*Math.cos(i),h.y=a*Math.sin(i),this.vertices.push(h),f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}for(c=new THREE.Vector3(0,0,1),e=1;b>=e;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CubeGeometry=function(a,b,c,d,e,f){return THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new THREE.BoxGeometry(a,b,c,d,e,f)},THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h},a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,d=d||8,e=e||1,f=void 0!==f?f:!1,g=void 0!==g?g:0,h=void 0!==h?h:2*Math.PI;var i,j,k=c/2,l=[],m=[];for(j=0;e>=j;j++){var n=[],o=[],p=j/e,q=p*(b-a)+a;for(i=0;d>=i;i++){var r=i/d,s=new THREE.Vector3;s.x=q*Math.sin(r*h+g),s.y=-p*c+k,s.z=q*Math.cos(r*h+g),this.vertices.push(s),n.push(this.vertices.length-1),o.push(new THREE.Vector2(r,1-p))}l.push(n),m.push(o)}for(c=(b-a)/c,i=0;d>i;i++)for(0!==a?(g=this.vertices[l[0][i]].clone(),h=this.vertices[l[0][i+1]].clone()):(g=this.vertices[l[1][i]].clone(),h=this.vertices[l[1][i+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),j=0;e>j;j++){var n=l[j][i],o=l[j+1][i],p=l[j+1][i+1],q=l[j][i+1],r=g.clone(),s=g.clone(),t=h.clone(),u=h.clone(),v=m[j][i].clone(),w=m[j+1][i].clone(),x=m[j+1][i+1].clone(),y=m[j][i+1].clone();this.faces.push(new THREE.Face3(n,o,q,[r,s,u])),this.faceVertexUvs[0].push([v,w,y]),this.faces.push(new THREE.Face3(o,p,q,[s.clone(),t,u.clone()])),this.faceVertexUvs[0].push([w.clone(),x,y.clone()])}if(!1===f&&a>0)for(this.vertices.push(new THREE.Vector3(0,k,0)),i=0;d>i;i++)n=l[0][i],o=l[0][i+1],p=this.vertices.length-1,r=new THREE.Vector3(0,1,0),s=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),v=m[0][i].clone(),w=m[0][i+1].clone(),x=new THREE.Vector2(w.x,0),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);if(!1===f&&b>0)for(this.vertices.push(new THREE.Vector3(0,-k,0)),i=0;d>i;i++)n=l[e][i+1],o=l[e][i],p=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),s=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),v=m[e][i+1].clone(),w=m[e][i].clone(),x=new THREE.Vector2(w.x,1),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.ExtrudeGeometry=function(a,b){"undefined"!=typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;c>d;d++)this.addShape(a[d],b)},THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){return b||THREE.error("THREE.ExtrudeGeometry: vec does not exist"),b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1e-10=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,d>1e-10?f>1e-10&&(a=!0):-1e-10>d?-1e-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(O=a.length;0<=--O;){c=O,d=O-1,0>d&&(d=a.length-1);for(var e=0,f=s+2*p,e=0;f>e;e++){var g=M*e,h=M*(e+1),i=b+c+g,g=b+d+g,j=b+d+h,h=b+c+h,i=i+C,g=g+C,j=j+C,h=h+C;B.faces.push(new THREE.Face3(i,g,h,null,null,w)),B.faces.push(new THREE.Face3(g,j,h,null,null,w)),i=x.generateSideWallUV(B,i,g,j,h),B.faceVertexUvs[0].push([i[0],i[1],i[3]]),B.faceVertexUvs[0].push([i[1],i[2],i[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=C,b+=C,c+=C,B.faces.push(new THREE.Face3(a,b,c,null,null,v)),a=x.generateTopUV(B,a,b,c),B.faceVertexUvs[0].push(a)}var h,i,j,k,l,m=void 0!==b.amount?b.amount:100,n=void 0!==b.bevelThickness?b.bevelThickness:6,o=void 0!==b.bevelSize?b.bevelSize:n-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,u=!1,v=b.material,w=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;t&&(h=t.getSpacedPoints(s),u=!0,q=!1,i=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3),q||(o=n=p=0);var y,z,A,B=this,C=this.vertices.length,t=a.extractPoints(r),r=t.shape,D=t.holes; -if(t=!THREE.Shape.Utils.isClockWise(r)){for(r=r.reverse(),z=0,A=D.length;A>z;z++)y=D[z],THREE.Shape.Utils.isClockWise(y)&&(D[z]=y.reverse());t=!1}var E=THREE.Shape.Utils.triangulateShape(r,D),F=r;for(z=0,A=D.length;A>z;z++)y=D[z],r=r.concat(y);var G,H,I,J,K,L,M=r.length,N=E.length,t=[],O=0;for(I=F.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),t[O]=d(F[O],F[G],F[H]);var P,Q=[],R=t.concat();for(z=0,A=D.length;A>z;z++){for(y=D[z],P=[],O=0,I=y.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),P[O]=d(y[O],y[G],y[H]);Q.push(P),R=R.concat(P)}for(G=0;p>G;G++){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,-J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),f(K.x,K.y,-J)}for(H=o,O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[0]).multiplyScalar(K.x),j.copy(i.binormals[0]).multiplyScalar(K.y),l.copy(h[0]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,0);for(I=1;s>=I;I++)for(O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[I]).multiplyScalar(K.x),j.copy(i.binormals[I]).multiplyScalar(K.y),l.copy(h[I]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,m/s*I);for(G=p-1;G>=0;G--){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,m+J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),u?f(K.x,K.y+h[s-1].y,h[s-1].x+J):f(K.x,K.y,m+J)}!function(){if(q){var a;for(a=0*M,O=0;N>O;O++)L=E[O],g(L[2]+a,L[1]+a,L[0]+a);for(a=s+2*p,a*=M,O=0;N>O;O++)L=E[O],g(L[0]+a,L[1]+a,L[2]+a)}else{for(O=0;N>O;O++)L=E[O],g(L[2],L[1],L[0]);for(O=0;N>O;O++)L=E[O],g(L[0]+M*s,L[1]+M*s,L[2]+M*s)}}(),function(){var a=0;for(e(F,a),a+=F.length,z=0,A=D.length;A>z;z++)y=D[z],e(y,a),a+=y.length}()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){return a=a.vertices,b=a[b],c=a[c],d=a[d],[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){return a=a.vertices,b=a[b],c=a[c],d=a[d],e=a[e],.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,1-d.z),new THREE.Vector2(e.y,1-e.z)]}},THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this),this.type="ShapeGeometry",!1==a instanceof Array&&(a=[a]),this.addShapeList(a,b),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;d>c;c++)this.addShape(a[c],b);return this},THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c,d,e,f=b.material,g=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,h=this.vertices.length;c=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var i=c.shape,j=c.holes;if(!THREE.Shape.Utils.isClockWise(i))for(i=i.reverse(),c=0,d=j.length;d>c;c++)e=j[c],THREE.Shape.Utils.isClockWise(e)&&(j[c]=e.reverse());var k=THREE.Shape.Utils.triangulateShape(i,j);for(c=0,d=j.length;d>c;c++)e=j[c],i=i.concat(e);for(j=i.length,d=k.length,c=0;j>c;c++)e=i[c],this.vertices.push(new THREE.Vector3(e.x,e.y,0));for(c=0;d>c;c++)j=k[c],i=j[0]+h,e=j[1]+h,j=j[2]+h,this.faces.push(new THREE.Face3(i,e,j,null,null,f)),this.faceVertexUvs[0].push(g.generateTopUV(this,i,e,j))},THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:a,segments:b,phiStart:c,phiLength:d},b=b||12,c=c||0,d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;h>=g;g++)for(var i=c+g*f*d,j=Math.cos(i),k=Math.sin(i),i=0,l=a.length;l>i;i++){var m=a[i],n=new THREE.Vector3;n.x=j*m.x-k*m.y,n.y=k*m.x+j*m.y,n.z=m.z,this.vertices.push(n)}for(c=a.length,g=0,h=b;h>g;g++)for(i=0,l=a.length-1;l>i;i++){b=k=i+c*g,d=k+c;var j=k+1+c,k=k+1,m=g*f,n=i*e,o=m+f,p=n+e;this.faces.push(new THREE.Face3(b,d,k)),this.faceVertexUvs[0].push([new THREE.Vector2(m,n),new THREE.Vector2(o,n),new THREE.Vector2(m,p)]),this.faces.push(new THREE.Face3(d,j,k)),this.faceVertexUvs[0].push([new THREE.Vector2(o,n),new THREE.Vector2(o,p),new THREE.Vector2(m,p)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1,d=d||1;var g=c+1,h=d+1,i=a/c,j=b/d;b=new Float32Array(g*h*3),a=new Float32Array(g*h*3);for(var k=new Float32Array(g*h*2),l=0,m=0,n=0;h>n;n++)for(var o=n*j-f,p=0;g>p;p++)b[l]=p*i-e,b[l+1]=-o,a[l+2]=1,k[m]=p/c,k[m+1]=1-n/d,l+=3,m+=2;for(l=0,e=new(65535n;n++)for(p=0;c>p;p++)f=p+g*(n+1),h=p+1+g*(n+1),i=p+1+g*n,e[l]=p+g*n,e[l+1]=f,e[l+2]=i,e[l+3]=f,e[l+4]=h,e[l+5]=i,l+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1)),this.addAttribute("position",new THREE.BufferAttribute(b,3)),this.addAttribute("normal",new THREE.BufferAttribute(a,3)),this.addAttribute("uv",new THREE.BufferAttribute(k,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f},a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(1,d):8;var g,h=[],i=a,j=(b-a)/d;for(a=0;d+1>a;a++){for(g=0;c+1>g;g++){var k=new THREE.Vector3,l=e+g/c*f;k.x=i*Math.cos(l),k.y=i*Math.sin(l),this.vertices.push(k),h.push(new THREE.Vector2((k.x/b+1)/2,(k.y/b+1)/2))}i+=j}for(b=new THREE.Vector3(0,0,1),a=0;d>a;a++)for(e=a*(c+1),g=0;c>g;g++)f=l=g+e,j=l+c+1,k=l+c+2,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]),f=l,j=l+c+2,k=l+1,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,i)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g},a=a||50,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),d=void 0!==d?d:0,e=void 0!==e?e:2*Math.PI,f=void 0!==f?f:0,g=void 0!==g?g:Math.PI;var h,i,j=[],k=[];for(i=0;c>=i;i++){var l=[],m=[];for(h=0;b>=h;h++){var n=h/b,o=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+n*e)*Math.sin(f+o*g),p.y=a*Math.cos(f+o*g),p.z=a*Math.sin(d+n*e)*Math.sin(f+o*g),this.vertices.push(p),l.push(this.vertices.length-1),m.push(new THREE.Vector2(n,1-o))}j.push(l),k.push(m)}for(i=0;c>i;i++)for(h=0;b>h;h++){d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1];var l=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),n=this.vertices[f].clone().normalize(),o=this.vertices[g].clone().normalize(),p=k[i][h+1].clone(),q=k[i][h].clone(),r=k[i+1][h].clone(),s=k[i+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(p.x=(p.x+q.x)/2,this.faces.push(new THREE.Face3(d,f,g,[l,n,o])),this.faceVertexUvs[0].push([p,r,s])):Math.abs(this.vertices[f].y)===a?(r.x=(r.x+s.x)/2,this.faces.push(new THREE.Face3(d,e,f,[l,m,n])),this.faceVertexUvs[0].push([p,q,r])):(this.faces.push(new THREE.Face3(d,e,g,[l,m,o])),this.faceVertexUvs[0].push([p,q,s]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),n,o.clone()])),this.faceVertexUvs[0].push([q.clone(),r,s.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50,void 0===b.bevelThickness&&(b.bevelThickness=10),void 0===b.bevelSize&&(b.bevelSize=8),void 0===b.bevelEnabled&&(b.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,c,b),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e},a=a||100,b=b||40,c=c||8,d=d||6,e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],i=0;c>=i;i++)for(var j=0;d>=j;j++){var k=j/d*e,l=i/c*Math.PI*2;f.x=a*Math.cos(k),f.y=a*Math.sin(k);var m=new THREE.Vector3;m.x=(a+b*Math.cos(l))*Math.cos(k),m.y=(a+b*Math.cos(l))*Math.sin(k),m.z=b*Math.sin(l),this.vertices.push(m),g.push(new THREE.Vector2(j/d,i/c)),h.push(m.clone().sub(f).normalize())}for(i=1;c>=i;i++)for(j=1;d>=j;j++)a=(d+1)*i+j-1,b=(d+1)*(i-1)+j-1,e=(d+1)*(i-1)+j,f=(d+1)*i+j,k=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),k=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);return a*=b/c,b=Math.cos(a),f*=d*(2+b)*.5,g=d*(2+b)*g*.5,d=e*d*Math.sin(a)*.5,new THREE.Vector3(f,g,d)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g},a=a||100,b=b||40,c=c||64,d=d||8,e=e||2,f=f||3,g=g||1;for(var i=Array(c),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=0;c>m;++m){i[m]=Array(d);var n=m/c*2*e*Math.PI,o=h(n,f,e,a,g),n=h(n+.01,f,e,a,g);for(j.subVectors(n,o),k.addVectors(n,o),l.crossVectors(j,k),k.crossVectors(l,j),l.normalize(),k.normalize(),n=0;d>n;++n){var p=n/d*2*Math.PI,q=-b*Math.cos(p),p=b*Math.sin(p),r=new THREE.Vector3;r.x=o.x+q*k.x+p*l.x,r.y=o.y+q*k.y+p*l.y,r.z=o.z+q*k.z+p*l.z,i[m][n]=this.vertices.push(r)-1}}for(m=0;c>m;++m)for(n=0;d>n;++n)e=(m+1)%c,f=(n+1)%d,a=i[m][n],b=i[e][n],e=i[e][f],f=i[m][f],g=new THREE.Vector2(m/c,n/d),j=new THREE.Vector2((m+1)/c,n/d),k=new THREE.Vector2((m+1)/c,(n+1)/d),l=new THREE.Vector2(m/c,(n+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,j,l]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([j.clone(),k,l.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e},b=b||64,c=c||1,d=d||8,e=e||!1,f=f||THREE.TubeGeometry.NoTaper;var g,h,i,j,k,l,m,n,o,p,q=[],r=b+1,s=new THREE.Vector3;for(n=new THREE.TubeGeometry.FrenetFrames(a,b,e),o=n.normals,p=n.binormals,this.tangents=n.tangents,this.normals=o,this.binormals=p,n=0;r>n;n++)for(q[n]=[],i=n/(r-1),m=a.getPointAt(i),g=o[n],h=p[n],k=c*f(i),i=0;d>i;i++)j=i/d*2*Math.PI,l=-k*Math.cos(j),j=k*Math.sin(j),s.copy(m),s.x+=l*g.x+j*h.x,s.y+=l*g.y+j*h.y,s.z+=l*g.z+j*h.z,q[n][i]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(n=0;b>n;n++)for(i=0;d>i;i++)f=e?(n+1)%b:n+1,r=(i+1)%d,a=q[n][i],c=q[f][i],f=q[f][r],r=q[n][r],s=new THREE.Vector2(n/b,i/d),o=new THREE.Vector2((n+1)/b,i/d),p=new THREE.Vector2((n+1)/b,(i+1)/d),g=new THREE.Vector2(n/b,(i+1)/d),this.faces.push(new THREE.Face3(a,c,r)),this.faceVertexUvs[0].push([s,o,g]),this.faces.push(new THREE.Face3(c,f,r)),this.faceVertexUvs[0].push([o.clone(),p,g.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(){return 1},THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)},THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,i=new THREE.Matrix4;b+=1;var j,k,l;for(this.tangents=e,this.normals=f,this.binormals=g,j=0;b>j;j++)k=j/(b-1),e[j]=a.getTangentAt(k),e[j].normalize();for(f[0]=new THREE.Vector3,g[0]=new THREE.Vector3,a=Number.MAX_VALUE,j=Math.abs(e[0].x),k=Math.abs(e[0].y),l=Math.abs(e[0].z),a>=j&&(a=j,d.set(1,0,0)),a>=k&&(a=k,d.set(0,1,0)),a>=l&&d.set(0,0,1),h.crossVectors(e[0],d).normalize(),f[0].crossVectors(e[0],h),g[0].crossVectors(e[0],f[0]),j=1;b>j;j++)f[j]=f[j-1].clone(),g[j]=g[j-1].clone(),h.crossVectors(e[j-1],e[j]),1e-4j;j++)f[j].applyMatrix4(i.makeRotationAxis(e[j],d*j)),g[j].crossVectors(e[j],f[j])},THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;return a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5,b.uv=new THREE.Vector2(c,1-a),b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);i.faces.push(d),q.copy(a).add(b).add(c).divideScalar(3),d=Math.atan2(q.z,-q.x),i.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){for(var c=Math.pow(2,b),d=e(i.vertices[a.a]),g=e(i.vertices[a.b]),h=e(i.vertices[a.c]),j=[],k=0;c>=k;k++){j[k]=[];for(var l=e(d.clone().lerp(h,k/c)),m=e(g.clone().lerp(h,k/c)),n=c-k,o=0;n>=o;o++)j[k][o]=0==o&&k==c?l:e(l.clone().lerp(m,o/n))}for(k=0;c>k;k++)for(o=0;2*(c-k)-1>o;o++)d=Math.floor(o/2),0==o%2?f(j[k][d+1],j[k+1][d],j[k][d]):f(j[k][d+1],j[k+1][d+1],j[k+1][d])}function h(a,b,c){return 0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y)),0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y)),a.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:a,indices:b,radius:c,detail:d},c=c||1,d=d||0;for(var i=this,j=0,k=a.length;k>j;j+=3)e(new THREE.Vector3(a[j],a[j+1],a[j+2]));a=this.vertices;for(var l=[],m=j=0,k=b.length;k>j;j+=3,m++){var n=a[b[j]],o=a[b[j+1]],p=a[b[j+2]];l[m]=new THREE.Face3(n.index,o.index,p.index,[n.clone(),o.clone(),p.clone()])}for(var q=new THREE.Vector3,j=0,k=l.length;k>j;j++)g(l[j],d);for(j=0,k=this.faceVertexUvs[0].length;k>j;j++)b=this.faceVertexUvs[0][j],d=b[0].x,a=b[1].x,l=b[2].x,m=Math.max(d,Math.max(a,l)),n=Math.min(d,Math.min(a,l)),m>.9&&.1>n&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>l&&(b[2].x+=1));for(j=0,k=this.vertices.length;k>j;j++)this.vertices[j].multiplyScalar(c);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)},THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b),this.type="IcosahedronGeometry",this.parameters={radius:a,detail:b}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b},THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b),this.type="OctahedronGeometry",this.parameters={radius:a,detail:b}},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b),this.type="TetrahedronGeometry",this.parameters={radius:a,detail:b}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:a,slices:b,stacks:c};var d,e,f,g,h=this.vertices,i=this.faces,j=this.faceVertexUvs[0],k=b+1;for(d=0;c>=d;d++)for(g=d/c,e=0;b>=e;e++)f=e/b,f=a(f,g),h.push(f);var l,m,n,o;for(d=0;c>d;d++)for(e=0;b>e;e++)a=d*k+e,h=d*k+e+1,g=(d+1)*k+e+1,f=(d+1)*k+e,l=new THREE.Vector2(e/b,d/c),m=new THREE.Vector2((e+1)/b,d/c),n=new THREE.Vector2((e+1)/b,(d+1)/c),o=new THREE.Vector2(e/b,(d+1)/c),i.push(new THREE.Face3(a,h,f)),j.push([l,m,o]),i.push(new THREE.Face3(h,g,f)),j.push([m.clone(),n,o.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry,a.addAttribute("position",new THREE.BufferAttribute(b,3)),a.addAttribute("color",new THREE.BufferAttribute(c,3)),b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.Line.call(this,a,b,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);return b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),function(c,d,e,f,g,h){THREE.Object3D.call(this),void 0===f&&(f=16776960),void 0===e&&(e=1),void 0===g&&(g=.2*e),void 0===h&&(h=.2*g),this.position.copy(d),this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:f})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(c),this.setLength(e,g,h)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var a,b=new THREE.Vector3;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(b.set(c.z,0,-c.x).normalize(),a=Math.acos(c.y),this.quaternion.setFromAxisAngle(b,a))}}(),THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a),void 0===c&&(c=.2*b),this.line.scale.set(1,a-b,1),this.line.updateMatrix(),this.cone.scale.set(c,b,c),this.cone.position.y=a,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a),this.cone.material.color.set(a)},THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3)),THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==a&&this.update(a)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x,d[1]=b.y,d[2]=b.z,d[3]=c.x,d[4]=b.y,d[5]=b.z,d[6]=c.x,d[7]=b.y,d[8]=b.z,d[9]=c.x,d[10]=c.y,d[11]=b.z,d[12]=c.x,d[13]=c.y,d[14]=b.z,d[15]=b.x,d[16]=c.y,d[17]=b.z,d[18]=b.x,d[19]=c.y,d[20]=b.z,d[21]=b.x,d[22]=b.y,d[23]=b.z,d[24]=b.x,d[25]=b.y,d[26]=c.z,d[27]=c.x,d[28]=b.y,d[29]=c.z,d[30]=c.x,d[31]=b.y,d[32]=c.z,d[33]=c.x,d[34]=c.y,d[35]=c.z,d[36]=c.x,d[37]=c.y,d[38]=c.z,d[39]=b.x,d[40]=c.y,d[41]=c.z,d[42]=b.x,d[43]=c.y,d[44]=c.z,d[45]=b.x,d[46]=b.y,d[47]=c.z,d[48]=b.x,d[49]=b.y,d[50]=b.z,d[51]=b.x,d[52]=b.y,d[53]=c.z,d[54]=c.x,d[55]=b.y,d[56]=b.z,d[57]=c.x,d[58]=b.y,d[59]=c.z,d[60]=c.x,d[61]=c.y,d[62]=b.z,d[63]=c.x,d[64]=c.y,d[65]=c.z,d[66]=b.x,d[67]=c.y,d[68]=b.z,d[69]=b.x,d[70]=c.y,d[71]=c.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(a){function b(a,b,d){c(a,d),c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3),d.colors.push(new THREE.Color(b)),void 0===f[a]&&(f[a]=[]),f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200),b("n2","n4",16755200),b("n4","n3",16755200),b("n3","n1",16755200),b("f1","f2",16755200),b("f2","f4",16755200),b("f4","f3",16755200),b("f3","f1",16755200),b("n1","f1",16755200),b("n2","f2",16755200),b("n3","f3",16755200),b("n4","f4",16755200),b("p","n1",16711680),b("p","n2",16711680),b("p","n3",16711680),b("p","n4",16711680),b("u1","u2",43775),b("u2","u3",43775),b("u3","u1",43775),b("c","t",16777215),b("p","c",3355443),b("cn1","cn2",3355443),b("cn3","cn4",3355443),b("cf1","cf2",3355443),b("cf3","cf4",3355443),THREE.Line.call(this,d,e,THREE.LinePieces),this.camera=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=f,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){var a,b,c=new THREE.Vector3,d=new THREE.Camera,e=function(e,f,g,h){if(c.set(f,g,h).unproject(d),e=b[e],void 0!==e)for(f=0,g=e.length;g>f;f++)a.vertices[e[f]].copy(c)};return function(){a=this.geometry,b=this.pointMap,d.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-1,-1,-1),e("n2",1,-1,-1),e("n3",-1,1,-1),e("n4",1,1,-1),e("f1",-1,-1,1),e("f2",1,-1,1),e("f3",-1,1,1),e("f4",1,1,1),e("u1",.7,1.1,-1),e("u2",-.7,1.1,-1),e("u3",0,2,-1),e("cf1",-1,0,1),e("cf2",1,0,1),e("cf3",0,-1,1),e("cf4",0,1,1),e("cn1",-1,0,-1),e("cn2",1,0,-1),e("cn3",0,-1,-1),e("cn4",0,1,-1),a.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(c,d),this.add(this.lightPlane),c=new THREE.Geometry,c.vertices.push(new THREE.Vector3,new THREE.Vector3),d=new THREE.LineBasicMaterial({fog:!1}),d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(c,d),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld),b.setFromMatrixPosition(this.light.target.matrixWorld),c.subVectors(b,a),this.lightPlane.lookAt(c),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(c),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(a,b,c){b=void 0!==b?b:16777215,c=Math.cos(THREE.Math.degToRad(void 0!==c?c:1));var d,e=[0,0],f={},g=function(a,b){return a-b},h=["a","b","c"],i=new THREE.BufferGeometry;a.geometry instanceof THREE.BufferGeometry?(d=new THREE.Geometry,d.fromBufferGeometry(a.geometry)):d=a.geometry.clone(),d.mergeVertices(),d.computeFaceNormals();var j=d.vertices;d=d.faces;for(var k=0,l=0,m=d.length;m>l;l++)for(var n=d[l],o=0;3>o;o++){e[0]=n[h[o]],e[1]=n[h[(o+1)%3]],e.sort(g);var p=e.toString();void 0===f[p]?(f[p]={vert1:e[0],vert2:e[1],face1:l,face2:void 0},k++):f[p].face2=l}e=new Float32Array(6*k),g=0;for(p in f)h=f[p],(void 0===h.face2||d[h.face1].normal.dot(d[h.face2].normal)<=c)&&(k=j[h.vert1],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z,k=j[h.vert2],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z);i.addAttribute("position",new THREE.BufferAttribute(e,3)),THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:b}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,a=void 0!==c?c:16776960,d=void 0!==d?d:1,b=new THREE.Geometry,c=0;for(var e=this.object.geometry.faces.length;e>c;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;g>b;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e),a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}return this.geometry.verticesNeedUpdate=!0,this},THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var e=-a;a>=e;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a),this.color2.set(b),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(c,d),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(a,b){this.light=a,this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,c,d),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;ce;e++)for(var g=0,h=a[e].vertexNormals.length;h>g;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexNormals.length;l>k;k++){var m=j.vertexNormals[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,b=void 0!==c?c:255,d=void 0!==d?d:1,c=new THREE.Geometry,a=a.geometry.faces;for(var e=0,f=a.length;f>e;e++)for(var g=0,h=a[e].vertexTangents.length;h>g;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexTangents.length;l>k;k++){var m=j.vertexTangents[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).transformDirection(f).multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var i=a.geometry.vertices,j=a.geometry.faces,k=0,l=new Uint32Array(6*j.length),m=0,n=j.length;n>m;m++)for(var o=j[m],p=0;3>p;p++){d[0]=o[g[p]],d[1]=o[g[(p+1)%3]],d.sort(f);var q=d.toString();void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++)}for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)k=i[l[2*m+p]],g=6*m+3*p,d[g+0]=k.x,d[g+1]=k.y,d[g+2]=k.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){i=a.geometry.attributes.position.array,n=a.geometry.attributes.index.array,j=a.geometry.drawcalls,k=0,0===j.length&&(j=[{count:n.length,index:0,start:0}]);for(var l=new Uint32Array(2*n.length),o=0,r=j.length;r>o;++o)for(var p=j[o].start,q=j[o].count,g=j[o].index,m=p,s=p+q;s>m;m+=3)for(p=0;3>p;p++)d[0]=g+n[m+p],d[1]=g+n[m+(p+1)%3],d.sort(f),q=d.toString(),void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++);for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)g=6*m+3*p,k=3*l[2*m+p],d[g+0]=i[k],d[g+1]=i[k+1],d[g+2]=i[k+2]}else for(i=a.geometry.attributes.position.array,k=i.length/3,l=k/3,d=new Float32Array(6*k),m=0,n=l;n>m;m++)for(p=0;3>p;p++)g=18*m+6*p,l=9*m+3*p,d[g+0]=i[l],d[g+1]=i[l+1],d[g+2]=i[l+2],k=9*m+(p+1)%3*3,d[g+3]=i[k],d[g+4]=i[k+1],d[g+5]=i[k+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b),this.animationsMap={},this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[a]=b,this.animationsList.push(b)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b,c=/([a-z]+)_?(\d+)/,d={},e=this.geometry,f=0,g=e.morphTargets.length;g>f;f++){var h=e.morphTargets[f].name.match(c);if(h&&1h.end&&(h.end=f),b||(b=i)}}for(i in d)h=d[i],this.createAnimation(i,h.start,h.end,a);this.firstAnimation=b},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){(a=this.animationsMap[a])&&(a.direction=1,a.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){(a=this.animationsMap[a])&&(a.direction=-1,a.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;return(a=this.animationsMap[a])&&(b=a.time),b},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;return(a=this.animationsMap[a])&&(b=a.duration),b},THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(a){(a=this.animationsMap[a])&&(a.active=!1)},THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;c>b;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a,d.mirroredLoop?(d.time>d.duration||0>d.time)&&(d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)):(d.time%=d.duration,0>d.time&&(d.time+=d.duration));var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f),e=d.time%e/e,d.directionBackwards&&(e=1-e),this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}},Detector={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(a){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var a=document.createElement("div");return a.id="webgl-error-message",a.style.fontFamily="arial",a.style.fontSize="13px",a.style.fontWeight="normal",a.style.textAlign="center",a.style.background="#222222",a.style.color="#ffffff",a.style.padding="1.5em",a.style.width="100%",a.style.margin="5em auto 0",a.style.zIndex="500000",a.style.position="absolute",a.style.pointerEvents="all",this.webgl||(a.innerHTML=['Either your graphics card or your browser does not support WebGL.. Try Google Chrome
    ','or view a list of WebGL compatible browsers.'].join("\n")),a},addGetWebGLMessage:function(a){var b,c,d;a=a||{},b=void 0!==a.parent?a.parent:document.body,c=void 0!==a.id?a.id:"oldie",d=Detector.getWebGLErrorMessage(),d.id=c,b.appendChild(d)}},window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}());var THREEx=THREEx||{};THREEx.KeyboardState=function(){this.keyCodes={},this.modifiers={};var a=this;this._onKeyDown=function(b){a._onKeyChange(b,!0)},this._onKeyUp=function(b){a._onKeyChange(b,!1)},document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)},THREEx.KeyboardState.prototype.destroy=function(){document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)},THREEx.KeyboardState.MODIFIERS=["shift","ctrl","alt","meta"],THREEx.KeyboardState.ALIAS={left:37,up:38,right:39,down:40,space:32,pageup:33,pagedown:34,tab:9},THREEx.KeyboardState.prototype._onKeyChange=function(a,b){var c=a.keyCode;this.keyCodes[c]=b,this.modifiers.shift=a.shiftKey,this.modifiers.ctrl=a.ctrlKey,this.modifiers.alt=a.altKey,this.modifiers.meta=a.metaKey},THREEx.KeyboardState.prototype.pressed=function(a){for(var b=a.split("+"),c=0;cd&&(d=c),a.setSize(d,window.innerHeight),b.aspect=d/window.innerHeight,b.updateProjectionMatrix()};return window.addEventListener("resize",c,!1),{stop:function(){window.removeEventListener("resize",c)}}}; \ No newline at end of file diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index 0d6b00d..83bc9e0 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -1,21 +1,27 @@ // Component representing an individual legend item +/* eslint-disable react/react-in-jsx-scope */ + import * as constants from '../constants'; -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ export default class LegendItem extends React.Component { - constructor( props ) { + static propTypes = { + clickCallback: React.PropTypes.func.isRequired, + type: React.PropTypes.string.isRequired, + }; + constructor( props ) { super( props ); - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Styles - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ this.legendItemStyle = { height: 20, - paddingBottom: 5 + paddingBottom: 5, }; this.toggleLinkStyle = { @@ -24,9 +30,9 @@ export default class LegendItem extends React.Component { cursor: 'pointer', // Transition for when we become inactive WebkitTransition: 'color 500ms ease-out', - MozTransition: 'color 500ms ease-out', - OTransition: 'color 500ms ease-out', - transition: 'color 500ms ease-out', + MozTransition: 'color 500ms ease-out', + OTransition: 'color 500ms ease-out', + transition: 'color 500ms ease-out', }; this.circleStyle = { @@ -39,51 +45,53 @@ export default class LegendItem extends React.Component { marginBottom: -2, // Transition for when we become inactive WebkitTransition: 'background-color 500ms ease-out', - MozTransition: 'background-color 500ms ease-out', - OTransition: 'background-color 500ms ease-out', - transition: 'background-color 500ms ease-out', + MozTransition: 'background-color 500ms ease-out', + OTransition: 'background-color 500ms ease-out', + transition: 'background-color 500ms ease-out', }; // Set our initial state this.state = { active: true }; } - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Behaviours - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ handleLinkClick( e ) { e.preventDefault(); - let newActive = !this.state.active; + const newActive = !this.state.active; this.setState( { active: newActive } ); this.props.clickCallback( this.props.type, newActive ); return false; } - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Final Render - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ render() { let itemText = ''; - switch( this.props.type ) { - case "r": - itemText = 'Red'; - break; - case "o": - itemText = 'Orange'; - break; - case "g": - itemText = 'Green'; - break; - case "b": - itemText = 'Blue'; - break; - case "p": - itemText = 'Purple'; - break; + switch (this.props.type) { + case 'r': + itemText = 'Red'; + break; + case 'o': + itemText = 'Orange'; + break; + case 'g': + itemText = 'Green'; + break; + case 'b': + itemText = 'Blue'; + break; + case 'p': + itemText = 'Purple'; + break; + default: + itemText = 'Red'; } - if( !this.state.active ) { + if (!this.state.active) { this.toggleLinkStyle.color = '#555'; this.circleStyle.backgroundColor = '#555'; } else { @@ -91,7 +99,6 @@ export default class LegendItem extends React.Component { this.circleStyle.backgroundColor = '#' + constants.COLOUR_MAP[ this.props.type ].getHexString(); } - /* jshint ignore: start */ return (
  • @@ -99,6 +106,5 @@ export default class LegendItem extends React.Component {
  • ); - /* jshint ignore: end */ } } diff --git a/src/components/legend.jsx b/src/components/legend.jsx index f2c8bc0..1adcfe8 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -1,46 +1,51 @@ // Main component for the interactive legend + +/* eslint-disable react/react-in-jsx-scope */ + import LegendItem from './legend-item.jsx'; -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component definition - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ export default class Legend extends React.Component { - constructor( props ) { + static propTypes = { + clickCallback: React.PropTypes.func.isRequired, + types: React.PropTypes.array.isRequired, + }; + constructor( props ) { super( props ); - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Styles - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ this.headerStyle = { fontSize: 18, - marginTop: 0 + marginTop: 0, }; this.listStyle = { listStyleType: 'none', margin: 0, - padding: 0 + padding: 0, }; } - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Final Render - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ render() { - let callback = this.props.clickCallback; + const callback = this.props.clickCallback; - /* jshint ignore: start */ return (

    Legend

      - {this.props.types.map( function( type ) { - return( ); + {this.props.types.map( function mapTypes( type ) { + return (); })}
    ); - /* jshint ignore: end */ } } diff --git a/src/components/progress.jsx b/src/components/progress.jsx index 2fc048c..8478ad1 100644 --- a/src/components/progress.jsx +++ b/src/components/progress.jsx @@ -1,41 +1,27 @@ -/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * component definition * * This component inspired by: * http://jsfiddle.net/oskar/Aapn8/ and * https://github.com/pughpugh/react-countdown-clock - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -// Keep this in CommonJS syntax as third-party libraries aren't necessarily es6 -var tween = require( 'react-tween-state' ); + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -const Progress = React.createClass({ - mixins: [tween.Mixin], +/* eslint-disable react/react-in-jsx-scope */ - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Styles - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - canvasStyle: { display: 'block' }, - strokeStyle: { - radius: 25, - width: 5.0, - color: '#008EAF' - }, +const tween = require( 'react-tween-state' ); - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * Instance Variables - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - _canvas: null, - _context: null, +const Progress = React.createClass({ + mixins: [tween.Mixin], getInitialState() { return { currVal: 0.0 }; }, - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Component Methods - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ componentDidMount() { - if( this._canvas ) return; + if (this._canvas) return; this._canvas = this.getDOMNode(); this._context = this._canvas.getContext( '2d' ); @@ -54,37 +40,54 @@ const Progress = React.createClass({ this._updateProgress(); }, + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Styles + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + strokeStyle: { + radius: 25, + width: 5.0, + color: '#008EAF', + }, + canvasStyle: { display: 'block' }, + + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * Instance Variables + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + _canvas: null, + _context: null, + handleProgressUpdate( newVal ) { let onEndFunc; // Handles weird case where a currVal of 1.0 gives us no circle. Basically // we tween to a value that will appear to be a full circle and then as soon // as it's done, tween back to the start value (i.e. empty circle) - if( newVal === 1.0 ) { - newVal = 0.99999; + let modNewVal = newVal; + if (newVal === 1.0) { + modNewVal = 0.99999; onEndFunc = () => { this.tweenState( 'currVal', { endValue: 0.0 } ); }; } this.tweenState( 'currVal', { - endValue: newVal, - onEnd: onEndFunc + endValue: modNewVal, + onEnd: onEndFunc, }); }, - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Behaviours - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ _updateProgress() { - if( !this._context ) return; + if (!this._context) return; // Clear out our previous strokes this._context.clearRect( 0, 0, this._canvas.width, this._canvas.height ); // Basic idea: angle has to be between PI * -0.5 (12 o'clock) and PI * 1.5 // (full circle) - since a circle is 2PI radians - let endAngle = (2 * this.getTweeningValue( 'currVal' )) - 0.5; + const endAngle = (2 * this.getTweeningValue( 'currVal' )) - 0.5; this._context.beginPath(); this._context.arc( @@ -98,14 +101,14 @@ const Progress = React.createClass({ this._context.stroke(); }, - /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Final Render - *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ render() { /* jshint ignore: start */ - return( ); + return (); /* jshint ignore: end */ - } + }, }); export default Progress; diff --git a/src/constants.js b/src/constants.js index 092fc49..d63da15 100644 --- a/src/constants.js +++ b/src/constants.js @@ -4,9 +4,9 @@ export const COLOUR_MAP = { o: new THREE.Color( 0xFF7F00 ), b: new THREE.Color( 0x008EAF ), g: new THREE.Color( 0x00CA35 ), - p: new THREE.Color( 0xDC0068 ) + p: new THREE.Color( 0xDC0068 ), }; -export const COLOUR_TYPES = [ 'r', 'o','b', 'g', 'p' ]; +export const COLOUR_TYPES = [ 'r', 'o', 'b', 'g', 'p' ]; export const PARTICLE_SPEED = 0.22; export const NUM_TRAIL_PARTICLES = 12; diff --git a/src/dataloading.js b/src/dataloading.js index 38e469c..e88f513 100644 --- a/src/dataloading.js +++ b/src/dataloading.js @@ -1,5 +1,27 @@ import * as constants from './constants'; +// private helper method +function _getDataFromServer( path, callback ) { + // We're going to ask a file for the JSON data. + const xhr = new XMLHttpRequest(); + + // Where do we get the data? + xhr.open( 'GET', path, true ); + + // What do we do when we have it? + xhr.onreadystatechange = function readyStateChanged() { + // If we've received the data + if (xhr.readyState === 4 && xhr.status === 200) { + // Parse the JSON + const parsedData = JSON.parse( xhr.responseText ); + if (callback) { callback( parsedData ); } + } + }; + + // Begin request + xhr.send( null ); +} + export function loadWorldPins( latLonFile, callback ) { _getDataFromServer( latLonFile, callback ); } @@ -9,31 +31,31 @@ export function loadCountryCodes( isoFile, callback ) { } export function loadContentData( callback ) { - let filePath = encodeURI( "categories/All.json" ); + const filePath = encodeURI( 'categories/All.json' ); _getDataFromServer( filePath, callback ); } // Generates randomized src/dest data, for when you want something slightly // more "interesting" export function loadRandomizedContentData( numPoints, countries, callback ) { - let toRet = []; - let keys = Object.keys( countries ); - let now = Date.now(); + const toRet = []; + const keys = Object.keys( countries ); + const now = Date.now(); - for( let idx = 0; idx < numPoints; idx++ ) { - let srcIdx = Math.floor( Math.random() * keys.length ); + for (let idx = 0; idx < numPoints; idx++) { + const srcIdx = Math.floor( Math.random() * keys.length ); + const colourIdx = constants.COLOUR_TYPES[ Math.floor( Math.random() * constants.COLOUR_TYPES.length ) ]; let destIdx = Math.floor( Math.random() * keys.length ); - let colourIdx = constants.COLOUR_TYPES[ Math.floor( Math.random() * constants.COLOUR_TYPES.length ) ]; // generate a random timestamp within the last week - let backInTime = Math.floor( Math.random() * constants.ONE_WEEK_IN_MILLIS ); + const backInTime = Math.floor( Math.random() * constants.ONE_WEEK_IN_MILLIS ); // account for the rare cases where we get the same index - if( srcIdx === destIdx ) { + if (srcIdx === destIdx) { destIdx = (destIdx === keys.length - 1) ? 0 : destIdx + 1; } - let point = {}; + const point = {}; point.src = countries[ keys[ srcIdx ] ]; point.dest = countries[ keys[ destIdx ] ]; point.colour = colourIdx; @@ -43,25 +65,3 @@ export function loadRandomizedContentData( numPoints, countries, callback ) { callback( toRet ); } - -// private helper method -function _getDataFromServer( path, callback ) { - // We're going to ask a file for the JSON data. - let xhr = new XMLHttpRequest(); - - // Where do we get the data? - xhr.open( 'GET', path, true ); - - // What do we do when we have it? - xhr.onreadystatechange = function() { - // If we've received the data - if( xhr.readyState === 4 && xhr.status === 200 ) { - // Parse the JSON - let parsedData = JSON.parse( xhr.responseText ); - if( callback ) callback( parsedData ); - } - }; - - // Begin request - xhr.send( null ); -} diff --git a/src/geopins.js b/src/geopins.js index fa5547e..27ae9d4 100644 --- a/src/geopins.js +++ b/src/geopins.js @@ -1,15 +1,31 @@ +// Convert arbitrary lat/lon to a vector within the globe's space +export function convertLatLonToVector( lat, lon ) { + const rad = 100; + const calcLon = lon - 90; + + const phi = Math.PI / 2 - lat * Math.PI / 180 - Math.PI * 0.01; + const theta = 2 * Math.PI - calcLon * Math.PI / 180 + Math.PI * 0.06; + + const vec = new THREE.Vector3(); + vec.x = Math.sin(phi) * Math.cos(theta) * rad; + vec.y = Math.cos(phi) * rad; + vec.z = Math.sin(phi) * Math.sin(theta) * rad; + + return vec; +} + export function loadGeoData( latlonData, countryLookup ) { - let countryData = {}; + const countryData = {}; Object.keys( latlonData.countries ).forEach( ( key ) => { - let country = latlonData.countries[key]; + const country = latlonData.countries[key]; // save out country name and code info country.countryCode = key; country.countryName = countryLookup[key]; // take the lat lon from the data and convert this to 3d globe space - let center = convertLatLonToVector( country.lat, country.lon ); + const center = convertLatLonToVector( country.lat, country.lon ); country.center = center; countryData[country.countryName] = country; @@ -17,19 +33,3 @@ export function loadGeoData( latlonData, countryLookup ) { return countryData; } - -// Convert arbitrary lat/lon to a vector within the globe's space -export function convertLatLonToVector( lat, lon ) { - let rad = 100; - lon -= 90; - - let phi = Math.PI/2 - lat * Math.PI / 180 - Math.PI * 0.01; - let theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06; - - let vec = new THREE.Vector3(); - vec.x = Math.sin(phi) * Math.cos(theta) * rad; - vec.y = Math.cos(phi) * rad; - vec.z = Math.sin(phi) * Math.sin(theta) * rad; - - return vec; -} diff --git a/src/main.js b/src/main.js index c96c740..f5d8dc9 100644 --- a/src/main.js +++ b/src/main.js @@ -1,5 +1,5 @@ // 3rd Party libraries (keep this in CommonJS syntax since it's not yet es6) -var us = require( 'underscore' ); +const us = require( 'underscore' ); // All our dependencies import * as dataLoading from './dataloading'; @@ -33,81 +33,80 @@ let _minDataTimestamp = null; let _maxDataTimestamp = null; let _remainingData = null; +function getDataForTick( startTime, endTime ) { + // We could be smarter about this algorithm and keep track of our last + // index into the data to speed up processing, but given that we'll only + // be operating on a few thousand points at a time, we kept it fairly simple + + // If we're starting at the beginning, all our data is technically "remaining" + if (startTime === _minDataTimestamp.getTime()) { + _remainingData = _sampleData; + } + + // This will split our array into two pieces: those points which fall into + // the given "tick", and those that don't. Since time's advancing we know that + // once a point satisfies this condition we won't use it again until we loop + const partitions = us.partition( _remainingData, ( point ) => { + const time = point.time.getTime(); + return ( time >= startTime ) && ( time <= endTime ); + }); + + _remainingData = partitions[1]; + + return partitions[0]; +} + function startDataPump() { // How many times we'll be polling for data in a single "loop" - let numPollingIntervals = constants.VIZ_LOOP_LENGTH / constants.VIZ_POLLING_INTERVAL; + const numPollingIntervals = constants.VIZ_LOOP_LENGTH / constants.VIZ_POLLING_INTERVAL; // keep track of the current polling interval for the progress viz let currPollingInterval = 0; // How much "real time" elapses in the data set - let timeRangeInData = _maxDataTimestamp.getTime() - _minDataTimestamp.getTime(); + const timeRangeInData = _maxDataTimestamp.getTime() - _minDataTimestamp.getTime(); // How much "real time" we'll consume on each tick of the data pump - let tickLength = Math.floor( timeRangeInData / numPollingIntervals ); + const tickLength = Math.floor( timeRangeInData / numPollingIntervals ); // keep track of our last "start time" let lastTime = _minDataTimestamp.getTime(); window.setInterval( () => { - let dataToViz = getDataForTick( lastTime, lastTime + tickLength ); + const dataToViz = getDataForTick( lastTime, lastTime + tickLength ); lastTime += tickLength; currPollingInterval++; - if( lastTime >= _maxDataTimestamp.getTime() ) { + if (lastTime >= _maxDataTimestamp.getTime()) { lastTime = _minDataTimestamp.getTime(); currPollingInterval = 0; } visualize.initVisualization( dataToViz ); progressViz.handleProgressUpdate( currPollingInterval / numPollingIntervals ); - }, constants.VIZ_POLLING_INTERVAL ); } -function getDataForTick( startTime, endTime ) { - // We could be smarter about this algorithm and keep track of our last - // index into the data to speed up processing, but given that we'll only - // be operating on a few thousand points at a time, we kept it fairly simple - - // If we're starting at the beginning, all our data is technically "remaining" - if( startTime == _minDataTimestamp.getTime() ) { - _remainingData = _sampleData; - } - - // This will split our array into two pieces: those points which fall into - // the given "tick", and those that don't. Since time's advancing we know that - // once a point satisfies this condition we won't use it again until we loop - let partitions = us.partition( _remainingData, ( point ) => { - let time = point.time.getTime(); - return ( time >= startTime ) && ( time <= endTime ); - }); - - _remainingData = partitions[1]; - - return partitions[0]; -} - // All the initialization stuff for THREE.js function initScene() { scene = new THREE.Scene(); scene.matrixAutoUpdate = false; - let light1 = new THREE.SpotLight( 0xeeeeee, 3 ); + const light1 = new THREE.SpotLight( 0xeeeeee, 3 ); light1.position.x = 730; light1.position.y = 520; light1.position.z = 626; light1.castShadow = true; scene.add( light1 ); - let light2 = new THREE.SpotLight( 0xeeeeee, 1.5 ); + const light2 = new THREE.SpotLight( 0xeeeeee, 1.5 ); light2.position.x = -730; light2.position.y = 520; light2.position.z = 626; light2.castShadow = true; scene.add( light2 ); - let light3 = new THREE.PointLight( 0x222222, 14.8 ); + const light3 = new THREE.PointLight( 0x222222, 14.8 ); light3.position.x = 0; light3.position.y = -750; light3.position.z = 0; @@ -116,15 +115,15 @@ function initScene() { rotating = new THREE.Object3D(); scene.add( rotating ); - let shaderMaterial = new THREE.MeshLambertMaterial({ - map: THREE.ImageUtils.loadTexture( 'images/map_outline.png' ) + const shaderMaterial = new THREE.MeshLambertMaterial({ + map: THREE.ImageUtils.loadTexture( 'images/map_outline.png' ), }); // Create the backing (sphere) - let sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); + const sphere = new THREE.Mesh( new THREE.SphereGeometry( 100, 40, 40 ), shaderMaterial ); sphere.doubleSided = false; sphere.rotation.x = Math.PI; - sphere.rotation.y = -Math.PI/2; + sphere.rotation.y = -Math.PI / 2; sphere.rotation.z = Math.PI; rotating.add( sphere ); @@ -132,7 +131,7 @@ function initScene() { rotating.add( visualizationMesh ); // Set up our renderer - renderer = new THREE.WebGLRenderer({ antialias:false, alpha: true }); + renderer = new THREE.WebGLRenderer({ antialias: false, alpha: true }); renderer.setSize( window.innerWidth, window.innerHeight ); renderer.autoClear = false; renderer.sortObjects = false; @@ -153,11 +152,11 @@ function initScene() { // firefox masterContainer.addEventListener( 'DOMMouseScroll', (e) => { - let evt = window.event || e; + const evt = window.event || e; mouseKeyboard.onMouseWheel( camera, evt ); }, false ); - THREEx.WindowResize( renderer, camera ); + THREEx.WindowResize( renderer, camera ); // eslint-disable-line new-cap // Get the globe spinning (defined in mousekeyboard.js) mouseKeyboard.startAutoRotate(); @@ -179,7 +178,7 @@ function reactInit() { React.render( React.createElement( Legend, { types: constants.COLOUR_TYPES, - clickCallback: visualize.toggleVisualizationType + clickCallback: visualize.toggleVisualizationType, }), document.getElementById( 'legend' ) ); @@ -192,10 +191,10 @@ function reactInit() { ); } -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Startup code -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if( !Detector.webgl ) { +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +if (!Detector.webgl) { Detector.addGetWebGLMessage(); } else { initScene(); @@ -217,19 +216,18 @@ if( !Detector.webgl ) { _latLonData = latLonData; dataLoading.loadRandomizedContentData( 2000, _countryLookup, ( sampleData ) => { // need to convert all the timestamps to JS dates - sampleData = us.map( sampleData, function( point ) { - if( typeof point.time === Date ) { - return point; - } else { - point.time = new Date( point.time ); + const mappedSampleData = us.map( sampleData, function mapSampleData( point ) { + if (typeof point.time === Date) { return point; } + point.time = new Date( point.time ); + return point; }); - _sampleData = us.sortBy( sampleData, 'time' ); + _sampleData = us.sortBy( mappedSampleData, 'time' ); _minDataTimestamp = _sampleData[0].time; _maxDataTimestamp = _sampleData[ _sampleData.length - 1 ].time; - let countryData = geopins.loadGeoData( _latLonData, _countryLookup ); + const countryData = geopins.loadGeoData( _latLonData, _countryLookup ); visualize.buildDataVizGeometries( _sampleData, countryData ); animate(); diff --git a/src/mousekeyboard.js b/src/mousekeyboard.js index 13f3019..cb207de 100644 --- a/src/mousekeyboard.js +++ b/src/mousekeyboard.js @@ -1,32 +1,30 @@ import * as vizLines from './visualize_lines'; // Ugly variable declarations -const rotateXMax = 90 * Math.PI/180; +const rotateXMax = 90 * Math.PI / 180; -let rotateVX = 0.35 * Math.PI/180; +let rotateVX = 0.35 * Math.PI / 180; let mouseX = 0; let mouseY = 0; let pmouseX = 0; let pmouseY = 0; -let pressX = 0; -let pressY = 0; let dragging = false; let rotateVY = 0; let rotateTargetX = 0; let rotateTargetY = 0; let _autoRotateId = null; -let keyboard = new THREEx.KeyboardState(); +const keyboard = new THREEx.KeyboardState(); -export var rotateX = 0; -export var rotateY = 0; +export var rotateX = 0; // eslint-disable-line no-var, vars-on-top +export var rotateY = 0; // eslint-disable-line no-var, vars-on-top export function updateRotation() { - if( rotateTargetX && rotateTargetY ) { + if (rotateTargetX && rotateTargetY) { rotateVX += (rotateTargetX - rotateX) * 0.012; rotateVY += (rotateTargetY - rotateY) * 0.012; - if( Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1 ) { + if (Math.abs(rotateTargetX - rotateX) < 0.1 && Math.abs(rotateTargetY - rotateY) < 0.1) { rotateTargetX = undefined; rotateTargetY = undefined; } @@ -38,24 +36,32 @@ export function updateRotation() { rotateVX *= 0.98; rotateVY *= 0.98; - if( dragging || rotateTargetX ) { + if (dragging || rotateTargetX) { rotateVX *= 0.6; rotateVY *= 0.6; } // constrain the pivot up/down to the poles // force a bit of bounce back action when hitting the poles - if( rotateX < -rotateXMax ) { + if (rotateX < -rotateXMax) { rotateX = -rotateXMax; rotateVX *= -0.95; } - if( rotateX > rotateXMax ) { + if (rotateX > rotateXMax) { rotateX = rotateXMax; rotateVX *= -0.95; } } +export function startAutoRotate() { + _autoRotateId = window.setInterval( () => { + rotateVY += 0.1 * Math.PI / 180 * 0.3; + }, 100 ); +} + +export function stopAutoRotate() { window.clearInterval( _autoRotateId ); } + export function onDocumentMouseMove( camera, event ) { pmouseX = mouseX; pmouseY = mouseY; @@ -63,8 +69,8 @@ export function onDocumentMouseMove( camera, event ) { mouseX = event.clientX - window.innerWidth * 0.5; mouseY = event.clientY - window.innerHeight * 0.5; - if( dragging ) { - if( !keyboard.pressed( "shift" ) ) { + if (dragging) { + if (!keyboard.pressed( 'shift' )) { rotateVY += (mouseX - pmouseX) / 2 * Math.PI / 180 * 0.3; rotateVX += (mouseY - pmouseY) / 2 * Math.PI / 180 * 0.3; } else { @@ -75,7 +81,7 @@ export function onDocumentMouseMove( camera, event ) { } export function onDocumentMouseDown( event ) { - if( event.target.className.indexOf( 'noMapDrag' ) != -1 ) { + if (event.target.className.indexOf( 'noMapDrag' ) !== -1) { return; } @@ -87,7 +93,7 @@ export function onDocumentMouseDown( event ) { stopAutoRotate(); } -export function onDocumentMouseUp( event ) { +export function onDocumentMouseUp() { dragging = false; startAutoRotate(); } @@ -100,23 +106,15 @@ export function handleMWheel( delta, camera ) { export function onMouseWheel( camera, event ) { let delta = 0; - if( event.wheelDelta ) { + if (event.wheelDelta) { delta = event.wheelDelta / 120; - } else if( event.detail ) { - delta = -event.detail/3; + } else if (event.detail) { + delta = -event.detail / 3; } - if( delta ) { + if (delta) { handleMWheel( delta, camera ); } event.returnValue = false; } - -export function startAutoRotate() { - _autoRotateId = window.setInterval( () => { - rotateVY += 0.1 * Math.PI / 180 * 0.3; - }, 100 ); -} - -export function stopAutoRotate() { window.clearInterval( _autoRotateId ); } diff --git a/src/util.js b/src/util.js index 1ac536b..b821baf 100644 --- a/src/util.js +++ b/src/util.js @@ -1,21 +1,23 @@ export function wrap( value, min, rangeSize ) { - rangeSize -= min; - while( value < min ) { - value += rangeSize; + const minRangeSize = rangeSize - min; + let modValue = value; + + while (modValue < min) { + modValue += minRangeSize; } - return value % rangeSize; + return modValue % minRangeSize; } export function screenXY( vec3, camera ) { - let projector = new THREE.Projector(); - let vector = projector.projectVector( vec3.clone(), camera ); - let result = {}; + const projector = new THREE.Projector(); + const vector = projector.projectVector( vec3.clone(), camera ); + const result = {}; - let windowWidth = ( windowWidth < 1280 ) ? 1280 : window.innerWidth; + const windowWidth = ( windowWidth < 1280 ) ? 1280 : window.innerWidth; - result.x = Math.round( vector.x * (windowWidth/2) ) + windowWidth/2; - result.y = Math.round( (0-vector.y) * (window.innerHeight/2) ) + window.innerHeight/2; + result.x = Math.round( vector.x * (windowWidth / 2) ) + windowWidth / 2; + result.y = Math.round( (0 - vector.y) * (window.innerHeight / 2) ) + window.innerHeight / 2; return result; } diff --git a/src/visualize.js b/src/visualize.js index 27e6dd6..8ba08f1 100644 --- a/src/visualize.js +++ b/src/visualize.js @@ -1,120 +1,24 @@ import * as vizLines from './visualize_lines'; import * as constants from './constants'; -const vec3_origin = new THREE.Vector3( 0, 0, 0 ); -const vec3_x_axis = new THREE.Vector3( 1, 0, 0 ); -const vec3_y_axis = new THREE.Vector3( 0, 1, 0 ); -const vec3_z_axis = new THREE.Vector3( 0, 0, 1 ); +const vec3_origin = new THREE.Vector3( 0, 0, 0 ); // eslint-disable-line camelcase +const vec3_x_axis = new THREE.Vector3( 1, 0, 0 ); // eslint-disable-line camelcase +const vec3_y_axis = new THREE.Vector3( 0, 1, 0 ); // eslint-disable-line camelcase +const vec3_z_axis = new THREE.Vector3( 0, 0, 1 ); // eslint-disable-line camelcase -let _meshPool = []; +const _meshPool = []; // Used to keep track of which types we're not currently displaying -let _typeStatus = {}; +const _typeStatus = {}; constants.COLOUR_TYPES.forEach( (type) => { _typeStatus[ type ] = true; }); -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Module Exports -// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -export function buildDataVizGeometries( linearData, countryData ) { - let loadLayer = document.getElementById( 'loading' ); - let count = 0; - - linearData.forEach( (set) => { - let exporterName = set.src.toUpperCase(); - let importerName = set.dest.toUpperCase(); - - let exporter = countryData[exporterName]; - let importer = countryData[importerName]; - - // we couldn't find the country, it wasn't in our list... - if( !exporter || !importer ) { - return; - } - - // visualize this event - set.lineGeometry = vizLines.makeConnectionLineGeometry( exporter, importer ); - }); - - loadLayer.style.display = 'none'; -} - -export function initMeshPool( poolSize, visualizationMesh ) { - for( let i = 0; i < poolSize; i++ ) { - _meshPool.push( new ParticleMesh( visualizationMesh ) ); - } -} - -export function initParticleViz( linearData ) { - // Return if we have no geometry, or our type has been toggled off - if( !linearData.lineGeometry || !_typeStatus[ linearData.colour ] ) { - return null; - } - - _getMeshFromPool( ( meshObj ) => { - // get our colour - let color = _getColourFromTypeStr( linearData.colour ); - - // merge it all together - meshObj.linesGeo.merge( linearData.lineGeometry ); - let points = linearData.lineGeometry.vertices; - let point = points[0]; - let particle = point.clone(); - particle.moveIndex = 0; - particle.nextIndex = 1; - particle.lerpN = 0; - particle.path = points; - meshObj.particlesGeo.vertices.push( particle ); - - meshObj.traceLineMat.opacity = 1.0; - - meshObj.attributes.alpha.value.push( 1.0 ); - meshObj.attributes.customColor.value.push( color ); - - // Create a trail for the particles by adding extra, slightly offset, particles - for( let num = 0; num < constants.NUM_TRAIL_PARTICLES; num++ ) { - let trail = particle.clone(); - trail.moveIndex = 0; - trail.nextIndex = 1; - trail.lerpN = -1 * constants.PARTICLE_SPEED * num; - trail.path = points; - - meshObj.particlesGeo.vertices.push( trail ); - meshObj.attributes.alpha.value.push( 1.0 - ( constants.TRAIL_OPACITY_MULTIPLIER * num ) ); - meshObj.attributes.customColor.value.push( color ); - } - - // Set the explosion color, too - meshObj.explosionSphere.material.color = color; - meshObj.traceLineMat.color = color; - - // since colours have been updated, tell THREE to force an update - meshObj.attributes.alpha.needsUpdate = true; - meshObj.attributes.customColor.needsUpdate = true; - - meshObj.vizMesh.add( meshObj.splineOutline ); - meshObj.vizMesh.add( meshObj.traceLine ); - meshObj.startParticleUpdates(); - }); -} - -export function initVisualization( linearData ) { - // build the meshes. One for each entry in our data - linearData.forEach( (data) => { - initParticleViz( data ); - }); -} - -export function toggleVisualizationType( type, isActive ) { - _typeStatus[ type ] = isActive; -} - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // HELPER METHODS // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ function _getMeshFromPool( callback ) { - if( _meshPool.length > 0 ) { + if (_meshPool.length > 0) { callback( _meshPool.shift() ); } else { window.setTimeout( _getMeshFromPool, 500, callback ); @@ -147,7 +51,7 @@ function _returnMeshToPool( mesh ) { function _getColourFromTypeStr( colorStr ) { let colour = constants.COLOUR_MAP[colorStr]; - if( !colour ) { + if (!colour) { colour = constants.COLOUR_MAP.r; } @@ -166,23 +70,23 @@ class ParticleMesh { // Use custom shader to have the trail taper off in transparency this.attributes = { alpha: { type: 'f', value: [] }, - customColor: { type: 'c', value: [] } + customColor: { type: 'c', value: [] }, }; this.uniforms = { color: { type: 'c', value: new THREE.Color( 0xffffff ) }, - texture: { type: 't', value: THREE.ImageUtils.loadTexture( "images/particleB.png" ) } + texture: { type: 't', value: THREE.ImageUtils.loadTexture( 'images/particleB.png' ) }, }; this.shaderMaterial = new THREE.ShaderMaterial({ - uniforms: this.uniforms, - attributes: this.attributes, - vertexShader: document.getElementById( 'vertexshader' ).textContent, + uniforms: this.uniforms, + attributes: this.attributes, + vertexShader: document.getElementById( 'vertexshader' ).textContent, fragmentShader: document.getElementById( 'fragmentshader' ).textContent, - blending: THREE.AdditiveBlending, - transparent: true, - depthTest: true, - depthWrite: false + blending: THREE.AdditiveBlending, + transparent: true, + depthTest: true, + depthWrite: false, }); this.pSystem = new THREE.PointCloud( this.particlesGeo, this.shaderMaterial ); @@ -197,22 +101,22 @@ class ParticleMesh { this.traceLineMat = new THREE.LineBasicMaterial({ color: 0xffffff, opacity: 1.0, - transparent: true + transparent: true, }); this.traceLine = new THREE.Line( new THREE.Geometry(), this.traceLineMat ); - for( let num = 0; num < constants.TRACE_LINE_VERTEX_COUNT; num++ ) { + for (let num = 0; num < constants.TRACE_LINE_VERTEX_COUNT; num++) { this.traceLine.geometry.vertices.push( vec3_origin.clone() ); } // Elements for the explosion effect - let explosionMat = new THREE.MeshBasicMaterial({ + const explosionMat = new THREE.MeshBasicMaterial({ color: 0xffffff, transparent: true, opacity: 1.0, - map: THREE.ImageUtils.loadTexture( 'images/explosion_texture_2.png' ) + map: THREE.ImageUtils.loadTexture( 'images/explosion_texture_2.png' ), }); - let explosionGeo = new THREE.SphereGeometry( 5, 32, 32 ); + const explosionGeo = new THREE.SphereGeometry( 5, 32, 32 ); this.explosionSphere = new THREE.Mesh( explosionGeo, explosionMat ); this.explosionSphere.complete = false; @@ -220,14 +124,14 @@ class ParticleMesh { this.explosionSphere.finalPos = null; this.explosionSphere.rotationAxis = null; - this.explosionSphere.update = function( traceLine ) { - if( this.complete ) return; + this.explosionSphere.update = function explosionSphereUpdate( traceLine ) { + if (this.complete) return; - if( !this.visible ) { + if (!this.visible) { this.visible = true; } - if( this.lerpVal <= 0.0 ) { + if (this.lerpVal <= 0.0) { this.complete = true; this.visible = false; traceLine.visible = false; @@ -240,12 +144,12 @@ class ParticleMesh { this.position.lerp( vec3_origin, this.lerpVal ); // This will "slurp up" the trace line - for( let index = 0; index < traceLine.geometry.vertices.length; index++ ) { - if( index > traceLine.slurpIndex || - traceLine.slurpIndex >= traceLine.geometry.vertices.length ) { + for (let index = 0; index < traceLine.geometry.vertices.length; index++) { + if (index > traceLine.slurpIndex || + traceLine.slurpIndex >= traceLine.geometry.vertices.length) { break; } - let vertex = traceLine.geometry.vertices[ index ]; + const vertex = traceLine.geometry.vertices[ index ]; vertex.copy( traceLine.geometry.vertices[ traceLine.slurpIndex ] ); } @@ -256,7 +160,7 @@ class ParticleMesh { this.rotateOnAxis( this.rotationAxis, constants.EXPLOSION_ROTATION_ANGLE ); // Don't start fading out until we're half done - if( this.lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2 ) { + if (this.lerpVal <= constants.EXPLOSION_INITIAL_LERP_FACTOR / 2) { this.material.opacity -= constants.EXPLOSION_OPACITY_LERP; } }; @@ -268,36 +172,39 @@ class ParticleMesh { // This update method is what actually gets our points moving across the scene. // Once the point has finished its path, this method will emit a "ParticleSystemComplete" // event, to allow us to re-pool the mesh. - this.pSystem.update = function( traceLine ) { + this.pSystem.update = function pSystemUpdate( traceLine ) { // no point doing all the calculations if the particle is already done - if( this.systemComplete ) return; + if (this.systemComplete) return; // Ensure we're visible - if( !this.visible ) { + if (!this.visible) { this.visible = true; traceLine.visible = true; } // purposely leak these out so we can use it after with the trace line - let particle, currentPoint, nextPoint; - for( let i = 0; i < this.geometry.vertices.length; i++ ) { + let particle; + let currentPoint; + let nextPoint; + + for (let i = 0; i < this.geometry.vertices.length; i++) { particle = this.geometry.vertices[i]; - let path = particle.path; + const path = particle.path; particle.lerpN += constants.PARTICLE_SPEED; - if( particle.lerpN > 1 ) { + if (particle.lerpN > 1) { particle.lerpN = 0; particle.moveIndex = particle.nextIndex; particle.nextIndex++; - if( i === 0 ) { + if (i === 0) { // decrease the opacity of the trace line material so that // it's at 0.3 when we're done (The explosion routine handles // the remaining transparency) traceLine.material.opacity -= (0.7 / path.length); } - if( particle.nextIndex >= path.length ) { + if (particle.nextIndex >= path.length) { particle.moveIndex = 0; particle.nextIndex = 0; @@ -320,9 +227,9 @@ class ParticleMesh { particle.lerp( nextPoint, particle.lerpN ); } - for( let index = 0; index < traceLine.geometry.vertices.length; index++ ) { - let vertex = traceLine.geometry.vertices[index]; - if( index >= particle.moveIndex ) { + for (let index = 0; index < traceLine.geometry.vertices.length; index++) { + const vertex = traceLine.geometry.vertices[index]; + if (index >= particle.moveIndex) { vertex.copy( currentPoint ); vertex.lerp( nextPoint, particle.lerpN ); } @@ -334,27 +241,26 @@ class ParticleMesh { } runExplosion() { - let path = this.particlesGeo.vertices[0].path; + const path = this.particlesGeo.vertices[0].path; // The final array element is the origin, hence the -2 offset - let finalPt = path[ path.length - 2 ]; - let color = this.attributes.customColor.value[0].getHex(); + const finalPt = path[ path.length - 2 ]; // To help "slurp up" the trace line this.traceLine.slurpIndex = 0; // Decide which axis this explosion is going to rotate about - let choice = Math.floor( Math.random() * 3 ); - switch( choice ) { - case 0: - this.explosionSphere.rotationAxis = vec3_x_axis; - break; - case 1: - this.explosionSphere.rotationAxis = vec3_y_axis; - break; - case 2: - this.explosionSphere.rotationAxis = vec3_z_axis; - break; + const choice = Math.floor( Math.random() * 3 ); + switch (choice) { // eslint-disable-line default-case + case 0: + this.explosionSphere.rotationAxis = vec3_x_axis; // eslint-disable-line camelcase + break; + case 1: + this.explosionSphere.rotationAxis = vec3_y_axis; // eslint-disable-line camelcase + break; + case 2: + this.explosionSphere.rotationAxis = vec3_z_axis; // eslint-disable-line camelcase + break; } this.explosionSphere.finalPos = finalPt.clone(); @@ -369,3 +275,98 @@ class ParticleMesh { this.particleUpdateId = window.setInterval( this.pSystem.update.bind( this.pSystem, this.traceLine ), 16 ); } } + +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Module Exports +// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +export function buildDataVizGeometries( linearData, countryData ) { + const loadLayer = document.getElementById( 'loading' ); + + linearData.forEach( (set) => { + const exporterName = set.src.toUpperCase(); + const importerName = set.dest.toUpperCase(); + + const exporter = countryData[exporterName]; + const importer = countryData[importerName]; + + // we couldn't find the country, it wasn't in our list... + if (!exporter || !importer) { + return; + } + + // visualize this event + set.lineGeometry = vizLines.makeConnectionLineGeometry( exporter, importer ); + }); + + loadLayer.style.display = 'none'; +} + +export function initMeshPool( poolSize, visualizationMesh ) { + for (let i = 0; i < poolSize; i++) { + _meshPool.push( new ParticleMesh( visualizationMesh ) ); + } +} + +export function initParticleViz( linearData ) { + // Return if we have no geometry, or our type has been toggled off + if (!linearData.lineGeometry || !_typeStatus[ linearData.colour ]) { + return null; + } + + _getMeshFromPool( ( meshObj ) => { + // get our colour + const color = _getColourFromTypeStr( linearData.colour ); + + // merge it all together + meshObj.linesGeo.merge( linearData.lineGeometry ); + const points = linearData.lineGeometry.vertices; + const point = points[0]; + const particle = point.clone(); + particle.moveIndex = 0; + particle.nextIndex = 1; + particle.lerpN = 0; + particle.path = points; + meshObj.particlesGeo.vertices.push( particle ); + + meshObj.traceLineMat.opacity = 1.0; + + meshObj.attributes.alpha.value.push( 1.0 ); + meshObj.attributes.customColor.value.push( color ); + + // Create a trail for the particles by adding extra, slightly offset, particles + for (let num = 0; num < constants.NUM_TRAIL_PARTICLES; num++) { + const trail = particle.clone(); + trail.moveIndex = 0; + trail.nextIndex = 1; + trail.lerpN = -1 * constants.PARTICLE_SPEED * num; + trail.path = points; + + meshObj.particlesGeo.vertices.push( trail ); + meshObj.attributes.alpha.value.push( 1.0 - ( constants.TRAIL_OPACITY_MULTIPLIER * num ) ); + meshObj.attributes.customColor.value.push( color ); + } + + // Set the explosion color, too + meshObj.explosionSphere.material.color = color; + meshObj.traceLineMat.color = color; + + // since colours have been updated, tell THREE to force an update + meshObj.attributes.alpha.needsUpdate = true; + meshObj.attributes.customColor.needsUpdate = true; + + meshObj.vizMesh.add( meshObj.splineOutline ); + meshObj.vizMesh.add( meshObj.traceLine ); + meshObj.startParticleUpdates(); + }); +} + +export function initVisualization( linearData ) { + // build the meshes. One for each entry in our data + linearData.forEach( (data) => { + initParticleViz( data ); + }); +} + +export function toggleVisualizationType( type, isActive ) { + _typeStatus[ type ] = isActive; +} diff --git a/src/visualize_lines.js b/src/visualize_lines.js index 555758a..3e92b6c 100644 --- a/src/visualize_lines.js +++ b/src/visualize_lines.js @@ -1,28 +1,24 @@ -let globeRadius = 1000; -let vec3_origin = new THREE.Vector3( 0, 0, 0 ); +const vec3_origin = new THREE.Vector3( 0, 0, 0 ); // eslint-disable-line camelcase export function makeConnectionLineGeometry( exporter, importer ) { - if( !exporter.countryName || !importer.countryName ) { + if (!exporter.countryName || !importer.countryName) { return undefined; } - let distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length(); - - // how high we want to shoot the curve upwards - let anchorHeight = globeRadius + distanceBetweenCountryCenter * 0.7; + const distanceBetweenCountryCenter = exporter.center.clone().sub(importer.center).length(); // start/end of the line - let start = exporter.center; - let end = importer.center; + const start = exporter.center; + const end = importer.center; // midpoint for the curve - let mid = start.clone().lerp( end, 0.5 ); - let midLength = mid.length(); + const mid = start.clone().lerp( end, 0.5 ); + const midLength = mid.length(); mid.normalize(); mid.multiplyScalar( midLength + distanceBetweenCountryCenter * 0.45 ); // the normal from start to end - let normal = (new THREE.Vector3()).subVectors( start, end ); + const normal = (new THREE.Vector3()).subVectors( start, end ); normal.normalize(); // The curve looks like this: @@ -35,19 +31,19 @@ export function makeConnectionLineGeometry( exporter, importer ) { // // splineCurveA splineCurveB - let distanceHalf = distanceBetweenCountryCenter * 0.5; + const distanceHalf = distanceBetweenCountryCenter * 0.5; - let startAnchor = start; - let midStartAnchor = mid.clone().add( normal.clone().multiplyScalar( distanceHalf ) ); - let midEndAnchor = mid.clone().add( normal.clone().multiplyScalar( -distanceHalf ) ); - let endAnchor = end; + const startAnchor = start; + const midStartAnchor = mid.clone().add( normal.clone().multiplyScalar( distanceHalf ) ); + const midEndAnchor = mid.clone().add( normal.clone().multiplyScalar( -distanceHalf ) ); + const endAnchor = end; // now make a bezier curve out of the above like so in the diagram - let splineCurveA = new THREE.CubicBezierCurve3( start, startAnchor, midStartAnchor, mid ); - let splineCurveB = new THREE.CubicBezierCurve3( mid, midEndAnchor, endAnchor, end ); + const splineCurveA = new THREE.CubicBezierCurve3( start, startAnchor, midStartAnchor, mid ); + const splineCurveB = new THREE.CubicBezierCurve3( mid, midEndAnchor, endAnchor, end ); // how many vertices do we want on this guy? this is for *each* side - let vertexCountDesired = Math.floor( distanceBetweenCountryCenter * 0.02 + 6 ) * 2; + const vertexCountDesired = Math.floor( distanceBetweenCountryCenter * 0.02 + 6 ) * 2; // collect the vertices let points = splineCurveA.getPoints( vertexCountDesired ); @@ -61,7 +57,7 @@ export function makeConnectionLineGeometry( exporter, importer ) { points.push( vec3_origin ); // create a line geometry out of these - let curveGeometry = new THREE.Geometry(); + const curveGeometry = new THREE.Geometry(); points.forEach( (point) => { curveGeometry.vertices.push( point ); }); @@ -70,11 +66,12 @@ export function makeConnectionLineGeometry( exporter, importer ) { } export function constrain(v, min, max) { - if( v < min ) { - v = min; - } else if( v > max ) { - v = max; + let modV = v; + if (v < min) { + modV = min; + } else if (v > max) { + modV = max; } - return v; + return modV; } From 0ab239649785c13cc93e2b8ffeaebc36471f7118 Mon Sep 17 00:00:00 2001 From: Dan Petker Date: Thu, 24 Sep 2015 09:15:38 -0400 Subject: [PATCH 189/190] Finished integrating eslint. --- Gruntfile.js | 54 ++++++++++++++++------------------ package.json | 2 +- public/dataglobe.min.js | 3 ++ public/thirdparty.min.js | 23 +++++++++++++++ src/components/legend-item.jsx | 10 +++---- src/components/legend.jsx | 10 +++---- 6 files changed, 63 insertions(+), 39 deletions(-) create mode 100644 public/dataglobe.min.js create mode 100644 public/thirdparty.min.js diff --git a/Gruntfile.js b/Gruntfile.js index 78574fd..496b100 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,45 +1,43 @@ // Gruntfile for building the dataglobe project us = require( 'underscore' ); -module.exports = function( grunt ) { - +module.exports = function gruntInit( grunt ) { grunt.initConfig({ pkg: grunt.file.readJSON( 'package.json' ), clean: { all: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/*.js' ], - incr: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/public/<%= pkg.name %>.min.js' ] + incr: [ 'build/tmp/components', 'build/tmp', 'build/*.js', 'public/public/<%= pkg.name %>.min.js' ], }, eslint: { - target: [ 'src/**/*.js', 'src/**/*.jsx' ] + target: [ 'src/**/*.js', 'src/**/*.jsx' ], }, bower_concat: { all: { dest: 'build/bower.js', // nice little callback to look for/use minified versions when available - callback: function( mainFiles, component ) { - return us.map( mainFiles, function( filepath ) { + callback: function findMinified( mainFiles ) { + return us.map( mainFiles, function minifiedMap( filepath ) { min = filepath.replace( /\.js$/, '.min.js' ); - if( grunt.file.exists( min ) ) { + if (grunt.file.exists( min )) { return min; - } else { - return filepath; } + return filepath; }); - } - } + }, + }, }, concat: { options: { - separator: ';' + separator: ';', }, dist: { src: ['<%= bower_concat.all.dest %>', 'thirdparty/*.js'], - dest: 'build/thirdparty.js' - } + dest: 'build/thirdparty.js', + }, }, browserify: { @@ -47,39 +45,39 @@ module.exports = function( grunt ) { debug: true, destFile: 'build/bundle.js', src: [ 'src/**/*.js', 'src/**/*.jsx' ], - transform: ['babelify'] + transform: ['babelify'], }, dev: { src: '<%= browserify.options.src %>', - dest: '<%= browserify.options.destFile %>' + dest: '<%= browserify.options.destFile %>', }, production: { options: { - debug: false + debug: false, }, src: '<%= browserify.options.src %>', - dest: '<%= browserify.options.destFile %>' - } + dest: '<%= browserify.options.destFile %>', + }, }, uglify: { options: { - banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' + banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n', }, all: { files: { 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ], - 'public/thirdparty.min.js': [ '<%= concat.dist.dest %>' ] - } + 'public/thirdparty.min.js': [ '<%= concat.dist.dest %>' ], + }, }, incr: { files: { - 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ] - } + 'public/<%= pkg.name %>.min.js': [ '<%= browserify.options.destFile %>' ], + }, }, }, @@ -87,9 +85,9 @@ module.exports = function( grunt ) { files: [ 'Gruntfile.js', 'src/**/*.js', - 'src/**/*.jsx' + 'src/**/*.jsx', ], - tasks: 'incremental' + tasks: 'incremental', }, }); @@ -107,13 +105,13 @@ module.exports = function( grunt ) { 'bower_concat:all', 'concat:dist', 'browserify:production', - 'uglify:all' + 'uglify:all', ]); grunt.registerTask( 'incremental', [ 'clean:incr', 'eslint', 'browserify:production', - 'uglify:incr' + 'uglify:incr', ]); }; diff --git a/package.json b/package.json index eba2eea..b8b7078 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "eslint-plugin-react": "^3.4.2", "grunt": "^0.4.5", "grunt-bower-concat": "^0.4.0", - "grunt-browserify": "^3.4.0", + "grunt-browserify": "^4.0.0", "grunt-contrib-clean": "^0.6.0", "grunt-contrib-concat": "^0.5.1", "grunt-contrib-uglify": "^0.8.0", diff --git a/public/dataglobe.min.js b/public/dataglobe.min.js new file mode 100644 index 0000000..c42243f --- /dev/null +++ b/public/dataglobe.min.js @@ -0,0 +1,3 @@ +/*! dataglobe 24-09-2015 */ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;ga?-.5*h*Math.pow(2,10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)+b:h*Math.pow(2,-10*(a-=1))*Math.sin(2*(a*d-f)*Math.PI/g)*.5+e+b},easeInBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*(a/=d)*a*((e+1)*a-e)+b},easeOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),f*((a=a/d-1)*a*((e+1)*a+e)+1)+b},easeInOutBack:function(a,b,c,d,e){var f=c-b;return void 0==e&&(e=1.70158),(a/=d/2)<1?f/2*a*a*(((e*=1.525)+1)*a-e)+b:f/2*((a-=2)*a*(((e*=1.525)+1)*a+e)+2)+b},easeInBounce:function(a,b,d,e){var f=d-b;return f-c.easeOutBounce(e-a,0,f,e)+b},easeOutBounce:function(a,b,c,d){var e=c-b;return(a/=d)<1/2.75?7.5625*e*a*a+b:2/2.75>a?e*(7.5625*(a-=1.5/2.75)*a+.75)+b:2.5/2.75>a?e*(7.5625*(a-=2.25/2.75)*a+.9375)+b:e*(7.5625*(a-=2.625/2.75)*a+.984375)+b},easeInOutBounce:function(a,b,d,e){var f=d-b;return e/2>a?.5*c.easeInBounce(2*a,0,f,e)+b:.5*c.easeOutBounce(2*a-e,0,f,e)+.5*f+b}};b.exports=c},{}],2:[function(a,b){"use strict";function c(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}function d(a){return a}var e=a("./easingTypes"),f="ADDITIVE",g=e.easeInOutQuad,h=300,i=0,j={easingTypes:e,stackBehavior:{ADDITIVE:"ADDITIVE",DESTRUCTIVE:"DESTRUCTIVE"}};j.Mixin={getInitialState:function(){return{tweenQueue:[]}},tweenState:function(a,b,c){"string"==typeof a&&(c=b,b=a,a=d),this._tweenState(a,b,c)},_tweenState:function(a,b,d){d=c(d);var e=this._pendingState||this.state,k=a(e);d.stackBehavior=d.stackBehavior||f,d.easing=d.easing||g,d.duration=null==d.duration?h:d.duration,d.beginValue=null==d.beginValue?k[b]:d.beginValue,d.delay=null==d.delay?i:d.delay;var l=e.tweenQueue;d.stackBehavior===j.stackBehavior.DESTRUCTIVE&&(l=e.tweenQueue.filter(function(a){return a.stateName!==b||a.stateRefFunc(e)!==k})),l.push({stateRefFunc:a,stateName:b,config:d,initTime:Date.now()+d.delay}),k[b]=d.endValue,this.setState({tweenQueue:l}),1===l.length&&this.startRaf()},getTweeningValue:function(a,b){return"string"==typeof a&&(b=a,a=d),this._getTweeningValue(a,b)},_getTweeningValue:function(a,b){for(var c=this.state,d=a(c),e=d[b],f=Date.now(),g=0;gh.config.duration?h.config.duration:Math.max(0,f-h.initTime),k=-h.config.endValue+h.config.easing(j,h.config.beginValue,h.config.endValue,h.config.duration);e+=k}}return e},_rafCb:function(){if(this.isMounted()){var a=this.state;if(0!==a.tweenQueue.length){var b=Date.now();a.tweenQueue.forEach(function(a){b-a.initTime>=a.config.duration&&a.config.onEnd&&a.config.onEnd()});var c=a.tweenQueue.filter(function(a){return b-a.initTime=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-(1/0),g=-(1/0);if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-(1/0)&&f===-(1/0))&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||e===1/0&&f===1/0)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)}Object.defineProperty(c,"__esModule",{value:!0});var g=function(){function a(a,b){for(var c=0;cg;g++){var h=Math.floor(Math.random()*e.length),i=k.COLOUR_TYPES[Math.floor(Math.random()*k.COLOUR_TYPES.length)],j=Math.floor(Math.random()*e.length),l=Math.floor(Math.random()*k.ONE_WEEK_IN_MILLIS);h===j&&(j=j===e.length-1?0:j+1);var m={};m.src=b[e[h]],m.dest=b[e[j]],m.colour=i,m.time=new Date(f-l),d.push(m)}c(d)}Object.defineProperty(c,"__esModule",{value:!0}),c.loadWorldPins=f,c.loadCountryCodes=g,c.loadContentData=h,c.loadRandomizedContentData=i;var j=a("./constants"),k=d(j)},{"./constants":7}],9:[function(a,b,c){"use strict";function d(a,b){var c=100,d=b-90,e=Math.PI/2-a*Math.PI/180-.01*Math.PI,f=2*Math.PI-d*Math.PI/180+.06*Math.PI,g=new THREE.Vector3;return g.x=Math.sin(e)*Math.cos(f)*c,g.y=Math.cos(e)*c,g.z=Math.sin(e)*Math.sin(f)*c,g}function e(a,b){var c={};return Object.keys(a.countries).forEach(function(e){var f=a.countries[e];f.countryCode=e,f.countryName=b[e];var g=d(f.lat,f.lon);f.center=g,c[f.countryName]=f}),c}Object.defineProperty(c,"__esModule",{value:!0}),c.convertLatLonToVector=d,c.loadGeoData=e},{}],10:[function(a){"use strict";function b(a){return a&&a.__esModule?a:{"default":a}}function c(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function d(a,b){a===I.getTime()&&(K=H);var c=w.partition(K,function(c){var d=c.time.getTime();return d>=a&&b>=d});return K=c[1],c[0]}function e(){var a=r.VIZ_LOOP_LENGTH/r.VIZ_POLLING_INTERVAL,b=0,c=J.getTime()-I.getTime(),e=Math.floor(c/a),f=I.getTime();window.setInterval(function(){var c=d(f,f+e);f+=e,b++,f>=J.getTime()&&(f=I.getTime(),b=0),n.initVisualization(c),E.handleProgressUpdate(b/a)},r.VIZ_POLLING_INTERVAL)}function f(){B=new THREE.Scene,B.matrixAutoUpdate=!1;var a=new THREE.SpotLight(15658734,3);a.position.x=730,a.position.y=520,a.position.z=626,a.castShadow=!0,B.add(a);var b=new THREE.SpotLight(15658734,1.5);b.position.x=-730,b.position.y=520,b.position.z=626,b.castShadow=!0,B.add(b);var c=new THREE.PointLight(2236962,14.8);c.position.x=0,c.position.y=-750,c.position.z=0,B.add(c),z=new THREE.Object3D,B.add(z);var d=new THREE.MeshLambertMaterial({map:THREE.ImageUtils.loadTexture("images/map_outline.png")}),e=new THREE.Mesh(new THREE.SphereGeometry(100,40,40),d);e.doubleSided=!1,e.rotation.x=Math.PI,e.rotation.y=-Math.PI/2,e.rotation.z=Math.PI,z.add(e),D=new THREE.Object3D,z.add(D),A=new THREE.WebGLRenderer({antialias:!1,alpha:!0}),A.setSize(window.innerWidth,window.innerHeight),A.autoClear=!1,A.sortObjects=!1,A.generateMipmaps=!1,y.appendChild(A.domElement),C=new THREE.PerspectiveCamera(12,window.innerWidth/window.innerHeight,1,2e4),C.position.z=1400,C.position.y=0,B.add(C),x.addEventListener("mousemove",l.onDocumentMouseMove.bind(null,C),!0),x.addEventListener("mousedown",l.onDocumentMouseDown,!0),x.addEventListener("mouseup",l.onDocumentMouseUp,!1),x.addEventListener("mousewheel",l.onMouseWheel.bind(null,C),!1),x.addEventListener("DOMMouseScroll",function(a){var b=window.event||a;l.onMouseWheel(C,b)},!1),THREEx.WindowResize(A,C),l.startAutoRotate()}function g(){l.updateRotation(),z.rotation.x=l.rotateX,z.rotation.y=l.rotateY,requestAnimationFrame(g),A.render(B,C)}function h(){React.render(React.createElement(t["default"],{types:r.COLOUR_TYPES,clickCallback:n.toggleVisualizationType}),document.getElementById("legend")),E=React.render(React.createElement(v["default"],null),document.getElementById("progress"))}var i=a("./dataloading"),j=c(i),k=a("./mousekeyboard"),l=c(k),m=a("./visualize"),n=c(m),o=a("./geopins"),p=c(o),q=a("./constants"),r=c(q),s=a("./components/legend.jsx"),t=b(s),u=a("./components/progress.jsx"),v=b(u),w=a("underscore"),x=document.getElementById("visualization"),y=document.getElementById("glContainer"),z=null,A=null,B=null,C=null,D=null,E=null,F=null,G=null,H=null,I=null,J=null,K=null;Detector.webgl?(f(),n.initMeshPool(r.MESH_POOL_SIZE,D),h(),j.loadCountryCodes("country_iso3166.json",function(a){F=a,j.loadWorldPins("country_lat_lon.json",function(a){ +G=a,j.loadRandomizedContentData(2e3,F,function(a){var b=w.map(a,function(a){return typeof a.time===Date?a:(a.time=new Date(a.time),a)});H=w.sortBy(b,"time"),I=H[0].time,J=H[H.length-1].time;var c=p.loadGeoData(G,F);n.buildDataVizGeometries(H,c),g(),e()})})})):Detector.addGetWebGLMessage()},{"./components/legend.jsx":5,"./components/progress.jsx":6,"./constants":7,"./dataloading":8,"./geopins":9,"./mousekeyboard":11,"./visualize":13,underscore:3}],11:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(){w&&x&&(p+=.012*(w-A),v+=.012*(x-B),Math.abs(w-A)<.1&&Math.abs(x-B)<.1&&(w=void 0,x=void 0)),c.rotateX=A+=p,c.rotateY=B+=v,p*=.98,v*=.98,(u||w)&&(p*=.6,v*=.6),-o>A&&(c.rotateX=A=-o,p*=-.95),A>o&&(c.rotateX=A=o,p*=-.95)}function f(){y=window.setInterval(function(){v+=.1*Math.PI/180*.3},100)}function g(){window.clearInterval(y)}function h(a,b){s=q,t=r,q=b.clientX-.5*window.innerWidth,r=b.clientY-.5*window.innerHeight,u&&(z.pressed("shift")?(a.position.x-=.5*(q-s),a.position.y+=.5*(r-t)):(v+=(q-s)/2*Math.PI/180*.3,p+=(r-t)/2*Math.PI/180*.3))}function i(a){-1===a.target.className.indexOf("noMapDrag")&&(u=!0,pressX=q,pressY=r,w=void 0,w=void 0,g())}function j(){u=!1,f()}function k(a,b){b.scale.z+=.1*a,b.scale.z=n.constrain(b.scale.z,.7,5)}function l(a,b){var c=0;b.wheelDelta?c=b.wheelDelta/120:b.detail&&(c=-b.detail/3),c&&k(c,a),b.returnValue=!1}Object.defineProperty(c,"__esModule",{value:!0}),c.updateRotation=e,c.startAutoRotate=f,c.stopAutoRotate=g,c.onDocumentMouseMove=h,c.onDocumentMouseDown=i,c.onDocumentMouseUp=j,c.handleMWheel=k,c.onMouseWheel=l;var m=a("./visualize_lines"),n=d(m),o=90*Math.PI/180,p=.35*Math.PI/180,q=0,r=0,s=0,t=0,u=!1,v=0,w=0,x=0,y=null,z=new THREEx.KeyboardState,A=0;c.rotateX=A;var B=0;c.rotateY=B},{"./visualize_lines":14}],12:[function(a,b,c){"use strict";function d(a,b,c){for(var d=c-b,e=a;b>e;)e+=d;return e%d}function e(a,b){var c=new THREE.Projector,d=c.projectVector(a.clone(),b),e={},f=1280>f?1280:window.innerWidth;return e.x=Math.round(d.x*(f/2))+f/2,e.y=Math.round((0-d.y)*(window.innerHeight/2))+window.innerHeight/2,e}Object.defineProperty(c,"__esModule",{value:!0}),c.wrap=d,c.screenXY=e},{}],13:[function(a,b,c){"use strict";function d(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b}function e(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function f(a){w.length>0?a(w.shift()):window.setTimeout(f,500,a)}function g(a){a.linesGeo.vertices=[],a.particlesGeo.vertices=[],a.pSystem.systemComplete=!1,a.explosionSphere.complete=!1,a.explosionSphere.lerpVal=r.EXPLOSION_INITIAL_LERP_FACTOR,a.explosionSphere.finalPos=null,a.explosionSphere.rotationAxis=null,a.explosionSphere.material.opacity=1,a.attributes.alpha.value=[],a.attributes.customColor.value=[],window.clearInterval(a.particleUpdateId),window.clearInterval(a.explosionUpdateId),a.vizMesh.remove(a.splineOutline),a.vizMesh.remove(a.traceLine),a.vizMesh.remove(a.explosionSphere),w.push(a)}function h(a){var b=r.COLOUR_MAP[a];return b||(b=r.COLOUR_MAP.r),b}function i(a,b){var c=document.getElementById("loading");a.forEach(function(a){var c=a.src.toUpperCase(),d=a.dest.toUpperCase(),e=b[c],f=b[d];e&&f&&(a.lineGeometry=p.makeConnectionLineGeometry(e,f))}),c.style.display="none"}function j(a,b){for(var c=0;a>c;c++)w.push(new y(b))}function k(a){return a.lineGeometry&&x[a.colour]?void f(function(b){var c=h(a.colour);b.linesGeo.merge(a.lineGeometry);var d=a.lineGeometry.vertices,e=d[0],f=e.clone();f.moveIndex=0,f.nextIndex=1,f.lerpN=0,f.path=d,b.particlesGeo.vertices.push(f),b.traceLineMat.opacity=1,b.attributes.alpha.value.push(1),b.attributes.customColor.value.push(c);for(var g=0;ga.slurpIndex||a.slurpIndex>=a.geometry.vertices.length);b++){var c=a.geometry.vertices[b];c.copy(a.geometry.vertices[a.slurpIndex])}a.slurpIndex++,a.geometry.verticesNeedUpdate=!0,a.material.opacity-=r.TRACE_LINE_OPACITY_LERP,this.rotateOnAxis(this.rotationAxis,r.EXPLOSION_ROTATION_ANGLE),this.lerpVal<=r.EXPLOSION_INITIAL_LERP_FACTOR/2&&(this.material.opacity-=r.EXPLOSION_OPACITY_LERP)}},this.pSystem.addEventListener("ParticleSystemComplete",this.runExplosion.bind(this)),this.explosionSphere.addEventListener("ExplosionComplete",g.bind(this,this)),this.pSystem.update=function(a){if(!this.systemComplete){this.visible||(this.visible=!0,a.visible=!0);for(var b=void 0,c=void 0,d=void 0,e=0;e1&&(b.lerpN=0,b.moveIndex=b.nextIndex,b.nextIndex++,0===e&&(a.material.opacity-=.7/f.length),b.nextIndex>=f.length))return b.moveIndex=0,b.nextIndex=0,this.systemComplete=!0,this.visible=!1,void this.dispatchEvent({type:"ParticleSystemComplete"});c=f[b.moveIndex],d=f[b.nextIndex],b.copy(c),b.lerp(d,b.lerpN)}for(var g=0;g=b.moveIndex&&(h.copy(c),h.lerp(d,b.lerpN))}a.geometry.verticesNeedUpdate=!0,this.geometry.verticesNeedUpdate=!0}}}return n(a,[{key:"runExplosion",value:function(){var a=this.particlesGeo.vertices[0].path,b=a[a.length-2];this.traceLine.slurpIndex=0;var c=Math.floor(3*Math.random());switch(c){case 0:this.explosionSphere.rotationAxis=t;break;case 1:this.explosionSphere.rotationAxis=u;break;case 2:this.explosionSphere.rotationAxis=v}this.explosionSphere.finalPos=b.clone(),this.explosionSphere.position.set(b.x,b.y,b.z),this.explosionSphere.position.lerp(s,this.explosionSphere.lerpVal),this.explosionUpdateId=window.setInterval(this.explosionSphere.update.bind(this.explosionSphere,this.traceLine),16),this.vizMesh.add(this.explosionSphere)}},{key:"startParticleUpdates",value:function(){this.particleUpdateId=window.setInterval(this.pSystem.update.bind(this.pSystem,this.traceLine),16)}}]),a}()},{"./constants":7,"./visualize_lines":14}],14:[function(a,b,c){"use strict";function d(a,b){if(!a.countryName||!b.countryName)return void 0;var c=a.center.clone().sub(b.center).length(),d=a.center,e=b.center,g=d.clone().lerp(e,.5),h=g.length();g.normalize(),g.multiplyScalar(h+.45*c);var i=(new THREE.Vector3).subVectors(d,e);i.normalize();var j=.5*c,k=d,l=g.clone().add(i.clone().multiplyScalar(j)),m=g.clone().add(i.clone().multiplyScalar(-j)),n=e,o=new THREE.CubicBezierCurve3(d,k,l,g),p=new THREE.CubicBezierCurve3(g,m,n,e),q=2*Math.floor(.02*c+6),r=o.getPoints(q);r=r.splice(0,r.length-1),r=r.concat(p.getPoints(q)),r.push(f);var s=new THREE.Geometry;return r.forEach(function(a){s.vertices.push(a)}),s}function e(a,b,c){var d=a;return b>a?d=b:a>c&&(d=c),d}Object.defineProperty(c,"__esModule",{value:!0}),c.makeConnectionLineGeometry=d,c.constrain=e;var f=new THREE.Vector3(0,0,0)},{}]},{},[7,8,9,10,11,12,13,14,4,5,6]); \ No newline at end of file diff --git a/public/thirdparty.min.js b/public/thirdparty.min.js new file mode 100644 index 0000000..90a6583 --- /dev/null +++ b/public/thirdparty.min.js @@ -0,0 +1,23 @@ +/*! dataglobe 24-09-2015 */ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.React=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g8&&11>=w),z=32,A=String.fromCharCode(z),B=m.topLevelTypes,C={beforeInput:{phasedRegistrationNames:{bubbled:s({onBeforeInput:null}),captured:s({onBeforeInputCapture:null})},dependencies:[B.topCompositionEnd,B.topKeyPress,B.topTextInput,B.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:s({onCompositionEnd:null}),captured:s({onCompositionEndCapture:null})},dependencies:[B.topBlur,B.topCompositionEnd,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:s({onCompositionStart:null}),captured:s({onCompositionStartCapture:null})},dependencies:[B.topBlur,B.topCompositionStart,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:s({onCompositionUpdate:null}),captured:s({onCompositionUpdateCapture:null})},dependencies:[B.topBlur,B.topCompositionUpdate,B.topKeyDown,B.topKeyPress,B.topKeyUp,B.topMouseDown]}},D=!1,E=null,F={eventTypes:C,extractEvents:function(a,b,c,d){return[i(a,b,c,d),l(a,b,c,d)]}};b.exports=F},{139:139,15:15,20:20,21:21,22:22,91:91,95:95}],4:[function(a,b){"use strict";function c(a,b){return a+b.charAt(0).toUpperCase()+b.substring(1)}var d={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeOpacity:!0},e=["Webkit","ms","Moz","O"];Object.keys(d).forEach(function(a){e.forEach(function(b){d[c(b,a)]=d[a]})});var f={background:{backgroundImage:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundColor:!0},border:{borderWidth:!0,borderStyle:!0,borderColor:!0},borderBottom:{borderBottomWidth:!0,borderBottomStyle:!0,borderBottomColor:!0},borderLeft:{borderLeftWidth:!0,borderLeftStyle:!0,borderLeftColor:!0},borderRight:{borderRightWidth:!0,borderRightStyle:!0,borderRightColor:!0},borderTop:{borderTopWidth:!0,borderTopStyle:!0,borderTopColor:!0},font:{fontStyle:!0,fontVariant:!0,fontWeight:!0,fontSize:!0,lineHeight:!0,fontFamily:!0}},g={isUnitlessNumber:d,shorthandPropertyExpansions:f};b.exports=g},{}],5:[function(a,b){"use strict";var c=a(4),d=a(21),e=(a(106),a(111)),f=a(131),g=a(141),h=(a(150),g(function(a){return f(a)})),i="cssFloat";d.canUseDOM&&void 0===document.documentElement.style.cssFloat&&(i="styleFloat");var j={createMarkupForStyles:function(a){var b="";for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];null!=d&&(b+=h(c)+":",b+=e(c,d)+";")}return b||null},setValueForStyles:function(a,b){var d=a.style;for(var f in b)if(b.hasOwnProperty(f)){var g=e(f,b[f]);if("float"===f&&(f=i),g)d[f]=g;else{var h=c.shorthandPropertyExpansions[f];if(h)for(var j in h)d[j]="";else d[f]=""}}}};b.exports=j},{106:106,111:111,131:131,141:141,150:150,21:21,4:4}],6:[function(a,b){"use strict";function c(){this._callbacks=null,this._contexts=null}var d=a(28),e=a(27),f=a(133);e(c.prototype,{enqueue:function(a,b){this._callbacks=this._callbacks||[],this._contexts=this._contexts||[],this._callbacks.push(a),this._contexts.push(b)},notifyAll:function(){var a=this._callbacks,b=this._contexts;if(a){f(a.length===b.length),this._callbacks=null,this._contexts=null;for(var c=0,d=a.length;d>c;c++)a[c].call(b[c]);a.length=0,b.length=0}},reset:function(){this._callbacks=null,this._contexts=null},destructor:function(){this.reset()}}),d.addPoolingTo(c),b.exports=c},{133:133,27:27,28:28}],7:[function(a,b){"use strict";function c(a){return"SELECT"===a.nodeName||"INPUT"===a.nodeName&&"file"===a.type}function d(a){var b=w.getPooled(B.change,D,a);t.accumulateTwoPhaseDispatches(b),v.batchedUpdates(e,b)}function e(a){s.enqueueEvents(a),s.processEventQueue()}function f(a,b){C=a,D=b,C.attachEvent("onchange",d)}function g(){C&&(C.detachEvent("onchange",d),C=null,D=null)}function h(a,b,c){return a===A.topChange?c:void 0}function i(a,b,c){a===A.topFocus?(g(),f(b,c)):a===A.topBlur&&g()}function j(a,b){C=a,D=b,E=a.value,F=Object.getOwnPropertyDescriptor(a.constructor.prototype,"value"),Object.defineProperty(C,"value",I),C.attachEvent("onpropertychange",l)}function k(){C&&(delete C.value,C.detachEvent("onpropertychange",l),C=null,D=null,E=null,F=null)}function l(a){if("value"===a.propertyName){var b=a.srcElement.value;b!==E&&(E=b,d(a))}}function m(a,b,c){return a===A.topInput?c:void 0}function n(a,b,c){a===A.topFocus?(k(),j(b,c)):a===A.topBlur&&k()}function o(a){return a!==A.topSelectionChange&&a!==A.topKeyUp&&a!==A.topKeyDown||!C||C.value===E?void 0:(E=C.value,D)}function p(a){return"INPUT"===a.nodeName&&("checkbox"===a.type||"radio"===a.type)}function q(a,b,c){return a===A.topClick?c:void 0}var r=a(15),s=a(17),t=a(20),u=a(21),v=a(85),w=a(93),x=a(134),y=a(136),z=a(139),A=r.topLevelTypes,B={change:{phasedRegistrationNames:{bubbled:z({onChange:null}),captured:z({onChangeCapture:null})},dependencies:[A.topBlur,A.topChange,A.topClick,A.topFocus,A.topInput,A.topKeyDown,A.topKeyUp,A.topSelectionChange]}},C=null,D=null,E=null,F=null,G=!1;u.canUseDOM&&(G=x("change")&&(!("documentMode"in document)||document.documentMode>8));var H=!1;u.canUseDOM&&(H=x("input")&&(!("documentMode"in document)||document.documentMode>9));var I={get:function(){return F.get.call(this)},set:function(a){E=""+a,F.set.call(this,a)}},J={eventTypes:B,extractEvents:function(a,b,d,e){var f,g;if(c(b)?G?f=h:g=i:y(b)?H?f=m:(f=o,g=n):p(b)&&(f=q),f){var j=f(a,b,d);if(j){var k=w.getPooled(B.change,j,e);return t.accumulateTwoPhaseDispatches(k),k}}g&&g(a,b,d)}};b.exports=J},{134:134,136:136,139:139,15:15,17:17,20:20,21:21,85:85,93:93}],8:[function(a,b){"use strict";var c=0,d={createReactRootIndex:function(){return c++}};b.exports=d},{}],9:[function(a,b){"use strict";function c(a,b,c){a.insertBefore(b,a.childNodes[c]||null)}var d=a(12),e=a(70),f=a(145),g=a(133),h={dangerouslyReplaceNodeWithMarkup:d.dangerouslyReplaceNodeWithMarkup,updateTextContent:f,processUpdates:function(a,b){for(var h,i=null,j=null,k=0;kb||d.hasOverloadedBooleanValue[a]&&b===!1}var d=a(10),e=a(143),f=(a(150),{createMarkupForID:function(a){return d.ID_ATTRIBUTE_NAME+"="+e(a)},createMarkupForProperty:function(a,b){if(d.isStandardName.hasOwnProperty(a)&&d.isStandardName[a]){if(c(a,b))return"";var f=d.getAttributeName[a];return d.hasBooleanValue[a]||d.hasOverloadedBooleanValue[a]&&b===!0?f:f+"="+e(b)}return d.isCustomAttribute(a)?null==b?"":a+"="+e(b):null},setValueForProperty:function(a,b,e){if(d.isStandardName.hasOwnProperty(b)&&d.isStandardName[b]){var f=d.getMutationMethod[b];if(f)f(a,e);else if(c(b,e))this.deleteValueForProperty(a,b);else if(d.mustUseAttribute[b])a.setAttribute(d.getAttributeName[b],""+e);else{var g=d.getPropertyName[b];d.hasSideEffects[b]&&""+a[g]==""+e||(a[g]=e)}}else d.isCustomAttribute(b)&&(null==e?a.removeAttribute(b):a.setAttribute(b,""+e))},deleteValueForProperty:function(a,b){if(d.isStandardName.hasOwnProperty(b)&&d.isStandardName[b]){var c=d.getMutationMethod[b];if(c)c(a,void 0);else if(d.mustUseAttribute[b])a.removeAttribute(d.getAttributeName[b]);else{var e=d.getPropertyName[b],f=d.getDefaultValueForProperty(a.nodeName,e);d.hasSideEffects[b]&&""+a[e]===f||(a[e]=f)}}else d.isCustomAttribute(b)&&a.removeAttribute(b)}});b.exports=f},{10:10,143:143,150:150}],12:[function(a,b){"use strict";function c(a){return a.substring(1,a.indexOf(" "))}var d=a(21),e=a(110),f=a(112),g=a(125),h=a(133),i=/^(<[^ \/>]+)/,j="data-danger-index",k={dangerouslyRenderMarkup:function(a){h(d.canUseDOM);for(var b,k={},l=0;li;i++){var k=h[i];if(k){var l=k.extractEvents(a,b,d,f);l&&(g=e(g,l))}}return g},enqueueEvents:function(a){a&&(i=e(i,a))},processEventQueue:function(){var a=i;i=null,f(a,j),g(!i)},__purge:function(){h={}},__getListenerBank:function(){return h}};b.exports=l},{103:103,118:118,133:133,18:18,19:19}],18:[function(a,b){"use strict";function c(){if(g)for(var a in h){var b=h[a],c=g.indexOf(a);if(f(c>-1),!i.plugins[c]){f(b.extractEvents),i.plugins[c]=b;var e=b.eventTypes;for(var j in e)f(d(e[j],b,j))}}}function d(a,b,c){f(!i.eventNameDispatchConfigs.hasOwnProperty(c)),i.eventNameDispatchConfigs[c]=a;var d=a.phasedRegistrationNames;if(d){for(var g in d)if(d.hasOwnProperty(g)){var h=d[g];e(h,b,c)}return!0}return a.registrationName?(e(a.registrationName,b,c),!0):!1}function e(a,b,c){f(!i.registrationNameModules[a]),i.registrationNameModules[a]=b,i.registrationNameDependencies[a]=b.eventTypes[c].dependencies}var f=a(133),g=null,h={},i={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(a){f(!g),g=Array.prototype.slice.call(a),c()},injectEventPluginsByName:function(a){var b=!1;for(var d in a)if(a.hasOwnProperty(d)){var e=a[d];h.hasOwnProperty(d)&&h[d]===e||(f(!h[d]),h[d]=e,b=!0)}b&&c()},getPluginModuleForEvent:function(a){var b=a.dispatchConfig;if(b.registrationName)return i.registrationNameModules[b.registrationName]||null;for(var c in b.phasedRegistrationNames)if(b.phasedRegistrationNames.hasOwnProperty(c)){var d=i.registrationNameModules[b.phasedRegistrationNames[c]];if(d)return d}return null},_resetEventPlugins:function(){g=null;for(var a in h)h.hasOwnProperty(a)&&delete h[a];i.plugins.length=0;var b=i.eventNameDispatchConfigs;for(var c in b)b.hasOwnProperty(c)&&delete b[c];var d=i.registrationNameModules;for(var e in d)d.hasOwnProperty(e)&&delete d[e]}};b.exports=i},{133:133}],19:[function(a,b){"use strict";function c(a){return a===p.topMouseUp||a===p.topTouchEnd||a===p.topTouchCancel}function d(a){return a===p.topMouseMove||a===p.topTouchMove}function e(a){return a===p.topMouseDown||a===p.topTouchStart}function f(a,b){var c=a._dispatchListeners,d=a._dispatchIDs;if(Array.isArray(c))for(var e=0;ea&&c[a]===e[a];a++);var g=d-a;for(b=1;g>=b&&c[d-b]===e[f-b];b++);var h=b>1?1-b:void 0;return this._fallbackText=e.slice(a,h),this._fallbackText}}),d.addPoolingTo(c),b.exports=c},{128:128,27:27,28:28}],23:[function(a,b){"use strict";var c,d=a(10),e=a(21),f=d.injection.MUST_USE_ATTRIBUTE,g=d.injection.MUST_USE_PROPERTY,h=d.injection.HAS_BOOLEAN_VALUE,i=d.injection.HAS_SIDE_EFFECTS,j=d.injection.HAS_NUMERIC_VALUE,k=d.injection.HAS_POSITIVE_NUMERIC_VALUE,l=d.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(e.canUseDOM){var m=document.implementation;c=m&&m.hasFeature&&m.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var n={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:f|h,allowTransparency:f,alt:null,async:h,autoComplete:null,autoPlay:h,cellPadding:null,cellSpacing:null,charSet:f,checked:g|h,classID:f,className:c?f:g,cols:f|k,colSpan:null,content:null,contentEditable:null,contextMenu:f,controls:g|h,coords:null,crossOrigin:null,data:null,dateTime:f,defer:h,dir:null,disabled:f|h,download:l,draggable:null,encType:null,form:f,formAction:f,formEncType:f,formMethod:f,formNoValidate:h,formTarget:f,frameBorder:f,headers:null,height:f,hidden:f|h,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:g,label:null,lang:null,list:f,loop:g|h,manifest:f,marginHeight:null,marginWidth:null,max:null,maxLength:f,media:f,mediaGroup:null,method:null,min:null,multiple:g|h,muted:g|h,name:null,noValidate:h,open:h,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:g|h,rel:null,required:h,role:f,rows:f|k,rowSpan:null,sandbox:null,scope:null,scrolling:null,seamless:f|h,selected:g|h,shape:null,size:f|k,sizes:f,span:k,spellCheck:null,src:null,srcDoc:g,srcSet:f,start:j,step:null,style:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:g|i,width:f,wmode:f,autoCapitalize:null,autoCorrect:null,itemProp:f,itemScope:f|h,itemType:f,itemID:f,itemRef:f,property:null},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoCapitalize:"autocapitalize",autoComplete:"autocomplete",autoCorrect:"autocorrect",autoFocus:"autofocus",autoPlay:"autoplay",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};b.exports=n},{10:10,21:21}],24:[function(a,b){"use strict";function c(a){i(null==a.props.checkedLink||null==a.props.valueLink)}function d(a){c(a),i(null==a.props.value&&null==a.props.onChange)}function e(a){c(a),i(null==a.props.checked&&null==a.props.onChange)}function f(a){this.props.valueLink.requestChange(a.target.value)}function g(a){this.props.checkedLink.requestChange(a.target.checked)}var h=a(76),i=a(133),j={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},k={Mixin:{propTypes:{value:function(a,b){return!a[b]||j[a.type]||a.onChange||a.readOnly||a.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(a,b){return!a[b]||a.onChange||a.readOnly||a.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:h.func}},getValue:function(a){return a.props.valueLink?(d(a),a.props.valueLink.value):a.props.value},getChecked:function(a){return a.props.checkedLink?(e(a),a.props.checkedLink.value):a.props.checked},getOnChange:function(a){return a.props.valueLink?(d(a),f):a.props.checkedLink?(e(a),g):a.props.onChange}};b.exports=k},{133:133,76:76}],25:[function(a,b){"use strict";function c(a){a.remove()}var d=a(30),e=a(103),f=a(118),g=a(133),h={trapBubbledEvent:function(a,b){g(this.isMounted());var c=this.getDOMNode();g(c);var f=d.trapBubbledEvent(a,b,c);this._localEventListeners=e(this._localEventListeners,f)},componentWillUnmount:function(){this._localEventListeners&&f(this._localEventListeners,c)}};b.exports=h},{103:103,118:118,133:133,30:30}],26:[function(a,b){"use strict";var c=a(15),d=a(112),e=c.topLevelTypes,f={eventTypes:null,extractEvents:function(a,b,c,f){if(a===e.topTouchStart){var g=f.target;g&&!g.onclick&&(g.onclick=d)}}};b.exports=f},{112:112,15:15}],27:[function(a,b){"use strict";function c(a){if(null==a)throw new TypeError("Object.assign target cannot be null or undefined");for(var b=Object(a),c=Object.prototype.hasOwnProperty,d=1;dk;k++){var m=h[k];g.hasOwnProperty(m)&&g[m]||(m===i.topWheel?j("wheel")?p.ReactEventListener.trapBubbledEvent(i.topWheel,"wheel",e):j("mousewheel")?p.ReactEventListener.trapBubbledEvent(i.topWheel,"mousewheel",e):p.ReactEventListener.trapBubbledEvent(i.topWheel,"DOMMouseScroll",e):m===i.topScroll?j("scroll",!0)?p.ReactEventListener.trapCapturedEvent(i.topScroll,"scroll",e):p.ReactEventListener.trapBubbledEvent(i.topScroll,"scroll",p.ReactEventListener.WINDOW_HANDLE):m===i.topFocus||m===i.topBlur?(j("focus",!0)?(p.ReactEventListener.trapCapturedEvent(i.topFocus,"focus",e),p.ReactEventListener.trapCapturedEvent(i.topBlur,"blur",e)):j("focusin")&&(p.ReactEventListener.trapBubbledEvent(i.topFocus,"focusin",e),p.ReactEventListener.trapBubbledEvent(i.topBlur,"focusout",e)),g[i.topBlur]=!0,g[i.topFocus]=!0):n.hasOwnProperty(m)&&p.ReactEventListener.trapBubbledEvent(m,n[m],e),g[m]=!0)}},trapBubbledEvent:function(a,b,c){return p.ReactEventListener.trapBubbledEvent(a,b,c)},trapCapturedEvent:function(a,b,c){return p.ReactEventListener.trapCapturedEvent(a,b,c)},ensureScrollValueMonitoring:function(){if(!l){var a=h.refreshScrollValues; + +p.ReactEventListener.monitorScrollValue(a),l=!0}},eventNameDispatchConfigs:e.eventNameDispatchConfigs,registrationNameModules:e.registrationNameModules,putListener:e.putListener,getListener:e.getListener,deleteListener:e.deleteListener,deleteAllListeners:e.deleteAllListeners});b.exports=p},{102:102,134:134,15:15,17:17,18:18,27:27,59:59}],31:[function(a,b){"use strict";var c=a(79),d=a(116),e=a(132),f=a(147),g={instantiateChildren:function(a){var b=d(a);for(var c in b)if(b.hasOwnProperty(c)){var f=b[c],g=e(f,null);b[c]=g}return b},updateChildren:function(a,b,g,h){var i=d(b);if(!i&&!a)return null;var j;for(j in i)if(i.hasOwnProperty(j)){var k=a&&a[j],l=k&&k._currentElement,m=i[j];if(f(l,m))c.receiveComponent(k,m,g,h),i[j]=k;else{k&&c.unmountComponent(k,j);var n=e(m,null);i[j]=n}}for(j in a)!a.hasOwnProperty(j)||i&&i.hasOwnProperty(j)||c.unmountComponent(a[j]);return i},unmountChildren:function(a){for(var b in a){var d=a[b];c.unmountComponent(d)}}};b.exports=g},{116:116,132:132,147:147,79:79}],32:[function(a,b){"use strict";function c(a,b){this.forEachFunction=a,this.forEachContext=b}function d(a,b,c,d){var e=a;e.forEachFunction.call(e.forEachContext,b,d)}function e(a,b,e){if(null==a)return a;var f=c.getPooled(b,e);m(a,d,f),c.release(f)}function f(a,b,c){this.mapResult=a,this.mapFunction=b,this.mapContext=c}function g(a,b,c,d){var e=a,f=e.mapResult,g=!f.hasOwnProperty(c);if(g){var h=e.mapFunction.call(e.mapContext,b,d);f[c]=h}}function h(a,b,c){if(null==a)return a;var d={},e=f.getPooled(d,b,c);return m(a,g,e),f.release(e),l.create(d)}function i(){return null}function j(a){return m(a,i,null)}var k=a(28),l=a(61),m=a(149),n=(a(150),k.twoArgumentPooler),o=k.threeArgumentPooler;k.addPoolingTo(c,n),k.addPoolingTo(f,o);var p={forEach:e,map:h,count:j};b.exports=p},{149:149,150:150,28:28,61:61}],33:[function(a,b){"use strict";function c(a,b){var c=x.hasOwnProperty(b)?x[b]:null;z.hasOwnProperty(b)&&r(c===v.OVERRIDE_BASE),a.hasOwnProperty(b)&&r(c===v.DEFINE_MANY||c===v.DEFINE_MANY_MERGED)}function d(a,b){if(b){r("function"!=typeof b),r(!l.isValidElement(b));var d=a.prototype;b.hasOwnProperty(u)&&y.mixins(a,b.mixins);for(var e in b)if(b.hasOwnProperty(e)&&e!==u){var f=b[e];if(c(d,e),y.hasOwnProperty(e))y[e](a,f);else{var i=x.hasOwnProperty(e),j=d.hasOwnProperty(e),k=f&&f.__reactDontBind,m="function"==typeof f,n=m&&!i&&!j&&!k;if(n)d.__reactAutoBindMap||(d.__reactAutoBindMap={}),d.__reactAutoBindMap[e]=f,d[e]=f;else if(j){var o=x[e];r(i&&(o===v.DEFINE_MANY_MERGED||o===v.DEFINE_MANY)),o===v.DEFINE_MANY_MERGED?d[e]=g(d[e],f):o===v.DEFINE_MANY&&(d[e]=h(d[e],f))}else d[e]=f}}}}function e(a,b){if(b)for(var c in b){var d=b[c];if(b.hasOwnProperty(c)){var e=c in y;r(!e);var f=c in a;r(!f),a[c]=d}}}function f(a,b){r(a&&b&&"object"==typeof a&&"object"==typeof b);for(var c in b)b.hasOwnProperty(c)&&(r(void 0===a[c]),a[c]=b[c]);return a}function g(a,b){return function(){var c=a.apply(this,arguments),d=b.apply(this,arguments);if(null==c)return d;if(null==d)return c;var e={};return f(e,c),f(e,d),e}}function h(a,b){return function(){a.apply(this,arguments),b.apply(this,arguments)}}function i(a,b){var c=b.bind(a);return c}function j(a){for(var b in a.__reactAutoBindMap)if(a.__reactAutoBindMap.hasOwnProperty(b)){var c=a.__reactAutoBindMap[b];a[b]=i(a,m.guard(c,a.constructor.displayName+"."+b))}}var k=a(34),l=(a(39),a(55)),m=a(58),n=a(65),o=a(66),p=(a(75),a(74),a(84)),q=a(27),r=a(133),s=a(138),t=a(139),u=(a(150),t({mixins:null})),v=s({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),w=[],x={mixins:v.DEFINE_MANY,statics:v.DEFINE_MANY,propTypes:v.DEFINE_MANY,contextTypes:v.DEFINE_MANY,childContextTypes:v.DEFINE_MANY,getDefaultProps:v.DEFINE_MANY_MERGED,getInitialState:v.DEFINE_MANY_MERGED,getChildContext:v.DEFINE_MANY_MERGED,render:v.DEFINE_ONCE,componentWillMount:v.DEFINE_MANY,componentDidMount:v.DEFINE_MANY,componentWillReceiveProps:v.DEFINE_MANY,shouldComponentUpdate:v.DEFINE_ONCE,componentWillUpdate:v.DEFINE_MANY,componentDidUpdate:v.DEFINE_MANY,componentWillUnmount:v.DEFINE_MANY,updateComponent:v.OVERRIDE_BASE},y={displayName:function(a,b){a.displayName=b},mixins:function(a,b){if(b)for(var c=0;c";return this._createOpenTagMarkupAndPutListeners(b)+this._createContentMarkup(b,d)+e},_createOpenTagMarkupAndPutListeners:function(a){var b=this._currentElement.props,c="<"+this._tag;for(var e in b)if(b.hasOwnProperty(e)){var f=b[e];if(null!=f)if(u.hasOwnProperty(e))d(this._rootNodeID,e,f,a);else{e===w&&(f&&(f=this._previousStyleCopy=o({},b.style)),f=g.createMarkupForStyles(f));var h=i.createMarkupForProperty(e,f);h&&(c+=" "+h)}}if(a.renderToStaticMarkup)return c+">";var j=i.createMarkupForID(this._rootNodeID);return c+" "+j+">"},_createContentMarkup:function(a,b){var c="";("listing"===this._tag||"pre"===this._tag||"textarea"===this._tag)&&(c="\n");var d=this._currentElement.props,e=d.dangerouslySetInnerHTML;if(null!=e){if(null!=e.__html)return c+e.__html}else{var f=v[typeof d.children]?d.children:null,g=null!=f?null:d.children;if(null!=f)return c+p(f);if(null!=g){var h=this.mountChildren(g,a,b);return c+h.join("")}}return c},receiveComponent:function(a,b,c){var d=this._currentElement;this._currentElement=a,this.updateComponent(b,d,a,c)},updateComponent:function(a,b,d,e){c(this._currentElement.props),this._updateDOMProperties(b.props,a),this._updateDOMChildren(b.props,a,e)},_updateDOMProperties:function(a,b){var c,e,f,g=this._currentElement.props;for(c in a)if(!g.hasOwnProperty(c)&&a.hasOwnProperty(c))if(c===w){var i=this._previousStyleCopy;for(e in i)i.hasOwnProperty(e)&&(f=f||{},f[e]="");this._previousStyleCopy=null}else u.hasOwnProperty(c)?s(this._rootNodeID,c):(h.isStandardName[c]||h.isCustomAttribute(c))&&y.deletePropertyByID(this._rootNodeID,c);for(c in g){var j=g[c],k=c===w?this._previousStyleCopy:a[c];if(g.hasOwnProperty(c)&&j!==k)if(c===w)if(j&&(j=this._previousStyleCopy=o({},j)),k){for(e in k)!k.hasOwnProperty(e)||j&&j.hasOwnProperty(e)||(f=f||{},f[e]="");for(e in j)j.hasOwnProperty(e)&&k[e]!==j[e]&&(f=f||{},f[e]=j[e])}else f=j;else u.hasOwnProperty(c)?d(this._rootNodeID,c,j,b):(h.isStandardName[c]||h.isCustomAttribute(c))&&y.updatePropertyByID(this._rootNodeID,c,j)}f&&y.updateStylesByID(this._rootNodeID,f)},_updateDOMChildren:function(a,b,c){var d=this._currentElement.props,e=v[typeof a.children]?a.children:null,f=v[typeof d.children]?d.children:null,g=a.dangerouslySetInnerHTML&&a.dangerouslySetInnerHTML.__html,h=d.dangerouslySetInnerHTML&&d.dangerouslySetInnerHTML.__html,i=null!=e?null:a.children,j=null!=f?null:d.children,k=null!=e||null!=g,l=null!=f||null!=h;null!=i&&null==j?this.updateChildren(null,b,c):k&&!l&&this.updateTextContent(""),null!=f?e!==f&&this.updateTextContent(""+f):null!=h?g!==h&&y.updateInnerHTMLByID(this._rootNodeID,h):null!=j&&this.updateChildren(j,b,c)},unmountComponent:function(){this.unmountChildren(),j.deleteAllListeners(this._rootNodeID),k.unmountIDFromEnvironment(this._rootNodeID),this._rootNodeID=null}},n.measureMethods(f,"ReactDOMComponent",{mountComponent:"mountComponent",updateComponent:"updateComponent"}),o(f.prototype,f.Mixin,m.Mixin),f.injection={injectIDOperations:function(a){f.BackendIDOperations=y=a}},b.exports=f},{10:10,11:11,114:114,133:133,134:134,139:139,150:150,27:27,30:30,35:35,5:5,68:68,69:69,73:73}],43:[function(a,b){"use strict";var c=a(15),d=a(25),e=a(29),f=a(33),g=a(55),h=g.createFactory("form"),i=f.createClass({displayName:"ReactDOMForm",tagName:"FORM",mixins:[e,d],render:function(){return h(this.props)},componentDidMount:function(){this.trapBubbledEvent(c.topLevelTypes.topReset,"reset"),this.trapBubbledEvent(c.topLevelTypes.topSubmit,"submit")}});b.exports=i},{15:15,25:25,29:29,33:33,55:55}],44:[function(a,b){"use strict";var c=a(5),d=a(9),e=a(11),f=a(68),g=a(73),h=a(133),i=a(144),j={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},k={updatePropertyByID:function(a,b,c){var d=f.getNode(a);h(!j.hasOwnProperty(b)),null!=c?e.setValueForProperty(d,b,c):e.deleteValueForProperty(d,b)},deletePropertyByID:function(a,b,c){var d=f.getNode(a);h(!j.hasOwnProperty(b)),e.deleteValueForProperty(d,b,c)},updateStylesByID:function(a,b){var d=f.getNode(a);c.setValueForStyles(d,b)},updateInnerHTMLByID:function(a,b){var c=f.getNode(a);i(c,b)},updateTextContentByID:function(a,b){var c=f.getNode(a);d.updateTextContent(c,b)},dangerouslyReplaceNodeWithMarkupByID:function(a,b){var c=f.getNode(a);d.dangerouslyReplaceNodeWithMarkup(c,b)},dangerouslyProcessChildrenUpdates:function(a,b){for(var c=0;cl;l++){var p=i[l];if(p!==g&&p.form===g.form){var q=j.getID(p);m(q);var r=o[q];m(r),k.asap(c,r)}}}return b}});b.exports=p},{11:11,133:133,2:2,24:24,27:27,29:29,33:33,55:55,68:68,85:85}],48:[function(a,b){"use strict";var c=a(29),d=a(33),e=a(55),f=(a(150),e.createFactory("option")),g=d.createClass({displayName:"ReactDOMOption",tagName:"OPTION",mixins:[c],componentWillMount:function(){},render:function(){return f(this.props,this.props.children)}});b.exports=g},{150:150,29:29,33:33,55:55}],49:[function(a,b){"use strict";function c(){if(this._pendingUpdate){this._pendingUpdate=!1;var a=g.getValue(this);null!=a&&this.isMounted()&&e(this,a)}}function d(a,b){if(null==a[b])return null;if(a.multiple){if(!Array.isArray(a[b]))return new Error("The `"+b+"` prop supplied to must be a scalar value if `multiple` is false.")}function e(a,b){var c,d,e,f=a.getDOMNode().options;if(a.props.multiple){for(c={},d=0,e=b.length;e>d;d++)c[""+b[d]]=!0;for(d=0,e=f.length;e>d;d++){var g=c.hasOwnProperty(f[d].value);f[d].selected!==g&&(f[d].selected=g)}}else{for(c=""+b,d=0,e=f.length;e>d;d++)if(f[d].value===c)return void(f[d].selected=!0);f.length&&(f[0].selected=!0)}}var f=a(2),g=a(24),h=a(29),i=a(33),j=a(55),k=a(85),l=a(27),m=j.createFactory("select"),n=i.createClass({displayName:"ReactDOMSelect",tagName:"SELECT",mixins:[f,g.Mixin,h],propTypes:{defaultValue:d,value:d},render:function(){var a=l({},this.props);return a.onChange=this._handleChange,a.value=null,m(a,this.props.children)},componentWillMount:function(){this._pendingUpdate=!1},componentDidMount:function(){var a=g.getValue(this);null!=a?e(this,a):null!=this.props.defaultValue&&e(this,this.props.defaultValue)},componentDidUpdate:function(a){var b=g.getValue(this);null!=b?(this._pendingUpdate=!1,e(this,b)):!a.multiple!=!this.props.multiple&&(null!=this.props.defaultValue?e(this,this.props.defaultValue):e(this,this.props.multiple?[]:""))},_handleChange:function(a){var b,d=g.getOnChange(this);return d&&(b=d.call(this,a)),this._pendingUpdate=!0,k.asap(c,this),b}});b.exports=n},{2:2,24:24,27:27,29:29,33:33,55:55,85:85}],50:[function(a,b){"use strict";function c(a,b,c,d){return a===c&&b===d}function d(a){var b=document.selection,c=b.createRange(),d=c.text.length,e=c.duplicate();e.moveToElementText(a),e.setEndPoint("EndToStart",c);var f=e.text.length,g=f+d;return{start:f,end:g}}function e(a){var b=window.getSelection&&window.getSelection();if(!b||0===b.rangeCount)return null;var d=b.anchorNode,e=b.anchorOffset,f=b.focusNode,g=b.focusOffset,h=b.getRangeAt(0),i=c(b.anchorNode,b.anchorOffset,b.focusNode,b.focusOffset),j=i?0:h.toString().length,k=h.cloneRange();k.selectNodeContents(a),k.setEnd(h.startContainer,h.startOffset);var l=c(k.startContainer,k.startOffset,k.endContainer,k.endOffset),m=l?0:k.toString().length,n=m+j,o=document.createRange();o.setStart(d,e),o.setEnd(f,g);var p=o.collapsed;return{start:p?n:m,end:p?m:n}}function f(a,b){var c,d,e=document.selection.createRange().duplicate();"undefined"==typeof b.end?(c=b.start,d=c):b.start>b.end?(c=b.end,d=b.start):(c=b.start,d=b.end),e.moveToElementText(a),e.moveStart("character",c),e.setEndPoint("EndToStart",e),e.moveEnd("character",d-c),e.select()}function g(a,b){if(window.getSelection){var c=window.getSelection(),d=a[j()].length,e=Math.min(b.start,d),f="undefined"==typeof b.end?e:Math.min(b.end,d);if(!c.extend&&e>f){var g=f;f=e,e=g}var h=i(a,e),k=i(a,f);if(h&&k){var l=document.createRange();l.setStart(h.node,h.offset),c.removeAllRanges(),e>f?(c.addRange(l),c.extend(k.node,k.offset)):(l.setEnd(k.node,k.offset),c.addRange(l))}}}var h=a(21),i=a(126),j=a(128),k=h.canUseDOM&&"selection"in document&&!("getSelection"in window),l={getOffsets:k?d:e,setOffsets:k?f:g};b.exports=l},{126:126,128:128,21:21}],51:[function(a,b){"use strict";var c=a(11),d=a(35),e=a(42),f=a(27),g=a(114),h=function(){};f(h.prototype,{construct:function(a){this._currentElement=a,this._stringText=""+a,this._rootNodeID=null,this._mountIndex=0},mountComponent:function(a,b){this._rootNodeID=a;var d=g(this._stringText);return b.renderToStaticMarkup?d:""+d+""},receiveComponent:function(a){if(a!==this._currentElement){this._currentElement=a;var b=""+a;b!==this._stringText&&(this._stringText=b,e.BackendIDOperations.updateTextContentByID(this._rootNodeID,b))}},unmountComponent:function(){d.unmountIDFromEnvironment(this._rootNodeID)}}),b.exports=h},{11:11,114:114,27:27,35:35,42:42}],52:[function(a,b){"use strict";function c(){this.isMounted()&&this.forceUpdate()}var d=a(2),e=a(11),f=a(24),g=a(29),h=a(33),i=a(55),j=a(85),k=a(27),l=a(133),m=(a(150),i.createFactory("textarea")),n=h.createClass({displayName:"ReactDOMTextarea",tagName:"TEXTAREA",mixins:[d,f.Mixin,g],getInitialState:function(){var a=this.props.defaultValue,b=this.props.children;null!=b&&(l(null==a),Array.isArray(b)&&(l(b.length<=1),b=b[0]),a=""+b),null==a&&(a="");var c=f.getValue(this);return{initialValue:""+(null!=c?c:a)}},render:function(){var a=k({},this.props);return l(null==a.dangerouslySetInnerHTML),a.defaultValue=null,a.value=null,a.onChange=this._handleChange,m(a,this.state.initialValue)},componentDidUpdate:function(){var a=f.getValue(this);if(null!=a){var b=this.getDOMNode();e.setValueForProperty(b,"value",""+a)}},_handleChange:function(a){var b,d=f.getOnChange(this);return d&&(b=d.call(this,a)),j.asap(c,this),b}});b.exports=n},{11:11,133:133,150:150,2:2,24:24,27:27,29:29,33:33,55:55,85:85}],53:[function(a,b){"use strict";function c(){this.reinitializeTransaction()}var d=a(85),e=a(101),f=a(27),g=a(112),h={initialize:g,close:function(){l.isBatchingUpdates=!1}},i={initialize:g,close:d.flushBatchedUpdates.bind(d)},j=[i,h];f(c.prototype,e.Mixin,{getTransactionWrappers:function(){return j}});var k=new c,l={isBatchingUpdates:!1,batchedUpdates:function(a,b,c,d,e){var f=l.isBatchingUpdates;l.isBatchingUpdates=!0,f?a(b,c,d,e):k.perform(a,null,b,c,d,e)}};b.exports=l},{101:101,112:112,27:27,85:85}],54:[function(a,b){"use strict";function c(a){return n.createClass({tagName:a.toUpperCase(),render:function(){return new B(a,null,null,null,null,this.props)}})}function d(){D.EventEmitter.injectReactEventListener(C),D.EventPluginHub.injectEventPluginOrder(h),D.EventPluginHub.injectInstanceHandle(E),D.EventPluginHub.injectMount(F),D.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:J,EnterLeaveEventPlugin:i,ChangeEventPlugin:f,MobileSafariClickEventPlugin:l,SelectEventPlugin:H,BeforeInputEventPlugin:e}),D.NativeComponent.injectGenericComponentClass(q),D.NativeComponent.injectTextComponentClass(A),D.NativeComponent.injectAutoWrapper(c),D.Class.injectMixin(m),D.NativeComponent.injectComponentClasses({button:r,form:s,iframe:v,img:t,input:w,option:x,select:y,textarea:z,html:L("html"),head:L("head"),body:L("body")}),D.DOMProperty.injectDOMPropertyConfig(k),D.DOMProperty.injectDOMPropertyConfig(K),D.EmptyComponent.injectEmptyComponent("noscript"),D.Updates.injectReconcileTransaction(G),D.Updates.injectBatchingStrategy(p),D.RootIndex.injectCreateReactRootIndex(j.canUseDOM?g.createReactRootIndex:I.createReactRootIndex),D.Component.injectEnvironment(o),D.DOMComponent.injectIDOperations(u)}var e=a(3),f=a(7),g=a(8),h=a(13),i=a(14),j=a(21),k=a(23),l=a(26),m=a(29),n=a(33),o=a(35),p=a(53),q=a(42),r=a(41),s=a(43),t=a(46),u=a(44),v=a(45),w=a(47),x=a(48),y=a(49),z=a(52),A=a(51),B=a(55),C=a(60),D=a(62),E=a(64),F=a(68),G=a(78),H=a(87),I=a(88),J=a(89),K=a(86),L=a(109);b.exports={inject:d}},{109:109,13:13,14:14,21:21,23:23,26:26,29:29,3:3,33:33,35:35,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,51:51,52:52,53:53,55:55,60:60,62:62,64:64,68:68,7:7,78:78,8:8,86:86,87:87,88:88,89:89}],55:[function(a,b){"use strict";var c=a(38),d=a(39),e=a(27),f=(a(150),{key:!0,ref:!0}),g=function(a,b,c,d,e,f){this.type=a,this.key=b,this.ref=c,this._owner=d,this._context=e,this.props=f};g.prototype={_isReactElement:!0},g.createElement=function(a,b,e){var h,i={},j=null,k=null;if(null!=b){k=void 0===b.ref?null:b.ref,j=void 0===b.key?null:""+b.key;for(h in b)b.hasOwnProperty(h)&&!f.hasOwnProperty(h)&&(i[h]=b[h]); + +}var l=arguments.length-2;if(1===l)i.children=e;else if(l>1){for(var m=Array(l),n=0;l>n;n++)m[n]=arguments[n+2];i.children=m}if(a&&a.defaultProps){var o=a.defaultProps;for(h in o)"undefined"==typeof i[h]&&(i[h]=o[h])}return new g(a,j,k,d.current,c.current,i)},g.createFactory=function(a){var b=g.createElement.bind(null,a);return b.type=a,b},g.cloneAndReplaceProps=function(a,b){var c=new g(a.type,a.key,a.ref,a._owner,a._context,b);return c},g.cloneElement=function(a,b,c){var h,i=e({},a.props),j=a.key,k=a.ref,l=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,l=d.current),void 0!==b.key&&(j=""+b.key);for(h in b)b.hasOwnProperty(h)&&!f.hasOwnProperty(h)&&(i[h]=b[h])}var m=arguments.length-2;if(1===m)i.children=c;else if(m>1){for(var n=Array(m),o=0;m>o;o++)n[o]=arguments[o+2];i.children=n}return new g(a.type,j,k,l,a._context,i)},g.isValidElement=function(a){var b=!(!a||!a._isReactElement);return b},b.exports=g},{150:150,27:27,38:38,39:39}],56:[function(a,b){"use strict";function c(){if(r.current){var a=r.current.getName();if(a)return" Check the render method of `"+a+"`."}return""}function d(a){var b=a&&a.getPublicInstance();if(!b)return void 0;var c=b.constructor;return c?c.displayName||c.name||void 0:void 0}function e(){var a=r.current;return a&&d(a)||void 0}function f(a,b){a._store.validated||null!=a.key||(a._store.validated=!0,h('Each child in an array or iterator should have a unique "key" prop.',a,b))}function g(a,b,c){x.test(a)&&h("Child objects should have non-numeric keys so ordering is preserved.",b,c)}function h(a,b,c){var f=e(),g="string"==typeof c?c:c.displayName||c.name,h=f||g,i=v[a]||(v[a]={});if(!i.hasOwnProperty(h)){i[h]=!0;var j="";if(b&&b._owner&&b._owner!==r.current){var k=d(b._owner);j=" It was passed a child from "+k+"."}}}function i(a,b){if(Array.isArray(a))for(var c=0;c");var h="";e&&(h=" The element was created by "+e+".")}}function l(a,b){return a!==a?b!==b:0===a&&0===b?1/a===1/b:a===b}function m(a){if(a._store){var b=a._store.originalProps,c=a.props;for(var d in c)c.hasOwnProperty(d)&&(b.hasOwnProperty(d)&&l(b[d],c[d])||(k(d,a),b[d]=c[d]))}}function n(a){if(null!=a.type){var b=s.getComponentClassForElement(a),c=b.displayName||b.name;b.propTypes&&j(c,b.propTypes,a.props,q.prop),"function"==typeof b.getDefaultProps}}var o=a(55),p=a(61),q=a(75),r=(a(74),a(39)),s=a(71),t=a(124),u=a(133),v=(a(150),{}),w={},x=/^\d+$/,y={},z={checkAndWarnForMutatedProps:m,createElement:function(a){var b=o.createElement.apply(this,arguments);if(null==b)return b;for(var c=2;ce;e++){b=a.ancestors[e];var g=k.getID(b)||"";p._handleTopLevel(a.topLevelType,b,g,a.nativeEvent)}}function f(a){var b=o(window);a(b)}var g=a(16),h=a(21),i=a(28),j=a(64),k=a(68),l=a(85),m=a(27),n=a(123),o=a(129);m(d.prototype,{destructor:function(){this.topLevelType=null,this.nativeEvent=null,this.ancestors.length=0}}),i.addPoolingTo(d,i.twoArgumentPooler);var p={_enabled:!0,_handleTopLevel:null,WINDOW_HANDLE:h.canUseDOM?window:null,setHandleTopLevel:function(a){p._handleTopLevel=a},setEnabled:function(a){p._enabled=!!a},isEnabled:function(){return p._enabled},trapBubbledEvent:function(a,b,c){var d=c;return d?g.listen(d,b,p.dispatchEvent.bind(null,a)):null},trapCapturedEvent:function(a,b,c){var d=c;return d?g.capture(d,b,p.dispatchEvent.bind(null,a)):null},monitorScrollValue:function(a){var b=f.bind(null,a);g.listen(window,"scroll",b)},dispatchEvent:function(a,b){if(p._enabled){var c=d.getPooled(a,b);try{l.batchedUpdates(e,c)}finally{d.release(c)}}}};b.exports=p},{123:123,129:129,16:16,21:21,27:27,28:28,64:64,68:68,85:85}],61:[function(a,b){"use strict";var c=(a(55),a(150),{create:function(a){return a},extract:function(a){return a},extractIfFragment:function(a){return a}});b.exports=c},{150:150,55:55}],62:[function(a,b){"use strict";var c=a(10),d=a(17),e=a(36),f=a(33),g=a(57),h=a(30),i=a(71),j=a(42),k=a(73),l=a(81),m=a(85),n={Component:e.injection,Class:f.injection,DOMComponent:j.injection,DOMProperty:c.injection,EmptyComponent:g.injection,EventPluginHub:d.injection,EventEmitter:h.injection,NativeComponent:i.injection,Perf:k.injection,RootIndex:l.injection,Updates:m.injection};b.exports=n},{10:10,17:17,30:30,33:33,36:36,42:42,57:57,71:71,73:73,81:81,85:85}],63:[function(a,b){"use strict";function c(a){return e(document.documentElement,a)}var d=a(50),e=a(107),f=a(117),g=a(119),h={hasSelectionCapabilities:function(a){return a&&("INPUT"===a.nodeName&&"text"===a.type||"TEXTAREA"===a.nodeName||"true"===a.contentEditable)},getSelectionInformation:function(){var a=g();return{focusedElem:a,selectionRange:h.hasSelectionCapabilities(a)?h.getSelection(a):null}},restoreSelection:function(a){var b=g(),d=a.focusedElem,e=a.selectionRange;b!==d&&c(d)&&(h.hasSelectionCapabilities(d)&&h.setSelection(d,e),f(d))},getSelection:function(a){var b;if("selectionStart"in a)b={start:a.selectionStart,end:a.selectionEnd};else if(document.selection&&"INPUT"===a.nodeName){var c=document.selection.createRange();c.parentElement()===a&&(b={start:-c.moveStart("character",-a.value.length),end:-c.moveEnd("character",-a.value.length)})}else b=d.getOffsets(a);return b||{start:0,end:0}},setSelection:function(a,b){var c=b.start,e=b.end;if("undefined"==typeof e&&(e=c),"selectionStart"in a)a.selectionStart=c,a.selectionEnd=Math.min(e,a.value.length);else if(document.selection&&"INPUT"===a.nodeName){var f=a.createTextRange();f.collapse(!0),f.moveStart("character",c),f.moveEnd("character",e-c),f.select()}else d.setOffsets(a,b)}};b.exports=h},{107:107,117:117,119:119,50:50}],64:[function(a,b){"use strict";function c(a){return m+a.toString(36)}function d(a,b){return a.charAt(b)===m||b===a.length}function e(a){return""===a||a.charAt(0)===m&&a.charAt(a.length-1)!==m}function f(a,b){return 0===b.indexOf(a)&&d(b,a.length)}function g(a){return a?a.substr(0,a.lastIndexOf(m)):""}function h(a,b){if(l(e(a)&&e(b)),l(f(a,b)),a===b)return a;var c,g=a.length+n;for(c=g;c=g;g++)if(d(a,g)&&d(b,g))f=g;else if(a.charAt(g)!==b.charAt(g))break;var h=a.substr(0,f);return l(e(h)),h}function j(a,b,c,d,e,i){a=a||"",b=b||"",l(a!==b);var j=f(b,a);l(j||f(a,b));for(var k=0,m=j?g:h,n=a;;n=m(n,b)){var p;if(e&&n===a||i&&n===b||(p=c(n,j,d)),p===!1||n===b)break;l(k++1){var b=a.indexOf(m,1);return b>-1?a.substr(0,b):a}return null},traverseEnterLeave:function(a,b,c,d,e){var f=i(a,b);f!==a&&j(a,f,c,d,!1,!0),f!==b&&j(f,b,c,e,!0,!1)},traverseTwoPhase:function(a,b,c){a&&(j("",a,b,c,!0,!1),j(a,"",b,c,!1,!0))},traverseAncestors:function(a,b,c){j("",a,b,c,!0,!1)},_getFirstCommonAncestorID:i,_getNextDescendantID:h,isAncestorIDOf:f,SEPARATOR:m};b.exports=p},{133:133,81:81}],65:[function(a,b){"use strict";var c={remove:function(a){a._reactInternalInstance=void 0},get:function(a){return a._reactInternalInstance},has:function(a){return void 0!==a._reactInternalInstance},set:function(a,b){a._reactInternalInstance=b}};b.exports=c},{}],66:[function(a,b){"use strict";var c={currentlyMountingInstance:null,currentlyUnmountingInstance:null};b.exports=c},{}],67:[function(a,b){"use strict";var c=a(104),d={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(a){var b=c(a);return a.replace(">"," "+d.CHECKSUM_ATTR_NAME+'="'+b+'">')},canReuseMarkup:function(a,b){var e=b.getAttribute(d.CHECKSUM_ATTR_NAME);e=e&&parseInt(e,10);var f=c(a);return f===e}};b.exports=d},{104:104}],68:[function(a,b){"use strict";function c(a,b){for(var c=Math.min(a.length,b.length),d=0;c>d;d++)if(a.charAt(d)!==b.charAt(d))return d;return a.length===b.length?-1:c}function d(a){var b=C(a);return b&&Q.getID(b)}function e(a){var b=f(a);if(b)if(J.hasOwnProperty(b)){var c=J[b];c!==a&&(E(!j(c,b)),J[b]=a)}else J[b]=a;return b}function f(a){return a&&a.getAttribute&&a.getAttribute(I)||""}function g(a,b){var c=f(a);c!==b&&delete J[c],a.setAttribute(I,b),J[b]=a}function h(a){return J.hasOwnProperty(a)&&j(J[a],a)||(J[a]=Q.findReactNodeByID(a)),J[a]}function i(a){var b=u.get(a)._rootNodeID;return s.isNullComponentID(b)?null:(J.hasOwnProperty(b)&&j(J[b],b)||(J[b]=Q.findReactNodeByID(b)),J[b])}function j(a,b){if(a){E(f(a)===b);var c=Q.findReactContainerForID(b);if(c&&B(c,a))return!0}return!1}function k(a){delete J[a]}function l(a){var b=J[a];return b&&j(b,a)?void(P=b):!1}function m(a){P=null,t.traverseAncestors(a,l);var b=P;return P=null,b}function n(a,b,c,d,e){var f=x.mountComponent(a,b,d,A);a._isTopLevel=!0,Q._mountImageIntoNode(f,c,e)}function o(a,b,c,d){var e=z.ReactReconcileTransaction.getPooled();e.perform(n,null,a,b,c,e,d),z.ReactReconcileTransaction.release(e)}var p=a(10),q=a(30),r=(a(39),a(55)),s=(a(56),a(57)),t=a(64),u=a(65),v=a(67),w=a(73),x=a(79),y=a(84),z=a(85),A=a(113),B=a(107),C=a(127),D=a(132),E=a(133),F=a(144),G=a(147),H=(a(150),t.SEPARATOR),I=p.ID_ATTRIBUTE_NAME,J={},K=1,L=9,M={},N={},O=[],P=null,Q={_instancesByReactRootID:M,scrollMonitor:function(a,b){b()},_updateRootComponent:function(a,b,c,d){return Q.scrollMonitor(c,function(){y.enqueueElementInternal(a,b),d&&y.enqueueCallbackInternal(a,d)}),a},_registerComponent:function(a,b){E(b&&(b.nodeType===K||b.nodeType===L)),q.ensureScrollValueMonitoring();var c=Q.registerContainer(b);return M[c]=a,c},_renderNewRootComponent:function(a,b,c){var d=D(a,null),e=Q._registerComponent(d,b);return z.batchedUpdates(o,d,e,b,c),d},render:function(a,b,c){E(r.isValidElement(a));var e=M[d(b)];if(e){var f=e._currentElement;if(G(f,a))return Q._updateRootComponent(e,a,b,c).getPublicInstance();Q.unmountComponentAtNode(b)}var g=C(b),h=g&&Q.isRenderedByReact(g),i=h&&!e,j=Q._renderNewRootComponent(a,b,i).getPublicInstance();return c&&c.call(j),j},constructAndRenderComponent:function(a,b,c){var d=r.createElement(a,b);return Q.render(d,c)},constructAndRenderComponentByID:function(a,b,c){var d=document.getElementById(c);return E(d),Q.constructAndRenderComponent(a,b,d)},registerContainer:function(a){var b=d(a);return b&&(b=t.getReactRootIDFromNodeID(b)),b||(b=t.createReactRootID()),N[b]=a,b},unmountComponentAtNode:function(a){E(a&&(a.nodeType===K||a.nodeType===L));var b=d(a),c=M[b];return c?(Q.unmountComponentFromNode(c,a),delete M[b],delete N[b],!0):!1},unmountComponentFromNode:function(a,b){for(x.unmountComponent(a),b.nodeType===L&&(b=b.documentElement);b.lastChild;)b.removeChild(b.lastChild)},findReactContainerForID:function(a){var b=t.getReactRootIDFromNodeID(a),c=N[b];return c},findReactNodeByID:function(a){var b=Q.findReactContainerForID(a);return Q.findComponentRoot(b,a)},isRenderedByReact:function(a){if(1!==a.nodeType)return!1;var b=Q.getID(a);return b?b.charAt(0)===H:!1},getFirstReactDOM:function(a){for(var b=a;b&&b.parentNode!==b;){if(Q.isRenderedByReact(b))return b;b=b.parentNode}return null},findComponentRoot:function(a,b){var c=O,d=0,e=m(b)||a;for(c[0]=e.firstChild,c.length=1;d>",v=g(),w=l(),x={array:d("array"),bool:d("boolean"),func:d("function"),number:d("number"),object:d("object"),string:d("string"),any:e(),arrayOf:f,element:v,instanceOf:h,node:w,objectOf:j,oneOf:i,oneOfType:k,shape:m};b.exports=x},{112:112,55:55,61:61,74:74}],77:[function(a,b){"use strict";function c(){this.listenersToPut=[]}var d=a(28),e=a(30),f=a(27);f(c.prototype,{enqueuePutListener:function(a,b,c){this.listenersToPut.push({rootNodeID:a,propKey:b,propValue:c})},putListeners:function(){for(var a=0;ac;c++){var d=q[c],e=d._pendingCallbacks;if(d._pendingCallbacks=null,m.performUpdateIfNecessary(d,a.reconcileTransaction),e)for(var g=0;g":">","<":"<",'"':""","'":"'"},f=/[&><"']/g;b.exports=d},{}],115:[function(a,b){"use strict";function c(a){return null==a?null:g(a)?a:d.has(a)?e.getNodeFromInstance(a):(f(null==a.render||"function"!=typeof a.render),void f(!1))}var d=(a(39),a(65)),e=a(68),f=a(133),g=a(135);a(150),b.exports=c},{133:133,135:135,150:150,39:39,65:65,68:68}],116:[function(a,b){"use strict";function c(a,b,c){var d=a,e=!d.hasOwnProperty(c);e&&null!=b&&(d[c]=b)}function d(a){if(null==a)return a;var b={};return e(a,c,b),b}var e=a(149);a(150),b.exports=d},{149:149,150:150}],117:[function(a,b){"use strict";function c(a){try{a.focus()}catch(b){}}b.exports=c},{}],118:[function(a,b){"use strict";var c=function(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)};b.exports=c},{}],119:[function(a,b){function c(){try{return document.activeElement||document.body}catch(a){return document.body}}b.exports=c},{}],120:[function(a,b){"use strict";function c(a){var b,c=a.keyCode;return"charCode"in a?(b=a.charCode,0===b&&13===c&&(b=13)):b=c,b>=32||13===b?b:0}b.exports=c},{}],121:[function(a,b){"use strict";function c(a){if(a.key){var b=e[a.key]||a.key;if("Unidentified"!==b)return b}if("keypress"===a.type){var c=d(a);return 13===c?"Enter":String.fromCharCode(c)}return"keydown"===a.type||"keyup"===a.type?f[a.keyCode]||"Unidentified":""}var d=a(120),e={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};b.exports=c},{120:120}],122:[function(a,b){"use strict";function c(a){var b=this,c=b.nativeEvent;if(c.getModifierState)return c.getModifierState(a);var d=e[a];return d?!!c[d]:!1}function d(){return c}var e={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};b.exports=d},{}],123:[function(a,b){"use strict";function c(a){var b=a.target||a.srcElement||window;return 3===b.nodeType?b.parentNode:b}b.exports=c},{}],124:[function(a,b){"use strict";function c(a){var b=a&&(d&&a[d]||a[e]);return"function"==typeof b?b:void 0}var d="function"==typeof Symbol&&Symbol.iterator,e="@@iterator";b.exports=c},{}],125:[function(a,b){function c(a){return e(!!f),l.hasOwnProperty(a)||(a="*"),g.hasOwnProperty(a)||(f.innerHTML="*"===a?"":"<"+a+">",g[a]=!f.firstChild),g[a]?l[a]:null}var d=a(21),e=a(133),f=d.canUseDOM?document.createElement("div"):null,g={circle:!0,defs:!0,ellipse:!0,g:!0,line:!0,linearGradient:!0,path:!0,polygon:!0,polyline:!0,radialGradient:!0,rect:!0,stop:!0,text:!0},h=[1,'"],i=[1,"","
    "],j=[3,"","
    "],k=[1,"",""],l={"*":[1,"?
    ","
    "],area:[1,"",""],col:[2,"","
    "],legend:[1,"
    ","
    "],param:[1,"",""],tr:[2,"","
    "],optgroup:h,option:h,caption:i,colgroup:i,tbody:i,tfoot:i,thead:i,td:j,th:j,circle:k,defs:k,ellipse:k,g:k,line:k,linearGradient:k,path:k,polygon:k,polyline:k,radialGradient:k,rect:k,stop:k,text:k};b.exports=c},{133:133,21:21}],126:[function(a,b){"use strict";function c(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function d(a){for(;a;){if(a.nextSibling)return a.nextSibling;a=a.parentNode}}function e(a,b){for(var e=c(a),f=0,g=0;e;){if(3===e.nodeType){if(g=f+e.textContent.length,b>=f&&g>=b)return{node:e,offset:b-f};f=g}e=c(d(e))}}b.exports=e},{}],127:[function(a,b){"use strict";function c(a){return a?a.nodeType===d?a.documentElement:a.firstChild:null}var d=9;b.exports=c},{}],128:[function(a,b){"use strict";function c(){return!e&&d.canUseDOM&&(e="textContent"in document.documentElement?"textContent":"innerText"),e}var d=a(21),e=null;b.exports=c},{21:21}],129:[function(a,b){"use strict";function c(a){return a===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:a.scrollLeft,y:a.scrollTop}}b.exports=c},{}],130:[function(a,b){function c(a){return a.replace(d,"-$1").toLowerCase()}var d=/([A-Z])/g;b.exports=c},{}],131:[function(a,b){"use strict";function c(a){return d(a).replace(e,"-ms-")}var d=a(130),e=/^ms-/;b.exports=c},{130:130}],132:[function(a,b){"use strict";function c(a){return"function"==typeof a&&"function"==typeof a.prototype.mountComponent&&"function"==typeof a.prototype.receiveComponent}function d(a,b){var d;if((null===a||a===!1)&&(a=f.emptyElement),"object"==typeof a){var e=a;d=b===e.type&&"string"==typeof e.type?g.createInternalComponent(e):c(e.type)?new e.type(e):new j}else"string"==typeof a||"number"==typeof a?d=g.createInstanceForText(a):i(!1);return d.construct(a),d._mountIndex=0,d._mountImage=null,d}var e=a(37),f=a(57),g=a(71),h=a(27),i=a(133),j=(a(150),function(){});h(j.prototype,e.Mixin,{_instantiateReactComponent:d}),b.exports=d},{133:133,150:150,27:27,37:37,57:57,71:71}],133:[function(a,b){"use strict";var c=function(a,b,c,d,e,f,g,h){if(!a){var i;if(void 0===b)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var j=[c,d,e,f,g,h],k=0;i=new Error("Invariant Violation: "+b.replace(/%s/g,function(){return j[k++]}))}throw i.framesToPop=1,i}};b.exports=c},{}],134:[function(a,b){"use strict";function c(a,b){if(!e.canUseDOM||b&&!("addEventListener"in document))return!1;var c="on"+a,f=c in document;if(!f){var g=document.createElement("div");g.setAttribute(c,"return;"),f="function"==typeof g[c]}return!f&&d&&"wheel"===a&&(f=document.implementation.hasFeature("Events.wheel","3.0")),f}var d,e=a(21);e.canUseDOM&&(d=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),b.exports=c},{21:21}],135:[function(a,b){function c(a){return!(!a||!("function"==typeof Node?a instanceof Node:"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName))}b.exports=c},{}],136:[function(a,b){"use strict";function c(a){return a&&("INPUT"===a.nodeName&&d[a.type]||"TEXTAREA"===a.nodeName)}var d={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};b.exports=c},{}],137:[function(a,b){function c(a){return d(a)&&3==a.nodeType}var d=a(135);b.exports=c},{135:135}],138:[function(a,b){"use strict";var c=a(133),d=function(a){var b,d={};c(a instanceof Object&&!Array.isArray(a));for(b in a)a.hasOwnProperty(b)&&(d[b]=b);return d};b.exports=d},{133:133}],139:[function(a,b){var c=function(a){var b;for(b in a)if(a.hasOwnProperty(b))return b;return null};b.exports=c},{}],140:[function(a,b){"use strict";function c(a,b,c){if(!a)return null;var e={};for(var f in a)d.call(a,f)&&(e[f]=b.call(c,a[f],f,a));return e}var d=Object.prototype.hasOwnProperty;b.exports=c},{}],141:[function(a,b){"use strict";function c(a){var b={};return function(c){return b.hasOwnProperty(c)||(b[c]=a.call(this,c)),b[c]}}b.exports=c},{}],142:[function(a,b){"use strict";function c(a){return e(d.isValidElement(a)),a}var d=a(55),e=a(133);b.exports=c},{133:133,55:55}],143:[function(a,b){"use strict";function c(a){return'"'+d(a)+'"'}var d=a(114);b.exports=c},{114:114}],144:[function(a,b){"use strict";var c=a(21),d=/^[ \r\n\t\f]/,e=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,f=function(a,b){a.innerHTML=b};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(f=function(a,b){MSApp.execUnsafeLocalFunction(function(){a.innerHTML=b})}),c.canUseDOM){var g=document.createElement("div");g.innerHTML=" ",""===g.innerHTML&&(f=function(a,b){if(a.parentNode&&a.parentNode.replaceChild(a,a),d.test(b)||"<"===b[0]&&e.test(b)){a.innerHTML=""+b;var c=a.firstChild;1===c.data.length?a.removeChild(c):c.deleteData(0,1)}else a.innerHTML=b})}b.exports=f},{21:21}],145:[function(a,b){"use strict";var c=a(21),d=a(114),e=a(144),f=function(a,b){a.textContent=b};c.canUseDOM&&("textContent"in document.documentElement||(f=function(a,b){e(a,d(b))})),b.exports=f},{114:114,144:144,21:21}],146:[function(a,b){"use strict";function c(a,b){if(a===b)return!0;var c;for(c in a)if(a.hasOwnProperty(c)&&(!b.hasOwnProperty(c)||a[c]!==b[c]))return!1;for(c in b)if(b.hasOwnProperty(c)&&!a.hasOwnProperty(c))return!1;return!0}b.exports=c},{}],147:[function(a,b){"use strict";function c(a,b){if(null!=a&&null!=b){var c=typeof a,d=typeof b;if("string"===c||"number"===c)return"string"===d||"number"===d;if("object"===d&&a.type===b.type&&a.key===b.key){var e=a._owner===b._owner;return e}}return!1}a(150),b.exports=c},{150:150}],148:[function(a,b){function c(a){var b=a.length;if(d(!Array.isArray(a)&&("object"==typeof a||"function"==typeof a)),d("number"==typeof b),d(0===b||b-1 in a),a.hasOwnProperty)try{return Array.prototype.slice.call(a)}catch(c){}for(var e=Array(b),f=0;b>f;f++)e[f]=a[f];return e}var d=a(133);b.exports=c},{133:133}],149:[function(a,b){"use strict";function c(a){return p[a]}function d(a,b){return a&&null!=a.key?f(a.key):b.toString(36)}function e(a){return(""+a).replace(q,c)}function f(a){return"$"+e(a)}function g(a,b,c,e,h){var k=typeof a;if(("undefined"===k||"boolean"===k)&&(a=null),null===a||"string"===k||"number"===k||i.isValidElement(a))return e(h,a,""===b?n+d(a,0):b,c),1;var p,q,r,s=0;if(Array.isArray(a))for(var t=0;ta?-1:a>0?1:+a}),THREE.log=function(){console.log.apply(console,arguments)},THREE.warn=function(){console.warn.apply(console,arguments)},THREE.error=function(){console.error.apply(console,arguments)},THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.NoShading=0,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.Projector=function(){THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(a,b){THREE.warn("THREE.Projector: .projectVector() is now vector.project()."),a.project(b)},this.unprojectVector=function(a,b){THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),a.unproject(b)},this.pickingRay=function(){THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.Color=function(a){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(a)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(a){return a instanceof THREE.Color?this.copy(a):"number"==typeof a?this.setHex(a):"string"==typeof a&&this.setStyle(a),this},setHex:function(a){return a=Math.floor(a),this.r=(a>>16&255)/255,this.g=(a>>8&255)/255,this.b=(255&a)/255,this},setRGB:function(a,b,c){return this.r=a,this.g=b,this.b=c,this},setHSL:function(a,b,c){if(0===b)this.r=this.g=this.b=c;else{var d=function(a,b,c){return 0>c&&(c+=1),c>1&&(c-=1),1/6>c?a+6*(b-a)*c:.5>c?b:2/3>c?a+6*(b-a)*(2/3-c):a};b=.5>=c?c*(1+b):c+b-c*b,c=2*c-b,this.r=d(c,b,a+1/3),this.g=d(c,b,a),this.b=d(c,b,a-1/3)}return this},setStyle:function(a){return/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(a)?(a=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(a),this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,this):/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(a)?(a=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(a),this.r=Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,this):/^\#([0-9a-f]{6})$/i.test(a)?(a=/^\#([0-9a-f]{6})$/i.exec(a),this.setHex(parseInt(a[1],16)),this):/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(a)?(a=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(a),this.setHex(parseInt(a[1]+a[1]+a[2]+a[2]+a[3]+a[3],16)),this):/^(\w+)$/i.test(a)?(this.setHex(THREE.ColorKeywords[a]),this):void 0},copy:function(a){return this.r=a.r,this.g=a.g,this.b=a.b,this},copyGammaToLinear:function(a,b){return void 0===b&&(b=2),this.r=Math.pow(a.r,b),this.g=Math.pow(a.g,b),this.b=Math.pow(a.b,b),this},copyLinearToGamma:function(a,b){void 0===b&&(b=2);var c=b>0?1/b:1;return this.r=Math.pow(a.r,c),this.g=Math.pow(a.g,c),this.b=Math.pow(a.b,c),this},convertGammaToLinear:function(){var a=this.r,b=this.g,c=this.b;return this.r=a*a,this.g=b*b,this.b=c*c,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){a=a||{h:0,s:0,l:0};var b,c=this.r,d=this.g,e=this.b,f=Math.max(c,d,e),g=Math.min(c,d,e),h=(g+f)/2;if(g===f)g=b=0;else{var i=f-g,g=.5>=h?i/(f+g):i/(2-f-g);switch(f){case c:b=(d-e)/i+(e>d?6:0);break;case d:b=(e-c)/i+2;break;case e:b=(c-d)/i+4}b/=6}return a.h=b,a.s=g,a.l=h,a},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(a,b,c){var d=this.getHSL();return d.h+=a,d.s+=b,d.l+=c,this.setHSL(d.h,d.s,d.l),this},add:function(a){return this.r+=a.r,this.g+=a.g,this.b+=a.b,this},addColors:function(a,b){return this.r=a.r+b.r,this.g=a.g+b.g,this.b=a.b+b.b,this},addScalar:function(a){return this.r+=a,this.g+=a,this.b+=a,this},multiply:function(a){return this.r*=a.r,this.g*=a.g,this.b*=a.b,this},multiplyScalar:function(a){return this.r*=a,this.g*=a,this.b*=a,this},lerp:function(a,b){return this.r+=(a.r-this.r)*b,this.g+=(a.g-this.g)*b,this.b+=(a.b-this.b)*b,this},equals:function(a){return a.r===this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a){return this.r=a[0],this.g=a[1],this.b=a[2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.r,a[b+1]=this.g,a[b+2]=this.b,a},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}},THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947, +deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},THREE.Quaternion=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._w=void 0!==d?d:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get w(){return this._w},set w(a){this._w=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._w=d,this.onChangeCallback(),this},copy:function(a){return this._x=a.x,this._y=a.y,this._z=a.z,this._w=a.w,this.onChangeCallback(),this},setFromEuler:function(a,b){if(!1==a instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);return"XYZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"YXZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"ZXY"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"ZYX"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"YZX"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):"XZY"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h),!1!==b&&this.onChangeCallback(),this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);return this._x=a.x*d,this._y=a.y*d,this._z=a.z*d,this._w=Math.cos(c),this.onChangeCallback(),this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],i=b[6],b=b[10],j=c+f+b;return j>0?(c=.5/Math.sqrt(j+1),this._w=.25/c,this._x=(i-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(i-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+i)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+i)/c,this._z=.25*c),this.onChangeCallback(),this},setFromUnitVectors:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3),b=c.dot(d)+1,1e-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d),this._x=a.x,this._y=a.y,this._z=a.z,this._w=b,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(a){return this._x*a._x+this._y*a._y+this._z*a._z+this._w*a._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();return 0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a),this.onChangeCallback(),this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,i=b._z,j=b._w;return this._x=c*j+f*g+d*i-e*h,this._y=d*j+f*h+e*g-c*i,this._z=e*j+f*i+c*h-d*g,this._w=f*j-c*g-d*h-e*i,this.onChangeCallback(),this},multiplyVector3:function(a){return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),a.applyQuaternion(this)},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;if(0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a),g>=1)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),i=Math.sqrt(1-g*g);return.001>Math.abs(i)?(this._w=.5*(f+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this):(g=Math.sin((1-b)*h)/i,h=Math.sin(b*h)/i,this._w=f*g+this._w*h,this._x=c*g+this._x*h,this._y=d*g+this._y*h,this._z=e*g+this._z*h,this.onChangeCallback(),this)},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){return void 0===b&&(b=0),this._x=a[b],this._y=a[b+1],this._z=a[b+2],this._w=a[b+3],this.onChangeCallback(),this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._w,a},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}},THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)},THREE.Vector2=function(a,b){this.x=a||0,this.y=b||0},THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){return this.x=a,this.y=b,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this)},addScalar:function(a){return this.x+=a,this.y+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this)},subScalar:function(a){return this.x-=a,this.y-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this},multiply:function(a){return this.x*=a.x,this.y*=a.y,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this},divide:function(a){return this.x/=a.x,this.y/=a.y,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0,this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector2,b=new THREE.Vector2),a.set(c,c),b.set(d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(a){return this.x*a.x+this.y*a.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x;return a=this.y-a.y,b*b+a*a},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this},clone:function(){return new THREE.Vector2(this.x,this.y)}},THREE.Vector3=function(a,b,c){this.x=a||0,this.y=b||0,this.z=c||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(a,b,c){return this.x=a,this.y=b,this.z=c,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this.z+=a.z,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this.z-=a.z,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this},multiply:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b)):(this.x*=a.x,this.y*=a.y,this.z*=a.z,this)},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this},multiplyVectors:function(a,b){return this.x=a.x*b.x,this.y=a.y*b.y,this.z=a.z*b.z,this},applyEuler:function(){var a;return function(b){return!1==b instanceof THREE.Euler&&THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromEuler(b)),this}}(),applyAxisAngle:function(){var a;return function(b,c){return void 0===a&&(a=new THREE.Quaternion),this.applyQuaternion(a.setFromAxisAngle(b,c)),this}}(),applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[3]*c+a[6]*d,this.y=a[1]*b+a[4]*c+a[7]*d,this.z=a[2]*b+a[5]*c+a[8]*d,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d+a[12],this.y=a[1]*b+a[5]*c+a[9]*d+a[13],this.z=a[2]*b+a[6]*c+a[10]*d+a[14],this},applyProjection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);return this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e,this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e,this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e,this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,i=a*c+g*b-e*d,j=a*d+e*c-f*b,b=-e*b-f*c-g*d;return this.x=h*a+b*-e+i*-g-j*-f,this.y=i*a+b*-f+j*-e-h*-g,this.z=j*a+b*-g+h*-f-i*-e,this},project:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld)),this.applyProjection(a)}}(),unproject:function(){var a;return function(b){return void 0===a&&(a=new THREE.Matrix4),a.multiplyMatrices(b.matrixWorld,a.getInverse(b.projectionMatrix)),this.applyProjection(a)}}(),transformDirection:function(a){var b=this.x,c=this.y,d=this.z;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d,this.y=a[1]*b+a[5]*c+a[9]*d,this.z=a[2]*b+a[6]*c+a[10]*d,this.normalize(),this},divide:function(a){return this.x/=a.x,this.y/=a.y,this.z/=a.z,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a):this.z=this.y=this.x=0,this},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this.zb.z&&(this.z=b.z),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector3,b=new THREE.Vector3),a.set(c,c,c),b.set(d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},cross:function(a,b){if(void 0!==b)return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b);var c=this.x,d=this.y,e=this.z;return this.x=d*a.z-e*a.y,this.y=e*a.x-c*a.z,this.z=c*a.y-d*a.x,this},crossVectors:function(a,b){var c=a.x,d=a.y,e=a.z,f=b.x,g=b.y,h=b.z;return this.x=d*h-e*g,this.y=e*f-c*h,this.z=c*g-d*f,this},projectOnVector:function(){var a,b;return function(c){return void 0===a&&(a=new THREE.Vector3),a.copy(c).normalize(),b=this.dot(a),this.copy(a).multiplyScalar(b)}}(),projectOnPlane:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),a.copy(this).projectOnVector(b),this.sub(a)}}(),reflect:function(){var a;return function(b){return void 0===a&&(a=new THREE.Vector3),this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){return a=this.dot(a)/(this.length()*a.length()),Math.acos(THREE.Math.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;return a=this.z-a.z,b*b+c*c+a*a},setEulerFromRotationMatrix:function(){THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(a,b)},setFromMatrixPosition:function(a){return this.x=a.elements[12],this.y=a.elements[13],this.z=a.elements[14],this},setFromMatrixScale:function(a){var b=this.set(a.elements[0],a.elements[1],a.elements[2]).length(),c=this.set(a.elements[4],a.elements[5],a.elements[6]).length();return a=this.set(a.elements[8],a.elements[9],a.elements[10]).length(),this.x=b,this.y=c,this.z=a,this},setFromMatrixColumn:function(a,b){var c=4*a,d=b.elements;return this.x=d[c],this.y=d[c+1],this.z=d[c+2],this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this.z=a[b+2],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}},THREE.Vector4=function(a,b,c,d){this.x=a||0,this.y=b||0,this.z=c||0,this.w=void 0!==d?d:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(a,b,c,d){return this.x=a,this.y=b,this.z=c,this.w=d,this},setX:function(a){return this.x=a,this},setY:function(a){return this.y=a,this},setZ:function(a){return this.z=a,this},setW:function(a){return this.w=a,this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a)}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a)}},copy:function(a){return this.x=a.x,this.y=a.y,this.z=a.z,this.w=void 0!==a.w?a.w:1,this},add:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b)):(this.x+=a.x,this.y+=a.y,this.z+=a.z,this.w+=a.w,this)},addScalar:function(a){return this.x+=a,this.y+=a,this.z+=a,this.w+=a,this},addVectors:function(a,b){return this.x=a.x+b.x,this.y=a.y+b.y,this.z=a.z+b.z,this.w=a.w+b.w,this},sub:function(a,b){return void 0!==b?(THREE.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b)):(this.x-=a.x,this.y-=a.y,this.z-=a.z,this.w-=a.w,this)},subScalar:function(a){return this.x-=a,this.y-=a,this.z-=a,this.w-=a,this},subVectors:function(a,b){return this.x=a.x-b.x,this.y=a.y-b.y,this.z=a.z-b.z,this.w=a.w-b.w,this},multiplyScalar:function(a){return this.x*=a,this.y*=a,this.z*=a,this.w*=a,this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;return a=a.elements,this.x=a[0]*b+a[4]*c+a[8]*d+a[12]*e,this.y=a[1]*b+a[5]*c+a[9]*d+a[13]*e,this.z=a[2]*b+a[6]*c+a[10]*d+a[14]*e,this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e,this},divideScalar:function(a){return 0!==a?(a=1/a,this.x*=a,this.y*=a,this.z*=a,this.w*=a):(this.z=this.y=this.x=0,this.w=1),this},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);return 1e-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b),this},setAxisAngleFromRotationMatrix:function(a){var b,c,d;a=a.elements;var e=a[0];d=a[4];var f=a[8],g=a[1],h=a[5],i=a[9];c=a[2],b=a[6];var j=a[10];return.01>Math.abs(d-g)&&.01>Math.abs(f-c)&&.01>Math.abs(i-b)?.1>Math.abs(d+g)&&.1>Math.abs(f+c)&&.1>Math.abs(i+b)&&.1>Math.abs(e+h+j-3)?(this.set(1,0,0,0),this):(a=Math.PI,e=(e+1)/2,h=(h+1)/2,j=(j+1)/2,d=(d+g)/4,f=(f+c)/4,i=(i+b)/4,e>h&&e>j?.01>e?(b=0,d=c=.707106781):(b=Math.sqrt(e),c=d/b,d=f/b):h>j?.01>h?(b=.707106781,c=0,d=.707106781):(c=Math.sqrt(h),b=d/c,d=i/c):.01>j?(c=b=.707106781,d=0):(d=Math.sqrt(j),b=f/d,c=i/d),this.set(b,c,d,a),this):(a=Math.sqrt((b-i)*(b-i)+(f-c)*(f-c)+(g-d)*(g-d)),.001>Math.abs(a)&&(a=1),this.x=(b-i)/a,this.y=(f-c)/a,this.z=(g-d)/a,this.w=Math.acos((e+h+j-1)/2),this)},min:function(a){return this.x>a.x&&(this.x=a.x),this.y>a.y&&(this.y=a.y),this.z>a.z&&(this.z=a.z),this.w>a.w&&(this.w=a.w),this},max:function(a){return this.xb.x&&(this.x=b.x),this.yb.y&&(this.y=b.y),this.zb.z&&(this.z=b.z),this.wb.w&&(this.w=b.w),this},clampScalar:function(){var a,b;return function(c,d){return void 0===a&&(a=new THREE.Vector4,b=new THREE.Vector4),a.set(c,c,c,c),b.set(d,d,d,d),this.clamp(a,b)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(a){var b=this.length();return 0!==b&&a!==b&&this.multiplyScalar(a/b),this},lerp:function(a,b){return this.x+=(a.x-this.x)*b,this.y+=(a.y-this.y)*b,this.z+=(a.z-this.z)*b,this.w+=(a.w-this.w)*b,this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a),this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){return void 0===b&&(b=0),this.x=a[b],this.y=a[b+1],this.z=a[b+2],this.w=a[b+3],this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this.x,a[b+1]=this.y,a[b+2]=this.z,a[b+3]=this.w,a},fromAttribute:function(a,b,c){return void 0===c&&(c=0),b=b*a.itemSize+c,this.x=a.array[b],this.y=a.array[b+1],this.z=a.array[b+2],this.w=a.array[b+3],this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(a,b,c,d){this._x=a||0,this._y=b||0,this._z=c||0,this._order=d||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(a){this._x=a,this.onChangeCallback()},get y(){return this._y},set y(a){this._y=a,this.onChangeCallback()},get z(){return this._z},set z(a){this._z=a,this.onChangeCallback()},get order(){return this._order},set order(a){this._order=a,this.onChangeCallback()},set:function(a,b,c,d){return this._x=a,this._y=b,this._z=c,this._order=d||this._order,this.onChangeCallback(),this},copy:function(a){return this._x=a._x,this._y=a._y,this._z=a._z,this._order=a._order,this.onChangeCallback(),this},setFromRotationMatrix:function(a,b,c){var d=THREE.Math.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],i=e[5],j=e[9],k=e[2],l=e[6],e=e[10];return b=b||this._order,"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(-j,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(l,i),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(j,-1,1)),.99999>Math.abs(j)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,i)):(this._y=Math.atan2(-k,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(l,-1,1)),.99999>Math.abs(l)?(this._y=Math.atan2(-k,e),this._z=Math.atan2(-f,i)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(k,-1,1)),.99999>Math.abs(k)?(this._x=Math.atan2(l,e),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-f,i))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.99999>Math.abs(h)?(this._x=Math.atan2(-j,i),this._y=Math.atan2(-k,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.99999>Math.abs(f)?(this._x=Math.atan2(l,i),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-j,e),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b),this._order=b,!1!==c&&this.onChangeCallback(),this},setFromQuaternion:function(){var a;return function(b,c,d){return void 0===a&&(a=new THREE.Matrix4),a.makeRotationFromQuaternion(b),this.setFromRotationMatrix(a,c,d),this}}(),setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(){var a=new THREE.Quaternion;return function(b){a.setFromEuler(this),this.setFromQuaternion(a,b)}}(),equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){return this._x=a[0],this._y=a[1],this._z=a[2],void 0!==a[3]&&(this._order=a[3]),this.onChangeCallback(),this},toArray:function(a,b){return void 0===a&&(a=[]),void 0===b&&(b=0),a[b]=this._x,a[b+1]=this._y,a[b+2]=this._z,a[b+3]=this._order,a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(a){return this.onChangeCallback=a,this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},THREE.Line3=function(a,b){this.start=void 0!==a?a:new THREE.Vector3,this.end=void 0!==b?b:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(a,b){return this.start.copy(a),this.end.copy(b),this},copy:function(a){return this.start.copy(a.start),this.end.copy(a.end),this},center:function(a){return(a||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){return(a||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){var c=b||new THREE.Vector3;return this.delta(c).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d){a.subVectors(c,this.start),b.subVectors(this.end,this.start);var e=b.dot(b),e=b.dot(a)/e;return d&&(e=THREE.Math.clamp(e,0,1)),e}}(),closestPointToPoint:function(a,b,c){return a=this.closestPointToPointParameter(a,b),c=c||new THREE.Vector3,this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){return this.start.applyMatrix4(a),this.end.applyMatrix4(a),this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}},THREE.Box2=function(a,b){this.min=void 0!==a?a:new THREE.Vector2(1/0,1/0),this.max=void 0!==b?b:new THREE.Vector2(-(1/0),-(1/0))},THREE.Box2.prototype={constructor:THREE.Box2,set:function(a,b){return this.min.copy(a),this.max.copy(b),this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;c>b;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector2;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-(1/0),this},empty:function(){return this.max.xthis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector2).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector2).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector2;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}},THREE.Box3=function(a,b){this.min=void 0!==a?a:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==b?b:new THREE.Vector3(-(1/0),-(1/0),-(1/0))},THREE.Box3.prototype={constructor:THREE.Box3,set:function(a,b){return this.min.copy(a),this.max.copy(b),this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;c>b;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new THREE.Vector3;return function(b,c){var d=a.copy(c).multiplyScalar(.5);return this.min.copy(b).sub(d),this.max.copy(b).add(d),this}}(),setFromObject:function(){var a=new THREE.Vector3;return function(b){var c=this;return b.updateMatrixWorld(!0),this.makeEmpty(),b.traverse(function(b){var d=b.geometry;if(void 0!==d)if(d instanceof THREE.Geometry)for(var e=d.vertices,d=0,f=e.length;f>d;d++)a.copy(e[d]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a);else if(d instanceof THREE.BufferGeometry&&void 0!==d.attributes.position)for(e=d.attributes.position.array,d=0,f=e.length;f>d;d+=3)a.set(e[d],e[d+1],e[d+2]),a.applyMatrix4(b.matrixWorld),c.expandByPoint(a)}),this}}(),copy:function(a){return this.min.copy(a.min),this.max.copy(a.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-(1/0),this}, +empty:function(){return this.max.xthis.max.x||a.ythis.max.y||a.zthis.max.z?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y&&this.min.z<=a.min.z&&a.max.z<=this.max.z?!0:!1},getParameter:function(a,b){return(b||new THREE.Vector3).set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y),(a.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},clampPoint:function(a,b){return(b||new THREE.Vector3).copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=new THREE.Vector3;return function(b){return b=b||new THREE.Sphere,b.center=this.center(),b.radius=.5*this.size(a).length(),b}}(),intersect:function(a){return this.min.max(a.min),this.max.min(a.max),this},union:function(a){return this.min.min(a.min),this.max.max(a.max),this},applyMatrix4:function(){var a=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(b){return a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b),a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b),a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b),a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b),a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b),a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b),a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b),a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b),this.makeEmpty(),this.setFromPoints(a),this}}(),translate:function(a){return this.min.add(a),this.max.add(a),this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0e;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix3(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),multiplyScalar:function(a){var b=this.elements;return b[0]*=a,b[3]*=a,b[6]*=a,b[1]*=a,b[4]*=a,b[7]*=a,b[2]*=a,b[5]*=a,b[8]*=a,this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],a=a[8];return b*f*a-b*g*i-c*e*a+c*g*h+d*e*i-d*f*h},getInverse:function(a,b){var c=a.elements,d=this.elements;if(d[0]=c[10]*c[5]-c[6]*c[9],d[1]=-c[10]*c[1]+c[2]*c[9],d[2]=c[6]*c[1]-c[2]*c[5],d[3]=-c[10]*c[4]+c[6]*c[8],d[4]=c[10]*c[0]-c[2]*c[8],d[5]=-c[6]*c[0]+c[2]*c[4],d[6]=c[9]*c[4]-c[5]*c[8],d[7]=-c[9]*c[0]+c[1]*c[8],d[8]=c[5]*c[0]-c[1]*c[4],c=c[0]*d[0]+c[1]*d[3]+c[2]*d[6],0===c){if(b)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/c),this},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[3],b[3]=a,a=b[2],b[2]=b[6],b[6]=a,a=b[5],b[5]=b[7],b[7]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a},getNormalMatrix:function(a){return this.getInverse(a).transpose(),this},transposeIntoArray:function(a){var b=this.elements;return a[0]=b[0],a[1]=b[3],a[2]=b[6],a[3]=b[1],a[4]=b[4],a[5]=b[7],a[6]=b[2],a[7]=b[5],a[8]=b[8],this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}},THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0e;e+=3,c+=3)a.x=b[c],a.y=b[c+1],a.z=b[c+2],a.applyMatrix4(this),b[c]=a.x,b[c+1]=a.y,b[c+2]=a.z;return b}}(),rotateAxis:function(a){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),a.transformDirection(this)},crossVector:function(a){return THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],f=a[1],g=a[5],h=a[9],i=a[13],j=a[2],k=a[6],l=a[10],m=a[14];return a[3]*(+e*h*k-d*i*k-e*g*l+c*i*l+d*g*m-c*h*m)+a[7]*(+b*h*m-b*i*l+e*f*l-d*f*m+d*i*j-e*h*j)+a[11]*(+b*i*k-b*g*m-e*f*k+c*f*m+e*g*j-c*i*j)+a[15]*(-d*g*j-b*h*k+b*g*l+d*f*k-c*f*l+c*h*j)},transpose:function(){var a,b=this.elements;return a=b[1],b[1]=b[4],b[4]=a,a=b[2],b[2]=b[8],b[8]=a,a=b[6],b[6]=b[9],b[9]=a,a=b[3],b[3]=b[12],b[12]=a,a=b[7],b[7]=b[13],b[13]=a,a=b[11],b[11]=b[14],b[14]=a,this},flattenToArrayOffset:function(a,b){var c=this.elements;return a[b]=c[0],a[b+1]=c[1],a[b+2]=c[2],a[b+3]=c[3],a[b+4]=c[4],a[b+5]=c[5],a[b+6]=c[6],a[b+7]=c[7],a[b+8]=c[8],a[b+9]=c[9],a[b+10]=c[10],a[b+11]=c[11],a[b+12]=c[12],a[b+13]=c[13],a[b+14]=c[14],a[b+15]=c[15],a},getPosition:function(){var a=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var b=this.elements;return a.set(b[12],b[13],b[14])}}(),setPosition:function(a){var b=this.elements;return b[12]=a.x,b[13]=a.y,b[14]=a.z,this},getInverse:function(a,b){var c=this.elements,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[12],i=d[1],j=d[5],k=d[9],l=d[13],m=d[2],n=d[6],o=d[10],p=d[14],q=d[3],r=d[7],s=d[11],d=d[15];if(c[0]=k*p*r-l*o*r+l*n*s-j*p*s-k*n*d+j*o*d,c[4]=h*o*r-g*p*r-h*n*s+f*p*s+g*n*d-f*o*d,c[8]=g*l*r-h*k*r+h*j*s-f*l*s-g*j*d+f*k*d,c[12]=h*k*n-g*l*n-h*j*o+f*l*o+g*j*p-f*k*p,c[1]=l*o*q-k*p*q-l*m*s+i*p*s+k*m*d-i*o*d,c[5]=g*p*q-h*o*q+h*m*s-e*p*s-g*m*d+e*o*d,c[9]=h*k*q-g*l*q-h*i*s+e*l*s+g*i*d-e*k*d,c[13]=g*l*m-h*k*m+h*i*o-e*l*o-g*i*p+e*k*p,c[2]=j*p*q-l*n*q+l*m*r-i*p*r-j*m*d+i*n*d,c[6]=h*n*q-f*p*q-h*m*r+e*p*r+f*m*d-e*n*d,c[10]=f*l*q-h*j*q+h*i*r-e*l*r-f*i*d+e*j*d,c[14]=h*j*m-f*l*m-h*i*n+e*l*n+f*i*p-e*j*p,c[3]=k*n*q-j*o*q-k*m*r+i*o*r+j*m*s-i*n*s,c[7]=f*o*q-g*n*q+g*m*r-e*o*r-f*m*s+e*n*s,c[11]=g*j*q-f*k*q-g*i*r+e*k*r+f*i*s-e*j*s,c[15]=f*k*m-g*j*m+g*i*n-e*k*n-f*i*o+e*j*o,c=e*c[0]+i*c[4]+m*c[8]+q*c[12],0==c){if(b)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/c),this},translate:function(){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(a){var b=this.elements,c=a.x,d=a.y;return a=a.z,b[0]*=c,b[4]*=d,b[8]*=a,b[1]*=c,b[5]*=d,b[9]*=a,b[2]*=c,b[6]*=d,b[10]*=a,b[3]*=c,b[7]*=d,b[11]*=a,this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],Math.max(a[4]*a[4]+a[5]*a[5]+a[6]*a[6],a[8]*a[8]+a[9]*a[9]+a[10]*a[10])))},makeTranslation:function(a,b,c){return this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1),this},makeRotationX:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1),this},makeRotationY:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1),this},makeRotationZ:function(a){var b=Math.cos(a);return a=Math.sin(a),this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(a,b){var c=Math.cos(b),d=Math.sin(b),e=1-c,f=a.x,g=a.y,h=a.z,i=e*f,j=e*g;return this.set(i*f+c,i*g-d*h,i*h+d*g,0,i*g+d*h,j*g+c,j*h-d*f,0,i*h-d*g,j*h+d*f,e*h*h+c,0,0,0,0,1),this},makeScale:function(a,b,c){return this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1),this},compose:function(a,b,c){return this.makeRotationFromQuaternion(b),this.scale(c),this.setPosition(a),this},decompose:function(){var a=new THREE.Vector3,b=new THREE.Matrix4;return function(c,d,e){var f=this.elements,g=a.set(f[0],f[1],f[2]).length(),h=a.set(f[4],f[5],f[6]).length(),i=a.set(f[8],f[9],f[10]).length();0>this.determinant()&&(g=-g),c.x=f[12],c.y=f[13],c.z=f[14],b.elements.set(this.elements),c=1/g;var f=1/h,j=1/i;return b.elements[0]*=c,b.elements[1]*=c,b.elements[2]*=c,b.elements[4]*=f,b.elements[5]*=f,b.elements[6]*=f,b.elements[8]*=j,b.elements[9]*=j,b.elements[10]*=j,d.setFromRotationMatrix(b),e.x=g,e.y=h,e.z=i,this}}(),makeFrustum:function(a,b,c,d,e,f){var g=this.elements;return g[0]=2*e/(b-a),g[4]=0,g[8]=(b+a)/(b-a),g[12]=0,g[1]=0,g[5]=2*e/(d-c),g[9]=(d+c)/(d-c),g[13]=0,g[2]=0,g[6]=0,g[10]=-(f+e)/(f-e),g[14]=-2*f*e/(f-e),g[3]=0,g[7]=0,g[11]=-1,g[15]=0,this},makePerspective:function(a,b,c,d){a=c*Math.tan(THREE.Math.degToRad(.5*a));var e=-a;return this.makeFrustum(e*b,a*b,e,a,c,d)},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=b-a,i=c-d,j=f-e;return g[0]=2/h,g[4]=0,g[8]=0,g[12]=-((b+a)/h),g[1]=0,g[5]=2/i,g[9]=0,g[13]=-((c+d)/i),g[2]=0,g[6]=0,g[10]=-2/j,g[14]=-((f+e)/j),g[3]=0,g[7]=0,g[11]=0,g[15]=1,this},fromArray:function(a){return this.elements.set(a),this},toArray:function(){var a=this.elements;return[a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],a[10],a[11],a[12],a[13],a[14],a[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}},THREE.Ray=function(a,b){this.origin=void 0!==a?a:new THREE.Vector3,this.direction=void 0!==b?b:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(a,b){return this.origin.copy(a),this.direction.copy(b),this},copy:function(a){return this.origin.copy(a.origin),this.direction.copy(a.direction),this},at:function(a,b){return(b||new THREE.Vector3).copy(this.direction).multiplyScalar(a).add(this.origin)},recast:function(){var a=new THREE.Vector3;return function(b){return this.origin.copy(this.at(b,a)),this}}(),closestPointToPoint:function(a,b){var c=b||new THREE.Vector3;c.subVectors(a,this.origin);var d=c.dot(this.direction);return 0>d?c.copy(this.origin):c.copy(this.direction).multiplyScalar(d).add(this.origin)},distanceToPoint:function(){var a=new THREE.Vector3;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);return 0>c?this.origin.distanceTo(b):(a.copy(this.direction).multiplyScalar(c).add(this.origin),a.distanceTo(b))}}(),distanceSqToSegment:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g){a.copy(d).add(e).multiplyScalar(.5),b.copy(e).sub(d).normalize(),c.copy(this.origin).sub(a);var h,i=.5*d.distanceTo(e),j=-this.direction.dot(b),k=c.dot(this.direction),l=-c.dot(b),m=c.lengthSq(),n=Math.abs(1-j*j);return n>0?(d=j*l-k,e=j*k-l,h=i*n,d>=0?e>=-h?h>=e?(i=1/n,d*=i,e*=i,j=d*(d+j*e+2*k)+e*(j*d+e+2*l)+m):(e=i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m):(e=-i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m):-h>=e?(d=Math.max(0,-(-j*i+k)),e=d>0?-i:Math.min(Math.max(-i,-l),i),j=-d*d+e*(e+2*l)+m):h>=e?(d=0,e=Math.min(Math.max(-i,-l),i),j=e*(e+2*l)+m):(d=Math.max(0,-(j*i+k)),e=d>0?i:Math.min(Math.max(-i,-l),i),j=-d*d+e*(e+2*l)+m)):(e=j>0?-i:i,d=Math.max(0,-(j*e+k)),j=-d*d+e*(e+2*l)+m),f&&f.copy(this.direction).multiplyScalar(d).add(this.origin),g&&g.copy(b).multiplyScalar(e).add(a),j}}(),isIntersectionSphere:function(a){return this.distanceToPoint(a.center)<=a.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d,f=b.radius*b.radius;return e>f?null:(f=Math.sqrt(f-e),e=d-f,d+=f,0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c))}}(),isIntersectionPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},distanceToPlane:function(a){var b=a.normal.dot(this.direction);return 0==b?0==a.distanceToPoint(this.origin)?0:null:(a=-(this.origin.dot(a.normal)+a.constant)/b,a>=0?a:null)},intersectPlane:function(a,b){var c=this.distanceToPlane(a);return null===c?null:this.at(c,b)},isIntersectionBox:function(){var a=new THREE.Vector3;return function(b){return null!==this.intersectBox(b,a)}}(),intersectBox:function(a,b){var c,d,e,f,g;d=1/this.direction.x,f=1/this.direction.y,g=1/this.direction.z;var h=this.origin;return d>=0?(c=(a.min.x-h.x)*d,d*=a.max.x-h.x):(c=(a.max.x-h.x)*d,d*=a.min.x-h.x),f>=0?(e=(a.min.y-h.y)*f,f*=a.max.y-h.y):(e=(a.max.y-h.y)*f,f*=a.min.y-h.y),c>f||e>d?null:((e>c||c!==c)&&(c=e),(d>f||d!==d)&&(d=f),g>=0?(e=(a.min.z-h.z)*g,g*=a.max.z-h.z):(e=(a.max.z-h.z)*g,g*=a.min.z-h.z),c>g||e>d?null:((e>c||c!==c)&&(c=e),(d>g||d!==d)&&(d=g),0>d?null:this.at(c>=0?c:d,b)))},intersectTriangle:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Vector3;return function(e,f,g,h,i){if(b.subVectors(f,e),c.subVectors(g,e),d.crossVectors(b,c),f=this.direction.dot(d),f>0){if(h)return null;h=1}else{if(!(0>f))return null;h=-1,f=-f}return a.subVectors(this.origin,e),e=h*this.direction.dot(c.crossVectors(a,c)),0>e?null:(g=h*this.direction.dot(b.cross(a)),0>g||e+g>f?null:(e=-h*a.dot(d),0>e?null:this.at(e/f,i)))}}(),applyMatrix4:function(a){return this.direction.add(this.origin).applyMatrix4(a),this.origin.applyMatrix4(a),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}},THREE.Sphere=function(a,b){this.center=void 0!==a?a:new THREE.Vector3,this.radius=void 0!==b?b:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(a,b){return this.center.copy(a),this.radius=b,this},setFromPoints:function(){var a=new THREE.Box3;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).center(d);for(var e=0,f=0,g=b.length;g>f;f++)e=Math.max(e,d.distanceToSquared(b[f]));return this.radius=Math.sqrt(e),this}}(),copy:function(a){return this.center.copy(a.center),this.radius=a.radius,this},empty:function(){return 0>=this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},clampPoint:function(a,b){var c=this.center.distanceToSquared(a),d=b||new THREE.Vector3;return d.copy(a),c>this.radius*this.radius&&(d.sub(this.center).normalize(),d.multiplyScalar(this.radius).add(this.center)),d},getBoundingBox:function(a){return a=a||new THREE.Box3,a.set(this.center,this.center),a.expandByScalar(this.radius),a},applyMatrix4:function(a){return this.center.applyMatrix4(a),this.radius*=a.getMaxScaleOnAxis(),this},translate:function(a){return this.center.add(a),this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}},THREE.Frustum=function(a,b,c,d,e,f){this.planes=[void 0!==a?a:new THREE.Plane,void 0!==b?b:new THREE.Plane,void 0!==c?c:new THREE.Plane,void 0!==d?d:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==f?f:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(a,b,c,d,e,f){var g=this.planes;return g[0].copy(a),g[1].copy(b),g[2].copy(c),g[3].copy(d),g[4].copy(e),g[5].copy(f),this},copy:function(a){for(var b=this.planes,c=0;6>c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],i=c[6],j=c[7],k=c[8],l=c[9],m=c[10],n=c[11],o=c[12],p=c[13],q=c[14],c=c[15];return b[0].setComponents(f-a,j-g,n-k,c-o).normalize(),b[1].setComponents(f+a,j+g,n+k,c+o).normalize(),b[2].setComponents(f+d,j+h,n+l,c+p).normalize(),b[3].setComponents(f-d,j-h,n-l,c-p).normalize(),b[4].setComponents(f-e,j-i,n-m,c-q).normalize(),b[5].setComponents(f+e,j+i,n+m,c+q).normalize(),this},intersectsObject:function(){var a=new THREE.Sphere;return function(b){var c=b.geometry;return null===c.boundingSphere&&c.computeBoundingSphere(),a.copy(c.boundingSphere),a.applyMatrix4(b.matrixWorld),this.intersectsSphere(a)}}(),intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)e;e++){var f=d[e];a.x=0g&&0>f)return!1}return!0}}(),containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}},THREE.Plane=function(a,b){this.normal=void 0!==a?a:new THREE.Vector3(1,0,0),this.constant=void 0!==b?b:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(a,b){return this.normal.copy(a),this.constant=b,this},setComponents:function(a,b,c,d){return this.normal.set(a,b,c),this.constant=d,this},setFromNormalAndCoplanarPoint:function(a,b){return this.normal.copy(a),this.constant=-b.dot(this.normal),this},setFromCoplanarPoints:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c,d,e){return d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize(),this.setFromNormalAndCoplanarPoint(d,c),this}}(),copy:function(a){return this.normal.copy(a.normal),this.constant=a.constant,this},normalize:function(){var a=1/this.normal.length();return this.normal.multiplyScalar(a),this.constant*=a,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){return this.orthoPoint(a,b).sub(a).negate()},orthoPoint:function(a,b){var c=this.distanceToPoint(a);return(b||new THREE.Vector3).copy(this.normal).multiplyScalar(c)},isIntersectionLine:function(a){var b=this.distanceToPoint(a.start);return a=this.distanceToPoint(a.end),0>b&&a>0||0>a&&b>0},intersectLine:function(){var a=new THREE.Vector3;return function(b,c){var d=c||new THREE.Vector3,e=b.delta(a),f=this.normal.dot(e);return 0!=f?(f=-(b.start.dot(this.normal)+this.constant)/f,0>f||f>1?void 0:d.copy(e).multiplyScalar(f).add(b.start)):0==this.distanceToPoint(b.start)?d.copy(b.start):void 0}}(),coplanarPoint:function(a){return(a||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Matrix3;return function(d,e){var f=e||c.getNormalMatrix(d),f=a.copy(this.normal).applyMatrix3(f),g=this.coplanarPoint(b);return g.applyMatrix4(d),this.setFromNormalAndCoplanarPoint(f,g),this}}(),translate:function(a){return this.constant-=a.dot(this.normal),this},equals:function(a){return a.normal.equals(this.normal)&&a.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}},THREE.Math={generateUUID:function(){var a,b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),c=Array(36),d=0;return function(){for(var e=0;36>e;e++)8==e||13==e||18==e||23==e?c[e]="-":14==e?c[e]="4":(2>=d&&(d=33554432+16777216*Math.random()|0),a=15&d,d>>=4,c[e]=b[19==e?3&a|8:a]);return c.join("")}}(),clamp:function(a,b,c){return b>a?b:a>c?c:a},clampBottom:function(a,b){return b>a?b:a},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},smoothstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*(3-2*a))},smootherstep:function(a,b,c){return b>=a?0:a>=c?1:(a=(a-b)/(c-b),a*a*a*(a*(6*a-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(a,b){return Math.floor(this.randFloat(a,b))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a*(.5-Math.random())},degToRad:function(){var a=Math.PI/180;return function(b){return b*a}}(),radToDeg:function(){var a=180/Math.PI;return function(b){return b*a}}(),isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},nextPowerOfTwo:function(a){return a--,a|=a>>1,a|=a>>2,a|=a>>4,a|=a>>8,a|=a>>16,a++,a}},THREE.Spline=function(a){function b(a,b,c,d,e,f,g){return a=.5*(c-a),d=.5*(d-b),(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b}this.points=a;var c,d,e,f,g,h,i,j,k,l=[],m={x:0,y:0,z:0};this.initFromArray=function(a){this.points=[];for(var b=0;bthis.points.length-2?this.points.length-1:d+1,l[3]=d>this.points.length-3?this.points.length-1:d+2,h=this.points[l[0]],i=this.points[l[1]],j=this.points[l[2]],k=this.points[l[3]],f=e*e,g=e*f,m.x=b(h.x,i.x,j.x,k.x,e,f,g),m.y=b(h.y,i.y,j.y,k.y,e,f,g),m.z=b(h.z,i.z,j.z,k.z,e,f,g),m},this.getControlPointsArray=function(){var a,b,c=this.points.length,d=[];for(a=0;c>a;a++)b=this.points[a],d[a]=[b.x,b.y,b.z];return d},this.getLength=function(a){var b,c,d,e=b=b=0,f=new THREE.Vector3,g=new THREE.Vector3,h=[],i=0;for(h[0]=0,a||(a=100),c=this.points.length*a,f.copy(this.points[0]),a=1;c>a;a++)b=a/c,d=this.getPoint(b),g.copy(d),i+=g.distanceTo(f),f.copy(d),b*=this.points.length-1,b=Math.floor(b),b!=e&&(h[b]=i,e=b);return h[h.length]=i,{chunks:h,total:i}},this.reparametrizeByArcLength=function(a){var b,c,d,e,f,g,h=[],i=new THREE.Vector3,j=this.getLength();for(h.push(i.copy(this.points[0]).clone()),b=1;bc;c++)d=e+1/g*c*(f-e),d=this.getPoint(d),h.push(i.copy(d).clone());h.push(i.copy(this.points[b]).clone())}this.points=h}},THREE.Triangle=function(a,b,c){this.a=void 0!==a?a:new THREE.Vector3,this.b=void 0!==b?b:new THREE.Vector3,this.c=void 0!==c?c:new THREE.Vector3},THREE.Triangle.normal=function(){var a=new THREE.Vector3;return function(b,c,d,e){return e=e||new THREE.Vector3,e.subVectors(d,c),a.subVectors(b,c),e.cross(a),b=e.lengthSq(),b>0?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(d,e,f,g,h){a.subVectors(g,e),b.subVectors(f,e),c.subVectors(d,e),d=a.dot(a),e=a.dot(b),f=a.dot(c);var i=b.dot(b);g=b.dot(c);var j=d*i-e*e;return h=h||new THREE.Vector3,0==j?h.set(-2,-1,-1):(j=1/j,i=(i*f-e*g)*j,d=(d*g-e*f)*j,h.set(1-i-d,d,i))}}(),THREE.Triangle.containsPoint=function(){var a=new THREE.Vector3;return function(b,c,d,e){return b=THREE.Triangle.barycoordFromPoint(b,c,d,e,a),0<=b.x&&0<=b.y&&1>=b.x+b.y}}(),THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(a,b,c){return this.a.copy(a),this.b.copy(b),this.c.copy(c),this},setFromPointsAndIndices:function(a,b,c,d){return this.a.copy(a[b]),this.b.copy(a[c]),this.c.copy(a[d]),this},copy:function(a){return this.a.copy(a.a),this.b.copy(a.b),this.c.copy(a.c),this},area:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(){return a.subVectors(this.c,this.b),b.subVectors(this.a,this.b),.5*a.cross(b).length()}}(),midpoint:function(a){return(a||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(a){return THREE.Triangle.normal(this.a,this.b,this.c,a)},plane:function(a){return(a||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(a,b){return THREE.Triangle.barycoordFromPoint(a,this.a,this.b,this.c,b)},containsPoint:function(a){return THREE.Triangle.containsPoint(a,this.a,this.b,this.c)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)},clone:function(){return(new THREE.Triangle).copy(this)}},THREE.Clock=function(a){this.autoStart=void 0!==a?a:!0,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running&&this.start(),this.running){var b=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),a=.001*(b-this.oldTime);this.oldTime=b,this.elapsedTime+=a}return a}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(a){a.addEventListener=THREE.EventDispatcher.prototype.addEventListener,a.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,a.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,a.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={}); + +var c=this._listeners;void 0===c[a]&&(c[a]=[]),-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},removeEventListener:function(a,b){if(void 0!==this._listeners){var c=this._listeners[a];if(void 0!==c){var d=c.indexOf(b);-1!==d&&c.splice(d,1)}}},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;for(var c=[],d=b.length,e=0;d>e;e++)c[e]=b[e];for(e=0;d>e;e++)c[e].call(this,a)}}}},function(a){a.Raycaster=function(b,c,d,e){this.ray=new a.Ray(b,c),this.near=d||0,this.far=e||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var b=function(a,b){return a.distance-b.distance},c=function(a,b,d,e){if(a.raycast(b,d),!0===e){a=a.children,e=0;for(var f=a.length;f>e;e++)c(a[e],b,d,!0)}};a.Raycaster.prototype={constructor:a.Raycaster,precision:1e-4,linePrecision:1,set:function(a,b){this.ray.set(a,b)},setFromCamera:function(b,c){c instanceof a.PerspectiveCamera?(this.ray.origin.copy(c.position),this.ray.direction.set(b.x,b.y,.5).unproject(c).sub(c.position).normalize()):c instanceof a.OrthographicCamera?(this.ray.origin.set(b.x,b.y,-1).unproject(c),this.ray.direction.set(0,0,-1).transformDirection(c.matrixWorld)):a.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(a,d){var e=[];return c(a,this,e,d),e.sort(b),e},intersectObjects:function(d,e){var f=[];if(!1==d instanceof Array)return a.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),f;for(var g=0,h=d.length;h>g;g++)c(d[g],this,f,e);return f.sort(b),f}}}(THREE),THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var a=new THREE.Vector3,b=new THREE.Euler,c=new THREE.Quaternion,d=new THREE.Vector3(1,1,1);b.onChange(function(){c.setFromEuler(b,!1)}),c.onChange(function(){b.setFromQuaternion(c,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:a},rotation:{enumerable:!0,value:b},quaternion:{enumerable:!0,value:c},scale:{enumerable:!0,value:d}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){return THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(a){THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=a},get useQuaternion(){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(a){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new THREE.Quaternion;return function(b,c){return a.setFromAxisAngle(b,c),this.quaternion.multiply(a),this}}(),rotateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new THREE.Vector3;return function(b,c){return a.copy(b).applyQuaternion(this.quaternion),this.position.add(a.multiplyScalar(c)),this}}(),translate:function(a,b){return THREE.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(b,a)},translateX:function(){var a=new THREE.Vector3(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new THREE.Vector3(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new THREE.Vector3(0,0,1);return function(b){return this.translateOnAxis(a,b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up),this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1c;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){return a=a||new THREE.Vector3,this.updateMatrixWorld(!0),a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){return c=c||new THREE.Quaternion,this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,c,b),c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Euler,this.getWorldQuaternion(a),b.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;return function(c){return c=c||new THREE.Vector3,this.updateMatrixWorld(!0),this.matrixWorld.decompose(a,b,c),c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Vector3,this.getWorldQuaternion(a),b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;c>b;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;c>b;b++)this.children[b].traverseVisible(a)}},traverseAncestors:function(a){this.parent&&(a(this.parent),this.parent.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix(),(!0===this.matrixWorldNeedsUpdate||!0===a)&&(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0);for(var b=0,c=this.children.length;c>b;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(){var a={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},b={},c={},d=function(b){if(void 0===a.materials&&(a.materials=[]),void 0===c[b.uuid]){var d=b.toJSON();delete d.metadata,c[b.uuid]=d,a.materials.push(d)}return b.uuid},e=function(c){var f={};if(f.uuid=c.uuid,f.type=c.type,""!==c.name&&(f.name=c.name),"{}"!==JSON.stringify(c.userData)&&(f.userData=c.userData),!0!==c.visible&&(f.visible=c.visible),c instanceof THREE.PerspectiveCamera)f.fov=c.fov,f.aspect=c.aspect,f.near=c.near,f.far=c.far;else if(c instanceof THREE.OrthographicCamera)f.left=c.left,f.right=c.right,f.top=c.top,f.bottom=c.bottom,f.near=c.near,f.far=c.far;else if(c instanceof THREE.AmbientLight)f.color=c.color.getHex();else if(c instanceof THREE.DirectionalLight)f.color=c.color.getHex(),f.intensity=c.intensity;else if(c instanceof THREE.PointLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance,f.decay=c.decay;else if(c instanceof THREE.SpotLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance,f.angle=c.angle,f.exponent=c.exponent,f.decay=c.decay;else if(c instanceof THREE.HemisphereLight)f.color=c.color.getHex(),f.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh||c instanceof THREE.Line||c instanceof THREE.PointCloud){var g=c.geometry;if(void 0===a.geometries&&(a.geometries=[]),void 0===b[g.uuid]){var h=g.toJSON();delete h.metadata,b[g.uuid]=h,a.geometries.push(h)}f.geometry=g.uuid,f.material=d(c.material),c instanceof THREE.Line&&(f.mode=c.mode)}else c instanceof THREE.Sprite&&(f.material=d(c.material));if(f.matrix=c.matrix.toArray(),0b;b++)a.vertexNormals[b]=this.vertexNormals[b].clone();for(b=0,c=this.vertexColors.length;c>b;b++)a.vertexColors[b]=this.vertexColors[b].clone();for(b=0,c=this.vertexTangents.length;c>b;b++)a.vertexTangents[b]=this.vertexTangents[b].clone();return a}},THREE.Face4=function(a,b,c,d,e,f,g){return THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(a,b,c,e,f,g)},THREE.BufferAttribute=function(a,b){this.array=a,this.itemSize=b,this.needsUpdate=!1},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},copyAt:function(a,b,c){a*=this.itemSize,c*=b.itemSize;for(var d=0,e=this.itemSize;e>d;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){return void 0===b&&(b=0),this.array.set(a,b),this},setX:function(a,b){return this.array[a*this.itemSize]=b,this},setY:function(a,b){return this.array[a*this.itemSize+1]=b,this},setZ:function(a,b){return this.array[a*this.itemSize+2]=b,this},setXY:function(a,b,c){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this},setXYZ:function(a,b,c,d){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this},setXYZW:function(a,b,c,d,e){return a*=this.itemSize,this.array[a]=b,this.array[a+1]=c,this.array[a+2]=d,this.array[a+3]=e,this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},THREE.Int8Attribute=function(a,b){return THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8Attribute=function(a,b){return THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint8ClampedAttribute=function(a,b){return THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int16Attribute=function(a,b){return THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint16Attribute=function(a,b){return THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Int32Attribute=function(a,b){return THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Uint32Attribute=function(a,b){return THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float32Attribute=function(a,b){return THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.Float64Attribute=function(a,b){return THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(a,b)},THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b),this.updateRange={offset:0,count:-1}},THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute,THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)},THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.offsets=this.drawcalls=[],this.boundingSphere=this.boundingBox=null},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1==b instanceof THREE.BufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):(this.attributes[a]=b,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(a){return this.attributes[a]},addDrawCall:function(a,b,c){this.drawcalls.push({start:a,count:b,index:void 0!==c?c:0})},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0),b=this.attributes.normal,void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(a)),a},fromGeometry:function(a,b){b=b||{vertexColors:THREE.NoColors};var c=a.vertices,d=a.faces,e=a.faceVertexUvs,f=b.vertexColors,g=0d;d+=3)a.set(b[d],b[d+1],b[d+2]),c.expandByPoint(a)}(void 0===b||0===b.length)&&(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,f=c.length;f>e;e+=3)b.set(c[e],c[e+1],c[e+2]),a.expandByPoint(b);a.center(d);for(var g=0,e=0,f=c.length;f>e;e+=3)b.set(c[e],c[e+1],c[e+2]),g=Math.max(g,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(g),isNaN(this.boundingSphere.radius)&&THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes;if(a.position){var b=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(b.length),3));else for(var c=a.normal.array,d=0,e=c.length;e>d;d++)c[d]=0;var f,g,h,c=a.normal.array,i=new THREE.Vector3,j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=new THREE.Vector3;if(a.index)for(var n=a.index.array,o=0p;++p){e=o[p].start,f=o[p].count;for(var r=o[p].index,d=e,e=e+f;e>d;d+=3)f=3*(r+n[d]),g=3*(r+n[d+1]),h=3*(r+n[d+2]),i.fromArray(b,f),j.fromArray(b,g),k.fromArray(b,h),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[f]+=l.x,c[f+1]+=l.y,c[f+2]+=l.z,c[g]+=l.x,c[g+1]+=l.y,c[g+2]+=l.z,c[h]+=l.x,c[h+1]+=l.y,c[h+2]+=l.z}else for(d=0,e=b.length;e>d;d+=9)i.fromArray(b,d),j.fromArray(b,d+3),k.fromArray(b,d+6),l.subVectors(k,j),m.subVectors(i,j),l.cross(m),c[d]=l.x,c[d+1]=l.y,c[d+2]=l.z,c[d+3]=l.x,c[d+4]=l.y,c[d+5]=l.z,c[d+6]=l.x,c[d+7]=l.y,c[d+8]=l.z;this.normalizeNormals(),a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){B.fromArray(d,3*a),C.fromArray(d,3*b),D.fromArray(d,3*c),E.fromArray(f,2*a),F.fromArray(f,2*b),G.fromArray(f,2*c),l=C.x-B.x,m=D.x-B.x,n=C.y-B.y,o=D.y-B.y,p=C.z-B.z,q=D.z-B.z,r=F.x-E.x,s=G.x-E.x,t=F.y-E.y,u=G.y-E.y,v=1/(r*u-s*t),H.set((u*l-t*m)*v,(u*n-t*o)*v,(u*p-t*q)*v),I.set((r*m-s*l)*v,(r*o-s*n)*v,(r*q-s*p)*v),i[a].add(H),i[b].add(H),i[c].add(H),j[a].add(I),j[b].add(I),j[c].add(I)}function b(a){Q.fromArray(e,3*a),R.copy(Q),M=i[a],O.copy(M),O.sub(Q.multiplyScalar(Q.dot(M))).normalize(),P.crossVectors(R,M),N=P.dot(j[a]),L=0>N?-1:1,h[4*a]=O.x,h[4*a+1]=O.y,h[4*a+2]=O.z,h[4*a+3]=L}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,f=this.attributes.uv.array,g=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*g),4));for(var h=this.attributes.tangent.array,i=[],j=[],k=0;g>k;k++)i[k]=new THREE.Vector3,j[k]=new THREE.Vector3;var l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=new THREE.Vector3,C=new THREE.Vector3,D=new THREE.Vector3,E=new THREE.Vector2,F=new THREE.Vector2,G=new THREE.Vector2,H=new THREE.Vector3,I=new THREE.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,c.length,0);var J=this.drawcalls,k=0;for(x=J.length;x>k;++k){w=J[k].start,y=J[k].count;var K=J[k].index,g=w;for(w+=y;w>g;g+=3)y=K+c[g],z=K+c[g+1],A=K+c[g+2],a(y,z,A)}var L,M,N,O=new THREE.Vector3,P=new THREE.Vector3,Q=new THREE.Vector3,R=new THREE.Vector3,k=0;for(x=J.length;x>k;++k)for(w=J[k].start,y=J[k].count,K=J[k].index,g=w,w+=y;w>g;g+=3)y=K+c[g],z=K+c[g+1],A=K+c[g+2],b(y),b(z),b(A)}},computeOffsets:function(a){void 0===a&&(a=65535);for(var b=this.attributes.index.array,c=this.attributes.position.array,d=b.length/3,e=new Uint16Array(b.length),f=0,g=0,h=[{start:0,count:0,index:0}],i=h[0],j=0,k=0,l=new Int32Array(6),m=new Int32Array(c.length),n=new Int32Array(c.length),o=0;oc;c++){for(var p=k=0;3>p;p++)o=b[3*c+p],-1==m[o]?(l[2*p]=o,l[2*p+1]=-1,k++):m[o]i.index+a)for(i={start:f,count:0,index:g},h.push(i),k=0;6>k;k+=2)p=l[k+1],p>-1&&pk;k+=2)o=l[k],p=l[k+1],-1===p&&(p=g++),m[o]=p,n[p]=o,e[f++]=p-i.index,i.count++}return this.reorderBuffers(e,n,g),this.drawcalls=this.offsets=h},merge:function(a,b){if(!1!=a instanceof THREE.BufferGeometry){void 0===b&&(b=0);var c,d=this.attributes;for(c in d)if(void 0!==a.attributes[c])for(var e=d[c].array,f=a.attributes[c],g=f.array,h=0,f=f.itemSize*b;he;e+=3)a=d[e],b=d[e+1],c=d[e+2],a=1/Math.sqrt(a*a+b*b+c*c),d[e]*=a,d[e+1]*=a,d[e+2]*=a},reorderBuffers:function(a,b,c){var d,e={};for(d in this.attributes)"index"!=d&&(e[d]=new this.attributes[d].array.constructor(this.attributes[d].itemSize*c));for(var f=0;c>f;f++){var g=b[f];for(d in this.attributes)if("index"!=d)for(var h=this.attributes[d].array,i=this.attributes[d].itemSize,j=e[d],k=0;i>k;k++)j[f*i+k]=h[g*i+k]}this.attributes.index.array=a;for(d in this.attributes)"index"!=d&&(this.attributes[d].array=e[d],this.attributes[d].numItems=this.attributes[d].itemSize*c)},toJSON:function(){var a,b={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},c=this.attributes,d=this.offsets,e=this.boundingSphere;for(a in c){var f=c[a],g=Array.prototype.slice.call(f.array);b.data.attributes[a]={itemSize:f.itemSize,type:f.array.constructor.name,array:g}}return 0a;a++){var d=this.offsets[a];b.offsets.push({start:d.start,index:d.index,count:d.count})}return b},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.hasTangents=!1,this.dynamic=!0,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(a){for(var b=(new THREE.Matrix3).getNormalMatrix(a),c=0,d=this.vertices.length;d>c;c++)this.vertices[c].applyMatrix4(a);for(c=0,d=this.faces.length;d>c;c++){a=this.faces[c],a.normal.applyMatrix3(b).normalize();for(var e=0,f=a.vertexNormals.length;f>e;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0},fromBufferGeometry:function(a){for(var b=this,c=a.attributes,d=c.position.array,e=void 0!==c.index?c.index.array:void 0,f=void 0!==c.normal?c.normal.array:void 0,g=void 0!==c.color?c.color.array:void 0,h=void 0!==c.uv?c.uv.array:void 0,i=[],j=[],k=c=0;ck;k+=3)l(o+e[k],o+e[k+1],o+e[k+2]);else for(c=0;cc;c++){var e=this.faces[c],f=this.vertices[e.a],g=this.vertices[e.b];a.subVectors(this.vertices[e.c],g),b.subVectors(f,g),a.cross(b),a.normalize(),e.normal.copy(a)}},computeVertexNormals:function(a){var b,c,d;for(d=Array(this.vertices.length),b=0,c=this.vertices.length;c>b;b++)d[b]=new THREE.Vector3;if(a){var e,f,g,h=new THREE.Vector3,i=new THREE.Vector3;for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],e=this.vertices[c.a],f=this.vertices[c.b],g=this.vertices[c.c],h.subVectors(g,f),i.subVectors(e,f),h.cross(i),d[c.a].add(h),d[c.b].add(h),d[c.c].add(h)}else for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],d[c.a].add(c.normal),d[c.b].add(c.normal),d[c.c].add(c.normal);for(b=0,c=this.vertices.length;c>b;b++)d[b].normalize();for(a=0,b=this.faces.length;b>a;a++)c=this.faces[a],c.vertexNormals[0]=d[c.a].clone(),c.vertexNormals[1]=d[c.b].clone(),c.vertexNormals[2]=d[c.c].clone()},computeMorphNormals:function(){var a,b,c,d,e;for(c=0,d=this.faces.length;d>c;c++)for(e=this.faces[c],e.__originalFaceNormal?e.__originalFaceNormal.copy(e.normal):e.__originalFaceNormal=e.normal.clone(),e.__originalVertexNormals||(e.__originalVertexNormals=[]),a=0,b=e.vertexNormals.length;b>a;a++)e.__originalVertexNormals[a]?e.__originalVertexNormals[a].copy(e.vertexNormals[a]):e.__originalVertexNormals[a]=e.vertexNormals[a].clone();var f=new THREE.Geometry;for(f.faces=this.faces,a=0,b=this.morphTargets.length;b>a;a++){if(!this.morphNormals[a]){this.morphNormals[a]={},this.morphNormals[a].faceNormals=[],this.morphNormals[a].vertexNormals=[],e=this.morphNormals[a].faceNormals;var g,h,i=this.morphNormals[a].vertexNormals;for(c=0,d=this.faces.length;d>c;c++)g=new THREE.Vector3,h={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},e.push(g),i.push(h)}for(i=this.morphNormals[a],f.vertices=this.morphTargets[a].vertices,f.computeFaceNormals(),f.computeVertexNormals(),c=0,d=this.faces.length;d>c;c++)e=this.faces[c],g=i.faceNormals[c],h=i.vertexNormals[c],g.copy(e.normal),h.a.copy(e.vertexNormals[0]),h.b.copy(e.vertexNormals[1]),h.c.copy(e.vertexNormals[2])}for(c=0,d=this.faces.length;d>c;c++)e=this.faces[c],e.normal=e.__originalFaceNormal,e.vertexNormals=e.__originalVertexNormals},computeTangents:function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=[],s=[];c=new THREE.Vector3;var t=new THREE.Vector3,u=new THREE.Vector3,v=new THREE.Vector3,w=new THREE.Vector3;for(a=0,b=this.vertices.length;b>a;a++)r[a]=new THREE.Vector3,s[a]=new THREE.Vector3;for(a=0,b=this.faces.length;b>a;a++)e=this.faces[a],f=this.faceVertexUvs[0][a],d=e.a,q=e.b,e=e.c,g=this.vertices[d],h=this.vertices[q],i=this.vertices[e],j=f[0],k=f[1],l=f[2],f=h.x-g.x,m=i.x-g.x,n=h.y-g.y,o=i.y-g.y,h=h.z-g.z,g=i.z-g.z,i=k.x-j.x,p=l.x-j.x,k=k.y-j.y,j=l.y-j.y,l=1/(i*j-p*k),c.set((j*f-k*m)*l,(j*n-k*o)*l,(j*h-k*g)*l),t.set((i*m-p*f)*l,(i*o-p*n)*l,(i*g-p*h)*l),r[d].add(c),r[q].add(c),r[e].add(c),s[d].add(t),s[q].add(t),s[e].add(t);for(t=["a","b","c","d"],a=0,b=this.faces.length;b>a;a++)for(e=this.faces[a],c=0;cd?-1:1,e.vertexTangents[c]=new THREE.Vector4(u.x,u.y,u.z,d);this.hasTangents=!0},computeLineDistances:function(){for(var a=0,b=this.vertices,c=0,d=b.length;d>c;c++)c>0&&(a+=b[c].distanceTo(b[c-1])),this.lineDistances[c]=a},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(!1==a instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a);else{var d,e=this.vertices.length,f=this.vertices,g=a.vertices,h=this.faces,i=a.faces,j=this.faceVertexUvs[0];a=a.faceVertexUvs[0],void 0===c&&(c=0),void 0!==b&&(d=(new THREE.Matrix3).getNormalMatrix(b));for(var k=0,l=g.length;l>k;k++){var m=g[k].clone();void 0!==b&&m.applyMatrix4(b),f.push(m)}for(k=0,l=i.length;l>k;k++){var n,g=i[k],o=g.vertexNormals,p=g.vertexColors,m=new THREE.Face3(g.a+e,g.b+e,g.c+e);for(m.normal.copy(g.normal),void 0!==d&&m.normal.applyMatrix3(d).normalize(),b=0,f=o.length;f>b;b++)n=o[b].clone(),void 0!==d&&n.applyMatrix3(d).normalize(),m.vertexNormals.push(n);for(m.color.copy(g.color),b=0,f=p.length;f>b;b++)n=p[b],m.vertexColors.push(n.clone());m.materialIndex=g.materialIndex+c,h.push(m)}for(k=0,l=a.length;l>k;k++)if(c=a[k],d=[],void 0!==c){for(b=0,f=c.length;f>b;b++)d.push(c[b].clone());j.push(d)}}},mergeMesh:function(a){!1==a instanceof THREE.Mesh?THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a):(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix))},mergeVertices:function(){var a,b,c,d={},e=[],f=[],g=Math.pow(10,4);for(b=0,c=this.vertices.length;c>b;b++)a=this.vertices[b],a=Math.round(a.x*g)+"_"+Math.round(a.y*g)+"_"+Math.round(a.z*g),void 0===d[a]?(d[a]=b,e.push(this.vertices[b]),f[b]=e.length-1):f[b]=f[d[a]];for(d=[],b=0,c=this.faces.length;c>b;b++)for(g=this.faces[b],g.a=f[g.a],g.b=f[g.b],g.c=f[g.c],g=[g.a,g.b,g.c],a=0;3>a;a++)if(g[a]==g[(a+1)%3]){ +d.push(b);break}for(b=d.length-1;b>=0;b--)for(g=d[b],this.faces.splice(g,1),f=0,c=this.faceVertexUvs.length;c>f;f++)this.faceVertexUvs[f].splice(g,1);return b=this.vertices.length-e.length,this.vertices=e,b},toJSON:function(){function a(a,b,c){return c?a|1<c;c++)a.vertices.push(b[c].clone());for(b=this.faces,c=0,d=b.length;d>c;c++)a.faces.push(b[c].clone());for(c=0,d=this.faceVertexUvs.length;d>c;c++){b=this.faceVertexUvs[c],void 0===a.faceVertexUvs[c]&&(a.faceVertexUvs[c]=[]);for(var e=0,f=b.length;f>e;e++){for(var g=b[e],h=[],i=0,j=g.length;j>i;i++)h.push(g[i].clone());a.faceVertexUvs[c].push(h)}}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){return b=b||new THREE.Vector3,this.getWorldQuaternion(a),b.set(0,0,-1).applyQuaternion(a)}}(),THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up),this.quaternion.setFromRotationMatrix(a)}}(),THREE.Camera.prototype.clone=function(a){return void 0===a&&(a=new THREE.Camera),THREE.Object3D.prototype.clone.call(this,a),a.matrixWorldInverse.copy(this.matrixWorldInverse),a.projectionMatrix.copy(this.projectionMatrix),a},THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this),this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0),d.lookAt(new THREE.Vector3(1,0,0)),this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0),e.lookAt(new THREE.Vector3(-1,0,0)),this.add(e);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,1),f.lookAt(new THREE.Vector3(0,1,0)),this.add(f);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,-1),g.lookAt(new THREE.Vector3(0,-1,0)),this.add(g);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0),h.lookAt(new THREE.Vector3(0,0,1)),this.add(h);var i=new THREE.PerspectiveCamera(90,1,a,b);i.up.set(0,-1,0),i.lookAt(new THREE.Vector3(0,0,-1)),this.add(i),this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(a,b){var c=this.renderTarget,j=c.generateMipmaps;c.generateMipmaps=!1,c.activeCubeFace=0,a.render(b,d,c),c.activeCubeFace=1,a.render(b,e,c),c.activeCubeFace=2,a.render(b,f,c),c.activeCubeFace=3,a.render(b,g,c),c.activeCubeFace=4,a.render(b,h,c),c.generateMipmaps=j,c.activeCubeFace=5,a.render(b,i,c)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=a,this.right=b,this.top=c,this.bottom=d,this.near=void 0!==e?e:.1,this.far=void 0!==f?f:2e3,this.updateProjectionMatrix()},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(c-a,c+a,d+b,d-b,this.near,this.far)},THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.left=this.left,a.right=this.right,a.top=this.top,a.bottom=this.bottom,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==a?a:50,this.aspect=void 0!==b?b:1,this.near=void 0!==c?c:.1,this.far=void 0!==d?d:2e3,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24),this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a))),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a,this.fullHeight=b,this.x=c,this.y=d,this.width=e,this.height=f,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var a=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var b=this.fullWidth/this.fullHeight,a=Math.tan(THREE.Math.degToRad(.5*a))*this.near,c=-a,d=b*c,b=Math.abs(b*a-d),c=Math.abs(a-c);this.projectionMatrix.makeFrustum(d+this.x*b/this.fullWidth,d+(this.x+this.width)*b/this.fullWidth,a-(this.y+this.height)*c/this.fullHeight,a-this.y*c/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(a,this.aspect,this.near,this.far)},THREE.PerspectiveCamera.prototype.clone=function(){var a=new THREE.PerspectiveCamera;return THREE.Camera.prototype.clone.call(this,a),a.zoom=this.zoom,a.fov=this.fov,a.aspect=this.aspect,a.near=this.near,a.far=this.far,a.projectionMatrix.copy(this.projectionMatrix),a},THREE.Light=function(a){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(a)},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.clone=function(a){return void 0===a&&(a=new THREE.Light),THREE.Object3D.prototype.clone.call(this,a),a.color.copy(this.color),a},THREE.AmbientLight=function(a){THREE.Light.call(this,a),this.type="AmbientLight"},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.AmbientLight.prototype.clone=function(){var a=new THREE.AmbientLight;return THREE.Light.prototype.clone.call(this,a),a},THREE.AreaLight=function(a,b){THREE.Light.call(this,a),this.type="AreaLight",this.normal=new THREE.Vector3(0,-1,0),this.right=new THREE.Vector3(1,0,0),this.intensity=void 0!==b?b:1,this.height=this.width=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},THREE.AreaLight.prototype=Object.create(THREE.Light.prototype),THREE.AreaLight.prototype.constructor=THREE.AreaLight,THREE.DirectionalLight=function(a,b){THREE.Light.call(this,a),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraTop=this.shadowCameraRight=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowCascade=!1,this.shadowCascadeOffset=new THREE.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.clone=function(){var a=new THREE.DirectionalLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraLeft=this.shadowCameraLeft,a.shadowCameraRight=this.shadowCameraRight,a.shadowCameraTop=this.shadowCameraTop,a.shadowCameraBottom=this.shadowCameraBottom,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a.shadowCascade=this.shadowCascade,a.shadowCascadeOffset.copy(this.shadowCascadeOffset),a.shadowCascadeCount=this.shadowCascadeCount,a.shadowCascadeBias=this.shadowCascadeBias.slice(0),a.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),a.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),a.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),a.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),a},THREE.HemisphereLight=function(a,b,c){THREE.Light.call(this,a),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new THREE.Color(b),this.intensity=void 0!==c?c:1},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.clone=function(){var a=new THREE.HemisphereLight;return THREE.Light.prototype.clone.call(this,a),a.groundColor.copy(this.groundColor),a.intensity=this.intensity,a},THREE.PointLight=function(a,b,c,d){THREE.Light.call(this,a),this.type="PointLight",this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.decay=void 0!==d?d:1},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,THREE.PointLight.prototype.clone=function(){var a=new THREE.PointLight;return THREE.Light.prototype.clone.call(this,a),a.intensity=this.intensity,a.distance=this.distance,a.decay=this.decay,a},THREE.SpotLight=function(a,b,c,d,e,f){THREE.Light.call(this,a),this.type="SpotLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==b?b:1,this.distance=void 0!==c?c:0,this.angle=void 0!==d?d:Math.PI/3,this.exponent=void 0!==e?e:10,this.decay=void 0!==f?f:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,THREE.SpotLight.prototype.clone=function(){var a=new THREE.SpotLight;return THREE.Light.prototype.clone.call(this,a),a.target=this.target.clone(),a.intensity=this.intensity,a.distance=this.distance,a.angle=this.angle,a.exponent=this.exponent,a.decay=this.decay,a.castShadow=this.castShadow,a.onlyShadow=this.onlyShadow,a.shadowCameraNear=this.shadowCameraNear,a.shadowCameraFar=this.shadowCameraFar,a.shadowCameraFov=this.shadowCameraFov,a.shadowCameraVisible=this.shadowCameraVisible,a.shadowBias=this.shadowBias,a.shadowDarkness=this.shadowDarkness,a.shadowMapWidth=this.shadowMapWidth,a.shadowMapHeight=this.shadowMapHeight,a},THREE.Cache={files:{},add:function(a,b){this.files[a]=b},get:function(a){return this.files[a]},remove:function(a){delete this.files[a]},clear:function(){this.files={}}},THREE.Loader=function(a){this.statusDomElement=(this.showStatus=a)?THREE.Loader.prototype.addStatusElement():null,this.imageLoader=new THREE.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var a=document.createElement("div");return a.style.position="absolute",a.style.right="0px",a.style.top="0px",a.style.fontSize="0.8em",a.style.textAlign="left",a.style.background="rgba(0,0,0,0.25)",a.style.color="#fff",a.style.width="120px",a.style.padding="0.5em 0.5em 0.5em 0.5em",a.style.zIndex=1e3,a.innerHTML="Loading ...",a},updateProgress:function(a){var b="Loaded ",b=a.total?b+((100*a.loaded/a.total).toFixed(0)+"%"):b+((a.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=b},extractUrlBase:function(a){return a=a.split("/"),1===a.length?"./":(a.pop(),a.join("/")+"/")},initMaterials:function(a,b){for(var c=[],d=0;db;b++)if(a[b]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(a,b){function c(a){return a=Math.log(a)/Math.LN2,Math.pow(2,Math.round(a))}function d(a,d,e,g,h,i,j){var k,l=b+e,m=THREE.Loader.Handlers.get(l);null!==m?k=m.load(l):(k=new THREE.Texture,m=f.imageLoader,m.crossOrigin=f.crossOrigin,m.load(l,function(a){if(!1===THREE.Math.isPowerOfTwo(a.width)||!1===THREE.Math.isPowerOfTwo(a.height)){var b=c(a.width),d=c(a.height),e=document.createElement("canvas");e.width=b,e.height=d,e.getContext("2d").drawImage(a,0,0,b,d),k.image=e}else k.image=a;k.needsUpdate=!0})),k.sourceFile=e,g&&(k.repeat.set(g[0],g[1]),1!==g[0]&&(k.wrapS=THREE.RepeatWrapping),1!==g[1]&&(k.wrapT=THREE.RepeatWrapping)),h&&k.offset.set(h[0],h[1]),i&&(e={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping},void 0!==e[i[0]]&&(k.wrapS=e[i[0]]),void 0!==e[i[1]]&&(k.wrapT=e[i[1]])),j&&(k.anisotropy=j),a[d]=k}function e(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]}var f=this,g="MeshLambertMaterial",h={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(a.shading){var i=a.shading.toLowerCase();"phong"===i?g="MeshPhongMaterial":"basic"===i&&(g="MeshBasicMaterial")}return void 0!==a.blending&&void 0!==THREE[a.blending]&&(h.blending=THREE[a.blending]),void 0!==a.transparent&&(h.transparent=a.transparent),void 0!==a.opacity&&1>a.opacity&&(h.transparent=!0),void 0!==a.depthTest&&(h.depthTest=a.depthTest),void 0!==a.depthWrite&&(h.depthWrite=a.depthWrite),void 0!==a.visible&&(h.visible=a.visible),void 0!==a.flipSided&&(h.side=THREE.BackSide),void 0!==a.doubleSided&&(h.side=THREE.DoubleSide),void 0!==a.wireframe&&(h.wireframe=a.wireframe),void 0!==a.vertexColors&&("face"===a.vertexColors?h.vertexColors=THREE.FaceColors:a.vertexColors&&(h.vertexColors=THREE.VertexColors)),a.colorDiffuse?h.color=e(a.colorDiffuse):a.DbgColor&&(h.color=a.DbgColor),a.colorSpecular&&(h.specular=e(a.colorSpecular)),a.colorEmissive&&(h.emissive=e(a.colorEmissive)),void 0!==a.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),a.opacity=a.transparency),void 0!==a.opacity&&(h.opacity=a.opacity),a.specularCoef&&(h.shininess=a.specularCoef),a.mapDiffuse&&b&&d(h,"map",a.mapDiffuse,a.mapDiffuseRepeat,a.mapDiffuseOffset,a.mapDiffuseWrap,a.mapDiffuseAnisotropy),a.mapLight&&b&&d(h,"lightMap",a.mapLight,a.mapLightRepeat,a.mapLightOffset,a.mapLightWrap,a.mapLightAnisotropy),a.mapBump&&b&&d(h,"bumpMap",a.mapBump,a.mapBumpRepeat,a.mapBumpOffset,a.mapBumpWrap,a.mapBumpAnisotropy),a.mapNormal&&b&&d(h,"normalMap",a.mapNormal,a.mapNormalRepeat,a.mapNormalOffset,a.mapNormalWrap,a.mapNormalAnisotropy),a.mapSpecular&&b&&d(h,"specularMap",a.mapSpecular,a.mapSpecularRepeat,a.mapSpecularOffset,a.mapSpecularWrap,a.mapSpecularAnisotropy),a.mapAlpha&&b&&d(h,"alphaMap",a.mapAlpha,a.mapAlphaRepeat,a.mapAlphaOffset,a.mapAlphaWrap,a.mapAlphaAnisotropy),a.mapBumpScale&&(h.bumpScale=a.mapBumpScale),a.mapNormalFactor&&(h.normalScale=new THREE.Vector2(a.mapNormalFactor,a.mapNormalFactor)),g=new THREE[g](h),void 0!==a.DbgName&&(g.name=a.DbgName),g}},THREE.Loader.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,b)},get:function(a){for(var b=0,c=this.handlers.length;c>b;b+=2){var d=this.handlers[b+1];if(this.handlers[b].test(a))return d}return null}},THREE.XHRLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);void 0!==f?b&&b(f):(f=new XMLHttpRequest,f.open("GET",a,!0),f.addEventListener("load",function(){THREE.Cache.add(a,this.response),b&&b(this.response),e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&f.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(f.responseType=this.responseType),f.send(null),e.manager.itemStart(a))},setResponseType:function(a){this.responseType=a},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.ImageLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(a,b,c,d){var e=this,f=THREE.Cache.get(a);return void 0===f?(f=document.createElement("img"),f.addEventListener("load",function(){THREE.Cache.add(a,this),b&&b(this),e.manager.itemEnd(a)},!1),void 0!==c&&f.addEventListener("progress",function(a){c(a)},!1),void 0!==d&&f.addEventListener("error",function(a){d(a)},!1),void 0!==this.crossOrigin&&(f.crossOrigin=this.crossOrigin),f.src=a,e.manager.itemStart(a),f):void b(f)},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.JSONLoader=function(a){THREE.Loader.call(this,a),this.withCredentials=!1},THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype),THREE.JSONLoader.prototype.constructor=THREE.JSONLoader,THREE.JSONLoader.prototype.load=function(a,b,c){c=c&&"string"==typeof c?c:this.extractUrlBase(a),this.onLoadStart(),this.loadAjaxJSON(this,a,b,c)},THREE.JSONLoader.prototype.loadAjaxJSON=function(a,b,c,d,e){var f=new XMLHttpRequest,g=0;f.onreadystatechange=function(){if(f.readyState===f.DONE)if(200===f.status||0===f.status){if(f.responseText){var h=JSON.parse(f.responseText),i=h.metadata;if(void 0!==i){if("object"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" should be loaded with THREE.ObjectLoader instead.");if("scene"===i.type)return void THREE.error("THREE.JSONLoader: "+b+" seems to be a Scene. Use THREE.SceneLoader instead.")}h=a.parse(h,d),c(h.geometry,h.materials)}else THREE.error("THREE.JSONLoader: "+b+" seems to be unreachable or the file is empty.");a.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load "+b+" ("+f.status+")");else f.readyState===f.LOADING?e&&(0===g&&(g=f.getResponseHeader("Content-Length")),e({total:g,loaded:f.responseText.length})):f.readyState===f.HEADERS_RECEIVED&&void 0!==e&&(g=f.getResponseHeader("Content-Length"))},f.open("GET",b,!0),f.withCredentials=this.withCredentials,f.send(null)},THREE.JSONLoader.prototype.parse=function(a,b){var c=new THREE.Geometry,d=void 0!==a.scale?1/a.scale:1;return function(b){var d,e,f,g,h,i,j,k,l,m,n,o,p,q=a.faces;i=a.vertices;var r=a.normals,s=a.colors,t=0;if(void 0!==a.uvs){for(d=0;dd;d++)c.faceVertexUvs[d]=[]}for(g=0,h=i.length;h>g;)d=new THREE.Vector3,d.x=i[g++]*b,d.y=i[g++]*b,d.z=i[g++]*b,c.vertices.push(d);for(g=0,h=q.length;h>g;)if(b=q[g++],l=1&b,f=2&b,d=8&b,j=16&b,m=32&b,i=64&b,b&=128,l){if(l=new THREE.Face3,l.a=q[g],l.b=q[g+1],l.c=q[g+3],n=new THREE.Face3,n.a=q[g+1],n.b=q[g+2],n.c=q[g+3],g+=4,f&&(f=q[g++],l.materialIndex=f,n.materialIndex=f),f=c.faces.length,d)for(d=0;t>d;d++)for(o=a.uvs[d],c.faceVertexUvs[d][f]=[],c.faceVertexUvs[d][f+1]=[],e=0;4>e;e++)k=q[g++],p=o[2*k],k=o[2*k+1],p=new THREE.Vector2(p,k),2!==e&&c.faceVertexUvs[d][f].push(p),0!==e&&c.faceVertexUvs[d][f+1].push(p);if(j&&(j=3*q[g++],l.normal.set(r[j++],r[j++],r[j]),n.normal.copy(l.normal)),m)for(d=0;4>d;d++)j=3*q[g++],m=new THREE.Vector3(r[j++],r[j++],r[j]),2!==d&&l.vertexNormals.push(m),0!==d&&n.vertexNormals.push(m);if(i&&(i=q[g++],i=s[i],l.color.setHex(i),n.color.setHex(i)),b)for(d=0;4>d;d++)i=q[g++],i=s[i],2!==d&&l.vertexColors.push(new THREE.Color(i)),0!==d&&n.vertexColors.push(new THREE.Color(i));c.faces.push(l),c.faces.push(n)}else{if(l=new THREE.Face3,l.a=q[g++],l.b=q[g++],l.c=q[g++],f&&(f=q[g++],l.materialIndex=f),f=c.faces.length,d)for(d=0;t>d;d++)for(o=a.uvs[d],c.faceVertexUvs[d][f]=[],e=0;3>e;e++)k=q[g++],p=o[2*k],k=o[2*k+1],p=new THREE.Vector2(p,k),c.faceVertexUvs[d][f].push(p);if(j&&(j=3*q[g++],l.normal.set(r[j++],r[j++],r[j])),m)for(d=0;3>d;d++)j=3*q[g++],m=new THREE.Vector3(r[j++],r[j++],r[j]),l.vertexNormals.push(m);if(i&&(i=q[g++],l.color.setHex(s[i])),b)for(d=0;3>d;d++)i=q[g++],l.vertexColors.push(new THREE.Color(s[i]));c.faces.push(l)}}(d),function(){var b=void 0!==a.influencesPerVertex?a.influencesPerVertex:2;if(a.skinWeights)for(var d=0,e=a.skinWeights.length;e>d;d+=b)c.skinWeights.push(new THREE.Vector4(a.skinWeights[d],b>1?a.skinWeights[d+1]:0,b>2?a.skinWeights[d+2]:0,b>3?a.skinWeights[d+3]:0));if(a.skinIndices)for(d=0,e=a.skinIndices.length;e>d;d+=b)c.skinIndices.push(new THREE.Vector4(a.skinIndices[d],b>1?a.skinIndices[d+1]:0,b>2?a.skinIndices[d+2]:0,b>3?a.skinIndices[d+3]:0));c.bones=a.bones,c.bones&&0d;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=a.morphTargets[d].name,c.morphTargets[d].vertices=[],h=c.morphTargets[d].vertices,i=a.morphTargets[d].vertices,f=0,g=i.length;g>f;f+=3){var j=new THREE.Vector3;j.x=i[f]*b,j.y=i[f+1]*b,j.z=i[f+2]*b,h.push(j)}}if(void 0!==a.morphColors)for(d=0,e=a.morphColors.length;e>d;d++)for(c.morphColors[d]={},c.morphColors[d].name=a.morphColors[d].name,c.morphColors[d].colors=[],g=c.morphColors[d].colors,h=a.morphColors[d].colors,b=0,f=h.length;f>b;b+=3)i=new THREE.Color(16755200),i.setRGB(h[b],h[b+1],h[b+2]),g.push(i)}(d),c.computeFaceNormals(),c.computeBoundingSphere(),void 0===a.materials||0===a.materials.length?{geometry:c}:(d=this.initMaterials(a.materials,b),this.needsTangents(d)&&c.computeTangents(),{geometry:c,materials:d})},THREE.LoadingManager=function(a,b,c){var d=this,e=0,f=0;this.onLoad=a,this.onProgress=b,this.onError=c,this.itemStart=function(){f++},this.itemEnd=function(a){e++,void 0!==d.onProgress&&d.onProgress(a,e,f),e===f&&void 0!==d.onLoad&&d.onLoad()}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b,c=new THREE.BufferGeometry,d=a.data.attributes;for(b in d){var e=d[b],f=new self[e.type](e.array);c.addAttribute(b,new THREE.BufferAttribute(f,e.itemSize))}return d=a.data.offsets,void 0!==d&&(c.offsets=JSON.parse(JSON.stringify(d))),a=a.data.boundingSphere,void 0!==a&&(d=new THREE.Vector3,void 0!==a.center&&d.fromArray(a.center),c.boundingSphere=new THREE.Sphere(d,a.radius)),c}},THREE.MaterialLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(a,b,c,d){var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a){var b=new THREE[a.type];if(void 0!==a.color&&b.color.setHex(a.color),void 0!==a.emissive&&b.emissive.setHex(a.emissive),void 0!==a.specular&&b.specular.setHex(a.specular),void 0!==a.shininess&&(b.shininess=a.shininess),void 0!==a.uniforms&&(b.uniforms=a.uniforms),void 0!==a.vertexShader&&(b.vertexShader=a.vertexShader),void 0!==a.fragmentShader&&(b.fragmentShader=a.fragmentShader),void 0!==a.vertexColors&&(b.vertexColors=a.vertexColors),void 0!==a.shading&&(b.shading=a.shading),void 0!==a.blending&&(b.blending=a.blending),void 0!==a.side&&(b.side=a.side),void 0!==a.opacity&&(b.opacity=a.opacity),void 0!==a.transparent&&(b.transparent=a.transparent),void 0!==a.wireframe&&(b.wireframe=a.wireframe),void 0!==a.size&&(b.size=a.size),void 0!==a.sizeAttenuation&&(b.sizeAttenuation=a.sizeAttenuation),void 0!==a.materials)for(var c=0,d=a.materials.length;d>c;c++)b.materials.push(this.parse(a.materials[c]));return b}},THREE.ObjectLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(a,b,c,d){""===this.texturePath&&(this.texturePath=a.substring(0,a.lastIndexOf("/")+1));var e=this,f=new THREE.XHRLoader(e.manager);f.setCrossOrigin(this.crossOrigin),f.load(a,function(a){e.parse(JSON.parse(a),b)},c,d)},setTexturePath:function(a){this.texturePath=a},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a,b){var c=this.parseGeometries(a.geometries),d=this.parseImages(a.images,function(){void 0!==b&&b(e)}),d=this.parseTextures(a.textures,d),d=this.parseMaterials(a.materials,d),e=this.parseObject(a.object,c,d);return void 0!==a.images&&0!==a.images.length||void 0===b||b(e),e},parseGeometries:function(a){var b={};if(void 0!==a)for(var c=new THREE.JSONLoader,d=new THREE.BufferGeometryLoader,e=0,f=a.length;f>e;e++){var g,h=a[e];switch(h.type){case"PlaneGeometry":case"PlaneBufferGeometry":g=new THREE[h.type](h.width,h.height,h.widthSegments,h.heightSegments);break;case"BoxGeometry":case"CubeGeometry":g=new THREE.BoxGeometry(h.width,h.height,h.depth,h.widthSegments,h.heightSegments,h.depthSegments);break;case"CircleGeometry":g=new THREE.CircleGeometry(h.radius,h.segments);break;case"CylinderGeometry":g=new THREE.CylinderGeometry(h.radiusTop,h.radiusBottom,h.height,h.radialSegments,h.heightSegments,h.openEnded);break;case"SphereGeometry":g=new THREE.SphereGeometry(h.radius,h.widthSegments,h.heightSegments,h.phiStart,h.phiLength,h.thetaStart,h.thetaLength);break;case"IcosahedronGeometry":g=new THREE.IcosahedronGeometry(h.radius,h.detail);break;case"TorusGeometry":g=new THREE.TorusGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.arc);break;case"TorusKnotGeometry":g=new THREE.TorusKnotGeometry(h.radius,h.tube,h.radialSegments,h.tubularSegments,h.p,h.q,h.heightScale);break;case"BufferGeometry":g=d.parse(h);break;case"Geometry":g=c.parse(h.data).geometry}g.uuid=h.uuid,void 0!==h.name&&(g.name=h.name),b[h.uuid]=g}return b},parseMaterials:function(a,b){var c={};if(void 0!==a)for(var d=function(a){return void 0===b[a]&&THREE.warn("THREE.ObjectLoader: Undefined texture",a),b[a]},e=new THREE.MaterialLoader,f=0,g=a.length;g>f;f++){var h=a[f],i=e.parse(h);i.uuid=h.uuid,void 0!==h.name&&(i.name=h.name),void 0!==h.map&&(i.map=d(h.map)),void 0!==h.bumpMap&&(i.bumpMap=d(h.bumpMap),h.bumpScale&&(i.bumpScale=new THREE.Vector2(h.bumpScale,h.bumpScale))),void 0!==h.alphaMap&&(i.alphaMap=d(h.alphaMap)),void 0!==h.envMap&&(i.envMap=d(h.envMap)),void 0!==h.normalMap&&(i.normalMap=d(h.normalMap),h.normalScale&&(i.normalScale=new THREE.Vector2(h.normalScale,h.normalScale))),void 0!==h.lightMap&&(i.lightMap=d(h.lightMap)),void 0!==h.specularMap&&(i.specularMap=d(h.specularMap)),c[h.uuid]=i}return c},parseImages:function(a,b){var c=this,d={};if(void 0!==a&&0g;g++){var i=a[g],j=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i.url)?i.url:c.texturePath+i.url;d[i.uuid]=e(j)}}return d},parseTextures:function(a,b){var c={};if(void 0!==a)for(var d=0,e=a.length;e>d;d++){var f=a[d];void 0===f.image&&THREE.warn('THREE.ObjectLoader: No "image" speficied for',f.uuid),void 0===b[f.image]&&THREE.warn("THREE.ObjectLoader: Undefined image",f.image);var g=new THREE.Texture(b[f.image]);g.needsUpdate=!0,g.uuid=f.uuid,void 0!==f.name&&(g.name=f.name),void 0!==f.repeat&&(g.repeat=new THREE.Vector2(f.repeat[0],f.repeat[1])),void 0!==f.minFilter&&(g.minFilter=THREE[f.minFilter]),void 0!==f.magFilter&&(g.magFilter=THREE[f.magFilter]),void 0!==f.anisotropy&&(g.anisotropy=f.anisotropy),f.wrap instanceof Array&&(g.wrapS=THREE[f.wrap[0]],g.wrapT=THREE[f.wrap[1]]),c[f.uuid]=g}return c},parseObject:function(){var a=new THREE.Matrix4;return function(b,c,d){var e;e=function(a){return void 0===c[a]&&THREE.warn("THREE.ObjectLoader: Undefined geometry",a),c[a]};var f=function(a){return void 0===d[a]&&THREE.warn("THREE.ObjectLoader: Undefined material",a),d[a]};switch(b.type){case"Scene":e=new THREE.Scene;break;case"PerspectiveCamera":e=new THREE.PerspectiveCamera(b.fov,b.aspect,b.near,b.far);break;case"OrthographicCamera":e=new THREE.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far);break;case"AmbientLight":e=new THREE.AmbientLight(b.color);break;case"DirectionalLight":e=new THREE.DirectionalLight(b.color,b.intensity);break;case"PointLight":e=new THREE.PointLight(b.color,b.intensity,b.distance,b.decay);break;case"SpotLight":e=new THREE.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay);break;case"HemisphereLight":e=new THREE.HemisphereLight(b.color,b.groundColor,b.intensity);break;case"Mesh":e=new THREE.Mesh(e(b.geometry),f(b.material));break;case"Line":e=new THREE.Line(e(b.geometry),f(b.material),b.mode);break;case"PointCloud":e=new THREE.PointCloud(e(b.geometry),f(b.material));break;case"Sprite":e=new THREE.Sprite(f(b.material));break;case"Group":e=new THREE.Group;break;default:e=new THREE.Object3D}if(e.uuid=b.uuid,void 0!==b.name&&(e.name=b.name),void 0!==b.matrix?(a.fromArray(b.matrix),a.decompose(e.position,e.quaternion,e.scale)):(void 0!==b.position&&e.position.fromArray(b.position),void 0!==b.rotation&&e.rotation.fromArray(b.rotation),void 0!==b.scale&&e.scale.fromArray(b.scale)),void 0!==b.visible&&(e.visible=b.visible),void 0!==b.userData&&(e.userData=b.userData),void 0!==b.children)for(var g in b.children)e.add(this.parseObject(b.children[g],c,d));return e}}()},THREE.TextureLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(a,b,c,d){var e=new THREE.ImageLoader(this.manager);e.setCrossOrigin(this.crossOrigin),e.load(a,function(a){a=new THREE.Texture(a),a.needsUpdate=!0,void 0!==b&&b(a)},c,d)},setCrossOrigin:function(a){this.crossOrigin=a}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(){this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(a,b,c,d){ +var e=this,f=new THREE.DataTexture,g=new THREE.XHRLoader;return g.setResponseType("arraybuffer"),g.load(a,function(a){(a=e._parser(a))&&(void 0!==a.image?f.image=a.image:void 0!==a.data&&(f.image.width=a.width,f.image.height=a.height,f.image.data=a.data),f.wrapS=void 0!==a.wrapS?a.wrapS:THREE.ClampToEdgeWrapping,f.wrapT=void 0!==a.wrapT?a.wrapT:THREE.ClampToEdgeWrapping,f.magFilter=void 0!==a.magFilter?a.magFilter:THREE.LinearFilter,f.minFilter=void 0!==a.minFilter?a.minFilter:THREE.LinearMipMapLinearFilter,f.anisotropy=void 0!==a.anisotropy?a.anisotropy:1,void 0!==a.format&&(f.format=a.format),void 0!==a.type&&(f.type=a.type),void 0!==a.mipmaps&&(f.mipmaps=a.mipmaps),1===a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.needsUpdate=!0,b&&b(f,a))},c,d),f}},THREE.CompressedTextureLoader=function(){this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(a,b,c){var d=this,e=[],f=new THREE.CompressedTexture;f.image=e;var g=new THREE.XHRLoader;if(g.setResponseType("arraybuffer"),a instanceof Array){var h=0;c=function(c){g.load(a[c],function(a){a=d._parser(a,!0),e[c]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps},h+=1,6===h&&(1==a.mipmapCount&&(f.minFilter=THREE.LinearFilter),f.format=a.format,f.needsUpdate=!0,b&&b(f))})};for(var i=0,j=a.length;j>i;++i)c(i)}else g.load(a,function(a){if(a=d._parser(a,!0),a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,g=0;c>g;g++){e[g]={mipmaps:[]};for(var h=0;hthis.opacity&&(a.opacity=this.opacity),!1!==this.transparent&&(a.transparent=this.transparent),!1!==this.wireframe&&(a.wireframe=this.wireframe),a},clone:function(a){return void 0===a&&(a=new THREE.Material),a.name=this.name,a.side=this.side,a.opacity=this.opacity,a.transparent=this.transparent,a.blending=this.blending,a.blendSrc=this.blendSrc,a.blendDst=this.blendDst,a.blendEquation=this.blendEquation,a.blendSrcAlpha=this.blendSrcAlpha,a.blendDstAlpha=this.blendDstAlpha,a.blendEquationAlpha=this.blendEquationAlpha,a.depthTest=this.depthTest,a.depthWrite=this.depthWrite,a.polygonOffset=this.polygonOffset,a.polygonOffsetFactor=this.polygonOffsetFactor,a.polygonOffsetUnits=this.polygonOffsetUnits,a.alphaTest=this.alphaTest,a.overdraw=this.overdraw,a.visible=this.visible,a},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(a){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(a)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.clone=function(){var a=new THREE.LineBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.linecap=this.linecap,a.linejoin=this.linejoin,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.LineDashedMaterial=function(a){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(a)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.clone=function(){var a=new THREE.LineDashedMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.linewidth=this.linewidth,a.scale=this.scale,a.dashSize=this.dashSize,a.gapSize=this.gapSize,a.vertexColors=this.vertexColors,a.fog=this.fog,a},THREE.MeshBasicMaterial=function(a){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.clone=function(){var a=new THREE.MeshBasicMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a},THREE.MeshLambertMaterial=function(a){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.wrapAround=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.clone=function(){var a=new THREE.MeshLambertMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshPhongMaterial=function(a){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.specular=new THREE.Color(1118481),this.shininess=30,this.wrapAround=this.metal=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.bumpMap=this.lightMap=this.map=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.envMap=this.alphaMap=this.specularMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(a)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.clone=function(){var a=new THREE.MeshPhongMaterial;return THREE.Material.prototype.clone.call(this,a),a.color.copy(this.color),a.emissive.copy(this.emissive),a.specular.copy(this.specular),a.shininess=this.shininess,a.metal=this.metal,a.wrapAround=this.wrapAround,a.wrapRGB.copy(this.wrapRGB),a.map=this.map,a.lightMap=this.lightMap,a.bumpMap=this.bumpMap,a.bumpScale=this.bumpScale,a.normalMap=this.normalMap,a.normalScale.copy(this.normalScale),a.specularMap=this.specularMap,a.alphaMap=this.alphaMap,a.envMap=this.envMap,a.combine=this.combine,a.reflectivity=this.reflectivity,a.refractionRatio=this.refractionRatio,a.fog=this.fog,a.shading=this.shading,a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a.wireframeLinecap=this.wireframeLinecap,a.wireframeLinejoin=this.wireframeLinejoin,a.vertexColors=this.vertexColors,a.skinning=this.skinning,a.morphTargets=this.morphTargets,a.morphNormals=this.morphNormals,a},THREE.MeshDepthMaterial=function(a){THREE.Material.call(this),this.type="MeshDepthMaterial",this.wireframe=this.morphTargets=!1,this.wireframeLinewidth=1,this.setValues(a)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.clone=function(){var a=new THREE.MeshDepthMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshNormalMaterial=function(a){THREE.Material.call(this,a),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(a)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.clone=function(){var a=new THREE.MeshNormalMaterial;return THREE.Material.prototype.clone.call(this,a),a.wireframe=this.wireframe,a.wireframeLinewidth=this.wireframeLinewidth,a},THREE.MeshFaceMaterial=function(a){this.uuid=THREE.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=a instanceof Array?a:[]},THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var a={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},b=0,c=this.materials.length;c>b;b++)a.materials.push(this.materials[b].toJSON());return a},clone:function(){for(var a=new THREE.MeshFaceMaterial,b=0;bg){var i=b.closestPointToPoint(a);i.applyMatrix4(e.matrixWorld);var j=c.ray.origin.distanceTo(i);d.push({distance:j,distanceToRay:g,point:i.clone(),index:f,face:null,object:e})}};if(f instanceof THREE.BufferGeometry){var j=f.attributes,k=j.position.array;if(void 0!==j.index){var j=j.index.array,l=f.offsets;0===l.length&&(l=[{start:0,count:j.length,index:0}]);for(var m=0,n=l.length;n>m;++m)for(var o=l[m].start,p=l[m].index,f=o,o=o+l[m].count;o>f;f++){var q=p+j[f];i.fromArray(k,3*q),g(i,q)}}else for(j=k.length/3,f=0;j>f;f++)i.set(k[3*f],k[3*f+1],k[3*f+2]),g(i,f)}else for(i=this.geometry.vertices,f=0;fg;g+=l){var t=s+n[g+1];h.fromArray(m,3*(s+n[g])),i.fromArray(m,3*t),t=b.distanceSqToSegment(h,i,k,j),t>f||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,offsetIndex:p,face:null,faceIndex:null,object:this}))}}else for(m=m.position.array,g=0;gf||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}else if(g instanceof THREE.Geometry)for(h=g.vertices,i=h.length,g=0;i-1>g;g+=l)t=b.distanceSqToSegment(h[g],h[g+1],k,j),t>f||(t=b.origin.distanceTo(k),td.far||e.push({distance:t,point:j.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}))}}}(),THREE.Line.prototype.clone=function(a){return void 0===a&&(a=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Mesh=function(a,b){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==a?a:new THREE.Geometry,this.material=void 0!==b?b:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0a;a++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[a].name]=a}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){return void 0!==this.morphTargetDictionary[a]?this.morphTargetDictionary[a]:(THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+a+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g,h){var i=this.geometry;if(null===i.boundingSphere&&i.computeBoundingSphere(),c.copy(i.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==g.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(g.ray).applyMatrix4(a),null===i.boundingBox||!1!==b.isIntersectionBox(i.boundingBox)))if(i instanceof THREE.BufferGeometry){var j=this.material;if(void 0!==j){var k,l,m=i.attributes,n=g.precision;if(void 0!==m.index){var o=m.index.array,p=m.position.array,q=i.offsets;0===q.length&&(q=[{start:0,count:o.length,index:0}]);for(var r=0,s=q.length;s>r;++r)for(var m=q[r].start,t=q[r].index,i=m,u=m+q[r].count;u>i;i+=3){m=t+o[i],k=t+o[i+1],l=t+o[i+2],d.fromArray(p,3*m),e.fromArray(p,3*k),f.fromArray(p,3*l);var v=j.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide);if(null!==v){v.applyMatrix4(this.matrixWorld);var w=g.ray.origin.distanceTo(v);n>w||wg.far||h.push({distance:w,point:v,face:new THREE.Face3(m,k,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this})}}}else for(p=m.position.array,o=i=0,u=p.length;u>i;i+=3,o+=9)m=i,k=i+1,l=i+2,d.fromArray(p,o),e.fromArray(p,o+3),f.fromArray(p,o+6),v=j.side===THREE.BackSide?b.intersectTriangle(f,e,d,!0):b.intersectTriangle(d,e,f,j.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),w=g.ray.origin.distanceTo(v),n>w||wg.far||h.push({distance:w,point:v,face:new THREE.Face3(m,k,l,THREE.Triangle.normal(d,e,f)),faceIndex:null,object:this}))}}else if(i instanceof THREE.Geometry)for(o=this.material instanceof THREE.MeshFaceMaterial,p=!0===o?this.material.materials:null,n=g.precision,q=i.vertices,r=0,s=i.faces.length;s>r;r++)if(t=i.faces[r],j=!0===o?p[t.materialIndex]:this.material,void 0!==j){if(m=q[t.a],k=q[t.b],l=q[t.c],!0===j.morphTargets){v=i.morphTargets,w=this.morphTargetInfluences,d.set(0,0,0),e.set(0,0,0),f.set(0,0,0);for(var u=0,x=v.length;x>u;u++){var y=w[u];if(0!==y){var z=v[u].vertices;d.x+=(z[t.a].x-m.x)*y,d.y+=(z[t.a].y-m.y)*y,d.z+=(z[t.a].z-m.z)*y,e.x+=(z[t.b].x-k.x)*y,e.y+=(z[t.b].y-k.y)*y,e.z+=(z[t.b].z-k.z)*y,f.x+=(z[t.c].x-l.x)*y,f.y+=(z[t.c].y-l.y)*y,f.z+=(z[t.c].z-l.z)*y}}d.add(m),e.add(k),f.add(l),m=d,k=e,l=f}v=j.side===THREE.BackSide?b.intersectTriangle(l,k,m,!0):b.intersectTriangle(m,k,l,j.side!==THREE.DoubleSide),null!==v&&(v.applyMatrix4(this.matrixWorld),w=g.ray.origin.distanceTo(v),n>w||wg.far||h.push({distance:w,point:v,face:t,faceIndex:r,object:this}))}}}(),THREE.Mesh.prototype.clone=function(a,b){return void 0===a&&(a=new THREE.Mesh(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,a,b),a},THREE.Bone=function(a){THREE.Object3D.call(this),this.type="Bone",this.skin=a},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Skeleton=function(a,b,c){if(this.useVertexTexture=void 0!==c?c:!0,this.identityMatrix=new THREE.Matrix4,a=a||[],this.bones=a.slice(0),this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=a=256b;b++)this.boneInverses.push(new THREE.Matrix4)},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var a=0,b=this.bones.length;b>a;a++){var c=new THREE.Matrix4;this.bones[a]&&c.getInverse(this.bones[a].matrixWorld),this.boneInverses.push(c)}},THREE.Skeleton.prototype.pose=function(){for(var a,b=0,c=this.bones.length;c>b;b++)(a=this.bones[b])&&a.matrixWorld.getInverse(this.boneInverses[b]);for(b=0,c=this.bones.length;c>b;b++)(a=this.bones[b])&&(a.parent?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale))},THREE.Skeleton.prototype.update=function(){var a=new THREE.Matrix4;return function(){for(var b=0,c=this.bones.length;c>b;b++)a.multiplyMatrices(this.bones[b]?this.bones[b].matrixWorld:this.identityMatrix,this.boneInverses[b]),a.flattenToArrayOffset(this.boneMatrices,16*b);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.SkinnedMesh=function(a,b,c){if(THREE.Mesh.call(this,a,b),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4,a=[],this.geometry&&void 0!==this.geometry.bones){for(var d,e,f,g,h=0,i=this.geometry.bones.length;i>h;++h)d=this.geometry.bones[h],e=d.pos,f=d.rotq,g=d.scl,b=new THREE.Bone(this),a.push(b),b.name=d.name,b.position.set(e[0],e[1],e[2]),b.quaternion.set(f[0],f[1],f[2],f[3]),void 0!==g?b.scale.set(g[0],g[1],g[2]):b.scale.set(1,1,1);for(h=0,i=this.geometry.bones.length;i>h;++h)d=this.geometry.bones[h],-1!==d.parent?a[d.parent].add(a[h]):this.add(a[h])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(a,void 0,c))},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(a,b){this.skeleton=a,void 0===b&&(this.updateMatrixWorld(!0),b=this.matrixWorld),this.bindMatrix.copy(b),this.bindMatrixInverse.getInverse(b)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var a=0;ae;e++){var g=a.morphTargets[e].name.match(d);if(g&&1h.end&&(h.end=e),b||(b=g)}}a.firstAnimation=b},THREE.MorphAnimMesh.prototype.setAnimationLabel=function(a,b,c){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[a]={start:b,end:c}},THREE.MorphAnimMesh.prototype.playAnimation=function(a,b){var c=this.geometry.animations[a];c?(this.setFrameRange(c.start,c.end),this.duration=(c.end-c.start)/b*1e3,this.time=0):THREE.warn("THREE.MorphAnimMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphAnimMesh.prototype.updateAnimation=function(a){var b=this.duration/this.length;this.time+=this.direction*a,this.mirroredLoop?(this.time>this.duration||0>this.time)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),0>this.time&&(this.time=0,this.directionBackwards=!1)):(this.time%=this.duration,0>this.time&&(this.time+=this.duration)),a=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/b),0,this.length-1),a!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[a]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=a),b=this.time%b/b,this.directionBackwards&&(b=1-b),this.morphTargetInfluences[this.currentKeyframe]=b,this.morphTargetInfluences[this.lastKeyframe]=1-b},THREE.MorphAnimMesh.prototype.interpolateTargets=function(a,b,c){for(var d=this.morphTargetInfluences,e=0,f=d.length;f>e;e++)d[e]=0;a>-1&&(d[a]=1-c),b>-1&&(d[b]=c)},THREE.MorphAnimMesh.prototype.clone=function(a){return void 0===a&&(a=new THREE.MorphAnimMesh(this.geometry,this.material)),a.duration=this.duration,a.mirroredLoop=this.mirroredLoop,a.time=this.time,a.lastKeyframe=this.lastKeyframe,a.currentKeyframe=this.currentKeyframe,a.direction=this.direction,a.directionBackwards=this.directionBackwards,THREE.Mesh.prototype.clone.call(this,a),a},THREE.LOD=function(){THREE.Object3D.call(this),this.objects=[]},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(a,b){void 0===b&&(b=0),b=Math.abs(b);for(var c=0;cb&&!(ad&&c>=this.objects[d].distance;d++)this.objects[d-1].object.visible=!1,this.objects[d].object.visible=!0;for(;e>d;d++)this.objects[d].object.visible=!1}}}(),THREE.LOD.prototype.clone=function(a){void 0===a&&(a=new THREE.LOD),THREE.Object3D.prototype.clone.call(this,a);for(var b=0,c=this.objects.length;c>b;b++){var d=this.objects[b].object.clone();d.visible=0===b,a.addLevel(d,this.objects[b].distance)}return a},THREE.Sprite=function(){var a=new Uint16Array([0,1,2,0,2,3]),b=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),c=new Float32Array([0,0,1,0,1,1,0,1]),d=new THREE.BufferGeometry;return d.addAttribute("index",new THREE.BufferAttribute(a,1)),d.addAttribute("position",new THREE.BufferAttribute(b,3)),d.addAttribute("uv",new THREE.BufferAttribute(c,2)),function(a){THREE.Object3D.call(this),this.type="Sprite",this.geometry=d,this.material=void 0!==a?a:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceToPoint(a);d>this.scale.x||c.push({distance:d,point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(a){return void 0===a&&(a=new THREE.Sprite(this.material)),THREE.Object3D.prototype.clone.call(this,a),a},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==a&&this.add(a,b,c,d,e)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(a,b,c,d,e,f){void 0===b&&(b=-1),void 0===c&&(c=0),void 0===f&&(f=1),void 0===e&&(e=new THREE.Color(16777215)),void 0===d&&(d=THREE.NormalBlending),c=Math.min(c,Math.max(0,c)),this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:1,opacity:f,color:e,blending:d})},THREE.LensFlare.prototype.updateLensFlares=function(){var a,b,c=this.lensFlares.length,d=2*-this.positionScreen.x,e=2*-this.positionScreen.y;for(a=0;c>a;a++)b=this.lensFlares[a],b.x=this.positionScreen.x+d*b.distance,b.y=this.positionScreen.y+e*b.distance,b.wantedRotation=b.x*Math.PI*.25,b.rotation+=.25*(b.wantedRotation-b.rotation)},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.overrideMaterial=this.fog=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.clone=function(a){return void 0===a&&(a=new THREE.Scene),THREE.Object3D.prototype.clone.call(this,a),null!==this.fog&&(a.fog=this.fog.clone()),null!==this.overrideMaterial&&(a.overrideMaterial=this.overrideMaterial.clone()),a.autoUpdate=this.autoUpdate,a.matrixAutoUpdate=this.matrixAutoUpdate,a},THREE.Fog=function(a,b,c){this.name="",this.color=new THREE.Color(a),this.near=void 0!==b?b:1,this.far=void 0!==c?c:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(a,b){this.name="",this.color=new THREE.Color(a),this.density=void 0!==b?b:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2 square( in vec2 a ) { return vec2( a.x*a.x, a.y*a.y ); }\nvec3 square( in vec3 a ) { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4 square( in vec4 a ) { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2 saturate( in vec2 a ) { return clamp( a, 0.0, 1.0 ); }\nvec3 saturate( in vec3 a ) { return clamp( a, 0.0, 1.0 ); }\nvec4 saturate( in vec4 a ) { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a ) { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a ) { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a ) { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2 whiteCompliment( in vec2 a ) { return saturate( vec2(1.0) - a ); }\nvec3 whiteCompliment( in vec3 a ) { return saturate( vec3(1.0) - a ); }\nvec4 whiteCompliment( in vec4 a ) { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n return normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n float distance = dot( planeNormal, point-pointOnPlane );\n return point - distance * planeNormal;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n return pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n if ( decayExponent > 0.0 ) {\n return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n }\n return 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n return pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n return pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n return a;\n#endif\n}\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n if ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n vLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n directionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n directionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n #endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n lVector = normalize( lVector );\n float dotProduct = dot( transformedNormal, lVector );\n\n vec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n pointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n pointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n #endif\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n float dotProduct = dot( transformedNormal, lVector );\n vec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n spotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n spotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n #endif\n\n }\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n float dotProduct = dot( transformedNormal, lVector );\n\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n #endif\n\n }\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n vLightBack += ambientLightColor;\n\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n uniform vec4 offsetRepeat;\n uniform sampler2D map;\n\n#endif\n",THREE.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n vec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n vec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n uniform sampler2D map;\n\n#endif",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n #ifdef USE_MORPHNORMALS\n\n vec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n #else\n\n vec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n varying float vFragDepth;\n\n #endif\n\n uniform float logDepthBufFC;\n\n#endif",THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n\n#endif",THREE.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n vec3 normal = normalize( vNormal );\n\n #ifdef DOUBLE_SIDED\n\n normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n #endif\n\n#else\n\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n normal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float pointDiffuseWeightFull = max( dotProduct, 0.0 );\n float pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float pointDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n // specular\n\n vec3 pointHalfVector = normalize( lVector + viewPosition );\n float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n float pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n lVector = normalize( lVector );\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float spotDiffuseWeightFull = max( dotProduct, 0.0 );\n float spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float spotDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n // specular\n\n vec3 spotHalfVector = normalize( lVector + viewPosition );\n float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n float spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n }\n\n }\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n // diffuse\n\n float dotProduct = dot( normal, dirVector );\n\n #ifdef WRAP_AROUND\n\n float dirDiffuseWeightFull = max( dotProduct, 0.0 );\n float dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float dirDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n totalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n // specular\n\n vec3 dirHalfVector = normalize( dirVector + viewPosition );\n float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n float dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n /*\n // fresnel term from skin shader\n const float F0 = 0.128;\n\n float base = 1.0 - dot( viewPosition, dirHalfVector );\n float exponential = pow( base, 5.0 );\n\n float fresnel = exponential + F0 * ( 1.0 - exponential );\n */\n\n /*\n // fresnel term from fresnel shader\n const float mFresnelBias = 0.08;\n const float mFresnelScale = 0.3;\n const float mFresnelPower = 5.0;\n\n float fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n */\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n // dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n totalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n vec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n totalDiffuseLight += hemiColor;\n\n // specular (sky light)\n\n vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n float hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n // specular (ground light)\n\n vec3 lVectorGround = -lVector;\n\n vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n float hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n float dotProductGround = dot( normal, lVectorGround );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n vec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n totalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n }\n\n#endif\n\n#ifdef METAL\n\n outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n outgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n uniform vec3 fogColor;\n\n #ifdef FOG_EXP2\n\n uniform float fogDensity;\n\n #else\n\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n vec3 morphedNormal = vec3( 0.0 );\n\n morphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n morphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n morphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n morphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n morphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n\n // Per-Pixel Tangent Space Normal Mapping\n // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n\n }\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n uniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n }\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n vWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n vec4 texelColor = texture2D( map, vUv );\n\n texelColor.xyz = inputToLinear( texelColor.xyz );\n\n diffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n vUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n vColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n #ifdef USE_MORPHTARGETS\n\n vec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n #endif\n\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n outgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif",THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n",THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n uniform vec4 offsetRepeat;\n\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n // Transforming Normal Vectors with the Inverse Transformation\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n #else\n\n vec3 reflectVec = vReflect;\n\n #endif\n\n #ifdef DOUBLE_SIDED\n float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n #else\n float flipNormal = 1.0;\n #endif\n\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n vec4 envColor = texture2D( envMap, sampleUV );\n\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #endif\n\n envColor.xyz = inputToLinear( envColor.xyz );\n\n #ifdef ENVMAP_BLENDING_MULTIPLY\n\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_MIX )\n\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_ADD )\n\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n #endif\n\n#endif\n",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n uniform sampler2D specularMap;\n\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n vFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n #endif\n\n#endif", +THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n #ifndef USE_MORPHNORMALS\n\n uniform float morphTargetInfluences[ 8 ];\n\n #else\n\n uniform float morphTargetInfluences[ 4 ];\n\n #endif\n\n#endif",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n\n#else\n\n specularStrength = 1.0;\n\n#endif",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n #else\n\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n #endif\n\n #ifdef FOG_EXP2\n\n float fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n fogFactor = whiteCompliment( fogFactor );\n\n #else\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n #endif\n \n outgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n\n // Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n // http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n vec2 dHdxy_fwd() {\n\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n return vec2( dBx, dBy );\n\n }\n\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n vec3 vSigmaX = dFdx( surf_pos );\n vec3 vSigmaY = dFdy( surf_pos );\n vec3 vN = surf_norm; // normalized\n\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n\n float fDet = dot( vSigmaX, R1 );\n\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n\n }\n\n#endif\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n vec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n vec3 objectNormal = morphedNormal;\n\n#else\n\n vec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n objectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n\n#endif\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n outgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n uniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n diffuseColor.rgb *= vColor;\n\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n vec3 morphed = vec3( 0.0 );\n morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n #ifndef USE_MORPHNORMALS\n\n morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n #endif\n\n morphed += position;\n\n#endif",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n vec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vReflect = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n #ifdef SHADOWMAP_DEBUG\n\n vec3 frustumColors[3];\n frustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n frustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n frustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n #endif\n\n #ifdef SHADOWMAP_CASCADE\n\n int inFrustumCount = 0;\n\n #endif\n\n float fDepth;\n vec3 shadowColor = vec3( 1.0 );\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n // if ( something && something ) breaks ATI OpenGL shader compiler\n // if ( all( something, something ) ) using this instead\n\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n\n // don't shadow pixels outside of light frustum\n // use just first frustum (for cascades)\n // don't shadow pixels behind far plane of light frustum\n\n #ifdef SHADOWMAP_CASCADE\n\n inFrustumCount += int( inFrustum );\n bvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n #else\n\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n #endif\n\n bool frustumTest = all( frustumTestVec );\n\n if ( frustumTest ) {\n\n shadowCoord.z += shadowBias[ i ];\n\n #if defined( SHADOWMAP_TYPE_PCF )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n /*\n // nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n // must enroll loop manually\n\n for ( float y = -1.25; y <= 1.25; y += 1.25 )\n for ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n // doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n //vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n shadow += 1.0;\n\n }\n\n shadow /= 9.0;\n\n */\n\n const float shadowDelta = 1.0 / 9.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.25 * xPixelOffset;\n float dy0 = -1.25 * yPixelOffset;\n float dx1 = 1.25 * xPixelOffset;\n float dy1 = 1.25 * yPixelOffset;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.0 * xPixelOffset;\n float dy0 = -1.0 * yPixelOffset;\n float dx1 = 1.0 * xPixelOffset;\n float dy1 = 1.0 * yPixelOffset;\n\n mat3 shadowKernel;\n mat3 depthKernel;\n\n depthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n depthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n depthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n depthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n depthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n depthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n depthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n depthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n depthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n vec3 shadowZ = vec3( shadowCoord.z );\n shadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n shadowKernel[0] *= vec3(0.25);\n\n shadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n shadowKernel[1] *= vec3(0.25);\n\n shadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n shadowKernel[2] *= vec3(0.25);\n\n vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n shadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n shadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n vec4 shadowValues;\n shadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n shadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n shadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n shadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n shadow = dot( shadowValues, vec4( 1.0 ) );\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #else\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n\n // spot with multiple shadows is darker\n\n shadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n // spot with multiple shadows has the same color as single shadow spot\n\n // shadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n #endif\n\n }\n\n\n #ifdef SHADOWMAP_DEBUG\n\n #ifdef SHADOWMAP_CASCADE\n\n if ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n #else\n\n if ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n #endif\n\n #endif\n\n }\n\n // NOTE: I am unsure if this is correct in linear space. -bhouston, Dec 29, 2014\n shadowColor = inputToLinear( shadowColor );\n\n outgoingLight = outgoingLight * shadowColor;\n\n#endif\n",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n #ifdef USE_SKINNING\n\n vec4 worldPosition = modelMatrix * skinned;\n\n #elif defined( USE_MORPHTARGETS )\n\n vec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n #endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n uniform sampler2D shadowMap[ MAX_SHADOWS ];\n uniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n uniform float shadowDarkness[ MAX_SHADOWS ];\n uniform float shadowBias[ MAX_SHADOWS ];\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n float unpackDepth( const in vec4 rgba_depth ) {\n\n const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n float depth = dot( rgba_depth, bit_shift );\n return depth;\n\n }\n\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n\n #ifdef BONE_TEXTURE\n\n uniform sampler2D boneTexture;\n uniform int boneTextureWidth;\n uniform int boneTextureHeight;\n\n mat4 getBoneMatrix( const in float i ) {\n\n float j = i * 4.0;\n float x = mod( j, float( boneTextureWidth ) );\n float y = floor( j / float( boneTextureWidth ) );\n\n float dx = 1.0 / float( boneTextureWidth );\n float dy = 1.0 / float( boneTextureHeight );\n\n y = dy * ( y + 0.5 );\n\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n mat4 bone = mat4( v1, v2, v3, v4 );\n\n return bone;\n\n }\n\n #else\n\n uniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n mat4 getBoneMatrix( const in float i ) {\n\n mat4 bone = boneGlobalMatrices[ int(i) ];\n return bone;\n\n }\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n uniform float logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n #extension GL_EXT_frag_depth : enable\n varying float vFragDepth;\n\n #endif\n\n#endif",THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n uniform sampler2D alphaMap;\n\n#endif\n",THREE.UniformsUtils={merge:function(a){for(var b={},c=0;c dashSize ) {\n discard;\n }\n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment," outgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n #else\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n #endif\n float color = 1.0 - smoothstep( mNear, mFar, depth );\n gl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n vWorldPosition = transformDirection( position, modelMatrix );\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"), +fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n vec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n res -= res.xxyz * bit_mask;\n return res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT\n gl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n #else\n gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n #endif\n}"].join("\n")}},THREE.WebGLRenderer=function(a){function b(a){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3),e.size=f,e.array=new Float32Array(c*f),e.buffer=W.createBuffer(),e.buffer.belongsToAttribute=d,e.needsUpdate=!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){return a.material instanceof THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function d(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var f=0,g=b.length;g>f;f++){var h=b[f],i=e[h];if(i>=0){var j=c[h];void 0!==j?(h=j.itemSize,W.bindBuffer(W.ARRAY_BUFFER,j.buffer),ra.enableAttribute(i),W.vertexAttribPointer(i,h,W.FLOAT,!1,0,d*h*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[h].length?W.vertexAttrib2fv(i,a.defaultAttributeValues[h]):3===a.defaultAttributeValues[h].length&&W.vertexAttrib3fv(i,a.defaultAttributeValues[h]))}}ra.disableUnusedAttributes()}function e(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.material.id!==b.material.id?a.material.id-b.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function f(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function g(a,b){return b[0]-a[0]}function h(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group)){void 0===a.__webglInit&&(a.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",Ma));var c=a.geometry;if(void 0!==c&&void 0===c.__webglInit)if(c.__webglInit=!0,c.addEventListener("dispose",Na),c instanceof THREE.BufferGeometry)X.info.memory.geometries++;else if(a instanceof THREE.Mesh)l(a,c);else if(a instanceof THREE.Line){if(void 0===c.__webglVertexBuffer){c.__webglVertexBuffer=W.createBuffer(),c.__webglColorBuffer=W.createBuffer(),c.__webglLineDistanceBuffer=W.createBuffer(),X.info.memory.geometries++;var d=c.vertices.length;c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__lineDistanceArray=new Float32Array(1*d),c.__webglLineCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0,c.lineDistancesNeedUpdate=!0}}else a instanceof THREE.PointCloud&&void 0===c.__webglVertexBuffer&&(c.__webglVertexBuffer=W.createBuffer(),c.__webglColorBuffer=W.createBuffer(),X.info.memory.geometries++,d=c.vertices.length,c.__vertexArray=new Float32Array(3*d),c.__colorArray=new Float32Array(3*d),c.__webglParticleCount=d,b(a),c.verticesNeedUpdate=!0,c.colorsNeedUpdate=!0);if(void 0===a.__webglActive)if(a.__webglActive=!0,a instanceof THREE.Mesh){if(c instanceof THREE.BufferGeometry)m(Q,c,a);else if(c instanceof THREE.Geometry)for(var c=Ta[c.id],d=0,e=c.length;e>d;d++)m(Q,c[d],a)}else a instanceof THREE.Line||a instanceof THREE.PointCloud?m(Q,c,a):(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)&&R.push({id:null,object:a,opaque:null,transparent:null,z:0});if(a instanceof THREE.Light)P.push(a);else if(a instanceof THREE.Sprite)U.push(a);else if(a instanceof THREE.LensFlare)V.push(a);else if((c=Q[a.id])&&(!1===a.frustumCulled||!0===ja.intersectsObject(a)))for(d=0,e=c.length;e>d;d++){var f=c[d],g=f,i=g.object,j=g.buffer,k=i.geometry,i=i.material;i instanceof THREE.MeshFaceMaterial?(i=i.materials[k instanceof THREE.BufferGeometry?0:j.materialIndex],g.material=i,i.transparent?T.push(g):S.push(g)):i&&(g.material=i,i.transparent?T.push(g):S.push(g)),f.render=!0,!0===X.sortObjects&&(la.setFromMatrixPosition(a.matrixWorld),la.applyProjection(ka),f.z=la.z)}}for(d=0,e=a.children.length;e>d;d++)h(a.children[d])}}function i(a,b,c,d,e){for(var f,g=0,h=a.length;h>g;g++){f=a[g];var i=f.object,j=f.buffer;if(u(i,b),e)f=e;else{if(f=f.material,!f)continue;q(f)}X.setMaterialFaces(f),j instanceof THREE.BufferGeometry?X.renderBufferDirect(b,c,d,f,j,i):X.renderBuffer(b,c,d,f,j,i)}}function j(a,b,c,d,e,f){for(var g,h=0,i=a.length;i>h;h++){g=a[h];var j=g.object;if(j.visible){if(f)g=f;else{if(g=g[b],!g)continue;q(g)}X.renderImmediateObject(c,d,e,g,j)}}}function k(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function l(a,b){var d=a.material,e=!1;if(void 0===Ta[b.id]||!0===b.groupsNeedUpdate){delete Q[a.id];for(var f,g,h=Ta,i=b.id,d=d instanceof THREE.MeshFaceMaterial,j=sa.get("OES_element_index_uint")?4294967296:65535,e={},k=b.morphTargets.length,l=b.morphNormals.length,n={},o=[],p=0,q=b.faces.length;q>p;p++){f=b.faces[p];var r=d?f.materialIndex:0;r in e||(e[r]={hash:r,counter:0}),f=e[r].hash+"_"+e[r].counter,f in n||(g={id:Ua++,faces3:[],materialIndex:r,vertices:0,numMorphTargets:k,numMorphNormals:l},n[f]=g,o.push(g)),n[f].vertices+3>j&&(e[r].counter+=1,f=e[r].hash+"_"+e[r].counter,f in n||(g={id:Ua++,faces3:[],materialIndex:r,vertices:0,numMorphTargets:k,numMorphNormals:l},n[f]=g,o.push(g))),n[f].faces3.push(p),n[f].vertices+=3}h[i]=o,b.groupsNeedUpdate=!1}for(h=Ta[b.id],i=0,d=h.length;d>i;i++){if(j=h[i],void 0===j.__webglVertexBuffer){if(e=j,e.__webglVertexBuffer=W.createBuffer(),e.__webglNormalBuffer=W.createBuffer(),e.__webglTangentBuffer=W.createBuffer(),e.__webglColorBuffer=W.createBuffer(),e.__webglUVBuffer=W.createBuffer(),e.__webglUV2Buffer=W.createBuffer(),e.__webglSkinIndicesBuffer=W.createBuffer(),e.__webglSkinWeightsBuffer=W.createBuffer(),e.__webglFaceBuffer=W.createBuffer(),e.__webglLineBuffer=W.createBuffer(),l=e.numMorphTargets)for(e.__webglMorphTargetsBuffers=[],k=0;l>k;k++)e.__webglMorphTargetsBuffers.push(W.createBuffer());if(l=e.numMorphNormals)for(e.__webglMorphNormalsBuffers=[],k=0;l>k;k++)e.__webglMorphNormalsBuffers.push(W.createBuffer());if(X.info.memory.geometries++,e=j,p=a,q=p.geometry,l=e.faces3,k=3*l.length,n=1*l.length,o=3*l.length,l=c(p,e),e.__vertexArray=new Float32Array(3*k),e.__normalArray=new Float32Array(3*k),e.__colorArray=new Float32Array(3*k),e.__uvArray=new Float32Array(2*k),121845?Uint32Array:Uint16Array,e.__typeArray=p,e.__faceArray=new p(3*n),e.__lineArray=new p(2*o),q=e.numMorphTargets)for(e.__morphTargetsArrays=[],p=0;q>p;p++)e.__morphTargetsArrays.push(new Float32Array(3*k));if(q=e.numMorphNormals)for(e.__morphNormalsArrays=[],p=0;q>p;p++)e.__morphNormalsArrays.push(new Float32Array(3*k));if(e.__webglFaceCount=3*n,e.__webglLineCount=2*o,l.attributes)for(n in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),n=void 0,l.attributes){var s,o=l.attributes[n],p={};for(s in o)p[s]=o[s];(!p.__webglInitialized||p.createUniqueBuffers)&&(p.__webglInitialized=!0,q=1,"v2"===p.type?q=2:"v3"===p.type?q=3:"v4"===p.type?q=4:"c"===p.type&&(q=3),p.size=q,p.array=new Float32Array(k*q),p.buffer=W.createBuffer(),p.buffer.belongsToAttribute=n,o.needsUpdate=!0,p.__original=o),e.__webglCustomAttributesList.push(p)}e.__inittedArrays=!0,b.verticesNeedUpdate=!0,b.morphTargetsNeedUpdate=!0,b.elementsNeedUpdate=!0,b.uvsNeedUpdate=!0,b.normalsNeedUpdate=!0,b.tangentsNeedUpdate=!0,e=b.colorsNeedUpdate=!0}else e=!1;(e||void 0===a.__webglActive)&&m(Q,j,a)}a.__webglActive=!0}function m(a,b,c){var d=c.id;a[d]=a[d]||[],a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function n(a){var b=a.geometry;if(b instanceof THREE.BufferGeometry)for(var d=b.attributes,e=b.attributesKeys,f=0,g=e.length;g>f;f++){var h=e[f],i=d[h],j="index"===h?W.ELEMENT_ARRAY_BUFFER:W.ARRAY_BUFFER;void 0===i.buffer?(i.buffer=W.createBuffer(),W.bindBuffer(j,i.buffer),W.bufferData(j,i.array,i instanceof THREE.DynamicBufferAttribute?W.DYNAMIC_DRAW:W.STATIC_DRAW),i.needsUpdate=!1):!0===i.needsUpdate&&(W.bindBuffer(j,i.buffer),void 0===i.updateRange||-1===i.updateRange.count?W.bufferSubData(j,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(W.bufferSubData(j,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),i.needsUpdate=!1)}else if(a instanceof THREE.Mesh){!0===b.groupsNeedUpdate&&l(a,b);for(var k=Ta[b.id],f=0,m=k.length;m>f;f++){var n=k[f],q=c(a,n),r=q.attributes&&o(q);if(b.verticesNeedUpdate||b.morphTargetsNeedUpdate||b.elementsNeedUpdate||b.uvsNeedUpdate||b.normalsNeedUpdate||b.colorsNeedUpdate||b.tangentsNeedUpdate||r){var s=n,t=a,u=W.DYNAMIC_DRAW,v=!b.dynamic,w=q;if(s.__inittedArrays){var x=!1==w instanceof THREE.MeshPhongMaterial&&w.shading===THREE.FlatShading,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,E=void 0,F=void 0,G=void 0,H=void 0,I=void 0,J=void 0,K=void 0,L=void 0,M=void 0,N=void 0,O=void 0,P=void 0,Q=void 0,R=void 0,S=void 0,T=void 0,U=void 0,V=void 0,X=void 0,Y=void 0,Z=void 0,$=void 0,_=void 0,aa=void 0,ba=void 0,ca=void 0,da=void 0,ea=void 0,fa=void 0,ga=void 0,ha=void 0,ia=void 0,ja=void 0,ka=void 0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=void 0,ya=s.__vertexArray,za=s.__uvArray,Aa=s.__uv2Array,Ba=s.__normalArray,Ca=s.__tangentArray,Da=s.__colorArray,Ea=s.__skinIndexArray,Fa=s.__skinWeightArray,Ga=s.__morphTargetsArrays,Ha=s.__morphNormalsArrays,Ia=s.__webglCustomAttributesList,Ja=void 0,Ka=s.__faceArray,La=s.__lineArray,Ma=t.geometry,Na=Ma.elementsNeedUpdate,Oa=Ma.uvsNeedUpdate,Pa=Ma.normalsNeedUpdate,Qa=Ma.tangentsNeedUpdate,Ra=Ma.colorsNeedUpdate,Sa=Ma.morphTargetsNeedUpdate,Ua=Ma.vertices,Va=s.faces3,Wa=Ma.faces,Xa=Ma.faceVertexUvs[0],Ya=Ma.faceVertexUvs[1],Za=Ma.skinIndices,$a=Ma.skinWeights,_a=Ma.morphTargets,ab=Ma.morphNormals;if(Ma.verticesNeedUpdate){for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],J=Ua[B.a],K=Ua[B.b],L=Ua[B.c],ya[ma]=J.x,ya[ma+1]=J.y,ya[ma+2]=J.z,ya[ma+3]=K.x,ya[ma+4]=K.y,ya[ma+5]=K.z,ya[ma+6]=L.x,ya[ma+7]=L.y,ya[ma+8]=L.z,ma+=9;W.bindBuffer(W.ARRAY_BUFFER,s.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,ya,u)}if(Sa)for(fa=0,ga=_a.length;ga>fa;fa++){for(y=va=0,z=Va.length;z>y;y++)ja=Va[y],B=Wa[ja],J=_a[fa].vertices[B.a],K=_a[fa].vertices[B.b],L=_a[fa].vertices[B.c],ha=Ga[fa],ha[va]=J.x,ha[va+1]=J.y,ha[va+2]=J.z,ha[va+3]=K.x,ha[va+4]=K.y,ha[va+5]=K.z,ha[va+6]=L.x,ha[va+7]=L.y,ha[va+8]=L.z,w.morphNormals&&(x?R=Q=P=ab[fa].faceNormals[ja]:(ka=ab[fa].vertexNormals[ja],P=ka.a,Q=ka.b,R=ka.c),ia=Ha[fa],ia[va]=P.x,ia[va+1]=P.y,ia[va+2]=P.z,ia[va+3]=Q.x,ia[va+4]=Q.y,ia[va+5]=Q.z,ia[va+6]=R.x,ia[va+7]=R.y,ia[va+8]=R.z),va+=9;W.bindBuffer(W.ARRAY_BUFFER,s.__webglMorphTargetsBuffers[fa]),W.bufferData(W.ARRAY_BUFFER,Ga[fa],u),w.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglMorphNormalsBuffers[fa]),W.bufferData(W.ARRAY_BUFFER,Ha[fa],u))}if($a.length){for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],V=$a[B.a],X=$a[B.b],Y=$a[B.c],Fa[ua]=V.x,Fa[ua+1]=V.y,Fa[ua+2]=V.z,Fa[ua+3]=V.w,Fa[ua+4]=X.x,Fa[ua+5]=X.y,Fa[ua+6]=X.z,Fa[ua+7]=X.w,Fa[ua+8]=Y.x,Fa[ua+9]=Y.y,Fa[ua+10]=Y.z,Fa[ua+11]=Y.w,Z=Za[B.a],$=Za[B.b],_=Za[B.c],Ea[ua]=Z.x,Ea[ua+1]=Z.y,Ea[ua+2]=Z.z,Ea[ua+3]=Z.w,Ea[ua+4]=$.x,Ea[ua+5]=$.y,Ea[ua+6]=$.z,Ea[ua+7]=$.w,Ea[ua+8]=_.x,Ea[ua+9]=_.y,Ea[ua+10]=_.z,Ea[ua+11]=_.w,ua+=12;ua>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglSkinIndicesBuffer),W.bufferData(W.ARRAY_BUFFER,Ea,u),W.bindBuffer(W.ARRAY_BUFFER,s.__webglSkinWeightsBuffer),W.bufferData(W.ARRAY_BUFFER,Fa,u))}if(Ra){for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],E=B.vertexColors,F=B.color,3===E.length&&w.vertexColors===THREE.VertexColors?(S=E[0],T=E[1],U=E[2]):U=T=S=F,Da[ta]=S.r,Da[ta+1]=S.g,Da[ta+2]=S.b,Da[ta+3]=T.r,Da[ta+4]=T.g,Da[ta+5]=T.b,Da[ta+6]=U.r,Da[ta+7]=U.g,Da[ta+8]=U.b,ta+=9;ta>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,Da,u))}if(Qa&&Ma.hasTangents){for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],G=B.vertexTangents,M=G[0],N=G[1],O=G[2],Ca[ra]=M.x,Ca[ra+1]=M.y,Ca[ra+2]=M.z,Ca[ra+3]=M.w,Ca[ra+4]=N.x,Ca[ra+5]=N.y,Ca[ra+6]=N.z,Ca[ra+7]=N.w,Ca[ra+8]=O.x,Ca[ra+9]=O.y,Ca[ra+10]=O.z,Ca[ra+11]=O.w,ra+=12;W.bindBuffer(W.ARRAY_BUFFER,s.__webglTangentBuffer),W.bufferData(W.ARRAY_BUFFER,Ca,u)}if(Pa){for(y=0,z=Va.length;z>y;y++)if(B=Wa[Va[y]],C=B.vertexNormals,D=B.normal,3===C.length&&!1===x)for(aa=0;3>aa;aa++)ca=C[aa],Ba[qa]=ca.x,Ba[qa+1]=ca.y,Ba[qa+2]=ca.z,qa+=3;else for(aa=0;3>aa;aa++)Ba[qa]=D.x,Ba[qa+1]=D.y,Ba[qa+2]=D.z,qa+=3;W.bindBuffer(W.ARRAY_BUFFER,s.__webglNormalBuffer),W.bufferData(W.ARRAY_BUFFER,Ba,u)}if(Oa&&Xa){for(y=0,z=Va.length;z>y;y++)if(A=Va[y],H=Xa[A],void 0!==H)for(aa=0;3>aa;aa++)da=H[aa],za[na]=da.x,za[na+1]=da.y,na+=2;na>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglUVBuffer),W.bufferData(W.ARRAY_BUFFER,za,u))}if(Oa&&Ya){for(y=0,z=Va.length;z>y;y++)if(A=Va[y],I=Ya[A],void 0!==I)for(aa=0;3>aa;aa++)ea=I[aa],Aa[oa]=ea.x,Aa[oa+1]=ea.y,oa+=2;oa>0&&(W.bindBuffer(W.ARRAY_BUFFER,s.__webglUV2Buffer),W.bufferData(W.ARRAY_BUFFER,Aa,u))}if(Na){for(y=0,z=Va.length;z>y;y++)Ka[pa]=la,Ka[pa+1]=la+1,Ka[pa+2]=la+2,pa+=3,La[sa]=la,La[sa+1]=la+1,La[sa+2]=la,La[sa+3]=la+2,La[sa+4]=la+1,La[sa+5]=la+2,sa+=6,la+=3;W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,s.__webglFaceBuffer),W.bufferData(W.ELEMENT_ARRAY_BUFFER,Ka,u),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,s.__webglLineBuffer),W.bufferData(W.ELEMENT_ARRAY_BUFFER,La,u)}if(Ia)for(aa=0,ba=Ia.length;ba>aa;aa++)if(Ja=Ia[aa],Ja.__original.needsUpdate){if(wa=0,1===Ja.size){if(void 0===Ja.boundTo||"vertices"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],Ja.array[wa]=Ja.value[B.a],Ja.array[wa+1]=Ja.value[B.b],Ja.array[wa+2]=Ja.value[B.c],wa+=3;else if("faces"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)xa=Ja.value[Va[y]],Ja.array[wa]=xa,Ja.array[wa+1]=xa,Ja.array[wa+2]=xa,wa+=3}else if(2===Ja.size){if(void 0===Ja.boundTo||"vertices"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],J=Ja.value[B.a],K=Ja.value[B.b],L=Ja.value[B.c],Ja.array[wa]=J.x,Ja.array[wa+1]=J.y,Ja.array[wa+2]=K.x,Ja.array[wa+3]=K.y,Ja.array[wa+4]=L.x,Ja.array[wa+5]=L.y,wa+=6;else if("faces"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)L=K=J=xa=Ja.value[Va[y]],Ja.array[wa]=J.x,Ja.array[wa+1]=J.y,Ja.array[wa+2]=K.x,Ja.array[wa+3]=K.y,Ja.array[wa+4]=L.x,Ja.array[wa+5]=L.y,wa+=6}else if(3===Ja.size){var bb;if(bb="c"===Ja.type?["r","g","b"]:["x","y","z"],void 0===Ja.boundTo||"vertices"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],J=Ja.value[B.a],K=Ja.value[B.b],L=Ja.value[B.c],Ja.array[wa]=J[bb[0]],Ja.array[wa+1]=J[bb[1]],Ja.array[wa+2]=J[bb[2]],Ja.array[wa+3]=K[bb[0]],Ja.array[wa+4]=K[bb[1]],Ja.array[wa+5]=K[bb[2]],Ja.array[wa+6]=L[bb[0]],Ja.array[wa+7]=L[bb[1]],Ja.array[wa+8]=L[bb[2]],wa+=9;else if("faces"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)L=K=J=xa=Ja.value[Va[y]],Ja.array[wa]=J[bb[0]],Ja.array[wa+1]=J[bb[1]],Ja.array[wa+2]=J[bb[2]],Ja.array[wa+3]=K[bb[0]],Ja.array[wa+4]=K[bb[1]],Ja.array[wa+5]=K[bb[2]],Ja.array[wa+6]=L[bb[0]],Ja.array[wa+7]=L[bb[1]],Ja.array[wa+8]=L[bb[2]],wa+=9;else if("faceVertices"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)xa=Ja.value[Va[y]],J=xa[0],K=xa[1],L=xa[2],Ja.array[wa]=J[bb[0]],Ja.array[wa+1]=J[bb[1]],Ja.array[wa+2]=J[bb[2]],Ja.array[wa+3]=K[bb[0]],Ja.array[wa+4]=K[bb[1]],Ja.array[wa+5]=K[bb[2]],Ja.array[wa+6]=L[bb[0]],Ja.array[wa+7]=L[bb[1]],Ja.array[wa+8]=L[bb[2]],wa+=9}else if(4===Ja.size)if(void 0===Ja.boundTo||"vertices"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)B=Wa[Va[y]],J=Ja.value[B.a],K=Ja.value[B.b],L=Ja.value[B.c],Ja.array[wa]=J.x,Ja.array[wa+1]=J.y,Ja.array[wa+2]=J.z,Ja.array[wa+3]=J.w,Ja.array[wa+4]=K.x,Ja.array[wa+5]=K.y,Ja.array[wa+6]=K.z,Ja.array[wa+7]=K.w,Ja.array[wa+8]=L.x,Ja.array[wa+9]=L.y,Ja.array[wa+10]=L.z,Ja.array[wa+11]=L.w,wa+=12;else if("faces"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)L=K=J=xa=Ja.value[Va[y]],Ja.array[wa]=J.x,Ja.array[wa+1]=J.y,Ja.array[wa+2]=J.z,Ja.array[wa+3]=J.w,Ja.array[wa+4]=K.x,Ja.array[wa+5]=K.y,Ja.array[wa+6]=K.z,Ja.array[wa+7]=K.w,Ja.array[wa+8]=L.x,Ja.array[wa+9]=L.y,Ja.array[wa+10]=L.z,Ja.array[wa+11]=L.w,wa+=12;else if("faceVertices"===Ja.boundTo)for(y=0,z=Va.length;z>y;y++)xa=Ja.value[Va[y]],J=xa[0],K=xa[1],L=xa[2],Ja.array[wa]=J.x,Ja.array[wa+1]=J.y,Ja.array[wa+2]=J.z,Ja.array[wa+3]=J.w,Ja.array[wa+4]=K.x,Ja.array[wa+5]=K.y,Ja.array[wa+6]=K.z,Ja.array[wa+7]=K.w,Ja.array[wa+8]=L.x,Ja.array[wa+9]=L.y,Ja.array[wa+10]=L.z,Ja.array[wa+11]=L.w,wa+=12;W.bindBuffer(W.ARRAY_BUFFER,Ja.buffer),W.bufferData(W.ARRAY_BUFFER,Ja.array,u)}v&&(delete s.__inittedArrays,delete s.__colorArray,delete s.__normalArray,delete s.__tangentArray,delete s.__uvArray,delete s.__uv2Array,delete s.__faceArray,delete s.__vertexArray,delete s.__lineArray,delete s.__skinIndexArray,delete s.__skinWeightArray)}}}b.verticesNeedUpdate=!1,b.morphTargetsNeedUpdate=!1,b.elementsNeedUpdate=!1,b.uvsNeedUpdate=!1,b.normalsNeedUpdate=!1,b.colorsNeedUpdate=!1,b.tangentsNeedUpdate=!1,q.attributes&&p(q)}else if(a instanceof THREE.Line){if(q=c(a,b),r=q.attributes&&o(q),b.verticesNeedUpdate||b.colorsNeedUpdate||b.lineDistancesNeedUpdate||r){var cb,db,eb,fb,gb,hb,ib,jb,kb,lb,mb,nb,ob=W.DYNAMIC_DRAW,pb=b.vertices,qb=b.colors,rb=b.lineDistances,sb=pb.length,tb=qb.length,ub=rb.length,vb=b.__vertexArray,wb=b.__colorArray,xb=b.__lineDistanceArray,yb=b.colorsNeedUpdate,zb=b.lineDistancesNeedUpdate,Ab=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(cb=0;sb>cb;cb++)fb=pb[cb],gb=3*cb,vb[gb]=fb.x,vb[gb+1]=fb.y,vb[gb+2]=fb.z;W.bindBuffer(W.ARRAY_BUFFER,b.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,vb,ob)}if(yb){for(db=0;tb>db;db++)hb=qb[db],gb=3*db,wb[gb]=hb.r,wb[gb+1]=hb.g,wb[gb+2]=hb.b;W.bindBuffer(W.ARRAY_BUFFER,b.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,wb,ob)}if(zb){for(eb=0;ub>eb;eb++)xb[eb]=rb[eb];W.bindBuffer(W.ARRAY_BUFFER,b.__webglLineDistanceBuffer),W.bufferData(W.ARRAY_BUFFER,xb,ob)}if(Ab)for(ib=0,jb=Ab.length;jb>ib;ib++)if(nb=Ab[ib],nb.needsUpdate&&(void 0===nb.boundTo||"vertices"===nb.boundTo)){if(gb=0,lb=nb.value.length,1===nb.size)for(kb=0;lb>kb;kb++)nb.array[kb]=nb.value[kb];else if(2===nb.size)for(kb=0;lb>kb;kb++)mb=nb.value[kb],nb.array[gb]=mb.x,nb.array[gb+1]=mb.y,gb+=2;else if(3===nb.size)if("c"===nb.type)for(kb=0;lb>kb;kb++)mb=nb.value[kb],nb.array[gb]=mb.r,nb.array[gb+1]=mb.g,nb.array[gb+2]=mb.b,gb+=3;else for(kb=0;lb>kb;kb++)mb=nb.value[kb],nb.array[gb]=mb.x,nb.array[gb+1]=mb.y,nb.array[gb+2]=mb.z,gb+=3;else if(4===nb.size)for(kb=0;lb>kb;kb++)mb=nb.value[kb],nb.array[gb]=mb.x,nb.array[gb+1]=mb.y,nb.array[gb+2]=mb.z,nb.array[gb+3]=mb.w,gb+=4;W.bindBuffer(W.ARRAY_BUFFER,nb.buffer),W.bufferData(W.ARRAY_BUFFER,nb.array,ob),nb.needsUpdate=!1}}b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,b.lineDistancesNeedUpdate=!1,q.attributes&&p(q)}else if(a instanceof THREE.PointCloud){if(q=c(a,b),r=q.attributes&&o(q),b.verticesNeedUpdate||b.colorsNeedUpdate||r){var Bb,Cb,Db,Eb,Fb,Gb,Hb,Ib,Jb,Kb,Lb,Mb=W.DYNAMIC_DRAW,Nb=b.vertices,Ob=Nb.length,Pb=b.colors,Qb=Pb.length,Rb=b.__vertexArray,Sb=b.__colorArray,Tb=b.colorsNeedUpdate,Ub=b.__webglCustomAttributesList;if(b.verticesNeedUpdate){for(Bb=0;Ob>Bb;Bb++)Db=Nb[Bb],Eb=3*Bb,Rb[Eb]=Db.x,Rb[Eb+1]=Db.y,Rb[Eb+2]=Db.z;W.bindBuffer(W.ARRAY_BUFFER,b.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,Rb,Mb)}if(Tb){for(Cb=0;Qb>Cb;Cb++)Fb=Pb[Cb],Eb=3*Cb,Sb[Eb]=Fb.r,Sb[Eb+1]=Fb.g,Sb[Eb+2]=Fb.b;W.bindBuffer(W.ARRAY_BUFFER,b.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,Sb,Mb)}if(Ub)for(Gb=0,Hb=Ub.length;Hb>Gb;Gb++){if(Lb=Ub[Gb],Lb.needsUpdate&&(void 0===Lb.boundTo||"vertices"===Lb.boundTo))if(Jb=Lb.value.length,Eb=0,1===Lb.size)for(Ib=0;Jb>Ib;Ib++)Lb.array[Ib]=Lb.value[Ib];else if(2===Lb.size)for(Ib=0;Jb>Ib;Ib++)Kb=Lb.value[Ib],Lb.array[Eb]=Kb.x,Lb.array[Eb+1]=Kb.y,Eb+=2;else if(3===Lb.size)if("c"===Lb.type)for(Ib=0;Jb>Ib;Ib++)Kb=Lb.value[Ib],Lb.array[Eb]=Kb.r,Lb.array[Eb+1]=Kb.g,Lb.array[Eb+2]=Kb.b,Eb+=3;else for(Ib=0;Jb>Ib;Ib++)Kb=Lb.value[Ib],Lb.array[Eb]=Kb.x,Lb.array[Eb+1]=Kb.y,Lb.array[Eb+2]=Kb.z,Eb+=3;else if(4===Lb.size)for(Ib=0;Jb>Ib;Ib++)Kb=Lb.value[Ib],Lb.array[Eb]=Kb.x,Lb.array[Eb+1]=Kb.y,Lb.array[Eb+2]=Kb.z,Lb.array[Eb+3]=Kb.w,Eb+=4;W.bindBuffer(W.ARRAY_BUFFER,Lb.buffer),W.bufferData(W.ARRAY_BUFFER,Lb.array,Mb),Lb.needsUpdate=!1}}b.verticesNeedUpdate=!1,b.colorsNeedUpdate=!1,q.attributes&&p(q)}}function o(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function p(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function q(a){!0===a.transparent?ra.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):ra.setBlending(THREE.NoBlending),ra.setDepthTest(a.depthTest),ra.setDepthWrite(a.depthWrite),ra.setColorWrite(a.colorWrite),ra.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function r(a,b,c,d,e){var f,g,h,i;if(ca=0,d.needsUpdate){d.program&&Sa(d),d.addEventListener("dispose",Qa);var j=Va[d.type];if(j){var k=THREE.ShaderLib[j];d.__webglShader={uniforms:THREE.UniformsUtils.clone(k.uniforms),vertexShader:k.vertexShader,fragmentShader:k.fragmentShader}}else d.__webglShader={uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var l=0,m=0,n=0,o=0,p=0,q=b.length;q>p;p++){var r=b[p];r.onlyShadow||!1===r.visible||(r instanceof THREE.DirectionalLight&&l++,r instanceof THREE.PointLight&&m++,r instanceof THREE.SpotLight&&n++,r instanceof THREE.HemisphereLight&&o++)}f=l,g=m,h=n,i=o;for(var u,y=0,z=0,A=b.length;A>z;z++){var D=b[z];D.castShadow&&(D instanceof THREE.SpotLight&&y++,D instanceof THREE.DirectionalLight&&!D.shadowCascade&&y++)}u=y;var E;if(Ba&&e&&e.skeleton&&e.skeleton.useVertexTexture)E=1024;else{var G=W.getParameter(W.MAX_VERTEX_UNIFORM_VECTORS),H=Math.floor((G-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(H=Math.min(e.skeleton.bones.length,H),H0,shadowMapType:X.shadowMapType,shadowMapDebug:X.shadowMapDebug,shadowMapCascade:X.shadowMapCascade,alphaTest:d.alphaTest,metal:d.metal,wrapAround:d.wrapAround,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},J=[];if(j?J.push(j):(J.push(d.fragmentShader),J.push(d.vertexShader)),void 0!==d.defines)for(var K in d.defines)J.push(K),J.push(d.defines[K]);for(K in I)J.push(K),J.push(I[K]);for(var L,N=J.join(),O=0,P=Y.length;P>O;O++){var Q=Y[O];if(Q.code===N){L=Q,L.usedTimes++;break}}void 0===L&&(L=new THREE.WebGLProgram(X,N,d,I),Y.push(L),X.info.memory.programs=Y.length),d.program=L;var R=L.attributes;if(d.morphTargets){d.numSupportedMorphTargets=0;for(var S,T="morphTarget",U=0;Uja;ja++)pa=b[ja],pa.onlyShadow||(qa=pa.color,ta=pa.intensity,ua=pa.distance,pa instanceof THREE.AmbientLight?pa.visible&&(va+=qa.r,wa+=qa.g,xa+=qa.b):pa instanceof THREE.DirectionalLight?(_a+=1,pa.visible&&(ma.setFromMatrixPosition(pa.matrixWorld),la.setFromMatrixPosition(pa.target.matrixWorld),ma.sub(la),ma.normalize(),db=3*Xa,Da[db]=ma.x,Da[db+1]=ma.y,Da[db+2]=ma.z,v(Ca,db,qa,ta),Xa+=1)):pa instanceof THREE.PointLight?(ab+=1,pa.visible&&(eb=3*Ya,v(Ea,eb,qa,ta),la.setFromMatrixPosition(pa.matrixWorld),Fa[eb]=la.x,Fa[eb+1]=la.y,Fa[eb+2]=la.z,Ha[Ya]=ua,Ia[Ya]=0===pa.distance?0:pa.decay,Ya+=1)):pa instanceof THREE.SpotLight?(bb+=1,pa.visible&&(fb=3*Za,v(Ja,fb,qa,ta),ma.setFromMatrixPosition(pa.matrixWorld),Ka[fb]=ma.x,Ka[fb+1]=ma.y,Ka[fb+2]=ma.z,La[Za]=ua,la.setFromMatrixPosition(pa.target.matrixWorld),ma.sub(la),ma.normalize(),Ma[fb]=ma.x,Ma[fb+1]=ma.y,Ma[fb+2]=ma.z,Na[Za]=Math.cos(pa.angle),Pa[Za]=pa.exponent,Ra[Za]=0===pa.distance?0:pa.decay,Za+=1)):pa instanceof THREE.HemisphereLight&&(cb+=1,pa.visible&&(ma.setFromMatrixPosition(pa.matrixWorld),ma.normalize(),gb=3*$a,Wa[gb]=ma.x,Wa[gb+1]=ma.y,Wa[gb+2]=ma.z,ra=pa.color,sa=pa.groundColor,v(Ta,gb,ra,ta),v(Ua,gb,sa,ta),$a+=1)));for(ja=3*Xa,ka=Math.max(Ca.length,3*_a);ka>ja;ja++)Ca[ja]=0;for(ja=3*Ya,ka=Math.max(Ea.length,3*ab);ka>ja;ja++)Ea[ja]=0;for(ja=3*Za,ka=Math.max(Ja.length,3*bb);ka>ja;ja++)Ja[ja]=0;for(ja=3*$a,ka=Math.max(Ta.length,3*cb);ka>ja;ja++)Ta[ja]=0;for(ja=3*$a,ka=Math.max(Ua.length,3*cb);ka>ja;ja++)Ua[ja]=0;ya.directional.length=Xa,ya.point.length=Ya,ya.spot.length=Za,ya.hemi.length=$a,ya.ambient[0]=va,ya.ambient[1]=wa,ya.ambient[2]=xa,na=!1}if(ea){var hb=oa;ha.ambientLightColor.value=hb.ambient,ha.directionalLightColor.value=hb.directional.colors,ha.directionalLightDirection.value=hb.directional.positions,ha.pointLightColor.value=hb.point.colors,ha.pointLightPosition.value=hb.point.positions,ha.pointLightDistance.value=hb.point.distances,ha.pointLightDecay.value=hb.point.decays,ha.spotLightColor.value=hb.spot.colors,ha.spotLightPosition.value=hb.spot.positions,ha.spotLightDistance.value=hb.spot.distances,ha.spotLightDirection.value=hb.spot.directions,ha.spotLightAngleCos.value=hb.spot.anglesCos,ha.spotLightExponent.value=hb.spot.exponents,ha.spotLightDecay.value=hb.spot.decays,ha.hemisphereLightSkyColor.value=hb.hemi.skyColors,ha.hemisphereLightGroundColor.value=hb.hemi.groundColors,ha.hemisphereLightDirection.value=hb.hemi.positions,s(ha,!0)}else s(ha,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){ha.opacity.value=d.opacity,ha.diffuse.value=d.color,ha.map.value=d.map,ha.lightMap.value=d.lightMap,ha.specularMap.value=d.specularMap,ha.alphaMap.value=d.alphaMap,d.bumpMap&&(ha.bumpMap.value=d.bumpMap,ha.bumpScale.value=d.bumpScale),d.normalMap&&(ha.normalMap.value=d.normalMap,ha.normalScale.value.copy(d.normalScale));var ib;if(d.map?ib=d.map:d.specularMap?ib=d.specularMap:d.normalMap?ib=d.normalMap:d.bumpMap?ib=d.bumpMap:d.alphaMap&&(ib=d.alphaMap),void 0!==ib){var jb=ib.offset,kb=ib.repeat;ha.offsetRepeat.value.set(jb.x,jb.y,kb.x,kb.y)}ha.envMap.value=d.envMap,ha.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,ha.reflectivity.value=d.reflectivity,ha.refractionRatio.value=d.refractionRatio}if(d instanceof THREE.LineBasicMaterial)ha.diffuse.value=d.color,ha.opacity.value=d.opacity;else if(d instanceof THREE.LineDashedMaterial)ha.diffuse.value=d.color,ha.opacity.value=d.opacity,ha.dashSize.value=d.dashSize,ha.totalSize.value=d.dashSize+d.gapSize,ha.scale.value=d.scale;else if(d instanceof THREE.PointCloudMaterial){if(ha.psColor.value=d.color,ha.opacity.value=d.opacity,ha.size.value=d.size,ha.scale.value=C.height/2,ha.map.value=d.map,null!==d.map){var lb=d.map.offset,mb=d.map.repeat;ha.offsetRepeat.value.set(lb.x,lb.y,mb.x,mb.y)}}else d instanceof THREE.MeshPhongMaterial?(ha.shininess.value=d.shininess,ha.emissive.value=d.emissive,ha.specular.value=d.specular,d.wrapAround&&ha.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(ha.emissive.value=d.emissive,d.wrapAround&&ha.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(ha.mNear.value=a.near,ha.mFar.value=a.far,ha.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(ha.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&ha.shadowMatrix)for(var nb=0,ob=0,pb=b.length;pb>ob;ob++){var qb=b[ob];qb.castShadow&&(qb instanceof THREE.SpotLight||qb instanceof THREE.DirectionalLight&&!qb.shadowCascade)&&(ha.shadowMap.value[nb]=qb.shadowMap,ha.shadowMapSize.value[nb]=qb.shadowMapSize,ha.shadowMatrix.value[nb]=qb.shadowMatrix,ha.shadowDarkness.value[nb]=qb.shadowDarkness,ha.shadowBias.value[nb]=qb.shadowBias,nb++)}for(var rb,sb,tb,ub=d.uniformsList,vb=0,wb=ub.length;wb>vb;vb++){var xb=ub[vb][0];if(!1!==xb.needsUpdate){var yb=xb.type,zb=xb.value,Ab=ub[vb][1];switch(yb){case"1i":W.uniform1i(Ab,zb);break;case"1f":W.uniform1f(Ab,zb);break;case"2f": +W.uniform2f(Ab,zb[0],zb[1]);break;case"3f":W.uniform3f(Ab,zb[0],zb[1],zb[2]);break;case"4f":W.uniform4f(Ab,zb[0],zb[1],zb[2],zb[3]);break;case"1iv":W.uniform1iv(Ab,zb);break;case"3iv":W.uniform3iv(Ab,zb);break;case"1fv":W.uniform1fv(Ab,zb);break;case"2fv":W.uniform2fv(Ab,zb);break;case"3fv":W.uniform3fv(Ab,zb);break;case"4fv":W.uniform4fv(Ab,zb);break;case"Matrix3fv":W.uniformMatrix3fv(Ab,!1,zb);break;case"Matrix4fv":W.uniformMatrix4fv(Ab,!1,zb);break;case"i":W.uniform1i(Ab,zb);break;case"f":W.uniform1f(Ab,zb);break;case"v2":W.uniform2f(Ab,zb.x,zb.y);break;case"v3":W.uniform3f(Ab,zb.x,zb.y,zb.z);break;case"v4":W.uniform4f(Ab,zb.x,zb.y,zb.z,zb.w);break;case"c":W.uniform3f(Ab,zb.r,zb.g,zb.b);break;case"iv1":W.uniform1iv(Ab,zb);break;case"iv":W.uniform3iv(Ab,zb);break;case"fv1":W.uniform1fv(Ab,zb);break;case"fv":W.uniform3fv(Ab,zb);break;case"v2v":void 0===xb._array&&(xb._array=new Float32Array(2*zb.length));for(var Bb=0,Cb=zb.length;Cb>Bb;Bb++)tb=2*Bb,xb._array[tb]=zb[Bb].x,xb._array[tb+1]=zb[Bb].y;W.uniform2fv(Ab,xb._array);break;case"v3v":for(void 0===xb._array&&(xb._array=new Float32Array(3*zb.length)),Bb=0,Cb=zb.length;Cb>Bb;Bb++)tb=3*Bb,xb._array[tb]=zb[Bb].x,xb._array[tb+1]=zb[Bb].y,xb._array[tb+2]=zb[Bb].z;W.uniform3fv(Ab,xb._array);break;case"v4v":for(void 0===xb._array&&(xb._array=new Float32Array(4*zb.length)),Bb=0,Cb=zb.length;Cb>Bb;Bb++)tb=4*Bb,xb._array[tb]=zb[Bb].x,xb._array[tb+1]=zb[Bb].y,xb._array[tb+2]=zb[Bb].z,xb._array[tb+3]=zb[Bb].w;W.uniform4fv(Ab,xb._array);break;case"m3":W.uniformMatrix3fv(Ab,!1,zb.elements);break;case"m3v":for(void 0===xb._array&&(xb._array=new Float32Array(9*zb.length)),Bb=0,Cb=zb.length;Cb>Bb;Bb++)zb[Bb].flattenToArrayOffset(xb._array,9*Bb);W.uniformMatrix3fv(Ab,!1,xb._array);break;case"m4":W.uniformMatrix4fv(Ab,!1,zb.elements);break;case"m4v":for(void 0===xb._array&&(xb._array=new Float32Array(16*zb.length)),Bb=0,Cb=zb.length;Cb>Bb;Bb++)zb[Bb].flattenToArrayOffset(xb._array,16*Bb);W.uniformMatrix4fv(Ab,!1,xb._array);break;case"t":if(rb=zb,sb=t(),W.uniform1i(Ab,sb),!rb)continue;if(rb instanceof THREE.CubeTexture||rb.image instanceof Array&&6===rb.image.length){var Db=rb,Eb=sb;if(6===Db.image.length)if(Db.needsUpdate){Db.image.__webglTextureCube||(Db.addEventListener("dispose",Oa),Db.image.__webglTextureCube=W.createTexture(),X.info.memory.textures++),W.activeTexture(W.TEXTURE0+Eb),W.bindTexture(W.TEXTURE_CUBE_MAP,Db.image.__webglTextureCube),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,Db.flipY);for(var Fb=Db instanceof THREE.CompressedTexture,Gb=Db.image[0]instanceof THREE.DataTexture,Hb=[],Ib=0;6>Ib;Ib++)Hb[Ib]=!X.autoScaleCubemaps||Fb||Gb?Gb?Db.image[Ib].image:Db.image[Ib]:x(Db.image[Ib],za);var Jb=Hb[0],Kb=THREE.Math.isPowerOfTwo(Jb.width)&&THREE.Math.isPowerOfTwo(Jb.height),Lb=B(Db.format),Mb=B(Db.type);for(w(W.TEXTURE_CUBE_MAP,Db,Kb),Ib=0;6>Ib;Ib++)if(Fb)for(var Nb,Ob=Hb[Ib].mipmaps,Pb=0,Qb=Ob.length;Qb>Pb;Pb++)Nb=Ob[Pb],Db.format!==THREE.RGBAFormat&&Db.format!==THREE.RGBFormat?-1Bb;Bb++)xb._array[Bb]=t();for(W.uniform1iv(Ab,xb._array),Bb=0,Cb=xb.value.length;Cb>Bb;Bb++)rb=xb.value[Bb],sb=xb._array[Bb],rb&&X.setTexture(rb,sb);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+yb)}}}}return W.uniformMatrix4fv(ga.modelViewMatrix,!1,e._modelViewMatrix.elements),ga.normalMatrix&&W.uniformMatrix3fv(ga.normalMatrix,!1,e._normalMatrix.elements),null!==ga.modelMatrix&&W.uniformMatrix4fv(ga.modelMatrix,!1,e.matrixWorld.elements),fa}function s(a,b){a.ambientLightColor.needsUpdate=b,a.directionalLightColor.needsUpdate=b,a.directionalLightDirection.needsUpdate=b,a.pointLightColor.needsUpdate=b,a.pointLightPosition.needsUpdate=b,a.pointLightDistance.needsUpdate=b,a.pointLightDecay.needsUpdate=b,a.spotLightColor.needsUpdate=b,a.spotLightPosition.needsUpdate=b,a.spotLightDistance.needsUpdate=b,a.spotLightDirection.needsUpdate=b,a.spotLightAngleCos.needsUpdate=b,a.spotLightExponent.needsUpdate=b,a.spotLightDecay.needsUpdate=b,a.hemisphereLightSkyColor.needsUpdate=b,a.hemisphereLightGroundColor.needsUpdate=b,a.hemisphereLightDirection.needsUpdate=b}function t(){var a=ca;return a>=wa&&THREE.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+wa),ca+=1,a}function u(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,a.matrixWorld),a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function v(a,b,c,d){a[b]=c.r*d,a[b+1]=c.g*d,a[b+2]=c.b*d}function w(a,b,c){c?(W.texParameteri(a,W.TEXTURE_WRAP_S,B(b.wrapS)),W.texParameteri(a,W.TEXTURE_WRAP_T,B(b.wrapT)),W.texParameteri(a,W.TEXTURE_MAG_FILTER,B(b.magFilter)),W.texParameteri(a,W.TEXTURE_MIN_FILTER,B(b.minFilter))):(W.texParameteri(a,W.TEXTURE_WRAP_S,W.CLAMP_TO_EDGE),W.texParameteri(a,W.TEXTURE_WRAP_T,W.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),W.texParameteri(a,W.TEXTURE_MAG_FILTER,A(b.magFilter)),W.texParameteri(a,W.TEXTURE_MIN_FILTER,A(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )")),(c=sa.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");return d.width=Math.floor(a.width*c),d.height=Math.floor(a.height*c),d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height),THREE.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a),d}return a}function y(a,b){W.bindRenderbuffer(W.RENDERBUFFER,a),b.depthBuffer&&!b.stencilBuffer?(W.renderbufferStorage(W.RENDERBUFFER,W.DEPTH_COMPONENT16,b.width,b.height),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(W.renderbufferStorage(W.RENDERBUFFER,W.DEPTH_STENCIL,b.width,b.height),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_STENCIL_ATTACHMENT,W.RENDERBUFFER,a)):W.renderbufferStorage(W.RENDERBUFFER,W.RGBA4,b.width,b.height)}function z(a){a instanceof THREE.WebGLRenderTargetCube?(W.bindTexture(W.TEXTURE_CUBE_MAP,a.__webglTexture),W.generateMipmap(W.TEXTURE_CUBE_MAP),W.bindTexture(W.TEXTURE_CUBE_MAP,null)):(W.bindTexture(W.TEXTURE_2D,a.__webglTexture),W.generateMipmap(W.TEXTURE_2D),W.bindTexture(W.TEXTURE_2D,null))}function A(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?W.NEAREST:W.LINEAR}function B(a){var b;if(a===THREE.RepeatWrapping)return W.REPEAT;if(a===THREE.ClampToEdgeWrapping)return W.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return W.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return W.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return W.NEAREST_MIPMAP_NEAREST;if(a===THREE.NearestMipMapLinearFilter)return W.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return W.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return W.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return W.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return W.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return W.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return W.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return W.UNSIGNED_SHORT_5_6_5;if(a===THREE.ByteType)return W.BYTE;if(a===THREE.ShortType)return W.SHORT;if(a===THREE.UnsignedShortType)return W.UNSIGNED_SHORT;if(a===THREE.IntType)return W.INT;if(a===THREE.UnsignedIntType)return W.UNSIGNED_INT;if(a===THREE.FloatType)return W.FLOAT;if(b=sa.get("OES_texture_half_float"),null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return W.ALPHA;if(a===THREE.RGBFormat)return W.RGB;if(a===THREE.RGBAFormat)return W.RGBA;if(a===THREE.LuminanceFormat)return W.LUMINANCE;if(a===THREE.LuminanceAlphaFormat)return W.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return W.FUNC_ADD;if(a===THREE.SubtractEquation)return W.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return W.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return W.ZERO;if(a===THREE.OneFactor)return W.ONE;if(a===THREE.SrcColorFactor)return W.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return W.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return W.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return W.ONE_MINUS_SRC_ALPHA;if(a===THREE.DstAlphaFactor)return W.DST_ALPHA;if(a===THREE.OneMinusDstAlphaFactor)return W.ONE_MINUS_DST_ALPHA;if(a===THREE.DstColorFactor)return W.DST_COLOR;if(a===THREE.OneMinusDstColorFactor)return W.ONE_MINUS_DST_COLOR;if(a===THREE.SrcAlphaSaturateFactor)return W.SRC_ALPHA_SATURATE;if(b=sa.get("WEBGL_compressed_texture_s3tc"),null!==b){if(a===THREE.RGB_S3TC_DXT1_Format)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT1_Format)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(a===THREE.RGBA_S3TC_DXT3_Format)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(a===THREE.RGBA_S3TC_DXT5_Format)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(b=sa.get("WEBGL_compressed_texture_pvrtc"),null!==b){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(b=sa.get("EXT_blend_minmax"),null!==b){if(a===THREE.MinEquation)return b.MIN_EXT;if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION),a=a||{};var C=void 0!==a.canvas?a.canvas:document.createElement("canvas"),D=void 0!==a.context?a.context:null,E=1,F=void 0!==a.precision?a.precision:"highp",G=void 0!==a.alpha?a.alpha:!1,H=void 0!==a.depth?a.depth:!0,I=void 0!==a.stencil?a.stencil:!0,J=void 0!==a.antialias?a.antialias:!1,K=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,L=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,M=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,N=new THREE.Color(0),O=0,P=[],Q={},R=[],S=[],T=[],U=[],V=[];this.domElement=C,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1,this.shadowMapType=THREE.PCFShadowMap,this.shadowMapCullFace=THREE.CullFaceFront,this.shadowMapCascade=this.shadowMapDebug=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var W,X=this,Y=[],Z=null,$=null,_=-1,aa="",ba=null,ca=0,da=0,ea=0,fa=C.width,ga=C.height,ha=0,ia=0,ja=new THREE.Frustum,ka=new THREE.Matrix4,la=new THREE.Vector3,ma=new THREE.Vector3,na=!0,oa={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var pa={alpha:G,depth:H,stencil:I,antialias:J,premultipliedAlpha:K,preserveDrawingBuffer:L};if(W=D||C.getContext("webgl",pa)||C.getContext("experimental-webgl",pa),null===W){if(null!==C.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}C.addEventListener("webglcontextlost",function(a){a.preventDefault(),va(),ua(),Q={}},!1)}catch(qa){THREE.error("THREE.WebGLRenderer: "+qa)}var ra=new THREE.WebGLState(W,B);void 0===W.getShaderPrecisionFormat&&(W.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var sa=new THREE.WebGLExtensions(W);sa.get("OES_texture_float"),sa.get("OES_texture_float_linear"),sa.get("OES_texture_half_float"),sa.get("OES_texture_half_float_linear"),sa.get("OES_standard_derivatives"),M&&sa.get("EXT_frag_depth");var ta=function(a,b,c,d){!0===K&&(a*=d,b*=d,c*=d),W.clearColor(a,b,c,d)},ua=function(){W.clearColor(0,0,0,1),W.clearDepth(1),W.clearStencil(0),W.enable(W.DEPTH_TEST),W.depthFunc(W.LEQUAL),W.frontFace(W.CCW),W.cullFace(W.BACK),W.enable(W.CULL_FACE),W.enable(W.BLEND),W.blendEquation(W.FUNC_ADD),W.blendFunc(W.SRC_ALPHA,W.ONE_MINUS_SRC_ALPHA),W.viewport(da,ea,fa,ga),ta(N.r,N.g,N.b,O)},va=function(){ba=Z=null,aa="",_=-1,na=!0,ra.reset()};ua(),this.context=W,this.state=ra;var wa=W.getParameter(W.MAX_TEXTURE_IMAGE_UNITS),xa=W.getParameter(W.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ya=W.getParameter(W.MAX_TEXTURE_SIZE),za=W.getParameter(W.MAX_CUBE_MAP_TEXTURE_SIZE),Aa=xa>0,Ba=Aa&&sa.get("OES_texture_float"),Ca=W.getShaderPrecisionFormat(W.VERTEX_SHADER,W.HIGH_FLOAT),Da=W.getShaderPrecisionFormat(W.VERTEX_SHADER,W.MEDIUM_FLOAT),Ea=W.getShaderPrecisionFormat(W.FRAGMENT_SHADER,W.HIGH_FLOAT),Fa=W.getShaderPrecisionFormat(W.FRAGMENT_SHADER,W.MEDIUM_FLOAT),Ga=function(){var a;return function(){if(void 0!==a)return a;if(a=[],sa.get("WEBGL_compressed_texture_pvrtc")||sa.get("WEBGL_compressed_texture_s3tc"))for(var b=W.getParameter(W.COMPRESSED_TEXTURE_FORMATS),c=0;c=0;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit,delete a._modelViewMatrix,delete a._normalMatrix,delete a.__webglActive})},Na=function(a){if(a=a.target,a.removeEventListener("dispose",Na),delete a.__webglInit,a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(W.deleteBuffer(c.buffer),delete c.buffer)}X.info.memory.geometries--}else if(b=Ta[a.id],void 0!==b){for(var c=0,d=b.length;d>c;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;g>f;f++)W.deleteBuffer(e.__webglMorphTargetsBuffers[f]);delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){for(f=0,g=e.numMorphNormals;g>f;f++)W.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Ra(e)}delete Ta[a.id]}else Ra(a);aa=""},Oa=function(a){a=a.target,a.removeEventListener("dispose",Oa),a.image&&a.image.__webglTextureCube?(W.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(W.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit),X.info.memory.textures--},Pa=function(a){if(a=a.target,a.removeEventListener("dispose",Pa),a&&void 0!==a.__webglTexture){if(W.deleteTexture(a.__webglTexture),delete a.__webglTexture,a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)W.deleteFramebuffer(a.__webglFramebuffer[b]),W.deleteRenderbuffer(a.__webglRenderbuffer[b]);else W.deleteFramebuffer(a.__webglFramebuffer),W.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer,delete a.__webglRenderbuffer}X.info.memory.textures--},Qa=function(a){a=a.target,a.removeEventListener("dispose",Qa),Sa(a)},Ra=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),c=0,d=b.length;d>c;c++){var e=b[c];void 0!==a[e]&&(W.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)W.deleteBuffer(a.__webglCustomAttributesList[e].buffer);delete a.__webglCustomAttributesList}X.info.memory.geometries--},Sa=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;for(a=0,c=Y.length;c>a;a++)if(d=Y[a],d.program===b){d.usedTimes--,0===d.usedTimes&&(e=!0);break}if(!0===e){for(e=[],a=0,c=Y.length;c>a;a++)d=Y[a],d.program!==b&&e.push(d);Y=e,W.deleteProgram(b),X.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){if(ra.initAttributes(),a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=W.createBuffer()),a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=W.createBuffer()),a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=W.createBuffer()),a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=W.createBuffer()),a.hasPositions&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglVertexBuffer),W.bufferData(W.ARRAY_BUFFER,a.positionArray,W.DYNAMIC_DRAW),ra.enableAttribute(b.attributes.position),W.vertexAttribPointer(b.attributes.position,3,W.FLOAT,!1,0,0)),a.hasNormals){if(W.bindBuffer(W.ARRAY_BUFFER,a.__webglNormalBuffer),!1==c instanceof THREE.MeshPhongMaterial&&c.shading===THREE.FlatShading){var d,e,f,g,h,i,j,k,l,m,n,o=3*a.count;for(n=0;o>n;n+=9)m=a.normalArray,d=m[n],e=m[n+1],f=m[n+2],g=m[n+3],i=m[n+4],k=m[n+5],h=m[n+6],j=m[n+7],l=m[n+8],d=(d+g+h)/3,e=(e+i+j)/3,f=(f+k+l)/3,m[n]=d,m[n+1]=e,m[n+2]=f,m[n+3]=d,m[n+4]=e,m[n+5]=f,m[n+6]=d,m[n+7]=e,m[n+8]=f}W.bufferData(W.ARRAY_BUFFER,a.normalArray,W.DYNAMIC_DRAW),ra.enableAttribute(b.attributes.normal),W.vertexAttribPointer(b.attributes.normal,3,W.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglUvBuffer),W.bufferData(W.ARRAY_BUFFER,a.uvArray,W.DYNAMIC_DRAW),ra.enableAttribute(b.attributes.uv),W.vertexAttribPointer(b.attributes.uv,2,W.FLOAT,!1,0,0)),a.hasColors&&c.vertexColors!==THREE.NoColors&&(W.bindBuffer(W.ARRAY_BUFFER,a.__webglColorBuffer),W.bufferData(W.ARRAY_BUFFER,a.colorArray,W.DYNAMIC_DRAW),ra.enableAttribute(b.attributes.color),W.vertexAttribPointer(b.attributes.color,3,W.FLOAT,!1,0,0)),ra.disableUnusedAttributes(),W.drawArrays(W.TRIANGLES,0,a.count),a.count=0},this.renderBufferDirect=function(a,b,c,e,f,g){if(!1!==e.visible)if(n(g),a=r(a,b,c,e,g),b=!1,c="direct_"+f.id+"_"+a.id+"_"+(e.wireframe?1:0),c!==aa&&(aa=c,b=!0),b&&ra.initAttributes(),g instanceof THREE.Mesh){g=!0===e.wireframe?W.LINES:W.TRIANGLES;var h=f.attributes.index;if(h){var i,j;if(h.array instanceof Uint32Array&&sa.get("OES_element_index_uint")?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.vertices+=h.array.length,X.info.render.faces+=h.array.length/3;else{b=!0;for(var k=0,l=c.length;l>k;k++){var m=c[k].index;b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.vertices+=c[k].count,X.info.render.faces+=c[k].count/3}}}else b&&d(e,a,f,0),e=f.attributes.position,W.drawArrays(g,0,e.array.length/e.itemSize),X.info.render.calls++,X.info.render.vertices+=e.array.length/e.itemSize,X.info.render.faces+=e.array.length/(3*e.itemSize)}else if(g instanceof THREE.PointCloud)if(g=W.POINTS,h=f.attributes.index)if(h.array instanceof Uint32Array&&sa.get("OES_element_index_uint")?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.points+=h.array.length;else for(1k;k++)m=c[k].index,b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.points+=c[k].count;else if(b&&d(e,a,f,0),e=f.attributes.position,c=f.offsets,0===c.length)W.drawArrays(g,0,e.array.length/3),X.info.render.calls++,X.info.render.points+=e.array.length/3;else for(k=0,l=c.length;l>k;k++)W.drawArrays(g,c[k].index,c[k].count),X.info.render.calls++,X.info.render.points+=c[k].count;else if(g instanceof THREE.Line)if(g=g.mode===THREE.LineStrip?W.LINE_STRIP:W.LINES,ra.setLineWidth(e.linewidth*E),h=f.attributes.index)if(h.array instanceof Uint32Array?(i=W.UNSIGNED_INT,j=4):(i=W.UNSIGNED_SHORT,j=2),c=f.offsets,0===c.length)b&&(d(e,a,f,0),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,h.array.length,i,0),X.info.render.calls++,X.info.render.vertices+=h.array.length;else for(1k;k++)m=c[k].index,b&&(d(e,a,f,m),W.bindBuffer(W.ELEMENT_ARRAY_BUFFER,h.buffer)),W.drawElements(g,c[k].count,i,c[k].start*j),X.info.render.calls++,X.info.render.vertices+=c[k].count;else if(b&&d(e,a,f,0),e=f.attributes.position,c=f.offsets,0===c.length)W.drawArrays(g,0,e.array.length/3),X.info.render.calls++,X.info.render.vertices+=e.array.length/3;else for(k=0,l=c.length;l>k;k++)W.drawArrays(g,c[k].index,c[k].count),X.info.render.calls++,X.info.render.vertices+=c[k].count},this.renderBuffer=function(a,b,c,d,e,f){if(!1!==d.visible){if(n(f),c=r(a,b,c,d,f),b=c.attributes,a=!1,c=e.id+"_"+c.id+"_"+(d.wireframe?1:0),c!==aa&&(aa=c,a=!0),a&&ra.initAttributes(),!d.morphTargets&&0<=b.position)a&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglVertexBuffer),ra.enableAttribute(b.position),W.vertexAttribPointer(b.position,3,W.FLOAT,!1,0,0));else if(f.morphTargetBase){if(c=d.program.attributes,-1!==f.morphTargetBase&&0<=c.position?(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[f.morphTargetBase]),ra.enableAttribute(c.position),W.vertexAttribPointer(c.position,3,W.FLOAT,!1,0,0)):0<=c.position&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglVertexBuffer),ra.enableAttribute(c.position),W.vertexAttribPointer(c.position,3,W.FLOAT,!1,0,0)),f.morphTargetForcedOrder.length)for(var h,i=0,j=f.morphTargetForcedOrder,k=f.morphTargetInfluences;i=0&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[j[i]]),ra.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),h=c["morphNormal"+i],h>=0&&d.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[j[i]]),ra.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=k[j[i]],i++;else{for(j=[],k=f.morphTargetInfluences,i=f.geometry.morphTargets,k.length>i.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),k.length=i.length),i=0,h=k.length;h>i;i++)j.push([k[i],i]);j.length>d.numSupportedMorphTargets?(j.sort(g),j.length=d.numSupportedMorphTargets):j.length>d.numSupportedMorphNormals?j.sort(g):0===j.length&&j.push([0,0]);for(var i=0,l=d.numSupportedMorphTargets;l>i;i++)if(j[i]){var m=j[i][1];h=c["morphTarget"+i],h>=0&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[m]),ra.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),h=c["morphNormal"+i],h>=0&&d.morphNormals&&(W.bindBuffer(W.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[m]),ra.enableAttribute(h),W.vertexAttribPointer(h,3,W.FLOAT,!1,0,0)),f.__webglMorphTargetInfluences[i]=k[m]}else f.__webglMorphTargetInfluences[i]=0}null!==d.program.uniforms.morphTargetInfluences&&W.uniform1fv(d.program.uniforms.morphTargetInfluences,f.__webglMorphTargetInfluences)}if(a){if(e.__webglCustomAttributesList)for(c=0,k=e.__webglCustomAttributesList.length;k>c;c++)j=e.__webglCustomAttributesList[c],0<=b[j.buffer.belongsToAttribute]&&(W.bindBuffer(W.ARRAY_BUFFER,j.buffer),ra.enableAttribute(b[j.buffer.belongsToAttribute]),W.vertexAttribPointer(b[j.buffer.belongsToAttribute],j.size,W.FLOAT,!1,0,0));0<=b.color&&(0d;d++){var m=R[d],n=m.object;n.visible&&(u(n,b),k(m))}a.overrideMaterial?(d=a.overrideMaterial,q(d),i(S,b,P,g,d),i(T,b,P,g,d),j(R,"",b,P,g,d)):(ra.setBlending(THREE.NoBlending),i(S,b,P,g,null),j(R,"opaque",b,P,g,null),i(T,b,P,g,null),j(R,"transparent",b,P,g,null)),Ka.render(a,b),La.render(a,b,ha,ia),c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&z(c),ra.setDepthTest(!0),ra.setDepthWrite(!0),ra.setColorWrite(!0)}},this.renderImmediateObject=function(a,b,c,d,e){var f=r(a,b,c,d,e);aa="",X.setMaterialFaces(d),e.immediateRenderCallback?e.immediateRenderCallback(f,W,ja):e.render(function(a){X.renderBufferImmediate(a,f,d)})};var Ta={},Ua=0,Va={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?W.disable(W.CULL_FACE):(W.frontFace(b===THREE.FrontFaceDirectionCW?W.CW:W.CCW),W.cullFace(a===THREE.CullFaceBack?W.BACK:a===THREE.CullFaceFront?W.FRONT:W.FRONT_AND_BACK),W.enable(W.CULL_FACE))},this.setMaterialFaces=function(a){ra.setDoubleSided(a.side===THREE.DoubleSide),ra.setFlipSided(a.side===THREE.BackSide)},this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",Oa),a.__webglTexture=W.createTexture(),X.info.memory.textures++),W.bindTexture(W.TEXTURE_2D,a.__webglTexture),W.pixelStorei(W.UNPACK_FLIP_Y_WEBGL,a.flipY),W.pixelStorei(W.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),W.pixelStorei(W.UNPACK_ALIGNMENT,a.unpackAlignment),a.image=x(a.image,ya);var b=a.image,c=THREE.Math.isPowerOfTwo(b.width)&&THREE.Math.isPowerOfTwo(b.height),d=B(a.format),e=B(a.type);w(W.TEXTURE_2D,a,c);var f=a.mipmaps;if(a instanceof THREE.DataTexture)if(0g;g++)b=f[g],W.texImage2D(W.TEXTURE_2D,g,d,b.width,b.height,0,d,e,b.data);a.generateMipmaps=!1}else W.texImage2D(W.TEXTURE_2D,0,d,b.width,b.height,0,d,e,b.data);else if(a instanceof THREE.CompressedTexture)for(g=0,h=f.length;h>g;g++)b=f[g],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1g;g++)b=f[g],W.texImage2D(W.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!1}else W.texImage2D(W.TEXTURE_2D,0,d,d,e,a.image);a.generateMipmaps&&c&&W.generateMipmap(W.TEXTURE_2D),a.needsUpdate=!1,a.onUpdate&&a.onUpdate()},this.setTexture=function(a,b){W.activeTexture(W.TEXTURE0+b),a.needsUpdate?X.uploadTexture(a):W.bindTexture(W.TEXTURE_2D,a.__webglTexture)},this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===a.__webglFramebuffer){void 0===a.depthBuffer&&(a.depthBuffer=!0),void 0===a.stencilBuffer&&(a.stencilBuffer=!0),a.addEventListener("dispose",Pa),a.__webglTexture=W.createTexture(),X.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=B(a.format),e=B(a.type);if(b){a.__webglFramebuffer=[],a.__webglRenderbuffer=[],W.bindTexture(W.TEXTURE_CUBE_MAP,a.__webglTexture),w(W.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=W.createFramebuffer(),a.__webglRenderbuffer[f]=W.createRenderbuffer(),W.texImage2D(W.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=W.TEXTURE_CUBE_MAP_POSITIVE_X+f;W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer[f]),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,h,g.__webglTexture,0),y(a.__webglRenderbuffer[f],a)}c&&W.generateMipmap(W.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=W.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:W.createRenderbuffer(),W.bindTexture(W.TEXTURE_2D,a.__webglTexture),w(W.TEXTURE_2D,a,c),W.texImage2D(W.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=W.TEXTURE_2D,W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_STENCIL_ATTACHMENT,W.RENDERBUFFER,a.__webglRenderbuffer):y(a.__webglRenderbuffer,a),c&&W.generateMipmap(W.TEXTURE_2D);b?W.bindTexture(W.TEXTURE_CUBE_MAP,null):W.bindTexture(W.TEXTURE_2D,null),W.bindRenderbuffer(W.RENDERBUFFER,null),W.bindFramebuffer(W.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=fa,a=ga,d=da,e=ea),b!==$&&(W.bindFramebuffer(W.FRAMEBUFFER,b),W.viewport(d,e,c,a),$=b),ha=c,ia=a},this.readRenderTargetPixels=function(a,b,c,d,e,f){if(a instanceof THREE.WebGLRenderTarget){if(a.__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;a.__webglFramebuffer!==$&&(W.bindFramebuffer(W.FRAMEBUFFER,a.__webglFramebuffer),g=!0),W.checkFramebufferStatus(W.FRAMEBUFFER)===W.FRAMEBUFFER_COMPLETE?W.readPixels(b,c,d,e,W.RGBA,W.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),g&&W.bindFramebuffer(W.FRAMEBUFFER,$)}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},THREE.WebGLRenderTarget=function(a,b,c){this.width=a,this.height=b,c=c||{},this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter,this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.format=void 0!==c.format?c.format:THREE.RGBAFormat,this.type=void 0!==c.type?c.type:THREE.UnsignedByteType,this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0,this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0,this.generateMipmaps=!0,this.shareDepthFrom=void 0!==c.shareDepthFrom?c.shareDepthFrom:null},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(a,b){this.width=a,this.height=b},clone:function(){var a=new THREE.WebGLRenderTarget(this.width,this.height);return a.wrapS=this.wrapS,a.wrapT=this.wrapT,a.magFilter=this.magFilter,a.minFilter=this.minFilter,a.anisotropy=this.anisotropy,a.offset.copy(this.offset),a.repeat.copy(this.repeat),a.format=this.format,a.type=this.type,a.depthBuffer=this.depthBuffer,a.stencilBuffer=this.stencilBuffer,a.generateMipmaps=this.generateMipmaps,a.shareDepthFrom=this.shareDepthFrom,a},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(a,b,c){THREE.WebGLRenderTarget.call(this,a,b,c),this.activeCubeFace=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c])return b[c];var d;switch(c){case"EXT_texture_filter_anisotropic":d=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":d=a.getExtension("WEBGL_compressed_texture_s3tc")||a.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}return null===d&&THREE.warn("THREE.WebGLRenderer: "+c+" extension not supported."),b[c]=d}},THREE.WebGLProgram=function(){var a=0;return function(b,c,d,e){var f=b.context,g=d.defines,h=d.__webglShader.uniforms,i=d.attributes,j=d.__webglShader.vertexShader,k=d.__webglShader.fragmentShader,l=d.index0AttributeName;void 0===l&&!0===e.morphTargets&&(l="position");var m="SHADOWMAP_TYPE_BASIC";e.shadowMapType===THREE.PCFShadowMap?m="SHADOWMAP_TYPE_PCF":e.shadowMapType===THREE.PCFSoftShadowMap&&(m="SHADOWMAP_TYPE_PCF_SOFT");var n="ENVMAP_TYPE_CUBE",o="ENVMAP_MODE_REFLECTION",p="ENVMAP_BLENDING_MULTIPLY";if(e.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:n="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:n="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:n="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:o="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:p="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:p="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:p="ENVMAP_BLENDING_ADD"}}var q,r,s=0l;l++)m=h[l],u[m]=f.getUniformLocation(g,m);for(this.uniforms=u,l="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" "),h=0;hv;v++)u=e[v],i[u]=f.getAttribLocation(g,u);return this.attributes=i,this.attributesKeys=Object.keys(this.attributes),this.id=a++,this.code=c,this.usedTimes=1,this.program=g,this.vertexShader=j,this.fragmentShader=k,this}}(),THREE.WebGLShader=function(){var a=function(a){a=a.split("\n");for(var b=0;ba;a++)c[a]=0},this.enableAttribute=function(b){c[b]=1,0===d[b]&&(a.enableVertexAttribArray(b),d[b]=1)},this.disableUnusedAttributes=function(){for(var b=0,e=d.length;e>b;b++)d[b]!==c[b]&&(a.disableVertexAttribArray(b),d[b]=0)},this.setBlending=function(c,d,l,m,n,o,p){c!==e&&(c===THREE.NoBlending?a.disable(a.BLEND):c===THREE.AdditiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.SRC_ALPHA,a.ONE)):c===THREE.SubtractiveBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.ONE_MINUS_SRC_COLOR)):c===THREE.MultiplyBlending?(a.enable(a.BLEND),a.blendEquation(a.FUNC_ADD),a.blendFunc(a.ZERO,a.SRC_COLOR)):c===THREE.CustomBlending?a.enable(a.BLEND):(a.enable(a.BLEND),a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD),a.blendFuncSeparate(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA,a.ONE,a.ONE_MINUS_SRC_ALPHA)),e=c),c===THREE.CustomBlending?(n=n||d,o=o||l,p=p||m,(d!==f||n!==i)&&(a.blendEquationSeparate(b(d),b(n)),f=d,i=n),(l!==g||m!==h||o!==j||p!==k)&&(a.blendFuncSeparate(b(l),b(m),b(o),b(p)),g=l,h=m,j=o,k=p)):k=j=i=h=g=f=null},this.setDepthTest=function(b){l!==b&&(b?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),l=b)},this.setDepthWrite=function(b){m!==b&&(a.depthMask(b),m=b)},this.setColorWrite=function(b){n!==b&&(a.colorMask(b,b,b,b),n=b)},this.setDoubleSided=function(b){o!==b&&(b?a.disable(a.CULL_FACE):a.enable(a.CULL_FACE),o=b)},this.setFlipSided=function(b){p!==b&&(a.frontFace(b?a.CW:a.CCW),p=b)},this.setLineWidth=function(b){b!==q&&(a.lineWidth(b),q=b)},this.setPolygonOffset=function(b,c,d){r!==b&&(b?a.enable(a.POLYGON_OFFSET_FILL):a.disable(a.POLYGON_OFFSET_FILL),r=b),!b||s===c&&t===d||(a.polygonOffset(c,d),s=c,t=d)},this.reset=function(){for(var a=0;aE;E++)if(A=16/w,B.set(A*x,A),G=b[E],t.set(G.matrixWorld.elements[12],G.matrixWorld.elements[13],G.matrixWorld.elements[14]),t.applyMatrix4(u.matrixWorldInverse),t.applyProjection(u.projectionMatrix),C.copy(t),D.x=C.x*y+y,D.y=C.y*z+z,p||0H;H++){var J=G.lensFlares[H];.001g;g++){var i=f[g];b._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse,b.matrixWorld),p.push(i)}for(g=0,h=b.children.length;h>g;g++)e(a,b.children[g],d)}}var f,g,h,i,j=a.context,k=new THREE.Frustum,l=new THREE.Matrix4,m=new THREE.Vector3,n=new THREE.Vector3,o=new THREE.Vector3,p=[],q=THREE.ShaderLib.depthRGBA,r=THREE.UniformsUtils.clone(q.uniforms);f=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader}),g=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0}),h=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,skinning:!0}),i=new THREE.ShaderMaterial({uniforms:r,vertexShader:q.vertexShader,fragmentShader:q.fragmentShader,morphTargets:!0,skinning:!0}),f._shadowPass=!0,g._shadowPass=!0,h._shadowPass=!0,i._shadowPass=!0,this.render=function(c,q){if(!1!==a.shadowMapEnabled){var r,s,t,u,v,w,x,y,z=[];for(u=0,j.clearColor(1,1,1,1),j.disable(j.BLEND),j.enable(j.CULL_FACE),j.frontFace(j.CCW),j.cullFace(a.shadowMapCullFace===THREE.CullFaceFront?j.FRONT:j.BACK),a.state.setDepthTest(!0),r=0,s=b.length;s>r;r++)if(t=b[r],t.castShadow)if(t instanceof THREE.DirectionalLight&&t.shadowCascade)for(v=0;vC;C++)y[C]=new THREE.Vector3,w[C]=new THREE.Vector3;y=x.shadowCascadeNearZ[B],x=x.shadowCascadeFarZ[B],w[0].set(-1,-1,y),w[1].set(1,-1,y),w[2].set(-1,1,y),w[3].set(1,1,y),w[4].set(-1,-1,x),w[5].set(1,-1,x),w[6].set(-1,1,x),w[7].set(1,1,x),A.originalCamera=q,w=new THREE.Gyroscope,w.position.copy(t.shadowCascadeOffset),w.add(A),w.add(A.target),q.add(w),t.shadowCascadeArray[v]=A}B=t,y=v,x=B.shadowCascadeArray[y],x.position.copy(B.position),x.target.position.copy(B.target.position),x.lookAt(x.target),x.shadowCameraVisible=B.shadowCameraVisible,x.shadowDarkness=B.shadowDarkness,x.shadowBias=B.shadowCascadeBias[y],w=B.shadowCascadeNearZ[y],B=B.shadowCascadeFarZ[y],x=x.pointsFrustum,x[0].z=w,x[1].z=w,x[2].z=w,x[3].z=w,x[4].z=B,x[5].z=B,x[6].z=B,x[7].z=B,z[u]=A,u++}else z[u]=t,u++;for(r=0,s=z.length;s>r;r++){if(t=z[r],t.shadowMap||(v=THREE.LinearFilter,a.shadowMapType===THREE.PCFSoftShadowMap&&(v=THREE.NearestFilter),t.shadowMap=new THREE.WebGLRenderTarget(t.shadowMapWidth,t.shadowMapHeight,{minFilter:v,magFilter:v,format:THREE.RGBAFormat}),t.shadowMapSize=new THREE.Vector2(t.shadowMapWidth,t.shadowMapHeight),t.shadowMatrix=new THREE.Matrix4),!t.shadowCamera){if(t instanceof THREE.SpotLight)t.shadowCamera=new THREE.PerspectiveCamera(t.shadowCameraFov,t.shadowMapWidth/t.shadowMapHeight,t.shadowCameraNear,t.shadowCameraFar);else{if(!(t instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",t);continue}t.shadowCamera=new THREE.OrthographicCamera(t.shadowCameraLeft,t.shadowCameraRight,t.shadowCameraTop,t.shadowCameraBottom,t.shadowCameraNear,t.shadowCameraFar)}c.add(t.shadowCamera),!0===c.autoUpdate&&c.updateMatrixWorld()}if(t.shadowCameraVisible&&!t.cameraHelper&&(t.cameraHelper=new THREE.CameraHelper(t.shadowCamera),c.add(t.cameraHelper)),t.isVirtual&&A.originalCamera==q){for(v=q,u=t.shadowCamera,w=t.pointsFrustum,x=t.pointsWorld,m.set(1/0,1/0,1/0),n.set(-(1/0),-(1/0),-(1/0)),B=0;8>B;B++)y=x[B],y.copy(w[B]),y.unproject(v),y.applyMatrix4(u.matrixWorldInverse),y.xn.x&&(n.x=y.x),y.yn.y&&(n.y=y.y),y.zn.z&&(n.z=y.z);u.left=m.x,u.right=n.x,u.top=n.y,u.bottom=m.y,u.updateProjectionMatrix()}for(u=t.shadowMap,w=t.shadowMatrix,v=t.shadowCamera,v.position.setFromMatrixPosition(t.matrixWorld),o.setFromMatrixPosition(t.target.matrixWorld),v.lookAt(o),v.updateMatrixWorld(),v.matrixWorldInverse.getInverse(v.matrixWorld),t.cameraHelper&&(t.cameraHelper.visible=t.shadowCameraVisible),t.shadowCameraVisible&&t.cameraHelper.update(),w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(v.projectionMatrix),w.multiply(v.matrixWorldInverse),l.multiplyMatrices(v.projectionMatrix,v.matrixWorldInverse),k.setFromMatrix(l),a.setRenderTarget(u),a.clear(),p.length=0,e(c,c,v),t=0,u=p.length;u>t;t++)x=p[t],w=x.object,x=x.buffer,B=w.material instanceof THREE.MeshFaceMaterial?w.material.materials[0]:w.material,y=void 0!==w.geometry.morphTargets&&0t;t++)x=d[t],w=x.object,w.visible&&w.castShadow&&(w._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,w.matrixWorld),a.renderImmediateObject(v,b,null,f,w))}r=a.getClearColor(),s=a.getClearAlpha(),j.clearColor(r.r,r.g,r.b,s),j.enable(j.BLEND),a.shadowMapCullFace===THREE.CullFaceFront&&j.cullFace(j.BACK),a.resetGLState()}}},THREE.SpritePlugin=function(a,b){function c(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y=a.context,z=new THREE.Vector3,A=new THREE.Quaternion,B=new THREE.Vector3;this.render=function(C,D){if(0!==b.length){if(void 0===w){var E=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),F=new Uint16Array([0,1,2,0,2,3]);u=y.createBuffer(),v=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,u),y.bufferData(y.ARRAY_BUFFER,E,y.STATIC_DRAW),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.bufferData(y.ELEMENT_ARRAY_BUFFER,F,y.STATIC_DRAW);var E=y.createProgram(),F=y.createShader(y.VERTEX_SHADER),G=y.createShader(y.FRAGMENT_SHADER);y.shaderSource(F,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),y.shaderSource(G,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),y.compileShader(F),y.compileShader(G),y.attachShader(E,F),y.attachShader(E,G),y.linkProgram(E),w=E,s=y.getAttribLocation(w,"position"),t=y.getAttribLocation(w,"uv"),d=y.getUniformLocation(w,"uvOffset"),e=y.getUniformLocation(w,"uvScale"),f=y.getUniformLocation(w,"rotation"),g=y.getUniformLocation(w,"scale"),h=y.getUniformLocation(w,"color"),i=y.getUniformLocation(w,"map"),j=y.getUniformLocation(w,"opacity"),k=y.getUniformLocation(w,"modelViewMatrix"),l=y.getUniformLocation(w,"projectionMatrix"),m=y.getUniformLocation(w,"fogType"),n=y.getUniformLocation(w,"fogDensity"),o=y.getUniformLocation(w,"fogNear"),p=y.getUniformLocation(w,"fogFar"),q=y.getUniformLocation(w,"fogColor"),r=y.getUniformLocation(w,"alphaTest"),E=document.createElement("canvas"),E.width=8,E.height=8,F=E.getContext("2d"),F.fillStyle="white",F.fillRect(0,0,8,8),x=new THREE.Texture(E),x.needsUpdate=!0}y.useProgram(w),y.enableVertexAttribArray(s),y.enableVertexAttribArray(t),y.disable(y.CULL_FACE),y.enable(y.BLEND),y.bindBuffer(y.ARRAY_BUFFER,u),y.vertexAttribPointer(s,2,y.FLOAT,!1,16,0),y.vertexAttribPointer(t,2,y.FLOAT,!1,16,8),y.bindBuffer(y.ELEMENT_ARRAY_BUFFER,v),y.uniformMatrix4fv(l,!1,D.projectionMatrix.elements),y.activeTexture(y.TEXTURE0),y.uniform1i(i,0),F=E=0,(G=C.fog)?(y.uniform3f(q,G.color.r,G.color.g,G.color.b),G instanceof THREE.Fog?(y.uniform1f(o,G.near),y.uniform1f(p,G.far),y.uniform1i(m,1), +F=E=1):G instanceof THREE.FogExp2&&(y.uniform1f(n,G.density),y.uniform1i(m,2),F=E=2)):(y.uniform1i(m,0),F=E=0);for(var G=0,H=b.length;H>G;G++){var I=b[G];I._modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,I.matrixWorld),I.z=-I._modelViewMatrix.elements[14]}b.sort(c);for(var J=[],G=0,H=b.length;H>G;G++){var I=b[G],K=I.material;y.uniform1f(r,K.alphaTest),y.uniformMatrix4fv(k,!1,I._modelViewMatrix.elements),I.matrixWorld.decompose(z,A,B),J[0]=B.x,J[1]=B.y,I=0,C.fog&&K.fog&&(I=F),E!==I&&(y.uniform1i(m,I),E=I),null!==K.map?(y.uniform2f(d,K.map.offset.x,K.map.offset.y),y.uniform2f(e,K.map.repeat.x,K.map.repeat.y)):(y.uniform2f(d,0,0),y.uniform2f(e,1,1)),y.uniform1f(j,K.opacity),y.uniform3f(h,K.color.r,K.color.g,K.color.b),y.uniform1f(f,K.rotation),y.uniform2fv(g,J),a.state.setBlending(K.blending,K.blendEquation,K.blendSrc,K.blendDst),a.state.setDepthTest(K.depthTest),a.state.setDepthWrite(K.depthWrite),K.map&&K.map.image&&K.map.image.width?a.setTexture(K.map,0):a.setTexture(x,0),y.drawElements(y.TRIANGLES,6,y.UNSIGNED_SHORT,0)}y.enable(y.CULL_FACE),a.resetGLState()}}},THREE.GeometryUtils={merge:function(a,b,c){THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry),a.merge(b,d,c)},center:function(a){return THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),a.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.Texture(void 0,b);return e.load(a,function(a){f.image=a,f.needsUpdate=!0,c&&c(f)},void 0,function(a){d&&d(a)}),f.sourceFile=a,f},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var f=new THREE.CubeTexture([],b);f.flipY=!1;var g=0;b=function(b){e.load(a[b],function(a){f.images[b]=a,g+=1,6===g&&(f.needsUpdate=!0,c&&c(f))},void 0,d)};for(var h=0,i=a.length;i>h;++h)b(h);return f},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,f=document.createElement("canvas");f.width=d,f.height=e;var g=f.getContext("2d");g.drawImage(a,0,0);for(var h=g.getImageData(0,0,d,e).data,i=g.createImageData(d,e),j=i.data,k=0;d>k;k++)for(var l=0;e>l;l++){var m=0>l-1?0:l-1,n=l+1>e-1?e-1:l+1,o=0>k-1?0:k-1,p=k+1>d-1?d-1:k+1,q=[],r=[0,0,h[4*(l*d+k)]/255*b];for(q.push([-1,0,h[4*(l*d+o)]/255*b]),q.push([-1,-1,h[4*(m*d+o)]/255*b]),q.push([0,-1,h[4*(m*d+k)]/255*b]),q.push([1,-1,h[4*(m*d+p)]/255*b]),q.push([1,0,h[4*(l*d+p)]/255*b]),q.push([1,1,h[4*(n*d+p)]/255*b]),q.push([0,1,h[4*(n*d+k)]/255*b]),q.push([-1,1,h[4*(n*d+o)]/255*b]),m=[],o=q.length,n=0;o>n;n++){var p=q[n],s=q[(n+1)%o],p=[p[0]-r[0],p[1]-r[1],p[2]-r[2]],s=[s[0]-r[0],s[1]-r[1],s[2]-r[2]];m.push(c([p[1]*s[2]-p[2]*s[1],p[2]*s[0]-p[0]*s[2],p[0]*s[1]-p[1]*s[0]]))}for(q=[0,0,0],n=0;nh;h++)e[3*h]=f,e[3*h+1]=g,e[3*h+2]=c;return a=new THREE.DataTexture(e,a,b,THREE.RGBFormat),a.needsUpdate=!0,a}},THREE.SceneUtils={createMultiMaterialObject:function(a,b){for(var c=new THREE.Object3D,d=0,e=b.length;e>d;d++)c.add(new THREE.Mesh(a,b[d]));return c},detach:function(a,b,c){a.applyMatrix(b.matrixWorld),b.remove(a),c.add(a)},attach:function(a,b,c){var d=new THREE.Matrix4;d.getInverse(c.matrixWorld),a.applyMatrix(d),b.remove(a),c.add(a)}},THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(a){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(a){var b=a.familyName.toLowerCase();return this.faces[b]=this.faces[b]||{},this.faces[b][a.cssFontWeight]=this.faces[b][a.cssFontWeight]||{},this.faces[b][a.cssFontWeight][a.cssFontStyle]=a,this.faces[b][a.cssFontWeight][a.cssFontStyle]=a},drawText:function(a){var b=this.getFace(),c=this.size/b.resolution,d=0,e=String(a).split(""),f=e.length,g=[];for(a=0;f>a;a++){var h=new THREE.Path,h=this.extractGlyphPoints(e[a],b,c,d,h),d=d+h.offset;g.push(h.path)}return{paths:g,offset:d/2}},extractGlyphPoints:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=[],r=b.glyphs[a]||b.glyphs["?"];if(r){if(r.o)for(b=r._cachedOutline||(r._cachedOutline=r.o.split(" ")),i=b.length,a=0;i>a;)switch(h=b[a++]){case"m":h=b[a++]*c+d,j=b[a++]*c,e.moveTo(h,j);break;case"l":h=b[a++]*c+d,j=b[a++]*c,e.lineTo(h,j);break;case"q":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,e.quadraticCurveTo(m,n,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++){var s=f/g;THREE.Shape.Utils.b2(s,k,m,h),THREE.Shape.Utils.b2(s,l,n,j)}break;case"b":if(h=b[a++]*c+d,j=b[a++]*c,m=b[a++]*c+d,n=b[a++]*c,o=b[a++]*c+d,p=b[a++]*c,e.bezierCurveTo(m,n,o,p,h,j),f=q[q.length-1])for(k=f.x,l=f.y,f=1,g=this.divisions;g>=f;f++)s=f/g,THREE.Shape.Utils.b3(s,k,m,o,h),THREE.Shape.Utils.b3(s,l,n,p,j)}return{offset:r.ha*c,path:e}}}},THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",f=void 0!==b.style?b.style:"normal";for(THREE.FontUtils.size=void 0!==b.size?b.size:100,THREE.FontUtils.divisions=c,THREE.FontUtils.face=d,THREE.FontUtils.weight=e,THREE.FontUtils.style=f,c=THREE.FontUtils.drawText(a).paths,d=[],e=0,f=c.length;f>e;e++)Array.prototype.push.apply(d,c[e].toShapes());return d},function(a){var b=function(a){for(var b=a.length,c=0,d=b-1,e=0;b>e;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*c};return a.Triangulate=function(a,c){var d=a.length;if(3>d)return null;var e,f,g,h=[],i=[],j=[];if(0f;f++)i[f]=f;else for(f=0;d>f;f++)i[f]=d-1-f;var k=2*d;for(f=d-1;d>2;){if(0>=k--){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}e=f,e>=d&&(e=0),f=e+1,f>=d&&(f=0),g=f+1,g>=d&&(g=0);var l;a:{var m=l=void 0,n=void 0,o=void 0,p=void 0,q=void 0,r=void 0,s=void 0,t=void 0,m=a[i[e]].x,n=a[i[e]].y,o=a[i[f]].x,p=a[i[f]].y,q=a[i[g]].x,r=a[i[g]].y;if(1e-10>(o-m)*(r-n)-(p-n)*(q-m))l=!1;else{var u=void 0,v=void 0,w=void 0,x=void 0,y=void 0,z=void 0,A=void 0,B=void 0,C=void 0,D=void 0,C=B=A=t=s=void 0,u=q-o,v=r-p,w=m-q,x=n-r,y=o-m,z=p-n;for(l=0;d>l;l++)if(s=a[i[l]].x,t=a[i[l]].y,!(s===m&&t===n||s===o&&t===p||s===q&&t===r)&&(A=s-m,B=t-n,C=s-o,D=t-p,s-=q,t-=r,C=u*D-v*C,A=y*B-z*A,B=w*t-x*s,C>=-1e-10&&B>=-1e-10&&A>=-1e-10)){l=!1;break a}l=!0}}if(l){for(h.push([a[i[e]],a[i[f]],a[i[g]]]),j.push([i[e],i[f],i[g]]),e=f,g=f+1;d>g;e++,g++)i[e]=i[g];d--,k=2*d}}return c?j:h},a.Triangulate.area=b,a}(THREE.FontUtils),self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace},THREE.typeface_js=self._typeface_js,THREE.Audio=function(a){THREE.Object3D.call(this),this.type="Audio",this.context=a.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;return c.open("GET",a,!0),c.responseType="arraybuffer",c.onload=function(){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a,b.autoplay&&b.play()})},c.send(),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)THREE.warn("THREE.Audio: Audio is already playing.");else{var a=this.context.createBufferSource();a.buffer=this.source.buffer,a.loop=this.source.loop,a.onended=this.source.onended,a.connect(this.panner),a.start(0,this.startTime),this.isPlaying=!0,this.source=a}},THREE.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},THREE.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(a){this.source.loop=a},THREE.Audio.prototype.setRefDistance=function(a){this.panner.refDistance=a},THREE.Audio.prototype.setRolloffFactor=function(a){this.panner.rolloffFactor=a},THREE.Audio.prototype.setVolume=function(a){this.gain.gain.value=a},THREE.Audio.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3;return function(b){THREE.Object3D.prototype.updateMatrixWorld.call(this,b),a.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(a.x,a.y,a.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Vector3,f=new THREE.Vector3;return function(g){THREE.Object3D.prototype.updateMatrixWorld.call(this,g),g=this.context.listener;var h=this.up;this.matrixWorld.decompose(a,b,c),d.set(0,0,-1).applyQuaternion(b),e.subVectors(a,f),g.setPosition(a.x,a.y,a.z),g.setOrientation(d.x,d.y,d.z,h.x,h.y,h.z),g.setVelocity(e.x,e.y,e.z),f.copy(a)}}(),THREE.Curve=function(){},THREE.Curve.prototype.getPoint=function(){return THREE.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},THREE.Curve.prototype.getPointAt=function(a){return a=this.getUtoTmapping(a),this.getPoint(a)},THREE.Curve.prototype.getPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPoint(b/a));return c},THREE.Curve.prototype.getSpacedPoints=function(a){a||(a=5);var b,c=[];for(b=0;a>=b;b++)c.push(this.getPointAt(b/a));return c},THREE.Curve.prototype.getLength=function(){var a=this.getLengths();return a[a.length-1]},THREE.Curve.prototype.getLengths=function(a){if(a||(a=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b,c,d=[],e=this.getPoint(0),f=0;for(d.push(0),c=1;a>=c;c++)b=this.getPoint(c/a),f+=b.distanceTo(e),d.push(f),e=b;return this.cacheArcLengths=d},THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},THREE.Curve.prototype.getUtoTmapping=function(a,b){var c,d=this.getLengths(),e=0,f=d.length;c=b?b:a*d[f-1];for(var g,h=0,i=f-1;i>=h;)if(e=Math.floor(h+(i-h)/2),g=d[e]-c,0>g)h=e+1;else{if(!(g>0)){i=e;break}i=e-1}return e=i,d[e]==c?e/(f-1):(h=d[e],d=(e+(c-h)/(d[e+1]-h))/(f-1))},THREE.Curve.prototype.getTangent=function(a){var b=a-1e-4;return a+=1e-4,0>b&&(b=0),a>1&&(a=1),b=this.getPoint(b),this.getPoint(a).clone().sub(b).normalize()},THREE.Curve.prototype.getTangentAt=function(a){return a=this.getUtoTmapping(a),this.getTangent(a)},THREE.Curve.Utils={tangentQuadraticBezier:function(a,b,c,d){return 2*(1-a)*(c-b)+2*a*(d-c)},tangentCubicBezier:function(a,b,c,d,e){return-3*b*(1-a)*(1-a)+3*c*(1-a)*(1-a)-6*a*c*(1-a)+6*a*d*(1-a)-3*a*a*d+3*a*a*e},tangentSpline:function(a){return 6*a*a-6*a+(3*a*a-4*a+1)+(-6*a*a+6*a)+(3*a*a-2*a)},interpolate:function(a,b,c,d,e){a=.5*(c-a),d=.5*(d-b);var f=e*e;return(2*b-2*c+a+d)*e*f+(-3*b+3*c-2*a-d)*f+a*e+b}},THREE.Curve.create=function(a,b){return a.prototype=Object.create(THREE.Curve.prototype),a.prototype.constructor=a,a.prototype.getPoint=b,a},THREE.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(a){this.curves.push(a)},THREE.CurvePath.prototype.checkConnection=function(){},THREE.CurvePath.prototype.closePath=function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new THREE.LineCurve(b,a))},THREE.CurvePath.prototype.getPoint=function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a=b)return b=c[a]-b,a=this.curves[a],b=1-b/a.getLength(),a.getPointAt(b);a++}return null},THREE.CurvePath.prototype.getLength=function(){var a=this.getCurveLengths();return a[a.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var a,b=[],c=0,d=this.curves.length;for(a=0;d>a;a++)c+=this.curves[a].getLength(),b.push(c);return this.cacheLengths=b},THREE.CurvePath.prototype.getBoundingBox=function(){var a,b,c,d,e,f,g=this.getPoints();a=b=Number.NEGATIVE_INFINITY,d=e=Number.POSITIVE_INFINITY;var h,i,j,k,l=g[0]instanceof THREE.Vector3;for(k=l?new THREE.Vector3:new THREE.Vector2,i=0,j=g.length;j>i;i++)h=g[i],h.x>a?a=h.x:h.xb?b=h.y:h.yc?c=h.z:h.zc;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getTransformedSpacedPoints=function(a,b){var c,d,e=this.getSpacedPoints(a);for(b||(b=this.bends),c=0,d=b.length;d>c;c++)e=this.getWrapPoints(e,b[c]);return e},THREE.CurvePath.prototype.getWrapPoints=function(a,b){var c,d,e,f,g,h,i=this.getBoundingBox();for(c=0,d=a.length;d>c;c++)e=a[c],f=e.x,g=e.y,h=f/i.maxX,h=b.getUtoTmapping(h,f),f=b.getPoint(h),h=b.getTangent(h),h.set(-h.y,h.x).multiplyScalar(g),e.x=f.x+h.x,e.y=f.y+h.y;return a},THREE.Gyroscope=function(){THREE.Object3D.call(this)},THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype),THREE.Gyroscope.prototype.constructor=THREE.Gyroscope,THREE.Gyroscope.prototype.updateMatrixWorld=function(){var a=new THREE.Vector3,b=new THREE.Quaternion,c=new THREE.Vector3,d=new THREE.Vector3,e=new THREE.Quaternion,f=new THREE.Vector3;return function(g){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||g)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(d,e,f),this.matrix.decompose(a,b,c),this.matrixWorld.compose(d,b,f)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,g=!0);for(var h=0,i=this.children.length;i>h;h++)this.children[h].updateMatrixWorld(g)}}(),THREE.Path=function(a){THREE.CurvePath.call(this),this.actions=[],a&&this.fromPoints(a)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},THREE.Path.prototype.fromPoints=function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;c>b;b++)this.lineTo(a[b].x,a[b].y)},THREE.Path.prototype.moveTo=function(){var a=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:a})},THREE.Path.prototype.lineTo=function(a,b){var c=Array.prototype.slice.call(arguments),d=this.actions[this.actions.length-1].args,d=new THREE.LineCurve(new THREE.Vector2(d[d.length-2],d[d.length-1]),new THREE.Vector2(a,b));this.curves.push(d),this.actions.push({action:THREE.PathActions.LINE_TO,args:c})},THREE.Path.prototype.quadraticCurveTo=function(a,b,c,d){var e=Array.prototype.slice.call(arguments),f=this.actions[this.actions.length-1].args,f=new THREE.QuadraticBezierCurve(new THREE.Vector2(f[f.length-2],f[f.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d));this.curves.push(f),this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:e})},THREE.Path.prototype.bezierCurveTo=function(a,b,c,d,e,f){var g=Array.prototype.slice.call(arguments),h=this.actions[this.actions.length-1].args,h=new THREE.CubicBezierCurve(new THREE.Vector2(h[h.length-2],h[h.length-1]),new THREE.Vector2(a,b),new THREE.Vector2(c,d),new THREE.Vector2(e,f));this.curves.push(h),this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:g})},THREE.Path.prototype.splineThru=function(a){var b=Array.prototype.slice.call(arguments),c=this.actions[this.actions.length-1].args,c=[new THREE.Vector2(c[c.length-2],c[c.length-1])];Array.prototype.push.apply(c,a),c=new THREE.SplineCurve(c),this.curves.push(c),this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:b})},THREE.Path.prototype.arc=function(a,b,c,d,e,f){var g=this.actions[this.actions.length-1].args;this.absarc(a+g[g.length-2],b+g[g.length-1],c,d,e,f)},THREE.Path.prototype.absarc=function(a,b,c,d,e,f){this.absellipse(a,b,c,c,d,e,f)},THREE.Path.prototype.ellipse=function(a,b,c,d,e,f,g){var h=this.actions[this.actions.length-1].args;this.absellipse(a+h[h.length-2],b+h[h.length-1],c,d,e,f,g)},THREE.Path.prototype.absellipse=function(a,b,c,d,e,f,g){var h=Array.prototype.slice.call(arguments),i=new THREE.EllipseCurve(a,b,c,d,e,f,g);this.curves.push(i),i=i.getPoint(1),h.push(i.x),h.push(i.y),this.actions.push({action:THREE.PathActions.ELLIPSE,args:h})},THREE.Path.prototype.getSpacedPoints=function(a){a||(a=40);for(var b=[],c=0;a>c;c++)b.push(this.getPoint(c/a));return b},THREE.Path.prototype.getPoints=function(a,b){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(a,b);a=a||12;var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[];for(c=0,d=this.actions.length;d>c;c++)switch(e=this.actions[c],f=e.action,e=e.args,f){case THREE.PathActions.MOVE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.LINE_TO:p.push(new THREE.Vector2(e[0],e[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:for(g=e[2],h=e[3],k=e[0],l=e[1],0=e;e++)o=e/a,f=THREE.Shape.Utils.b2(o,m,k,g),o=THREE.Shape.Utils.b2(o,n,l,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.BEZIER_CURVE_TO:for(g=e[4],h=e[5],k=e[0],l=e[1],i=e[2],j=e[3],0=e;e++)o=e/a,f=THREE.Shape.Utils.b3(o,m,k,i,g),o=THREE.Shape.Utils.b3(o,n,l,j,h),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.CSPLINE_THRU:for(f=this.actions[c-1].args,o=[new THREE.Vector2(f[f.length-2],f[f.length-1])],f=a*e[0].length,o=o.concat(e[0]),o=new THREE.SplineCurve(o),e=1;f>=e;e++)p.push(o.getPointAt(e/f));break;case THREE.PathActions.ARC:for(g=e[0],h=e[1],l=e[2],i=e[3],f=e[4],k=!!e[5],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+l*Math.sin(o),p.push(new THREE.Vector2(f,o));break;case THREE.PathActions.ELLIPSE:for(g=e[0],h=e[1],l=e[2],j=e[3],i=e[4],f=e[5],k=!!e[6],m=f-i,n=2*a,e=1;n>=e;e++)o=e/n,k||(o=1-o),o=i+o*m,f=g+l*Math.cos(o),o=h+j*Math.sin(o),p.push(new THREE.Vector2(f,o))}return c=p[p.length-1],1e-10>Math.abs(c.x-p[0].x)&&1e-10>Math.abs(c.y-p[0].y)&&p.splice(p.length-1,1),b&&p.push(p[0]),p},THREE.Path.prototype.toShapes=function(a,b){function c(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c],f=new THREE.Shape;f.actions=e.actions,f.curves=e.curves,b.push(f)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,f=0;c>f;e=f++){var g=b[e],h=b[f],i=h.x-g.x,j=h.y-g.y;if(1e-10j&&(g=b[f],i=-i,h=b[e],j=-j),!(a.yh.y))if(a.y==g.y){if(a.x==g.x)return!0}else{if(e=j*(a.x-g.x)-i*(a.y-g.y),0==e)return!0;0>e||(d=!d)}}else if(a.y==g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=function(a){var b,c,d,e,f=[],g=new THREE.Path;for(b=0,c=a.length;c>b;b++)d=a[b],e=d.args,d=d.action,d==THREE.PathActions.MOVE_TO&&0!=g.actions.length&&(f.push(g),g=new THREE.Path),g[d].apply(g,e);return 0!=g.actions.length&&f.push(g),f}(this.actions);if(0==e.length)return[];if(!0===b)return c(e);var f,g,h,i=[];if(1==e.length)return g=e[0],h=new THREE.Shape,h.actions=g.actions,h.curves=g.curves,i.push(h),i;var j=!THREE.Shape.Utils.isClockWise(e[0].getPoints()),j=a?!j:j;h=[];var k,l=[],m=[],n=0;l[n]=void 0,m[n]=[];var o,p;for(o=0,p=e.length;p>o;o++)g=e[o],k=g.getPoints(),f=THREE.Shape.Utils.isClockWise(k),(f=a?!f:f)?(!j&&l[n]&&n++,l[n]={s:new THREE.Shape,p:k},l[n].s.actions=g.actions,l[n].s.curves=g.curves,j&&n++,m[n]=[]):m[n].push({h:g,p:k[0]});if(!l[0])return c(e);if(1g;g++)h[g]=[];for(g=0,e=l.length;e>g;g++)for(f=m[g],j=0;jo;o++)for(h=l[o].s,i.push(h),g=m[o],e=0,f=g.length;f>e;e++)h.holes.push(g[e].h);return i},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(a){return new THREE.ExtrudeGeometry(this,a)},THREE.Shape.prototype.makeGeometry=function(a){return new THREE.ShapeGeometry(this,a)},THREE.Shape.prototype.getPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedPoints(a,this.bends);return d},THREE.Shape.prototype.getSpacedPointsHoles=function(a){var b,c=this.holes.length,d=[];for(b=0;c>b;b++)d[b]=this.holes[b].getTransformedSpacedPoints(a,this.bends);return d},THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransformedPoints(a),holes:this.getPointsHoles(a)}},THREE.Shape.prototype.extractPoints=function(a){return this.useSpacedPoints?this.extractAllSpacedPoints(a):this.extractAllPoints(a)},THREE.Shape.prototype.extractAllSpacedPoints=function(a){return{shape:this.getTransformedSpacedPoints(a),holes:this.getSpacedPointsHoles(a)}},THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!=b.x?a.x0){if(0>n||n>m)return[];if(i=j*k-i*l,0>i||i>m)return[]}else{if(n>0||m>n)return[];if(i=j*k-i*l,i>0||m>i)return[]}return 0==i?!f||0!=n&&n!=m?[a]:[]:i==m?!f||0!=n&&n!=m?[b]:[]:0==n?[d]:n==m?[e]:(f=i/m,[{x:a.x+f*g,y:a.y+f*h}])}return 0!=n||j*k!=i*l?[]:(h=0==g&&0==h,i=0==i&&0==j,h&&i?a.x!=d.x||a.y!=d.y?[]:[a]:h?c(d,e,a)?[a]:[]:i?c(a,b,d)?[d]:[]:(0!=g?(a.x=i?m>a?[]:a==m?f?[]:[b]:d>=a?[b,h]:[b,j]:i>d?[]:i==d?f?[]:[g]:d>=a?[g,h]:[g,j]))}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x,c=c.y-a.y;var g=d.x-a.x;return d=d.y-a.y,a=e*c-f*b,e=e*d-f*g,1e-100?e>=0&&b>=0:e>=0||b>=0):e>0}var f,g,h,i,j,k={};for(h=a.concat(),f=0,g=b.length;g>f;f++)Array.prototype.push.apply(h,b[f]);for(f=0,g=h.length;g>f;f++)j=h[f].x+":"+h[f].y,void 0!==k[j]&&THREE.warn("THREE.Shape: Duplicate point",j),k[j]=f;f=function(a,b){function c(a,b){var c=q.length-1,d=a-1;0>d&&(d=c);var f=a+1;return f>c&&(f=0),(c=e(q[a],q[d],q[f],h[b]))?(c=h.length-1,d=b-1,0>d&&(d=c),f=b+1,f>c&&(f=0),(c=e(h[b],h[d],h[f],q[a]))?!0:!1):!1}function f(a,b){var c,e;for(c=0;ct;t++)r.push(t);n=0;for(var u=2*r.length;0u){console.log("Infinite Loop! Holes left:"+r.length+", Probably Hole outside Shape!");break}for(j=n;j=0)break;s[m]=!0}if(i>=0)break}}return q}(a,b);var l=THREE.FontUtils.Triangulate(f,!1);for(f=0,g=l.length;g>f;f++)for(i=l[f],h=0;3>h;h++)j=i[h].x+":"+i[h].y,j=k[j],void 0!==j&&(i[h]=j);return l.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}},THREE.LineCurve=function(a,b){this.v1=a,this.v2=b},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);return b.multiplyScalar(a).add(this.v1),b},THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)},THREE.LineCurve.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a,this.v1=b,this.v2=c},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(a){var b=new THREE.Vector2;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b},THREE.QuadraticBezierCurve.prototype.getTangent=function(a){var b=new THREE.Vector2;return b.x=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Curve.Utils.tangentQuadraticBezier(a,this.v0.y,this.v1.y,this.v2.y),b.normalize()},THREE.CubicBezierCurve=function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(a){var b;return b=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new THREE.Vector2(b,a)},THREE.CubicBezierCurve.prototype.getTangent=function(a){var b;return b=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),a=THREE.Curve.Utils.tangentCubicBezier(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b=new THREE.Vector2(b,a),b.normalize(),b},THREE.SplineCurve=function(a){this.points=void 0==a?[]:a},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector2;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c},THREE.EllipseCurve=function(a,b,c,d,e,f,g){this.aX=a,this.aY=b,this.xRadius=c,this.yRadius=d,this.aStartAngle=e,this.aEndAngle=f,this.aClockwise=g},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(a){var b=this.aEndAngle-this.aStartAngle;return 0>b&&(b+=2*Math.PI),b>2*Math.PI&&(b-=2*Math.PI),a=!0===this.aClockwise?this.aEndAngle+(1-a)*(2*Math.PI-b):this.aStartAngle+a*b,b=new THREE.Vector2,b.x=this.aX+this.xRadius*Math.cos(a),b.y=this.aY+this.yRadius*Math.sin(a),b},THREE.ArcCurve=function(a,b,c,d,e,f){THREE.EllipseCurve.call(this,a,b,c,c,d,e,f)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(a,b){this.v1=a,this.v2=b},function(a){var b=new THREE.Vector3;return b.subVectors(this.v2,this.v1),b.multiplyScalar(a),b.add(this.v1),b}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(a,b,c){this.v0=a,this.v1=b,this.v2=c},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b2(a,this.v0.x,this.v1.x,this.v2.x),b.y=THREE.Shape.Utils.b2(a,this.v0.y,this.v1.y,this.v2.y),b.z=THREE.Shape.Utils.b2(a,this.v0.z,this.v1.z,this.v2.z),b}),THREE.CubicBezierCurve3=THREE.Curve.create(function(a,b,c,d){this.v0=a,this.v1=b,this.v2=c,this.v3=d},function(a){var b=new THREE.Vector3;return b.x=THREE.Shape.Utils.b3(a,this.v0.x,this.v1.x,this.v2.x,this.v3.x),b.y=THREE.Shape.Utils.b3(a,this.v0.y,this.v1.y,this.v2.y,this.v3.y),b.z=THREE.Shape.Utils.b3(a,this.v0.z,this.v1.z,this.v2.z,this.v3.z),b}),THREE.SplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-1;var c=Math.floor(a);a-=c;var d=b[0==c?c:c-1],e=b[c],f=b[c>b.length-2?b.length-1:c+1],b=b[c>b.length-3?b.length-1:c+2],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(a){this.points=void 0==a?[]:a},function(a){var b=this.points;a*=b.length-0;var c=Math.floor(a);a-=c;var c=c+(c>0?0:(Math.floor(Math.abs(c)/b.length)+1)*b.length),d=b[(c-1)%b.length],e=b[c%b.length],f=b[(c+1)%b.length],b=b[(c+2)%b.length],c=new THREE.Vector3;return c.x=THREE.Curve.Utils.interpolate(d.x,e.x,f.x,b.x,a),c.y=THREE.Curve.Utils.interpolate(d.y,e.y,f.y,b.y,a),c.z=THREE.Curve.Utils.interpolate(d.z,e.z,f.z,b.z,a),c}),THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){THREE.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){THREE.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){THREE.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(a){if(!0===a.initialized)return a;for(var b=0;ba.hierarchy[b].keys[c].time&&(a.hierarchy[b].keys[c].time=0),void 0!==a.hierarchy[b].keys[c].rot&&!(a.hierarchy[b].keys[c].rot instanceof THREE.Quaternion)){var d=a.hierarchy[b].keys[c].rot;a.hierarchy[b].keys[c].rot=(new THREE.Quaternion).fromArray(d)}if(a.hierarchy[b].keys.length&&void 0!==a.hierarchy[b].keys[0].morphTargets){for(d={},c=0;ca;a++){var c=this.hierarchy[a];void 0===c.animationCache&&(c.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var d=this.data.name,e=c.animationCache.animations,f=e[d];for(void 0===f&&(f={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:c.matrix},e[d]=f),c=0;3>c;c++){for(var d=this.keyTypes[c],e=this.data.hierarchy[a].keys[0],g=this.getNextKeyWith(d,a,1);g.timee.index;)e=g,g=this.getNextKeyWith(d,a,g.index+1);f.prevKey[d]=e,f.nextKey[d]=g}}},resetBlendWeights:function(){for(var a=0,b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a].animationCache;void 0!==c&&(c=c.blending,c.positionWeight=0,c.quaternionWeight=0,c.scaleWeight=0)}},update:function(){var a=[],b=new THREE.Vector3,c=new THREE.Vector3,d=new THREE.Quaternion,e=function(a,b){var c,d,e,g,h,i,j=[],k=[];return c=(a.length-1)*b,d=Math.floor(c),c-=d,j[0]=0===d?d:d-1,j[1]=d,j[2]=d>a.length-2?d:d+1,j[3]=d>a.length-3?d:d+2,d=a[j[0]],g=a[j[1]],h=a[j[2]],i=a[j[3]],j=c*c,e=c*j,k[0]=f(d[0],g[0],h[0],i[0],c,j,e),k[1]=f(d[1],g[1],h[1],i[1],c,j,e),k[2]=f(d[2],g[2],h[2],i[2],c,j,e),k},f=function(a,b,c,d,e,f,g){return a=.5*(c-a),d=.5*(d-b),(2*(b-c)+a+d)*g+(-3*(b-c)-2*a-d)*f+a*e+b};return function(f){if(!1!==this.isPlaying&&(this.currentTime+=f*this.timeScale,0!==this.weight)){f=this.data.length,(this.currentTime>f||0>this.currentTime)&&(this.loop?(this.currentTime%=f,0>this.currentTime&&(this.currentTime+=f),this.reset()):this.stop()),f=0;for(var g=this.hierarchy.length;g>f;f++)for(var h=this.hierarchy[f],i=h.animationCache.animations[this.data.name],j=h.animationCache.blending,k=0;3>k;k++){var l=this.keyTypes[k],m=i.prevKey[l],n=i.nextKey[l];if(0this.timeScale&&m.time>=this.currentTime){for(m=this.data.hierarchy[f].keys[0],n=this.getNextKeyWith(l,f,1);n.timem.index;)m=n,n=this.getNextKeyWith(l,f,n.index+1);i.prevKey[l]=m,i.nextKey[l]=n}var o=(this.currentTime-m.time)/(n.time-m.time),p=m[l],q=n[l];0>o&&(o=0),o>1&&(o=1),"pos"===l?this.interpolationType===THREE.AnimationHandler.LINEAR?(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.positionWeight),h.position.lerp(c,m),j.positionWeight+=this.weight):(this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD)&&(a[0]=this.getPrevKeyWith("pos",f,m.index-1).pos,a[1]=p,a[2]=q,a[3]=this.getNextKeyWith("pos",f,n.index+1).pos,o=.33*o+.33,n=e(a,o),m=this.weight/(this.weight+j.positionWeight),j.positionWeight+=this.weight,l=h.position,l.x+=(n[0]-l.x)*m,l.y+=(n[1]-l.y)*m,l.z+=(n[2]-l.z)*m,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(o=e(a,1.01*o),b.set(o[0],o[1],o[2]),b.sub(l),b.y=0,b.normalize(),o=Math.atan2(b.x,b.z),h.rotation.set(0,o,0))):"rot"===l?(THREE.Quaternion.slerp(p,q,d,o),0===j.quaternionWeight?(h.quaternion.copy(d),j.quaternionWeight=this.weight):(m=this.weight/(this.weight+j.quaternionWeight),THREE.Quaternion.slerp(h.quaternion,d,h.quaternion,m),j.quaternionWeight+=this.weight)):"scl"===l&&(c.x=p[0]+(q[0]-p[0])*o,c.y=p[1]+(q[1]-p[1])*o,c.z=p[2]+(q[2]-p[2])*o,m=this.weight/(this.weight+j.scaleWeight),h.scale.lerp(c,m),j.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(a,b,c){var d=this.data.hierarchy[b].keys;for(c=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?c0?c:0:c>=0?c:c+d.length;c>=0;c--)if(void 0!==d[c][a])return d[c];return this.data.hierarchy[b].keys[d.length-1]}},THREE.KeyFrameAnimation=function(a){this.root=a.node,this.data=THREE.AnimationHandler.init(a),this.hierarchy=THREE.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.loop=this.isPaused=!0,a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.data.hierarchy[a].sids,d=this.hierarchy[a];if(this.data.hierarchy[a].keys.length&&c){for(var e=0;ea;a++)b=this.hierarchy[a],c=this.data.hierarchy[a],void 0===c.animationCache&&(c.animationCache={},c.animationCache.prevKey=null,c.animationCache.nextKey=null,c.animationCache.originalMatrix=b.matrix),b=this.data.hierarchy[a].keys,b.length&&(c.animationCache.prevKey=b[0],c.animationCache.nextKey=b[1],this.startTime=Math.min(b[0].time,this.startTime),this.endTime=Math.max(b[b.length-1].time,this.endTime));this.update(0)}this.isPaused=!1,THREE.AnimationHandler.play(this)},stop:function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.stop(this);for(var a=0;aa&&(this.currentTime%=a),this.currentTime=Math.min(this.currentTime,a),a=0;for(var b=this.hierarchy.length;b>a;a++){var c=this.hierarchy[a],d=this.data.hierarchy[a],e=d.keys,d=d.animationCache;if(e.length){var f=d.prevKey,g=d.nextKey;if(g.time<=this.currentTime){for(;g.timef.index;)f=g,g=e[f.index+1];d.prevKey=f,d.nextKey=g}g.time>=this.currentTime?f.interpolate(g,this.currentTime):f.interpolate(g,g.time),this.data.hierarchy[a].node.updateMatrix(),c.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(a,b,c){for(b=this.data.hierarchy[b].keys,c%=b.length;c=0?c:c+b.length;c>=0;c--)if(b[c].hasTarget(a))return b[c];return b[b.length-1]}},THREE.MorphAnimation=function(a){this.mesh=a,this.frames=a.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.currentFrame=this.lastFrame=0,this.isPlaying=!1},THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration),a=this.duration/this.frames;var b=Math.floor(this.currentTime/a),c=this.mesh.morphTargetInfluences;b!=this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=1,c[b]=0,this.lastFrame=this.currentFrame,this.currentFrame=b),c[b]=this.currentTime%a/a,c[this.lastFrame]=1-c[b]}}},THREE.BoxGeometry=function(a,b,c,d,e,f){function g(a,b,c,d,e,f,g,i){var j,k=h.widthSegments,l=h.heightSegments,m=e/2,n=f/2,o=h.vertices.length;"x"===a&&"y"===b||"y"===a&&"x"===b?j="z":"x"===a&&"z"===b||"z"===a&&"x"===b?(j="y",l=h.depthSegments):("z"===a&&"y"===b||"y"===a&&"z"===b)&&(j="x",k=h.depthSegments);var p=k+1,q=l+1,r=e/k,s=f/l,t=new THREE.Vector3;for(t[j]=g>0?1:-1,e=0;q>e;e++)for(f=0;p>f;f++){var u=new THREE.Vector3;u[a]=(f*r-m)*c,u[b]=(e*s-n)*d,u[j]=g,h.vertices.push(u)}for(e=0;l>e;e++)for(f=0;k>f;f++)n=f+p*e,a=f+p*(e+1),b=f+1+p*(e+1),c=f+1+p*e,d=new THREE.Vector2(f/k,1-e/l),g=new THREE.Vector2(f/k,1-(e+1)/l),j=new THREE.Vector2((f+1)/k,1-(e+1)/l),m=new THREE.Vector2((f+1)/k,1-e/l),n=new THREE.Face3(n+o,a+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([d,g,m]),n=new THREE.Face3(a+o,b+o,c+o),n.normal.copy(t),n.vertexNormals.push(t.clone(),t.clone(),t.clone()),n.materialIndex=i,h.faces.push(n),h.faceVertexUvs[0].push([g.clone(),j,m.clone()])}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:f},this.widthSegments=d||1,this.heightSegments=e||1,this.depthSegments=f||1;var h=this;d=a/2,e=b/2,f=c/2,g("z","y",-1,-1,c,b,d,0),g("z","y",1,-1,c,b,-d,1),g("x","z",1,1,a,c,e,2),g("x","z",1,-1,a,c,-e,3),g("x","y",1,-1,a,b,f,4),g("x","y",-1,-1,a,b,-f,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d},a=a||50,b=void 0!==b?Math.max(3,b):8,c=void 0!==c?c:0,d=void 0!==d?d:2*Math.PI;var e,f=[];e=new THREE.Vector3;var g=new THREE.Vector2(.5,.5);for(this.vertices.push(e),f.push(g),e=0;b>=e;e++){var h=new THREE.Vector3,i=c+e/b*d;h.x=a*Math.cos(i),h.y=a*Math.sin(i),this.vertices.push(h),f.push(new THREE.Vector2((h.x/a+1)/2,(h.y/a+1)/2))}for(c=new THREE.Vector3(0,0,1),e=1;b>=e;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([f[e].clone(),f[e+1].clone(),g.clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CubeGeometry=function(a,b,c,d,e,f){return THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new THREE.BoxGeometry(a,b,c,d,e,f)},THREE.CylinderGeometry=function(a,b,c,d,e,f,g,h){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h},a=void 0!==a?a:20,b=void 0!==b?b:20,c=void 0!==c?c:100,d=d||8,e=e||1,f=void 0!==f?f:!1,g=void 0!==g?g:0,h=void 0!==h?h:2*Math.PI;var i,j,k=c/2,l=[],m=[];for(j=0;e>=j;j++){var n=[],o=[],p=j/e,q=p*(b-a)+a;for(i=0;d>=i;i++){var r=i/d,s=new THREE.Vector3;s.x=q*Math.sin(r*h+g),s.y=-p*c+k,s.z=q*Math.cos(r*h+g),this.vertices.push(s),n.push(this.vertices.length-1),o.push(new THREE.Vector2(r,1-p))}l.push(n),m.push(o)}for(c=(b-a)/c,i=0;d>i;i++)for(0!==a?(g=this.vertices[l[0][i]].clone(),h=this.vertices[l[0][i+1]].clone()):(g=this.vertices[l[1][i]].clone(),h=this.vertices[l[1][i+1]].clone()),g.setY(Math.sqrt(g.x*g.x+g.z*g.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),j=0;e>j;j++){var n=l[j][i],o=l[j+1][i],p=l[j+1][i+1],q=l[j][i+1],r=g.clone(),s=g.clone(),t=h.clone(),u=h.clone(),v=m[j][i].clone(),w=m[j+1][i].clone(),x=m[j+1][i+1].clone(),y=m[j][i+1].clone();this.faces.push(new THREE.Face3(n,o,q,[r,s,u])),this.faceVertexUvs[0].push([v,w,y]),this.faces.push(new THREE.Face3(o,p,q,[s.clone(),t,u.clone()])),this.faceVertexUvs[0].push([w.clone(),x,y.clone()])}if(!1===f&&a>0)for(this.vertices.push(new THREE.Vector3(0,k,0)),i=0;d>i;i++)n=l[0][i],o=l[0][i+1],p=this.vertices.length-1,r=new THREE.Vector3(0,1,0),s=new THREE.Vector3(0,1,0),t=new THREE.Vector3(0,1,0),v=m[0][i].clone(),w=m[0][i+1].clone(),x=new THREE.Vector2(w.x,0),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);if(!1===f&&b>0)for(this.vertices.push(new THREE.Vector3(0,-k,0)),i=0;d>i;i++)n=l[e][i+1],o=l[e][i],p=this.vertices.length-1,r=new THREE.Vector3(0,-1,0),s=new THREE.Vector3(0,-1,0),t=new THREE.Vector3(0,-1,0),v=m[e][i+1].clone(),w=m[e][i].clone(),x=new THREE.Vector2(w.x,1),this.faces.push(new THREE.Face3(n,o,p,[r,s,t])),this.faceVertexUvs[0].push([v,w,x]);this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.ExtrudeGeometry=function(a,b){"undefined"!=typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=a instanceof Array?a:[a],this.addShapeList(a,b),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;c>d;d++)this.addShape(a[d],b)},THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){return b||THREE.error("THREE.ExtrudeGeometry: vec does not exist"),b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1e-10=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,d>1e-10?f>1e-10&&(a=!0):-1e-10>d?-1e-10>f&&(a=!0):Math.sign(e)==Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(O=a.length;0<=--O;){c=O,d=O-1,0>d&&(d=a.length-1);for(var e=0,f=s+2*p,e=0;f>e;e++){var g=M*e,h=M*(e+1),i=b+c+g,g=b+d+g,j=b+d+h,h=b+c+h,i=i+C,g=g+C,j=j+C,h=h+C;B.faces.push(new THREE.Face3(i,g,h,null,null,w)),B.faces.push(new THREE.Face3(g,j,h,null,null,w)),i=x.generateSideWallUV(B,i,g,j,h),B.faceVertexUvs[0].push([i[0],i[1],i[3]]),B.faceVertexUvs[0].push([i[1],i[2],i[3]])}}}function f(a,b,c){B.vertices.push(new THREE.Vector3(a,b,c))}function g(a,b,c){a+=C,b+=C,c+=C,B.faces.push(new THREE.Face3(a,b,c,null,null,v)),a=x.generateTopUV(B,a,b,c),B.faceVertexUvs[0].push(a)}var h,i,j,k,l,m=void 0!==b.amount?b.amount:100,n=void 0!==b.bevelThickness?b.bevelThickness:6,o=void 0!==b.bevelSize?b.bevelSize:n-2,p=void 0!==b.bevelSegments?b.bevelSegments:3,q=void 0!==b.bevelEnabled?b.bevelEnabled:!0,r=void 0!==b.curveSegments?b.curveSegments:12,s=void 0!==b.steps?b.steps:1,t=b.extrudePath,u=!1,v=b.material,w=b.extrudeMaterial,x=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;t&&(h=t.getSpacedPoints(s),u=!0,q=!1,i=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,s,!1),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3),q||(o=n=p=0);var y,z,A,B=this,C=this.vertices.length,t=a.extractPoints(r),r=t.shape,D=t.holes;if(t=!THREE.Shape.Utils.isClockWise(r)){for(r=r.reverse(),z=0,A=D.length;A>z;z++)y=D[z],THREE.Shape.Utils.isClockWise(y)&&(D[z]=y.reverse());t=!1}var E=THREE.Shape.Utils.triangulateShape(r,D),F=r;for(z=0,A=D.length;A>z;z++)y=D[z],r=r.concat(y);var G,H,I,J,K,L,M=r.length,N=E.length,t=[],O=0;for(I=F.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),t[O]=d(F[O],F[G],F[H]);var P,Q=[],R=t.concat();for(z=0,A=D.length;A>z;z++){for(y=D[z],P=[],O=0,I=y.length,G=I-1,H=O+1;I>O;O++,G++,H++)G===I&&(G=0),H===I&&(H=0),P[O]=d(y[O],y[G],y[H]);Q.push(P),R=R.concat(P)}for(G=0;p>G;G++){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,-J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),f(K.x,K.y,-J)}for(H=o,O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[0]).multiplyScalar(K.x),j.copy(i.binormals[0]).multiplyScalar(K.y),l.copy(h[0]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,0);for(I=1;s>=I;I++)for(O=0;M>O;O++)K=q?c(r[O],R[O],H):r[O],u?(k.copy(i.normals[I]).multiplyScalar(K.x),j.copy(i.binormals[I]).multiplyScalar(K.y),l.copy(h[I]).add(k).add(j),f(l.x,l.y,l.z)):f(K.x,K.y,m/s*I);for(G=p-1;G>=0;G--){for(I=G/p,J=n*(1-I),H=o*Math.sin(I*Math.PI/2),O=0,I=F.length;I>O;O++)K=c(F[O],t[O],H),f(K.x,K.y,m+J);for(z=0,A=D.length;A>z;z++)for(y=D[z],P=Q[z],O=0,I=y.length;I>O;O++)K=c(y[O],P[O],H),u?f(K.x,K.y+h[s-1].y,h[s-1].x+J):f(K.x,K.y,m+J)}!function(){if(q){var a;for(a=0*M,O=0;N>O;O++)L=E[O],g(L[2]+a,L[1]+a,L[0]+a);for(a=s+2*p,a*=M,O=0;N>O;O++)L=E[O],g(L[0]+a,L[1]+a,L[2]+a)}else{for(O=0;N>O;O++)L=E[O],g(L[2],L[1],L[0]);for(O=0;N>O;O++)L=E[O],g(L[0]+M*s,L[1]+M*s,L[2]+M*s)}}(),function(){var a=0;for(e(F,a),a+=F.length,z=0,A=D.length;A>z;z++)y=D[z],e(y,a),a+=y.length}()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(a,b,c,d){return a=a.vertices,b=a[b],c=a[c],d=a[d],[new THREE.Vector2(b.x,b.y),new THREE.Vector2(c.x,c.y),new THREE.Vector2(d.x,d.y)]},generateSideWallUV:function(a,b,c,d,e){return a=a.vertices,b=a[b],c=a[c],d=a[d],e=a[e],.01>Math.abs(b.y-c.y)?[new THREE.Vector2(b.x,1-b.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(d.x,1-d.z),new THREE.Vector2(e.x,1-e.z)]:[new THREE.Vector2(b.y,1-b.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(d.y,1-d.z),new THREE.Vector2(e.y,1-e.z)]}},THREE.ShapeGeometry=function(a,b){THREE.Geometry.call(this),this.type="ShapeGeometry",!1==a instanceof Array&&(a=[a]),this.addShapeList(a,b),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(a,b){for(var c=0,d=a.length;d>c;c++)this.addShape(a[c],b);return this},THREE.ShapeGeometry.prototype.addShape=function(a,b){void 0===b&&(b={});var c,d,e,f=b.material,g=void 0===b.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:b.UVGenerator,h=this.vertices.length;c=a.extractPoints(void 0!==b.curveSegments?b.curveSegments:12);var i=c.shape,j=c.holes;if(!THREE.Shape.Utils.isClockWise(i))for(i=i.reverse(),c=0,d=j.length;d>c;c++)e=j[c],THREE.Shape.Utils.isClockWise(e)&&(j[c]=e.reverse());var k=THREE.Shape.Utils.triangulateShape(i,j);for(c=0,d=j.length;d>c;c++)e=j[c],i=i.concat(e);for(j=i.length,d=k.length,c=0;j>c;c++)e=i[c],this.vertices.push(new THREE.Vector3(e.x,e.y,0));for(c=0;d>c;c++)j=k[c],i=j[0]+h,e=j[1]+h,j=j[2]+h,this.faces.push(new THREE.Face3(i,e,j,null,null,f)),this.faceVertexUvs[0].push(g.generateTopUV(this,i,e,j))},THREE.LatheGeometry=function(a,b,c,d){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:a,segments:b,phiStart:c,phiLength:d},b=b||12,c=c||0,d=d||2*Math.PI;for(var e=1/(a.length-1),f=1/b,g=0,h=b;h>=g;g++)for(var i=c+g*f*d,j=Math.cos(i),k=Math.sin(i),i=0,l=a.length;l>i;i++){var m=a[i],n=new THREE.Vector3;n.x=j*m.x-k*m.y,n.y=k*m.x+j*m.y,n.z=m.z,this.vertices.push(n)}for(c=a.length,g=0,h=b;h>g;g++)for(i=0,l=a.length-1;l>i;i++){b=k=i+c*g,d=k+c;var j=k+1+c,k=k+1,m=g*f,n=i*e,o=m+f,p=n+e;this.faces.push(new THREE.Face3(b,d,k)),this.faceVertexUvs[0].push([new THREE.Vector2(m,n),new THREE.Vector2(o,n),new THREE.Vector2(m,p)]),this.faces.push(new THREE.Face3(d,j,k)),this.faceVertexUvs[0].push([new THREE.Vector2(o,n),new THREE.Vector2(o,p),new THREE.Vector2(m,p)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(a,b,c,d){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,f=b/2;c=c||1,d=d||1;var g=c+1,h=d+1,i=a/c,j=b/d;b=new Float32Array(g*h*3),a=new Float32Array(g*h*3);for(var k=new Float32Array(g*h*2),l=0,m=0,n=0;h>n;n++)for(var o=n*j-f,p=0;g>p;p++)b[l]=p*i-e,b[l+1]=-o,a[l+2]=1,k[m]=p/c,k[m+1]=1-n/d,l+=3,m+=2;for(l=0,e=new(65535n;n++)for(p=0;c>p;p++)f=p+g*(n+1),h=p+1+g*(n+1),i=p+1+g*n,e[l]=p+g*n,e[l+1]=f,e[l+2]=i,e[l+3]=f,e[l+4]=h,e[l+5]=i,l+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1)),this.addAttribute("position",new THREE.BufferAttribute(b,3)),this.addAttribute("normal",new THREE.BufferAttribute(a,3)),this.addAttribute("uv",new THREE.BufferAttribute(k,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:f},a=a||0,b=b||50,e=void 0!==e?e:0,f=void 0!==f?f:2*Math.PI,c=void 0!==c?Math.max(3,c):8,d=void 0!==d?Math.max(1,d):8;var g,h=[],i=a,j=(b-a)/d;for(a=0;d+1>a;a++){for(g=0;c+1>g;g++){var k=new THREE.Vector3,l=e+g/c*f;k.x=i*Math.cos(l),k.y=i*Math.sin(l),this.vertices.push(k),h.push(new THREE.Vector2((k.x/b+1)/2,(k.y/b+1)/2))}i+=j}for(b=new THREE.Vector3(0,0,1),a=0;d>a;a++)for(e=a*(c+1),g=0;c>g;g++)f=l=g+e,j=l+c+1,k=l+c+2,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]),f=l,j=l+c+2,k=l+1,this.faces.push(new THREE.Face3(f,j,k,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[f].clone(),h[j].clone(),h[k].clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,i)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(a,b,c,d,e,f,g){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:f,thetaLength:g},a=a||50,b=Math.max(3,Math.floor(b)||8),c=Math.max(2,Math.floor(c)||6),d=void 0!==d?d:0,e=void 0!==e?e:2*Math.PI,f=void 0!==f?f:0,g=void 0!==g?g:Math.PI;var h,i,j=[],k=[];for(i=0;c>=i;i++){var l=[],m=[];for(h=0;b>=h;h++){var n=h/b,o=i/c,p=new THREE.Vector3;p.x=-a*Math.cos(d+n*e)*Math.sin(f+o*g),p.y=a*Math.cos(f+o*g),p.z=a*Math.sin(d+n*e)*Math.sin(f+o*g),this.vertices.push(p),l.push(this.vertices.length-1),m.push(new THREE.Vector2(n,1-o))}j.push(l),k.push(m)}for(i=0;c>i;i++)for(h=0;b>h;h++){d=j[i][h+1],e=j[i][h],f=j[i+1][h],g=j[i+1][h+1];var l=this.vertices[d].clone().normalize(),m=this.vertices[e].clone().normalize(),n=this.vertices[f].clone().normalize(),o=this.vertices[g].clone().normalize(),p=k[i][h+1].clone(),q=k[i][h].clone(),r=k[i+1][h].clone(),s=k[i+1][h+1].clone();Math.abs(this.vertices[d].y)===a?(p.x=(p.x+q.x)/2,this.faces.push(new THREE.Face3(d,f,g,[l,n,o])),this.faceVertexUvs[0].push([p,r,s])):Math.abs(this.vertices[f].y)===a?(r.x=(r.x+s.x)/2,this.faces.push(new THREE.Face3(d,e,f,[l,m,n])),this.faceVertexUvs[0].push([p,q,r])):(this.faces.push(new THREE.Face3(d,e,g,[l,m,o])),this.faceVertexUvs[0].push([p,q,s]),this.faces.push(new THREE.Face3(e,f,g,[m.clone(),n,o.clone()])),this.faceVertexUvs[0].push([q.clone(),r,s.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50,void 0===b.bevelThickness&&(b.bevelThickness=10),void 0===b.bevelSize&&(b.bevelSize=8),void 0===b.bevelEnabled&&(b.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,c,b),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e},a=a||100,b=b||40,c=c||8,d=d||6,e=e||2*Math.PI;for(var f=new THREE.Vector3,g=[],h=[],i=0;c>=i;i++)for(var j=0;d>=j;j++){var k=j/d*e,l=i/c*Math.PI*2;f.x=a*Math.cos(k),f.y=a*Math.sin(k);var m=new THREE.Vector3;m.x=(a+b*Math.cos(l))*Math.cos(k),m.y=(a+b*Math.cos(l))*Math.sin(k),m.z=b*Math.sin(l),this.vertices.push(m),g.push(new THREE.Vector2(j/d,i/c)),h.push(m.clone().sub(f).normalize())}for(i=1;c>=i;i++)for(j=1;d>=j;j++)a=(d+1)*i+j-1,b=(d+1)*(i-1)+j-1,e=(d+1)*(i-1)+j,f=(d+1)*i+j,k=new THREE.Face3(a,b,f,[h[a].clone(),h[b].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[a].clone(),g[b].clone(),g[f].clone()]),k=new THREE.Face3(b,e,f,[h[b].clone(),h[e].clone(),h[f].clone()]),this.faces.push(k),this.faceVertexUvs[0].push([g[b].clone(),g[e].clone(),g[f].clone()]);this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(a,b,c,d,e,f,g){function h(a,b,c,d,e){var f=Math.cos(a),g=Math.sin(a);return a*=b/c,b=Math.cos(a),f*=d*(2+b)*.5,g=d*(2+b)*g*.5,d=e*d*Math.sin(a)*.5,new THREE.Vector3(f,g,d)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,p:e,q:f,heightScale:g},a=a||100,b=b||40,c=c||64,d=d||8,e=e||2,f=f||3,g=g||1;for(var i=Array(c),j=new THREE.Vector3,k=new THREE.Vector3,l=new THREE.Vector3,m=0;c>m;++m){i[m]=Array(d);var n=m/c*2*e*Math.PI,o=h(n,f,e,a,g),n=h(n+.01,f,e,a,g);for(j.subVectors(n,o),k.addVectors(n,o),l.crossVectors(j,k),k.crossVectors(l,j),l.normalize(),k.normalize(),n=0;d>n;++n){var p=n/d*2*Math.PI,q=-b*Math.cos(p),p=b*Math.sin(p),r=new THREE.Vector3;r.x=o.x+q*k.x+p*l.x,r.y=o.y+q*k.y+p*l.y,r.z=o.z+q*k.z+p*l.z,i[m][n]=this.vertices.push(r)-1}}for(m=0;c>m;++m)for(n=0;d>n;++n)e=(m+1)%c,f=(n+1)%d,a=i[m][n],b=i[e][n],e=i[e][f],f=i[m][f],g=new THREE.Vector2(m/c,n/d),j=new THREE.Vector2((m+1)/c,n/d),k=new THREE.Vector2((m+1)/c,(n+1)/d),l=new THREE.Vector2(m/c,(n+1)/d),this.faces.push(new THREE.Face3(a,b,f)),this.faceVertexUvs[0].push([g,j,l]),this.faces.push(new THREE.Face3(b,e,f)),this.faceVertexUvs[0].push([j.clone(),k,l.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(a,b,c,d,e,f){THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:a,segments:b,radius:c,radialSegments:d,closed:e},b=b||64,c=c||1,d=d||8,e=e||!1,f=f||THREE.TubeGeometry.NoTaper;var g,h,i,j,k,l,m,n,o,p,q=[],r=b+1,s=new THREE.Vector3;for(n=new THREE.TubeGeometry.FrenetFrames(a,b,e),o=n.normals,p=n.binormals,this.tangents=n.tangents,this.normals=o,this.binormals=p,n=0;r>n;n++)for(q[n]=[],i=n/(r-1),m=a.getPointAt(i),g=o[n],h=p[n],k=c*f(i),i=0;d>i;i++)j=i/d*2*Math.PI,l=-k*Math.cos(j),j=k*Math.sin(j),s.copy(m),s.x+=l*g.x+j*h.x,s.y+=l*g.y+j*h.y,s.z+=l*g.z+j*h.z,q[n][i]=this.vertices.push(new THREE.Vector3(s.x,s.y,s.z))-1;for(n=0;b>n;n++)for(i=0;d>i;i++)f=e?(n+1)%b:n+1,r=(i+1)%d,a=q[n][i],c=q[f][i],f=q[f][r],r=q[n][r],s=new THREE.Vector2(n/b,i/d),o=new THREE.Vector2((n+1)/b,i/d),p=new THREE.Vector2((n+1)/b,(i+1)/d),g=new THREE.Vector2(n/b,(i+1)/d),this.faces.push(new THREE.Face3(a,c,r)),this.faceVertexUvs[0].push([s,o,g]),this.faces.push(new THREE.Face3(c,f,r)),this.faceVertexUvs[0].push([o.clone(),p,g.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(){return 1},THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)},THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],f=[],g=[],h=new THREE.Vector3,i=new THREE.Matrix4;b+=1;var j,k,l;for(this.tangents=e,this.normals=f,this.binormals=g,j=0;b>j;j++)k=j/(b-1),e[j]=a.getTangentAt(k),e[j].normalize();for(f[0]=new THREE.Vector3,g[0]=new THREE.Vector3,a=Number.MAX_VALUE,j=Math.abs(e[0].x),k=Math.abs(e[0].y),l=Math.abs(e[0].z),a>=j&&(a=j,d.set(1,0,0)),a>=k&&(a=k,d.set(0,1,0)),a>=l&&d.set(0,0,1),h.crossVectors(e[0],d).normalize(),f[0].crossVectors(e[0],h),g[0].crossVectors(e[0],f[0]),j=1;b>j;j++)f[j]=f[j-1].clone(),g[j]=g[j-1].clone(),h.crossVectors(e[j-1],e[j]),1e-4j;j++)f[j].applyMatrix4(i.makeRotationAxis(e[j],d*j)),g[j].crossVectors(e[j],f[j])},THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=i.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;return a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5,b.uv=new THREE.Vector2(c,1-a),b}function f(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);i.faces.push(d),q.copy(a).add(b).add(c).divideScalar(3),d=Math.atan2(q.z,-q.x),i.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function g(a,b){for(var c=Math.pow(2,b),d=e(i.vertices[a.a]),g=e(i.vertices[a.b]),h=e(i.vertices[a.c]),j=[],k=0;c>=k;k++){j[k]=[];for(var l=e(d.clone().lerp(h,k/c)),m=e(g.clone().lerp(h,k/c)),n=c-k,o=0;n>=o;o++)j[k][o]=0==o&&k==c?l:e(l.clone().lerp(m,o/n))}for(k=0;c>k;k++)for(o=0;2*(c-k)-1>o;o++)d=Math.floor(o/2),0==o%2?f(j[k][d+1],j[k+1][d],j[k][d]):f(j[k][d+1],j[k+1][d+1],j[k+1][d])}function h(a,b,c){return 0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y)),0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y)),a.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:a,indices:b,radius:c,detail:d},c=c||1,d=d||0;for(var i=this,j=0,k=a.length;k>j;j+=3)e(new THREE.Vector3(a[j],a[j+1],a[j+2]));a=this.vertices;for(var l=[],m=j=0,k=b.length;k>j;j+=3,m++){var n=a[b[j]],o=a[b[j+1]],p=a[b[j+2]];l[m]=new THREE.Face3(n.index,o.index,p.index,[n.clone(),o.clone(),p.clone()])}for(var q=new THREE.Vector3,j=0,k=l.length;k>j;j++)g(l[j],d);for(j=0,k=this.faceVertexUvs[0].length;k>j;j++)b=this.faceVertexUvs[0][j],d=b[0].x,a=b[1].x,l=b[2].x,m=Math.max(d,Math.max(a,l)),n=Math.min(d,Math.min(a,l)),m>.9&&.1>n&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>l&&(b[2].x+=1));for(j=0,k=this.vertices.length;k>j;j++)this.vertices[j].multiplyScalar(c); + +this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(a,b){this.parameters={radius:a,detail:b};var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],a,b)},THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b),this.type="IcosahedronGeometry",this.parameters={radius:a,detail:b}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(a,b){this.parameters={radius:a,detail:b},THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b),this.type="OctahedronGeometry",this.parameters={radius:a,detail:b}},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(a,b){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b),this.type="TetrahedronGeometry",this.parameters={radius:a,detail:b}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(a,b,c){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:a,slices:b,stacks:c};var d,e,f,g,h=this.vertices,i=this.faces,j=this.faceVertexUvs[0],k=b+1;for(d=0;c>=d;d++)for(g=d/c,e=0;b>=e;e++)f=e/b,f=a(f,g),h.push(f);var l,m,n,o;for(d=0;c>d;d++)for(e=0;b>e;e++)a=d*k+e,h=d*k+e+1,g=(d+1)*k+e+1,f=(d+1)*k+e,l=new THREE.Vector2(e/b,d/c),m=new THREE.Vector2((e+1)/b,d/c),n=new THREE.Vector2((e+1)/b,(d+1)/c),o=new THREE.Vector2(e/b,(d+1)/c),i.push(new THREE.Face3(a,h,f)),j.push([l,m,o]),i.push(new THREE.Face3(h,g,f)),j.push([m.clone(),n,o.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.AxisHelper=function(a){a=a||1;var b=new Float32Array([0,0,0,a,0,0,0,0,0,0,a,0,0,0,0,0,0,a]),c=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);a=new THREE.BufferGeometry,a.addAttribute("position",new THREE.BufferAttribute(b,3)),a.addAttribute("color",new THREE.BufferAttribute(c,3)),b=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.Line.call(this,a,b,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var a=new THREE.Geometry;a.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var b=new THREE.CylinderGeometry(0,.5,1,5,1);return b.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),function(c,d,e,f,g,h){THREE.Object3D.call(this),void 0===f&&(f=16776960),void 0===e&&(e=1),void 0===g&&(g=.2*e),void 0===h&&(h=.2*g),this.position.copy(d),this.line=new THREE.Line(a,new THREE.LineBasicMaterial({color:f})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(b,new THREE.MeshBasicMaterial({color:f})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(c),this.setLength(e,g,h)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var a,b=new THREE.Vector3;return function(c){.99999c.y?this.quaternion.set(1,0,0,0):(b.set(c.z,0,-c.x).normalize(),a=Math.acos(c.y),this.quaternion.setFromAxisAngle(b,a))}}(),THREE.ArrowHelper.prototype.setLength=function(a,b,c){void 0===b&&(b=.2*a),void 0===c&&(c=.2*b),this.line.scale.set(1,a-b,1),this.line.updateMatrix(),this.cone.scale.set(c,b,c),this.cone.position.y=a,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(a){this.line.material.color.set(a),this.cone.material.color.set(a)},THREE.BoxHelper=function(a){var b=new THREE.BufferGeometry;b.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3)),THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==a&&this.update(a)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(a){var b=a.geometry;null===b.boundingBox&&b.computeBoundingBox();var c=b.boundingBox.min,b=b.boundingBox.max,d=this.geometry.attributes.position.array;d[0]=b.x,d[1]=b.y,d[2]=b.z,d[3]=c.x,d[4]=b.y,d[5]=b.z,d[6]=c.x,d[7]=b.y,d[8]=b.z,d[9]=c.x,d[10]=c.y,d[11]=b.z,d[12]=c.x,d[13]=c.y,d[14]=b.z,d[15]=b.x,d[16]=c.y,d[17]=b.z,d[18]=b.x,d[19]=c.y,d[20]=b.z,d[21]=b.x,d[22]=b.y,d[23]=b.z,d[24]=b.x,d[25]=b.y,d[26]=c.z,d[27]=c.x,d[28]=b.y,d[29]=c.z,d[30]=c.x,d[31]=b.y,d[32]=c.z,d[33]=c.x,d[34]=c.y,d[35]=c.z,d[36]=c.x,d[37]=c.y,d[38]=c.z,d[39]=b.x,d[40]=c.y,d[41]=c.z,d[42]=b.x,d[43]=c.y,d[44]=c.z,d[45]=b.x,d[46]=b.y,d[47]=c.z,d[48]=b.x,d[49]=b.y,d[50]=b.z,d[51]=b.x,d[52]=b.y,d[53]=c.z,d[54]=c.x,d[55]=b.y,d[56]=b.z,d[57]=c.x,d[58]=b.y,d[59]=c.z,d[60]=c.x,d[61]=c.y,d[62]=b.z,d[63]=c.x,d[64]=c.y,d[65]=c.z,d[66]=b.x,d[67]=c.y,d[68]=b.z,d[69]=b.x,d[70]=c.y,d[71]=c.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.BoundingBoxHelper=function(a,b){var c=void 0!==b?b:8947848;this.object=a,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:c,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(a){function b(a,b,d){c(a,d),c(b,d)}function c(a,b){d.vertices.push(new THREE.Vector3),d.colors.push(new THREE.Color(b)),void 0===f[a]&&(f[a]=[]),f[a].push(d.vertices.length-1)}var d=new THREE.Geometry,e=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),f={};b("n1","n2",16755200),b("n2","n4",16755200),b("n4","n3",16755200),b("n3","n1",16755200),b("f1","f2",16755200),b("f2","f4",16755200),b("f4","f3",16755200),b("f3","f1",16755200),b("n1","f1",16755200),b("n2","f2",16755200),b("n3","f3",16755200),b("n4","f4",16755200),b("p","n1",16711680),b("p","n2",16711680),b("p","n3",16711680),b("p","n4",16711680),b("u1","u2",43775),b("u2","u3",43775),b("u3","u1",43775),b("c","t",16777215),b("p","c",3355443),b("cn1","cn2",3355443),b("cn3","cn4",3355443),b("cf1","cf2",3355443),b("cf3","cf4",3355443),THREE.Line.call(this,d,e,THREE.LinePieces),this.camera=a,this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=f,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){var a,b,c=new THREE.Vector3,d=new THREE.Camera,e=function(e,f,g,h){if(c.set(f,g,h).unproject(d),e=b[e],void 0!==e)for(f=0,g=e.length;g>f;f++)a.vertices[e[f]].copy(c)};return function(){a=this.geometry,b=this.pointMap,d.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-1,-1,-1),e("n2",1,-1,-1),e("n3",-1,1,-1),e("n4",1,1,-1),e("f1",-1,-1,1),e("f2",1,-1,1),e("f3",-1,1,1),e("f4",1,1,1),e("u1",.7,1.1,-1),e("u2",-.7,1.1,-1),e("u3",0,2,-1),e("cf1",-1,0,1),e("cf2",1,0,1),e("cf3",0,-1,1),e("cf4",0,1,1),e("cn1",-1,0,-1),e("cn2",1,0,-1),e("cn3",0,-1,-1),e("cn4",0,1,-1),a.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,b=b||1;var c=new THREE.Geometry;c.vertices.push(new THREE.Vector3(-b,b,0),new THREE.Vector3(b,b,0),new THREE.Vector3(b,-b,0),new THREE.Vector3(-b,-b,0),new THREE.Vector3(-b,b,0));var d=new THREE.LineBasicMaterial({fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(c,d),this.add(this.lightPlane),c=new THREE.Geometry,c.vertices.push(new THREE.Vector3,new THREE.Vector3),d=new THREE.LineBasicMaterial({fog:!1}),d.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(c,d),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3,c=new THREE.Vector3;return function(){a.setFromMatrixPosition(this.light.matrixWorld),b.setFromMatrixPosition(this.light.target.matrixWorld),c.subVectors(b,a),this.lightPlane.lookAt(c),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(c),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(a,b,c){b=void 0!==b?b:16777215,c=Math.cos(THREE.Math.degToRad(void 0!==c?c:1));var d,e=[0,0],f={},g=function(a,b){return a-b},h=["a","b","c"],i=new THREE.BufferGeometry;a.geometry instanceof THREE.BufferGeometry?(d=new THREE.Geometry,d.fromBufferGeometry(a.geometry)):d=a.geometry.clone(),d.mergeVertices(),d.computeFaceNormals();var j=d.vertices;d=d.faces;for(var k=0,l=0,m=d.length;m>l;l++)for(var n=d[l],o=0;3>o;o++){e[0]=n[h[o]],e[1]=n[h[(o+1)%3]],e.sort(g);var p=e.toString();void 0===f[p]?(f[p]={vert1:e[0],vert2:e[1],face1:l,face2:void 0},k++):f[p].face2=l}e=new Float32Array(6*k),g=0;for(p in f)h=f[p],(void 0===h.face2||d[h.face1].normal.dot(d[h.face2].normal)<=c)&&(k=j[h.vert1],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z,k=j[h.vert2],e[g++]=k.x,e[g++]=k.y,e[g++]=k.z);i.addAttribute("position",new THREE.BufferAttribute(e,3)),THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:b}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,a=void 0!==c?c:16776960,d=void 0!==d?d:1,b=new THREE.Geometry,c=0;for(var e=this.object.geometry.faces.length;e>c;c++)b.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,b,new THREE.LineBasicMaterial({color:a,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var a=this.geometry.vertices,b=this.object,c=b.geometry.vertices,d=b.geometry.faces,e=b.matrixWorld;b.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(e);for(var f=b=0,g=d.length;g>b;b++,f+=2){var h=d[b];a[f].copy(c[h.a]).add(c[h.b]).add(c[h.c]).divideScalar(3).applyMatrix4(e),a[f+1].copy(h.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(a[f])}return this.geometry.verticesNeedUpdate=!0,this},THREE.GridHelper=function(a,b){var c=new THREE.Geometry,d=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var e=-a;a>=e;e+=b){c.vertices.push(new THREE.Vector3(-a,0,e),new THREE.Vector3(a,0,e),new THREE.Vector3(e,0,-a),new THREE.Vector3(e,0,a));var f=0===e?this.color1:this.color2;c.colors.push(f,f,f,f)}THREE.Line.call(this,c,d,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(a,b){this.color1.set(a),this.color2.set(b),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(a,b){THREE.Object3D.call(this),this.light=a,this.light.updateMatrixWorld(),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var c=new THREE.SphereGeometry(b,4,2);c.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var d=0;8>d;d++)c.faces[d].color=this.colors[4>d?0:1];d=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(c,d),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var a=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(a,b){this.light=a,this.light.updateMatrixWorld();var c=new THREE.SphereGeometry(b,4,2),d=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});d.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,c,d),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(a){this.bones=this.getBoneList(a);for(var b=new THREE.Geometry,c=0;ce;e++)for(var g=0,h=a[e].vertexNormals.length;h>g;g++)c.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexNormals.length;l>k;k++){var m=j.vertexNormals[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(a,b,c,d){this.object=a,this.size=void 0!==b?b:1,b=void 0!==c?c:255,d=void 0!==d?d:1,c=new THREE.Geometry,a=a.geometry.faces;for(var e=0,f=a.length;f>e;e++)for(var g=0,h=a[e].vertexTangents.length;h>g;g++)c.vertices.push(new THREE.Vector3),c.vertices.push(new THREE.Vector3);THREE.Line.call(this,c,new THREE.LineBasicMaterial({color:b,linewidth:d}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(){var a=new THREE.Vector3;return function(b){b=["a","b","c","d"],this.object.updateMatrixWorld(!0);for(var c=this.geometry.vertices,d=this.object.geometry.vertices,e=this.object.geometry.faces,f=this.object.matrixWorld,g=0,h=0,i=e.length;i>h;h++)for(var j=e[h],k=0,l=j.vertexTangents.length;l>k;k++){var m=j.vertexTangents[k];c[g].copy(d[j[b[k]]]).applyMatrix4(f),a.copy(m).transformDirection(f).multiplyScalar(this.size),a.add(c[g]),g+=1,c[g].copy(a),g+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(a,b){var c=void 0!==b?b:16777215,d=[0,0],e={},f=function(a,b){return a-b},g=["a","b","c"],h=new THREE.BufferGeometry;if(a.geometry instanceof THREE.Geometry){for(var i=a.geometry.vertices,j=a.geometry.faces,k=0,l=new Uint32Array(6*j.length),m=0,n=j.length;n>m;m++)for(var o=j[m],p=0;3>p;p++){d[0]=o[g[p]],d[1]=o[g[(p+1)%3]],d.sort(f);var q=d.toString();void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++)}for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)k=i[l[2*m+p]],g=6*m+3*p,d[g+0]=k.x,d[g+1]=k.y,d[g+2]=k.z;h.addAttribute("position",new THREE.BufferAttribute(d,3))}else if(a.geometry instanceof THREE.BufferGeometry){if(void 0!==a.geometry.attributes.index){i=a.geometry.attributes.position.array,n=a.geometry.attributes.index.array,j=a.geometry.drawcalls,k=0,0===j.length&&(j=[{count:n.length,index:0,start:0}]);for(var l=new Uint32Array(2*n.length),o=0,r=j.length;r>o;++o)for(var p=j[o].start,q=j[o].count,g=j[o].index,m=p,s=p+q;s>m;m+=3)for(p=0;3>p;p++)d[0]=g+n[m+p],d[1]=g+n[m+(p+1)%3],d.sort(f),q=d.toString(),void 0===e[q]&&(l[2*k]=d[0],l[2*k+1]=d[1],e[q]=!0,k++);for(d=new Float32Array(6*k),m=0,n=k;n>m;m++)for(p=0;2>p;p++)g=6*m+3*p,k=3*l[2*m+p],d[g+0]=i[k],d[g+1]=i[k+1],d[g+2]=i[k+2]}else for(i=a.geometry.attributes.position.array,k=i.length/3,l=k/3,d=new Float32Array(6*k),m=0,n=l;n>m;m++)for(p=0;3>p;p++)g=18*m+6*p,l=9*m+3*p,d[g+0]=i[l],d[g+1]=i[l+1],d[g+2]=i[l+2],k=9*m+(p+1)%3*3,d[g+3]=i[k],d[g+4]=i[k+1],d[g+5]=i[k+2];h.addAttribute("position",new THREE.BufferAttribute(d,3))}THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:c}),THREE.LinePieces),this.matrix=a.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(a,b){THREE.Mesh.call(this,a,b),this.animationsMap={},this.animationsList=[];var c=this.geometry.morphTargets.length;this.createAnimation("__default",0,c-1,c/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(a,b,c,d){b={startFrame:b,endFrame:c,length:c-b+1,fps:d,duration:(c-b)/d,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[a]=b,this.animationsList.push(b)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(a){for(var b,c=/([a-z]+)_?(\d+)/,d={},e=this.geometry,f=0,g=e.morphTargets.length;g>f;f++){var h=e.morphTargets[f].name.match(c);if(h&&1h.end&&(h.end=f),b||(b=i)}}for(i in d)h=d[i],this.createAnimation(i,h.start,h.end,a);this.firstAnimation=b},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(a){(a=this.animationsMap[a])&&(a.direction=1,a.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(a){(a=this.animationsMap[a])&&(a.direction=-1,a.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(a,b){var c=this.animationsMap[a];c&&(c.fps=b,c.duration=(c.end-c.start)/c.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(a,b){var c=this.animationsMap[a];c&&(c.duration=b,c.fps=(c.end-c.start)/c.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(a,b){var c=this.animationsMap[a];c&&(c.weight=b)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(a,b){var c=this.animationsMap[a];c&&(c.time=b)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(a){var b=0;return(a=this.animationsMap[a])&&(b=a.time),b},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(a){var b=-1;return(a=this.animationsMap[a])&&(b=a.duration),b},THREE.MorphBlendMesh.prototype.playAnimation=function(a){var b=this.animationsMap[a];b?(b.time=0,b.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+a+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(a){(a=this.animationsMap[a])&&(a.active=!1)},THREE.MorphBlendMesh.prototype.update=function(a){for(var b=0,c=this.animationsList.length;c>b;b++){var d=this.animationsList[b];if(d.active){var e=d.duration/d.length;d.time+=d.direction*a,d.mirroredLoop?(d.time>d.duration||0>d.time)&&(d.direction*=-1,d.time>d.duration&&(d.time=d.duration,d.directionBackwards=!0),0>d.time&&(d.time=0,d.directionBackwards=!1)):(d.time%=d.duration,0>d.time&&(d.time+=d.duration));var f=d.startFrame+THREE.Math.clamp(Math.floor(d.time/e),0,d.length-1),g=d.weight;f!==d.currentFrame&&(this.morphTargetInfluences[d.lastFrame]=0,this.morphTargetInfluences[d.currentFrame]=1*g,this.morphTargetInfluences[f]=0,d.lastFrame=d.currentFrame,d.currentFrame=f),e=d.time%e/e,d.directionBackwards&&(e=1-e),this.morphTargetInfluences[d.currentFrame]=e*g,this.morphTargetInfluences[d.lastFrame]=(1-e)*g}}},Detector={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{return!!window.WebGLRenderingContext&&!!document.createElement("canvas").getContext("experimental-webgl")}catch(a){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var a=document.createElement("div");return a.id="webgl-error-message",a.style.fontFamily="arial",a.style.fontSize="13px",a.style.fontWeight="normal",a.style.textAlign="center",a.style.background="#222222",a.style.color="#ffffff",a.style.padding="1.5em",a.style.width="100%",a.style.margin="5em auto 0",a.style.zIndex="500000",a.style.position="absolute",a.style.pointerEvents="all",this.webgl||(a.innerHTML=['Either your graphics card or your browser does not support WebGL.. Try Google Chrome
    ','or view a list of WebGL compatible browsers.'].join("\n")),a},addGetWebGLMessage:function(a){var b,c,d;a=a||{},b=void 0!==a.parent?a.parent:document.body,c=void 0!==a.id?a.id:"oldie",d=Detector.getWebGLErrorMessage(),d.id=c,b.appendChild(d)}},window.requestAnimationFrame||(window.requestAnimationFrame=function(){return window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}());var THREEx=THREEx||{};THREEx.KeyboardState=function(){this.keyCodes={},this.modifiers={};var a=this;this._onKeyDown=function(b){a._onKeyChange(b,!0)},this._onKeyUp=function(b){a._onKeyChange(b,!1)},document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("keyup",this._onKeyUp,!1)},THREEx.KeyboardState.prototype.destroy=function(){document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)},THREEx.KeyboardState.MODIFIERS=["shift","ctrl","alt","meta"],THREEx.KeyboardState.ALIAS={left:37,up:38,right:39,down:40,space:32,pageup:33,pagedown:34,tab:9},THREEx.KeyboardState.prototype._onKeyChange=function(a,b){var c=a.keyCode;this.keyCodes[c]=b,this.modifiers.shift=a.shiftKey,this.modifiers.ctrl=a.ctrlKey,this.modifiers.alt=a.altKey,this.modifiers.meta=a.metaKey},THREEx.KeyboardState.prototype.pressed=function(a){for(var b=a.split("+"),c=0;cd&&(d=c),a.setSize(d,window.innerHeight),b.aspect=d/window.innerHeight,b.updateProjectionMatrix()};return window.addEventListener("resize",c,!1),{stop:function(){window.removeEventListener("resize",c)}}}; \ No newline at end of file diff --git a/src/components/legend-item.jsx b/src/components/legend-item.jsx index 83bc9e0..32c42e9 100644 --- a/src/components/legend-item.jsx +++ b/src/components/legend-item.jsx @@ -8,11 +8,6 @@ import * as constants from '../constants'; * Component definition * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ export default class LegendItem extends React.Component { - static propTypes = { - clickCallback: React.PropTypes.func.isRequired, - type: React.PropTypes.string.isRequired, - }; - constructor( props ) { super( props ); @@ -108,3 +103,8 @@ export default class LegendItem extends React.Component { ); } } + +LegendItem.propTypes = { + clickCallback: React.PropTypes.func.isRequired, + type: React.PropTypes.string.isRequired, +}; diff --git a/src/components/legend.jsx b/src/components/legend.jsx index 1adcfe8..11039de 100644 --- a/src/components/legend.jsx +++ b/src/components/legend.jsx @@ -8,11 +8,6 @@ import LegendItem from './legend-item.jsx'; * Component definition * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ export default class Legend extends React.Component { - static propTypes = { - clickCallback: React.PropTypes.func.isRequired, - types: React.PropTypes.array.isRequired, - }; - constructor( props ) { super( props ); @@ -49,3 +44,8 @@ export default class Legend extends React.Component { ); } } + +Legend.propTypes = { + clickCallback: React.PropTypes.func.isRequired, + types: React.PropTypes.array.isRequired, +}; From ad23c5c0c648c26a073696d90a72805e05aa690b Mon Sep 17 00:00:00 2001 From: Nick Young Date: Tue, 5 Jul 2016 12:17:59 +1200 Subject: [PATCH 190/190] Specify compatible version of threejs in bower.json --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index aa03230..ce2ee30 100644 --- a/bower.json +++ b/bower.json @@ -16,6 +16,6 @@ ], "dependencies": { "react": "^0.13.1", - "threejs": "*" + "threejs": "r71" } }