vizicities/dist/vizicities.min.js

9 wiersze
191 KiB
JavaScript
Czysty Wina Historia

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("proj4"),require("THREE")):"function"==typeof define&&define.amd?define(["proj4","THREE"],t):"object"==typeof exports?exports.VIZI=t(require("proj4"),require("THREE")):e.VIZI=t(e.proj4,e.THREE)}(this,function(__WEBPACK_EXTERNAL_MODULE_22__,__WEBPACK_EXTERNAL_MODULE_24__){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(42),s=r(a),u=n(37),l=r(u),c=n(36),f=r(c),h=n(46),p=r(h),d=n(61),v=r(d),y=n(72),_=r(y),m=n(73),g=r(m),b=n(80),w=r(b),x=n(75),k=r(x),M=n(78),O=r(M),E=n(79),P=r(E),T=n(11),j=r(T),S=n(10),C=r(S),A={version:"0.3",World:o["default"],world:i.world,Controls:s["default"],Layer:l["default"],layer:u.layer,EnvironmentLayer:f["default"],environmentLayer:c.environmentLayer,ImageTileLayer:p["default"],imageTileLayer:h.imageTileLayer,GeoJSONTileLayer:v["default"],geoJSONTileLayer:d.geoJSONTileLayer,TopoJSONTileLayer:_["default"],topoJSONTileLayer:y.topoJSONTileLayer,GeoJSONLayer:g["default"],geoJSONLayer:m.geoJSONLayer,TopoJSONLayer:w["default"],topoJSONLayer:b.topoJSONLayer,PolygonLayer:k["default"],polygonLayer:x.polygonLayer,PolylineLayer:O["default"],polylineLayer:M.polylineLayer,PointLayer:P["default"],pointLayer:E.pointLayer,Point:j["default"],point:T.point,LatLon:C["default"],latLon:S.latLon};t["default"]=A,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(2),l=r(u),c=n(3),f=r(c),h=n(6),p=r(h),d=n(11),v=n(10),y=n(23),_=r(y),m=n(36),g=r(m),b=function(e){function t(e,n){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var r={crs:p["default"].EPSG3857,skybox:!1};this.options=(0,f["default"])({},r,n),this._layers=[],this._controls=[],this._initContainer(e),this._initEngine(),this._initEnvironment(),this._initEvents(),this._pause=!1,this._update()}return o(t,e),a(t,[{key:"_initContainer",value:function(e){this._container=document.getElementById(e)}},{key:"_initEngine",value:function(){this._engine=new _["default"](this._container,this)}},{key:"_initEnvironment",value:function(){this._environment=new g["default"]({skybox:this.options.skybox}).addTo(this)}},{key:"_initEvents",value:function(){this.on("controlsMoveEnd",this._onControlsMoveEnd)}},{key:"_onControlsMoveEnd",value:function(e){var t=(0,d.point)(e.x,e.z);this._resetView(this.pointToLatLon(t),t)}},{key:"_resetView",value:function(e,t){this.emit("preResetView"),this._moveStart(),this._move(e,t),this._moveEnd(),this.emit("postResetView")}},{key:"_moveStart",value:function(){this.emit("moveStart")}},{key:"_move",value:function(e,t){this._lastPosition=e,this.emit("move",e,t)}},{key:"_moveEnd",value:function(){this.emit("moveEnd")}},{key:"_update",value:function(){if(!this._pause){var e=this._engine.clock.getDelta();window.requestAnimationFrame(this._update.bind(this)),this._controls.forEach(function(e){e.update()}),this.emit("preUpdate",e),this._engine.update(e),this.emit("postUpdate",e)}}},{key:"setView",value:function(e){return this._originLatlon=e,this._originPoint=this.project(e),this._resetView(e),this}},{key:"getPosition",value:function(){return this._lastPosition}},{key:"project",value:function(e){return this.options.crs.latLonToPoint((0,v.latLon)(e))}},{key:"unproject",value:function(e){return this.options.crs.pointToLatLon((0,d.point)(e))}},{key:"latLonToPoint",value:function(e){var t=this.project((0,v.latLon)(e));return t._subtract(this._originPoint)}},{key:"pointToLatLon",value:function(e){var t=(0,d.point)(e).add(this._originPoint);return this.unproject(t)}},{key:"pointScale",value:function(e,t){return this.options.crs.pointScale(e,t)}},{key:"metresToWorld",value:function(e,t,n){return this.options.crs.metresToWorld(e,t,n)}},{key:"worldToMetres",value:function(e,t,n){return this.options.crs.worldToMetres(e,t,n)}},{key:"getCamera",value:function(){return this._engine._camera}},{key:"addLayer",value:function(e){return e._addToWorld(this),this._layers.push(e),e.isOutput()&&(this._engine._scene.add(e._object3D),this._engine._domScene3D.add(e._domObject3D),this._engine._domScene2D.add(e._domObject2D)),this.emit("layerAdded",e),this}},{key:"removeLayer",value:function(e){var t=this._layers.indexOf(e);return t>-1&&this._layers.splice(t,1),e.isOutput()&&(this._engine._scene.remove(e._object3D),this._engine._domScene3D.remove(e._domObject3D),this._engine._domScene2D.remove(e._domObject2D)),this.emit("layerRemoved"),this}},{key:"addControls",value:function(e){return e._addToWorld(this),this._controls.push(e),this.emit("controlsAdded",e),this}},{key:"removeControls",value:function(e){var t=this._controls.indexOf(t);return t>-1&&this._controls.splice(t,1),this.emit("controlsRemoved",e),this}},{key:"stop",value:function(){this._pause=!0}},{key:"start",value:function(){this._pause=!1,this._update()}},{key:"destroy",value:function(){this.stop(),this.off("controlsMoveEnd",this._onControlsMoveEnd);var e,t;for(e=this._controls.length-1;e>=0;e--)t=this._controls[0],this.removeControls(t),t.destroy();var n;for(e=this._layers.length-1;e>=0;e--)n=this._layers[0],this.removeLayer(n),n.destroy();this._environment=null,this._engine.destroy(),this._engine=null,this._container=null}}]),t}(l["default"]);t["default"]=b;var w=function(e,t){return new b(e,t)};t.world=w},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events&&this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);a>i;i++)s[i]=r[i].fn;return s},i.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events||!this._events[s])return!1;var u,l,c=this._events[s],f=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,a),!0}for(l=1,u=new Array(f-1);f>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var h,p=c.length;for(l=0;p>l;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;default:if(!u)for(h=1,u=new Array(f-1);f>h;h++)u[h-1]=arguments[h];c[l].fn.apply(c[l].context,u)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events||!this._events[i])return this;var a=this._events[i],s=[];if(t)if(a.fn)(a.fn!==t||r&&!a.once||n&&a.context!==n)&&s.push(a);else for(var u=0,l=a.length;l>u;u++)(a[u].fn!==t||r&&!a[u].once||n&&a[u].context!==n)&&s.push(a[u]);return s.length?this._events[i]=1===s.length?s[0]:s:delete this._events[i],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[o?o+e:e]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},function(e,t,n){function r(e,t){return e="number"==typeof e||b.test(e)?+e:-1,t=null==t?_:t,e>-1&&e%1==0&&t>e}function i(e,t,n){var r=e[t];(!c(r,n)||c(r,w[t])&&!x.call(e,t)||void 0===n&&!(t in e))&&(e[t]=n)}function o(e){return function(t){return null==t?void 0:t[e]}}function a(e,t,n){return s(e,t,n)}function s(e,t,n,r){n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=r?r(n[s],e[s],s,n,e):e[s];i(n,s,u)}return n}function u(e){return y(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o="function"==typeof o?(i--,o):void 0,a&&l(n[0],n[1],a)&&(o=3>i?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}function l(e,t,n){if(!d(n))return!1;var i=typeof t;return("number"==i?f(n)&&r(t,n.length):"string"==i&&t in n)?c(n[t],e):!1}function c(e,t){return e===t||e!==e&&t!==t}function f(e){return null!=e&&!("function"==typeof e&&h(e))&&p(M(e))}function h(e){var t=d(e)?k.call(e):"";return t==m||t==g}function p(e){return"number"==typeof e&&e>-1&&e%1==0&&_>=e}function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var v=n(4),y=n(5),_=9007199254740991,m="[object Function]",g="[object GeneratorFunction]",b=/^(?:0|[1-9]\d*)$/,w=Object.prototype,x=w.hasOwnProperty,k=w.toString,M=o("length"),O=u(function(e,t){a(t,v(t),e)});e.exports=O},function(e,t){function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function r(e,t){return e="number"==typeof e||k.test(e)?+e:-1,t=null==t?m:t,e>-1&&e%1==0&&t>e}function i(e,t){return O.call(e,t)||"object"==typeof e&&t in e&&null===P(e)}function o(e){return j(Object(e))}function a(e){return function(t){return null==t?void 0:t[e]}}function s(e){var t=e?e.length:void 0;return p(t)&&(C(e)||y(e)||l(e))?n(t,String):null}function u(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||M;return e===n}function l(e){return f(e)&&O.call(e,"callee")&&(!T.call(e,"callee")||E.call(e)==g)}function c(e){return null!=e&&!("function"==typeof e&&h(e))&&p(S(e))}function f(e){return v(e)&&c(e)}function h(e){var t=d(e)?E.call(e):"";return t==b||t==w}function p(e){return"number"==typeof e&&e>-1&&e%1==0&&m>=e}function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){return!!e&&"object"==typeof e}function y(e){return"string"==typeof e||!C(e)&&v(e)&&E.call(e)==x}function _(e){var t=u(e);if(!t&&!c(e))return o(e);var n=s(e),a=!!n,l=n||[],f=l.length;for(var h in e)!i(e,h)||a&&("length"==h||r(h,f))||t&&"constructor"==h||l.push(h);return l}var m=9007199254740991,g="[object Arguments]",b="[object Function]",w="[object GeneratorFunction]",x="[object String]",k=/^(?:0|[1-9]\d*)$/,M=Object.prototype,O=M.hasOwnProperty,E=M.toString,P=Object.getPrototypeOf,T=M.propertyIsEnumerable,j=Object.keys,S=a("length"),C=Array.isArray;e.exports=_},function(e,t){function n(e,t,n){var r=n.length;switch(r){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function r(e,t){if("function"!=typeof e)throw new TypeError(u);return t=w(void 0===t?e.length-1:a(t),0),function(){for(var r=arguments,i=-1,o=w(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,r[0],a);case 2:return e.call(this,r[0],r[1],a)}var s=Array(t+1);for(i=-1;++i<t;)s[i]=r[i];return s[t]=a,n(e,this,s)}}function i(e){var t=o(e)?b.call(e):"";return t==h||t==p}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){if(!e)return 0===e?e:0;if(e=s(e),e===l||e===-l){var t=0>e?-1:1;return t*c}var n=e%1;return e===e?n?e-n:e:0}function s(e){if(o(e)){var t=i(e.valueOf)?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=y.test(e);return n||_.test(e)?m(e.slice(2),n?2:8):v.test(e)?f:+e}var u="Expected a function",l=1/0,c=1.7976931348623157e308,f=NaN,h="[object Function]",p="[object GeneratorFunction]",d=/^\s+|\s+$/g,v=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,_=/^0o[0-7]+$/i,m=parseInt,g=Object.prototype,b=g.toString,w=Math.max;e.exports=r},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),o=r(i),a=n(15),s=r(a),u=n(17),l=r(u),c=n(19),f=r(c),h=n(20),p=r(h),d={};d.EPSG3857=o["default"],d.EPSG900913=i.EPSG900913,d.EPSG3395=s["default"],d.EPSG4326=l["default"],d.Simple=f["default"],d.Proj4=p["default"],t["default"]=d,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(13),l=r(u),c=n(14),f=r(c),h={code:"EPSG:3857",projection:l["default"],transformScale:1/(Math.PI*l["default"].R),transformation:function(){var e=1/(Math.PI*l["default"].R);return new f["default"](e,0,-e,0)}()},p=(0,o["default"])({},s["default"],h),d=(0,o["default"])({},p,{code:"EPSG:900913"});t.EPSG900913=d,t["default"]=p},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(9),s=r(a),u=(n(10),{wrapLon:[-180,180],R:6378137,distance:function(e,t,n){var r,i,o,a=Math.PI/180;if(n){r=e.lat*a,i=t.lat*a;var s=e.lon*a,u=t.lon*a,l=i-r,c=u-s,f=l/2,h=c/2;o=Math.sin(f)*Math.sin(f)+Math.cos(r)*Math.cos(i)*Math.sin(h)*Math.sin(h);var p=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o));return this.R*p}return r=e.lat*a,i=t.lat*a,o=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lon-e.lon)*a),this.R*Math.acos(Math.min(o,1))},pointScale:function(e,t){return this.projection.pointScale?this.projection.pointScale(e,t):[1,1]},metresToProjected:function(e,t){return e*t[1]},projectedToMetres:function(e,t){return e/t[1]},metresToWorld:function(e,t,n){var r=this.metresToProjected(e,t),i=this.scale(n);n&&(i/=2);var o=i*(this.transformScale*r);return n&&(o/=t[1]),o},worldToMetres:function(e,t,n){var r=this.scale(n);n&&(r/=2);var i=e/r/this.transformScale,o=this.projectedToMetres(i,t);return n&&(o*=t[1]),o}});t["default"]=(0,o["default"])({},s["default"],u),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(10),o=n(11),a=n(12),s=r(a),u={scaleFactor:1e6,latLonToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return t&&(r/=2),this.transformation._transform(n,r)},pointToLatLon:function(e,t){var n=this.scale(t);t&&(n/=2);var r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return e>=0?256*Math.pow(2,e):this.scaleFactor},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);e&&(n/=2);var r=this.transformation.transform((0,o.point)(t[0]),n),i=this.transformation.transform((0,o.point)(t[1]),n);return[r,i]},wrapLatLon:function(e){var t=this.wrapLat?(0,s["default"])(e.lat,this.wrapLat,!0):e.lat,n=this.wrapLon?(0,s["default"])(e.lon,this.wrapLon,!0):e.lon,r=e.alt;return(0,i.latLon)(t,n,r)}};t["default"]=u,e.exports=t["default"]},function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,r,i){if(n(this,e),isNaN(t)||isNaN(r))throw new Error("Invalid LatLon object: ("+t+", "+r+")");this.lat=+t,this.lon=+r,void 0!==i&&(this.alt=+i)}return r(e,[{key:"clone",value:function(){return new e(this.lat,this.lon,this.alt)}}]),e}();t["default"]=i;var o=function(e,t,n){return e instanceof i?e:Array.isArray(e)&&"object"!=typeof e[0]?3===e.length?new i(e[0],e[1],e[2]):2===e.length?new i(e[0],e[1]):null:void 0===e||null===e?e:"object"==typeof e&&"lat"in e?new i(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new i(e,t,n)};t.latLon=o},function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,r,i){n(this,e),this.x=i?Math.round(t):t,this.y=i?Math.round(r):r}return r(e,[{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"add",value:function(e){return this.clone()._add(o(e))}},{key:"_add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"subtract",value:function(e){return this.clone()._subtract(o(e))}},{key:"_subtract",value:function(e){return this.x-=e.x,this.y-=e.y,this}}]),e}();t["default"]=i;var o=function(e,t,n){return e instanceof i?e:Array.isArray(e)?new i(e[0],e[1]):void 0===e||null===e?e:new i(e,t,n)};t.point=o},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var r=t[1],i=t[0],o=r-i;return e===r&&n?e:((e-i)%o+o)%o+i};t["default"]=n,e.exports=t["default"]},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(11),o={R:6378137,MAX_LATITUDE:85.0511287798,ECC:.081819191,ECC2:.006694380015894481,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),o=Math.sin(r*t);return(0,i.point)(this.R*e.lon*t,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(e){var t=180/Math.PI;return(0,r.latLon)((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},pointScale:function(e,t){var n,r=Math.PI/180;if(t){var i=e.lat*r,o=(e.lon*r,this.R),a=Math.sin(i),s=a*a,u=Math.cos(i),l=o*(1-this.ECC2)/Math.pow(1-this.ECC2*s,1.5),c=o/Math.sqrt(1-this.ECC2*s),f=o/l/u;return n=o/c/u,[n,f]}return n=1/Math.cos(e.lat*r),[n,n]},bounds:function(){var e=6378137*Math.PI;return[[-e,-e],[e,e]]}()};t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(11),a=function(){function e(t,n,i,o){r(this,e),this._a=t,this._b=n,this._c=i,this._d=o}return i(e,[{key:"transform",value:function(e,t){return this._transform(e.clone(),t)}},{key:"_transform",value:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e}},{key:"untransform",value:function(e,t){return t=t||1,(0,o.point)((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}}]),e}();t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(16),l=r(u),c=n(14),f=r(c),h={code:"EPSG:3395",projection:l["default"],transformScale:1/(Math.PI*l["default"].R),transformation:function(){var e=1/(Math.PI*l["default"].R);return new f["default"](e,0,-e,0)}()},p=(0,o["default"])({},s["default"],h);t["default"]=p,e.exports=t["default"]},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(11),o={R:6378137,R_MINOR:6356752.314245179,ECC:.081819191,ECC2:.006694380015894481,project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,o=this.R_MINOR/n,a=Math.sqrt(1-o*o),s=a*Math.sin(r),u=Math.tan(Math.PI/4-r/2)/Math.pow((1-s)/(1+s),a/2);return r=-n*Math.log(Math.max(u,1e-10)),(0,i.point)(e.lon*t*n,r)},unproject:function(e){for(var t,n=180/Math.PI,i=this.R,o=this.R_MINOR/i,a=Math.sqrt(1-o*o),s=Math.exp(-e.y/i),u=Math.PI/2-2*Math.atan(s),l=0,c=.1;15>l&&Math.abs(c)>1e-7;l++)t=a*Math.sin(u),t=Math.pow((1-t)/(1+t),a/2),c=Math.PI/2-2*Math.atan(s*t)-u,u+=c;return(0,r.latLon)(u*n,e.x*n/i)},pointScale:function(e){var t=Math.PI/180,n=e.lat*t,r=Math.sin(n),i=r*r,o=Math.cos(n),a=Math.sqrt(1-this.ECC2*i)/o;return[a,a]},bounds:[[-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]]};t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(18),l=r(u),c=n(14),f=r(c),h={code:"EPSG:4326",projection:l["default"],transformScale:1/180,transformation:new f["default"](1/180,0,-1/180,0)},p=(0,o["default"])({},s["default"],h);t["default"]=p,e.exports=t["default"]},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(11),o={project:function(e){return(0,i.point)(e.lon,e.lat)},unproject:function(e){return(0,r.latLon)(e.y,e.x)},pointScale:function(e){var t=111132.92,n=-559.82,r=1.175,i=-.0023,o=111412.84,a=-93.5,s=.118,u=Math.PI/180,l=e.lat*u,c=t+n*Math.cos(2*l)+r*Math.cos(4*l)+i*Math.cos(6*l),f=o*Math.cos(l)+a*Math.cos(3*l)+s*Math.cos(5*l);return[1/c,1/f]},bounds:[[-180,-90],[180,90]]};t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(9),s=r(a),u=n(18),l=r(u),c=n(14),f=r(c),h={projection:l["default"],transformation:new f["default"](1,0,1,0),scale:function(e){return e?Math.pow(2,e):1},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lon-e.lon,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0},p=(0,o["default"])({},s["default"],h);t["default"]=p,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(21),l=r(u),c=n(14),f=r(c),h=function(e,t,n){var r=(0,l["default"])(t,n),i=r.bounds[1][0]-r.bounds[0][0],o=r.bounds[1][1]-r.bounds[0][1],a=i/2,s=o/2,u=1/a,c=1/s,h=Math.min(u,c),p=h*(r.bounds[0][0]+a),d=h*(r.bounds[0][1]+s);return{code:e,projection:r,transformScale:h,transformation:new f["default"](h,-p,-h,d)}},p=function(e,t,n){return(0,o["default"])({},s["default"],h(e,t,n))};t["default"]=p,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(22),o=r(i),a=n(10),s=n(11),u=function(e,t){var n=(0,o["default"])(e),r=function(e){return(0,s.point)(n.forward([e.lon,e.lat]))},i=function(e){var t=n.inverse([e.x,e.y]);return(0,a.latLon)(t[1],t[0])};return{project:r,unproject:i,pointScale:function(e,t){return[1,1]},bounds:function(){if(t)return t;var e=r([-90,-180]),n=r([90,180]);return[e,n]}()}};t["default"]=u,e.exports=t["default"]},function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE_22__},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(2),l=r(u),c=n(24),f=r(c),h=n(25),p=r(h),d=n(26),v=r(d),y=n(27),_=r(y),m=n(28),g=r(m),b=n(29),w=r(b),x=n(31),k=r(x),M=n(33),O=r(M),E=n(34),P=r(E),T=function(e){function t(e,n){i(this,t),console.log("Init Engine"),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._world=n,this._scene=p["default"],this._domScene3D=v["default"],this._domScene2D=_["default"],this._renderer=(0,g["default"])(e),this._domRenderer3D=(0,w["default"])(e),this._domRenderer2D=(0,k["default"])(e),this._camera=(0,O["default"])(e),this._picking=(0,P["default"])(this._world,this._renderer,this._camera),this.clock=new f["default"].Clock,this._frustum=new f["default"].Frustum}return o(t,e),a(t,[{key:"update",value:function(e){this.emit("preRender"),this._renderer.render(this._scene,this._camera),this._domRenderer3D.render(this._domScene3D,this._camera),this._domRenderer2D.render(this._domScene2D,this._camera),this.emit("postRender")}},{key:"destroy",value:function(){for(var e,t=this._scene.children.length-1;t>=0;t--)e=this._scene.children[t],e&&(this._scene.remove(e),e.geometry&&(e.geometry.dispose(),e.geometry=null),e.material&&(e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null));for(var t=this._domScene3D.children.length-1;t>=0;t--)e=this._domScene3D.children[t],e&&this._domScene3D.remove(e);for(var t=this._domScene2D.children.length-1;t>=0;t--)e=this._domScene2D.children[t],e&&this._domScene2D.remove(e);this._picking.destroy(),this._picking=null,this._world=null,this._scene=null,this._domScene3D=null,this._domScene2D=null,this._renderer=null,this._domRenderer3D=null,this._domRenderer2D=null,this._camera=null,this._clock=null,this._frustum=null}}]),t}(l["default"]);t["default"]=T,e.exports=t["default"]},function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE_24__},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(){var e=new o["default"].Scene;return e}(),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(){var e=new o["default"].Scene;return e}(),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(){var e=new o["default"].Scene;return e}(),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=n(25);r(a);t["default"]=function(e){var t=new o["default"].WebGLRenderer({antialias:!0});t.setClearColor(16777215,1),t.setPixelRatio(window.devicePixelRatio),t.gammaInput=!0,t.gammaOutput=!0,t.shadowMap.enabled=!0,t.shadowMap.cullFace=o["default"].CullFaceBack,e.appendChild(t.domElement);var n=function(){t.setSize(e.clientWidth,e.clientHeight)};return window.addEventListener("resize",n,!1),n(),t},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=(r(i),n(30)),a=n(26);r(a);t["default"]=function(e){var t=new o.CSS3DRenderer;t.domElement.style.position="absolute",t.domElement.style.top=0,e.appendChild(t.domElement);var n=function(){t.setSize(e.clientWidth,e.clientHeight)};return window.addEventListener("resize",n,!1),n(),t},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=function(e){o["default"].Object3D.call(this),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",function(e){null!==this.element.parentNode&&this.element.parentNode.removeChild(this.element)})};a.prototype=Object.create(o["default"].Object3D.prototype),a.prototype.constructor=a;var s=function(e){a.call(this,e)};s.prototype=Object.create(a.prototype),s.prototype.constructor=s;var u=function(){console.log("THREE.CSS3DRenderer",o["default"].REVISION);var e,t,n,r,i=new o["default"].Matrix4,u={camera:{fov:0,style:""},objects:{}},l=document.createElement("div");l.style.overflow="hidden",l.style.WebkitTransformStyle="preserve-3d",l.style.MozTransformStyle="preserve-3d",l.style.oTransformStyle="preserve-3d",l.style.transformStyle="preserve-3d",this.domElement=l;var c=document.createElement("div");c.style.WebkitTransformStyle="preserve-3d",c.style.MozTransformStyle="preserve-3d",c.style.oTransformStyle="preserve-3d",c.style.transformStyle="preserve-3d",l.appendChild(c),this.setClearColor=function(){},this.getSize=function(){return{width:e,height:t}},this.setSize=function(i,o){e=i,t=o,n=e/2,r=t/2,l.style.width=i+"px",l.style.height=o+"px",c.style.width=i+"px",c.style.height=o+"px"};var f=function(e){return Math.abs(e)<Number.EPSILON?0:e},h=function(e){var t=e.elements;return"matrix3d("+f(t[0])+","+f(-t[1])+","+f(t[2])+","+f(t[3])+","+f(t[4])+","+f(-t[5])+","+f(t[6])+","+f(t[7])+","+f(t[8])+","+f(-t[9])+","+f(t[10])+","+f(t[11])+","+f(t[12])+","+f(-t[13])+","+f(t[14])+","+f(t[15])+")"},p=function(e){var t=e.elements;return"translate3d(-50%,-50%,0) matrix3d("+f(t[0])+","+f(t[1])+","+f(t[2])+","+f(t[3])+","+f(-t[4])+","+f(-t[5])+","+f(-t[6])+","+f(-t[7])+","+f(t[8])+","+f(t[9])+","+f(t[10])+","+f(t[11])+","+f(t[12])+","+f(t[13])+","+f(t[14])+","+f(t[15])+")"},d=function v(e,t){if(e instanceof a){var n;e instanceof s?(i.copy(t.matrixWorldInverse),i.transpose(),i.copyPosition(e.matrixWorld),i.scale(e.scale),i.elements[3]=0,i.elements[7]=0,i.elements[11]=0,i.elements[15]=1,n=p(i)):n=p(e.matrixWorld);var r=e.element,o=u.objects[e.id];(void 0===o||o!==n)&&(r.style.WebkitTransform=n,r.style.MozTransform=n,r.style.oTransform=n,r.style.transform=n,u.objects[e.id]=n),r.parentNode!==c&&c.appendChild(r)}for(var l=0,f=e.children.length;f>l;l++)v(e.children[l],t)};this.render=function(e,i){var a=.5/Math.tan(o["default"].Math.degToRad(.5*i.fov))*t;u.camera.fov!==a&&(l.style.WebkitPerspective=a+"px",l.style.MozPerspective=a+"px",l.style.oPerspective=a+"px",l.style.perspective=a+"px",u.camera.fov=a),e.updateMatrixWorld(),null===i.parent&&i.updateMatrixWorld(),i.matrixWorldInverse.getInverse(i.matrixWorld);var s="translate3d(0,0,"+a+"px)"+h(i.matrixWorldInverse)+" translate3d("+n+"px,"+r+"px, 0)";u.camera.style!==s&&(c.style.WebkitTransform=s,c.style.MozTransform=s,c.style.oTransform=s,c.style.transform=s,u.camera.style=s),d(e,i)}};t.CSS3DObject=a,t.CSS3DSprite=s,t.CSS3DRenderer=u,o["default"].CSS3DObject=a,o["default"].CSS3DSprite=s,o["default"].CSS3DRenderer=u},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=(r(i),n(32)),a=n(27);r(a);t["default"]=function(e){var t=new o.CSS2DRenderer;t.domElement.style.position="absolute",t.domElement.style.top=0,e.appendChild(t.domElement);var n=function(){t.setSize(e.clientWidth,e.clientHeight);
};return window.addEventListener("resize",n,!1),n(),t},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=function(e){o["default"].Object3D.call(this),this.element=e,this.element.style.position="absolute",this.addEventListener("removed",function(e){null!==this.element.parentNode&&this.element.parentNode.removeChild(this.element)})};a.prototype=Object.create(o["default"].Object3D.prototype),a.prototype.constructor=a;var s=function(){console.log("THREE.CSS2DRenderer",o["default"].REVISION);var e,t,n,r,i=new o["default"].Vector3,s=new o["default"].Matrix4,u=new o["default"].Matrix4,l=document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.setSize=function(i,o){e=i,t=o,n=e/2,r=t/2,l.style.width=i+"px",l.style.height=o+"px"};var c=function f(e,t){if(e instanceof a){i.setFromMatrixPosition(e.matrixWorld),i.applyProjection(u);var o=e.element,s="translate(-50%,-50%) translate("+(i.x*n+n)+"px,"+(-i.y*r+r)+"px)";o.style.WebkitTransform=s,o.style.MozTransform=s,o.style.oTransform=s,o.style.transform=s,o.parentNode!==l&&l.appendChild(o)}for(var c=0,h=e.children.length;h>c;c++)f(e.children[c],t)};this.render=function(e,t){e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),s.copy(t.matrixWorldInverse.getInverse(t.matrixWorld)),u.multiplyMatrices(t.projectionMatrix,s),c(e,t)}};t.CSS2DObject=a,t.CSS2DRenderer=s,o["default"].CSS2DObject=a,o["default"].CSS2DRenderer=s},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(e){var t=new o["default"].PerspectiveCamera(45,1,1,2e5);t.position.y=400,t.position.z=400;var n=function(){t.aspect=e.clientWidth/e.clientHeight,t.updateProjectionMatrix()};return window.addEventListener("resize",n,!1),n(),t},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(24),s=r(a),u=n(11),l=n(35),c=r(l),f=1,h=function(){function e(t,n,r){i(this,e),this._world=t,this._renderer=n,this._camera=r,this._raycaster=new s["default"].Raycaster,this._raycaster.linePrecision=3,this._pickingScene=c["default"],this._pickingTexture=new s["default"].WebGLRenderTarget,this._pickingTexture.texture.minFilter=s["default"].LinearFilter,this._pickingTexture.texture.generateMipmaps=!1,this._nextId=1,this._resizeTexture(),this._initEvents()}return o(e,[{key:"_initEvents",value:function(){window.addEventListener("resize",this._resizeTexture.bind(this),!1),this._world._container.addEventListener("mouseup",this._onMouseUp.bind(this),!1),this._world.on("move",this._onWorldMove,this)}},{key:"_onMouseUp",value:function(e){if(0===e.button){var t=(0,u.point)(e.clientX,e.clientY),n=(0,u.point)(0,0);n.x=t.x/this._width*2-1,n.y=2*-(t.y/this._height)+1,this._pick(t,n)}}},{key:"_onWorldMove",value:function(){this._needUpdate=!0}},{key:"_resizeTexture",value:function(){var e=this._renderer.getSize();this._width=e.width,this._height=e.height,this._pickingTexture.setSize(this._width,this._height),this._pixelBuffer=new Uint8Array(4*this._width*this._height),this._needUpdate=!0}},{key:"_update",value:function(){if(this._needUpdate){var e=this._pickingTexture;this._renderer.render(this._pickingScene,this._camera,this._pickingTexture),this._renderer.readRenderTargetPixels(e,0,0,e.width,e.height,this._pixelBuffer),this._needUpdate=!1}}},{key:"_pick",value:function(e,t){this._update();var n=e.x+(this._pickingTexture.height-e.y)*this._pickingTexture.width,r=255*this._pixelBuffer[4*n+2]*255+255*this._pixelBuffer[4*n+1]+this._pixelBuffer[4*n+0];if(16646655!==r){this._raycaster.setFromCamera(t,this._camera);var i,o=this._raycaster.intersectObjects(this._pickingScene.children,!0),a=e.clone();o.length>0&&(i=o[0].point.clone()),this._world.emit("pick",r,a,i,o),this._world.emit("pick-"+r,a,i,o)}}},{key:"add",value:function(e){this._pickingScene.add(e),this._needUpdate=!0}},{key:"remove",value:function(e){this._pickingScene.remove(e),this._needUpdate=!0}},{key:"getNextId",value:function(){return f++}},{key:"destroy",value:function(){if(window.removeEventListener("resize",this._resizeTexture,!1),this._renderer.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this._world.off("move",this._onWorldMove),this._pickingScene.children)for(var e,t=this._pickingScene.children.length-1;t>=0;t--)e=this._pickingScene.children[t],e&&(this._pickingScene.remove(e),e.material&&(e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null));this._pickingScene=null,this._pickingTexture=null,this._pixelBuffer=null,this._world=null,this._renderer=null,this._camera=null}}]),e}();t["default"]=function(e,t,n){return new h(e,t,n)},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(){var e=new o["default"].Scene;return e}(),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(37),l=r(u),c=n(3),f=r(c),h=n(24),p=r(h),d=n(38),v=r(d),y=function(e){function t(e){i(this,t);var n={skybox:!1},r=(0,f["default"])({},n,e);s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,r)}return o(t,e),a(t,[{key:"_onAdd",value:function(){this._initLights(),this._options.skybox&&this._initSkybox()}},{key:"_initLights",value:function(){if(this._options.skybox){this._skyboxLight=new p["default"].DirectionalLight(16777215,1),this._skyboxLight.castShadow=!0;var e=1e3;this._skyboxLight.shadow.camera.left=-e,this._skyboxLight.shadow.camera.right=e,this._skyboxLight.shadow.camera.top=e,this._skyboxLight.shadow.camera.bottom=-e,this._skyboxLight.shadow.camera.near=1e4,this._skyboxLight.shadow.camera.far=7e4,this._skyboxLight.shadow.mapSize.width=2048,this._skyboxLight.shadow.mapSize.height=2048,this.add(this._skyboxLight)}else{var t=new p["default"].DirectionalLight(16777215,1);t.position.x=1e3,t.position.y=1e3,t.position.z=1e3;var n=new p["default"].DirectionalLight(16777215,.5);n.position.x=-1e3,n.position.y=1e3,n.position.z=-1e3,this.add(t),this.add(n)}}},{key:"_initSkybox",value:function(){this._skybox=new v["default"](this._world,this._skyboxLight),this.add(this._skybox._mesh)}},{key:"_initGrid",value:function(){var e=4e3,t=100,n=new p["default"].GridHelper(e,t);this.add(n)}},{key:"destroy",value:function(){this._skyboxLight=null,this.remove(this._skybox._mesh),this._skybox.destroy(),this._skybox=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=y;var _=function(e){return new y(e)};t.environmentLayer=_},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(2),l=r(u),c=n(3),f=r(c),h=n(24),p=r(h),d=n(25),v=(r(d),n(30)),y=n(32),_=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var n={output:!0};this._options=(0,f["default"])({},n,e),this.isOutput()&&(this._object3D=new p["default"].Object3D,this._dom3D=document.createElement("div"),this._domObject3D=new v.CSS3DObject(this._dom3D),this._dom2D=document.createElement("div"),this._domObject2D=new y.CSS2DObject(this._dom2D))}return o(t,e),a(t,[{key:"add",value:function(e){this._object3D.add(e)}},{key:"remove",value:function(e){this._object3D.remove(e)}},{key:"addDOM3D",value:function(e){this._domObject3D.add(e)}},{key:"removeDOM3D",value:function(e){this._domObject3D.remove(e)}},{key:"addDOM2D",value:function(e){this._domObject2D.add(e)}},{key:"removeDOM2D",value:function(e){this._domObject2D.remove(e)}},{key:"addTo",value:function(e){return e.addLayer(this),this}},{key:"_addToWorld",value:function(e){this._world=e,this._onAdd(e),this.emit("added")}},{key:"_onAdd",value:function(e){}},{key:"getPickingId",value:function(){return this._world._engine._picking?this._world._engine._picking.getNextId():!1}},{key:"addToPicking",value:function(e){this._world._engine._picking&&this._world._engine._picking.add(e)}},{key:"removeFromPicking",value:function(e){this._world._engine._picking&&this._world._engine._picking.remove(e)}},{key:"isOutput",value:function(){return this._options.output}},{key:"destroy",value:function(){if(this._object3D&&this._object3D.children)for(var e,t=this._object3D.children.length-1;t>=0;t--)e=this._object3D.children[t],e&&(this.remove(e),e.geometry&&(e.geometry.dispose(),e.geometry=null),e.material&&(e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null));if(this._domObject3D&&this._domObject3D.children)for(var e,t=this._domObject3D.children.length-1;t>=0;t--)e=this._domObject3D.children[t],e&&this.removeDOM3D(e);if(this._domObject2D&&this._domObject2D.children)for(var e,t=this._domObject2D.children.length-1;t>=0;t--)e=this._domObject2D.children[t],e&&this.removeDOM2D(e);this._domObject3D=null,this._domObject2D=null,this._world=null,this._object3D=null}}]),t}(l["default"]);t["default"]=_;var m=function(e){return new _(e)};t.layer=m},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(24),s=r(a),u=n(39),l=r(u),c=n(40),f=r(c),h={vertexShader:["varying vec3 vPosition;","void main() {","vPosition = position;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform samplerCube cubemap;","varying vec3 vPosition;","void main() {","gl_FragColor = textureCube(cubemap, normalize(vPosition));","}"].join("\n")},p=function(){function e(t,n){i(this,e),this._world=t,this._light=n,this._settings={distance:38e3,turbidity:10,reileigh:2,mieCoefficient:.005,mieDirectionalG:.8,luminance:1,inclination:.48,azimuth:.25},this._initSkybox(),this._updateUniforms(),this._initEvents()}return o(e,[{key:"_initEvents",value:function(){this._throttledWorldUpdate=(0,f["default"])(this._update,100),this._world.on("preUpdate",this._throttledWorldUpdate,this)}},{key:"_initSkybox",value:function(){this._cubeCamera=new s["default"].CubeCamera(1,2e6,128);var e=this._cubeCamera.renderTarget;this._sky=new l["default"],this._skyScene=new s["default"].Scene,this._skyScene.add(this._sky.mesh),this._sunSphere=new s["default"].Mesh(new s["default"].SphereBufferGeometry(2e3,16,8),new s["default"].MeshBasicMaterial({color:16777215}));var t={cubemap:{type:"t",value:e}},n=new s["default"].ShaderMaterial({uniforms:t,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,side:s["default"].BackSide});this._mesh=new s["default"].Mesh(new s["default"].BoxGeometry(19e4,19e4,19e4),n),this._updateSkybox=!0}},{key:"_updateUniforms",value:function(){var e=this._settings,t=this._sky.uniforms;t.turbidity.value=e.turbidity,t.reileigh.value=e.reileigh,t.luminance.value=e.luminance,t.mieCoefficient.value=e.mieCoefficient,t.mieDirectionalG.value=e.mieDirectionalG;var n=Math.PI*(e.inclination-.5),r=2*Math.PI*(e.azimuth-.5);this._sunSphere.position.x=e.distance*Math.cos(r),this._sunSphere.position.y=e.distance*Math.sin(r)*Math.sin(n),this._sunSphere.position.z=e.distance*Math.sin(r)*Math.cos(n),this._light.position.copy(this._sunSphere.position),this._sky.uniforms.sunPosition.value.copy(this._sunSphere.position)}},{key:"_update",value:function(e){this._updateSkybox&&(this._updateSkybox=!1,this._light.intensity=1-.95*(this._settings.inclination/.5),this._updateUniforms(),this._cubeCamera.updateCubeMap(this._world._engine._renderer,this._skyScene))}},{key:"getRenderTarget",value:function(){return this._cubeCamera.renderTarget}},{key:"setInclination",value:function(e){this._settings.inclination=e,this._updateSkybox=!0}},{key:"destroy",value:function(){this._world.off("preUpdate",this._throttledWorldUpdate),this._throttledWorldUpdate=null,this._world=null,this._light=null,this._cubeCamera=null,this._sky.mesh.geometry.dispose(),this._sky.mesh.geometry=null,this._sky.mesh.material.map&&(this._sky.mesh.material.map.dispose(),this._sky.mesh.material.map=null),this._sky.mesh.material.dispose(),this._sky.mesh.material=null,this._sky.mesh=null,this._sky=null,this._skyScene=null,this._sunSphere.geometry.dispose(),this._sunSphere.geometry=null,this._sunSphere.material.map&&(this._sunSphere.material.map.dispose(),this._sunSphere.material.map=null),this._sunSphere.material.dispose(),this._sunSphere.material=null,this._sunSphere=null,this._mesh.geometry.dispose(),this._mesh.geometry=null,this._mesh.material.map&&(this._mesh.material.map.dispose(),this._mesh.material.map=null),this._mesh.material.dispose(),this._mesh.material=null}}]),e}();t["default"]=p;var d=function(e,t){return new p(e,t)};t.skybox=d},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);o["default"].ShaderLib.sky={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},sunPosition:{type:"v3",value:new o["default"].Vector3}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 sunPosition;","varying vec3 vWorldPosition;","vec3 cameraPos = vec3(0., 0., 0.);","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const vec3 up = vec3(0.0, 1.0, 0.0);","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","float sunfade = 1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);","// luminance = 1.0 ;// vWorldPosition.y / 450000. + 0.5; //sunPosition.y / 450000. * 1. + 0.5;","// gl_FragColor = vec4(sunfade, sunfade, sunfade, 1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(sunPosition);","float sunE = sunIntensity(dot(sunDirection, up));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up, normalize(vWorldPosition - cameraPos))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor ","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPos), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPos);","float theta = acos(direction.y); // elevation --> y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --> x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPos).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1.0;","}"].join("\n")};var a=function(){var e=o["default"].ShaderLib.sky,t=o["default"].UniformsUtils.clone(e.uniforms),n=new o["default"].ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:t,side:o["default"].BackSide}),r=new o["default"].SphereBufferGeometry(45e4,32,15),i=new o["default"].Mesh(r,n);this.mesh=i,this.uniforms=t};t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e,t,n){var r=!0,s=!0;if("function"!=typeof e)throw new TypeError(a);return i(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:r,maxWait:t,trailing:s})}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var o=n(41),a="Expected a function";e.exports=r},function(e,t){function n(e,t,n){function r(){g&&clearTimeout(g),p&&clearTimeout(p),w=0,h=p=y=g=b=void 0}function s(t,n){n&&clearTimeout(n),p=g=b=void 0,t&&(w=m(),d=e.apply(y,h),g||p||(h=y=void 0))}function u(){var e=t-(m()-v);0>=e||e>t?s(b,p):g=setTimeout(u,e)}function l(){return(g&&b||p&&M)&&(d=e.apply(y,h)),r(),d}function c(){s(M,g)}function f(){if(h=arguments,v=m(),y=this,b=M&&(g||!x),k===!1)var n=x&&!g;else{p||x||(w=v);var r=k-(v-w),i=0>=r||r>k;i?(p&&(p=clearTimeout(p)),w=v,d=e.apply(y,h)):p||(p=setTimeout(c,r))}return i&&g?g=clearTimeout(g):g||t===k||(g=setTimeout(u,t)),n&&(i=!0,d=e.apply(y,h)),!i||g||p||(h=y=void 0),d}var h,p,d,v,y,g,b,w=0,x=!1,k=!1,M=!0;if("function"!=typeof e)throw new TypeError(a);return t=o(t)||0,i(n)&&(x=!!n.leading,k="maxWait"in n&&_(o(n.maxWait)||0,t),M="trailing"in n?!!n.trailing:M),f.cancel=r,f.flush=l,f}function r(e){var t=i(e)?y.call(e):"";return t==u||t==l}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function o(e){if(i(e)){var t=r(e.valueOf)?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(c,"");var n=h.test(e);return n||p.test(e)?d(e.slice(2),n?2:8):f.test(e)?s:+e}var a="Expected a function",s=NaN,u="[object Function]",l="[object GeneratorFunction]",c=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^0o[0-7]+$/i,d=parseInt,v=Object.prototype,y=v.toString,_=Math.max,m=Date.now;e.exports=n},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(43),o=r(i),a={Orbit:o["default"],orbit:i.orbit,orbit:i.orbit};t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(2),l=r(u),c=n(24),f=(r(c),n(44)),h=r(f),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this)}return o(t,e),a(t,[{key:"_initEvents",value:function(){var e=this;this._controls.addEventListener("start",function(t){e._world.emit("controlsMoveStart",t.target.target)}),this._controls.addEventListener("change",function(t){e._world.emit("controlsMove",t.target.target)}),this._controls.addEventListener("end",function(t){e._world.emit("controlsMoveEnd",t.target.target)})}},{key:"_panTo",value:function(e,t){}},{key:"_panBy",value:function(e,t){}},{key:"_zoomTo",value:function(e,t){}},{key:"_zoomBy",value:function(e,t){}},{key:"_lookAt",value:function(e,t){}},{key:"_lookAtTarget",value:function(){}},{key:"_tiltTo",value:function(e,t){}},{key:"_tiltBy",value:function(e,t){}},{key:"_rotateTo",value:function(e,t){}},{key:"_rotateBy",value:function(e,t){}},{key:"_flyTo",value:function(e,t){}},{key:"update",value:function(){this._controls.update()}},{key:"addTo",value:function(e){return e.addControls(this),this}},{key:"_addToWorld",value:function(e){this._world=e,this._controls=new h["default"](e._engine._camera,e._container),this._controls.keys=!1,this._controls.maxPolarAngle=1.5533,this._initEvents(),this.emit("added")}},{key:"destroy",value:function(){this._controls.dispose(),this._world=null,this._controls=null}}]),t}(l["default"]);t["default"]=p;var d=function(){return new p};t.orbit=d},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=n(45),s=r(a),u=function(e,t){function n(){return 2*Math.PI/60/60*B.autoRotateSpeed}function r(){return Math.pow(.95,B.zoomSpeed)}function i(e){V-=e}function a(e){U-=e}function u(e){B.object instanceof o["default"].PerspectiveCamera?G/=e:B.object instanceof o["default"].OrthographicCamera?(B.object.zoom=Math.max(B.minZoom,Math.min(B.maxZoom,B.object.zoom*e)),B.object.updateProjectionMatrix(),X=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),B.enableZoom=!1)}function l(e){B.object instanceof o["default"].PerspectiveCamera?G*=e:B.object instanceof o["default"].OrthographicCamera?(B.object.zoom=Math.max(B.minZoom,Math.min(B.maxZoom,B.object.zoom/e)),B.object.updateProjectionMatrix(),X=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),B.enableZoom=!1)}function c(e){Y.set(e.clientX,e.clientY)}function f(e){te.set(e.clientX,e.clientY)}function h(e){$.set(e.clientX,e.clientY)}function p(e){J.set(e.clientX,e.clientY),K.subVectors(J,Y);var t=B.domElement===document?B.domElement.body:B.domElement;i(2*Math.PI*K.x/t.clientWidth*B.rotateSpeed),a(2*Math.PI*K.y/t.clientHeight*B.rotateSpeed),Y.copy(J),B.update()}function d(e){ne.set(e.clientX,e.clientY),re.subVectors(ne,te),re.y>0?u(r()):re.y<0&&l(r()),te.copy(ne),B.update()}function v(e){Q.set(e.clientX,e.clientY),ee.subVectors(Q,$),ae(ee.x,ee.y),$.copy(Q),B.update()}function y(e){}function _(e){var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),t>0?l(r()):0>t&&u(r()),B.update()}function m(e){switch(e.keyCode){case B.keys.UP:ae(0,B.keyPanSpeed),B.update();break;case B.keys.BOTTOM:ae(0,-B.keyPanSpeed),B.update();break;case B.keys.LEFT:ae(B.keyPanSpeed,0),B.update();break;case B.keys.RIGHT:ae(-B.keyPanSpeed,0),B.update()}}function g(e){Y.set(e.pointers[0].pageX,e.pointers[0].pageY)}function b(e){var t=e.pointers[0].pageX-e.pointers[1].pageX,n=e.pointers[0].pageY-e.pointers[1].pageY,r=Math.sqrt(t*t+n*n);te.set(0,r)}function w(e){$.set(e.deltaX,e.deltaY)}function x(e){J.set(e.pointers[0].pageX,e.pointers[0].pageY),K.subVectors(J,Y);var t=B.domElement===document?B.domElement.body:B.domElement;i(2*Math.PI*K.x/t.clientWidth*B.rotateSpeed),a(2*Math.PI*K.y/t.clientHeight*B.rotateSpeed),Y.copy(J),B.update()}function k(e){var t=e.pointers[0].pageX-e.pointers[1].pageX,n=e.pointers[0].pageY-e.pointers[1].pageY,i=Math.sqrt(t*t+n*n);ne.set(0,i),re.subVectors(ne,te),re.y>0?l(r()):re.y<0&&u(r()),te.copy(ne),B.update()}function M(e){Q.set(e.deltaX,e.deltaY),ee.subVectors(Q,$),ae(ee.x,ee.y),$.copy(Q),B.update()}function O(e){}function E(e){if(B.enabled!==!1){if(e.preventDefault(),e.button===B.mouseButtons.ORBIT){if(B.enableRotate===!1)return;c(e),W=N.ROTATE}else if(e.button===B.mouseButtons.ZOOM){if(B.enableZoom===!1)return;f(e),W=N.DOLLY}else if(e.button===B.mouseButtons.PAN){if(B.enablePan===!1)return;h(e),W=N.PAN}W!==N.NONE&&(document.addEventListener("mousemove",P,!1),document.addEventListener("mouseup",T,!1),document.addEventListener("mouseout",T,!1),B.dispatchEvent(z))}}function P(e){if(B.enabled!==!1)if(e.preventDefault(),W===N.ROTATE){if(B.enableRotate===!1)return;p(e)}else if(W===N.DOLLY){if(B.enableZoom===!1)return;d(e)}else if(W===N.PAN){if(B.enablePan===!1)return;v(e)}}function T(e){B.enabled!==!1&&(y(e),document.removeEventListener("mousemove",P,!1),document.removeEventListener("mouseup",T,!1),document.removeEventListener("mouseout",T,!1),B.dispatchEvent(H),W=N.NONE)}function j(e){B.enabled!==!1&&B.enableZoom!==!1&&W===N.NONE&&(e.preventDefault(),e.stopPropagation(),_(e),B.dispatchEvent(z),B.dispatchEvent(H))}function S(e){B.enabled!==!1&&B.enableKeys!==!1&&B.enablePan!==!1&&m(e)}function C(e){if(B.enabled!==!1){switch(e.touches.length){case 1:if(B.enableRotate===!1)return;g(e),W=N.TOUCH_ROTATE;break;case 2:if(B.enableZoom===!1)return;b(e),W=N.TOUCH_DOLLY;break;case 3:if(B.enablePan===!1)return;w(e),W=N.TOUCH_PAN;break;default:W=N.NONE}W!==N.NONE&&B.dispatchEvent(z)}}function A(e){if(B.enabled!==!1)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(B.enableRotate===!1)return;if(W!==N.TOUCH_ROTATE)return;x(e);break;case 2:if(B.enableZoom===!1)return;if(W!==N.TOUCH_DOLLY)return;k(e);break;case 3:if(B.enablePan===!1)return;if(W!==N.TOUCH_PAN)return;M(e);break;default:W=N.NONE}}function L(e){B.enabled!==!1&&(O(e),B.dispatchEvent(H),W=N.NONE)}function D(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new o["default"].Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-(1/0),this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:o["default"].MOUSE.LEFT,
ZOOM:o["default"].MOUSE.MIDDLE,PAN:o["default"].MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return I},this.getAzimuthalAngle=function(){return R},this.reset=function(){B.target.copy(B.target0),B.object.position.copy(B.position0),B.object.zoom=B.zoom0,B.object.updateProjectionMatrix(),B.dispatchEvent(F),B.update(),W=N.NONE},this.update=function(){var t=new o["default"].Vector3,r=(new o["default"].Quaternion).setFromUnitVectors(e.up,new o["default"].Vector3(0,1,0)),a=r.clone().inverse(),s=new o["default"].Vector3,u=new o["default"].Quaternion;return function(){var e=B.object.position;t.copy(e).sub(B.target),t.applyQuaternion(r),R=Math.atan2(t.x,t.z),I=Math.atan2(Math.sqrt(t.x*t.x+t.z*t.z),t.y),B.autoRotate&&W===N.NONE&&i(n()),R+=V,I+=U,R=Math.max(B.minAzimuthAngle,Math.min(B.maxAzimuthAngle,R)),I=Math.max(B.minPolarAngle,Math.min(B.maxPolarAngle,I)),I=Math.max(q,Math.min(Math.PI-q,I));var o=t.length()*G;return o=Math.max(B.minDistance,Math.min(B.maxDistance,o)),B.target.add(Z),t.x=o*Math.sin(I)*Math.sin(R),t.y=o*Math.cos(I),t.z=o*Math.sin(I)*Math.cos(R),t.applyQuaternion(a),e.copy(B.target).add(t),B.object.lookAt(B.target),B.enableDamping===!0?(V*=1-B.dampingFactor,U*=1-B.dampingFactor):(V=0,U=0),G=1,Z.set(0,0,0),X||s.distanceToSquared(B.object.position)>q||8*(1-u.dot(B.object.quaternion))>q?(B.dispatchEvent(F),s.copy(B.object.position),u.copy(B.object.quaternion),X=!1,!0):!1}}(),this.dispose=function(){B.domElement.removeEventListener("contextmenu",D,!1),B.domElement.removeEventListener("mousedown",E,!1),B.domElement.removeEventListener("mousewheel",j,!1),B.domElement.removeEventListener("MozMousePixelScroll",j,!1),B.domElement.removeEventListener("touchstart",C,!1),B.domElement.removeEventListener("touchend",L,!1),B.domElement.removeEventListener("touchmove",A,!1),document.removeEventListener("mousemove",P,!1),document.removeEventListener("mouseup",T,!1),document.removeEventListener("mouseout",T,!1),window.removeEventListener("keydown",S,!1)};var R,I,B=this,F={type:"change"},z={type:"start"},H={type:"end"},N={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},W=N.NONE,q=1e-6,U=0,V=0,G=1,Z=new o["default"].Vector3,X=!1,Y=new o["default"].Vector2,J=new o["default"].Vector2,K=new o["default"].Vector2,$=new o["default"].Vector2,Q=new o["default"].Vector2,ee=new o["default"].Vector2,te=new o["default"].Vector2,ne=new o["default"].Vector2,re=new o["default"].Vector2,ie=function(){var e=new o["default"].Vector3;return function(t,n){var r=n.elements;e.set(r[0],0,r[2]),e.multiplyScalar(-t),Z.add(e)}}(),oe=function(){var e=new o["default"].Vector3;return function(t,n){var r=n.elements,i=t/Math.cos(I);e.set(r[4],0,r[6]),e.multiplyScalar(i),Z.add(e)}}(),ae=function(){var e=new o["default"].Vector3;return function(t,n){var r=B.domElement===document?B.domElement.body:B.domElement;if(B.object instanceof o["default"].PerspectiveCamera){var i=B.object.position;e.copy(i).sub(B.target);var a=e.length();a*=Math.tan(B.object.fov/2*Math.PI/180),ie(2*t*a/r.clientHeight,B.object.matrix),oe(2*n*a/r.clientHeight,B.object.matrix)}else B.object instanceof o["default"].OrthographicCamera?(ie(t*(B.object.right-B.object.left)/r.clientWidth,B.object.matrix),oe(n*(B.object.top-B.object.bottom)/r.clientHeight,B.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),B.enablePan=!1)}}();B.domElement.addEventListener("contextmenu",D,!1),B.domElement.addEventListener("mousedown",E,!1),B.domElement.addEventListener("mousewheel",j,!1),B.domElement.addEventListener("MozMousePixelScroll",j,!1),B.hammer=new s["default"](B.domElement),B.hammer.get("pan").set({pointers:0,direction:s["default"].DIRECTION_ALL}),B.hammer.get("pinch").set({enable:!0,threshold:.1}),B.hammer.on("panstart",function(e){if(B.enabled!==!1&&"mouse"!==e.pointerType){if(1===e.pointers.length){if(B.enablePan===!1)return;w(e),W=N.TOUCH_PAN}else if(2===e.pointers.length){if(B.enableRotate===!1)return;g(e),W=N.TOUCH_ROTATE}W!==N.NONE&&B.dispatchEvent(z)}}),B.hammer.on("panend",function(e){"mouse"!==e.pointerType&&L(e)}),B.hammer.on("panmove",function(e){if(B.enabled!==!1&&"mouse"!==e.pointerType)if(1===e.pointers.length){if(B.enablePan===!1)return;if(W!==N.TOUCH_PAN)return;M(e)}else if(2===e.pointers.length){if(B.enableRotate===!1)return;if(W!==N.TOUCH_ROTATE)return;x(e)}}),B.hammer.on("pinchstart",function(e){B.enabled!==!1&&"mouse"!==e.pointerType&&B.enableZoom!==!1&&(b(e),W=N.TOUCH_DOLLY,W!==N.NONE&&B.dispatchEvent(z))}),B.hammer.on("pinchend",function(e){"mouse"!==e.pointerType&&L(e)}),B.hammer.on("pinchmove",function(e){B.enabled!==!1&&"mouse"!==e.pointerType&&B.enableZoom!==!1&&W===N.TOUCH_DOLLY&&k(e)}),window.addEventListener("keydown",S,!1),this.update()};u.prototype=Object.create(o["default"].EventDispatcher.prototype),u.prototype.constructor=o["default"].OrbitControls,Object.defineProperties(u.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.constraint.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.constraint.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor=e}}}),t["default"]=u,e.exports=t["default"]},function(e,t,n){var r;!function(i,o,a,s){"use strict";function u(e,t,n){return setTimeout(p(e,n),t)}function l(e,t,n){return Array.isArray(e)?(c(e,n[t],n),!0):!1}function c(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function f(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),e.apply(this,arguments)}}function h(e,t,n){var r,i=t.prototype;r=e.prototype=Object.create(i),r.constructor=e,r._super=i,n&&fe(r,n)}function p(e,t){return function(){return e.apply(t,arguments)}}function d(e,t){return typeof e==de?e.apply(t?t[0]||s:s,t):e}function v(e,t){return e===s?t:e}function y(e,t,n){c(b(t),function(t){e.addEventListener(t,n,!1)})}function _(e,t,n){c(b(t),function(t){e.removeEventListener(t,n,!1)})}function m(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function g(e,t){return e.indexOf(t)>-1}function b(e){return e.trim().split(/\s+/g)}function w(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function x(e){return Array.prototype.slice.call(e,0)}function k(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];w(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function M(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;o<he.length;){if(n=he[o],r=n?n+i:t,r in e)return r;o++}return s}function O(){return be++}function E(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||i}function P(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){d(e.options.enable,[e])&&n.handler(t)},this.init()}function T(e){var t,n=e.options.inputClass;return new(t=n?n:ke?W:Me?V:xe?Z:N)(e,j)}function j(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=t&Se&&r-i===0,a=t&(Ae|Le)&&r-i===0;n.isFirst=!!o,n.isFinal=!!a,o&&(e.session={}),n.eventType=t,S(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function S(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=L(t)),i>1&&!n.firstMultiple?n.firstMultiple=L(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,u=t.center=D(r);t.timeStamp=_e(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=F(s,u),t.distance=B(s,u),C(n,t),t.offsetDirection=I(t.deltaX,t.deltaY);var l=R(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=ye(l.x)>ye(l.y)?l.x:l.y,t.scale=a?H(a.pointers,r):1,t.rotation=a?z(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,A(n,t);var c=e.element;m(t.srcEvent.target,c)&&(c=t.srcEvent.target),t.target=c}function C(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};(t.eventType===Se||o.eventType===Ae)&&(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function A(e,t){var n,r,i,o,a=e.lastInterval||t,u=t.timeStamp-a.timeStamp;if(t.eventType!=Le&&(u>je||a.velocity===s)){var l=t.deltaX-a.deltaX,c=t.deltaY-a.deltaY,f=R(u,l,c);r=f.x,i=f.y,n=ye(f.x)>ye(f.y)?f.x:f.y,o=I(l,c),e.lastInterval=t}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=o}function L(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:ve(e.pointers[n].clientX),clientY:ve(e.pointers[n].clientY)},n++;return{timeStamp:_e(),pointers:t,center:D(t),deltaX:e.deltaX,deltaY:e.deltaY}}function D(e){var t=e.length;if(1===t)return{x:ve(e[0].clientX),y:ve(e[0].clientY)};for(var n=0,r=0,i=0;t>i;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:ve(n/t),y:ve(r/t)}}function R(e,t,n){return{x:t/e||0,y:n/e||0}}function I(e,t){return e===t?De:ye(e)>=ye(t)?0>e?Re:Ie:0>t?Be:Fe}function B(e,t,n){n||(n=We);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function F(e,t,n){n||(n=We);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}function z(e,t){return F(t[1],t[0],qe)+F(e[1],e[0],qe)}function H(e,t){return B(t[0],t[1],qe)/B(e[0],e[1],qe)}function N(){this.evEl=Ve,this.evWin=Ge,this.allow=!0,this.pressed=!1,P.apply(this,arguments)}function W(){this.evEl=Ye,this.evWin=Je,P.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function q(){this.evTarget=$e,this.evWin=Qe,this.started=!1,P.apply(this,arguments)}function U(e,t){var n=x(e.touches),r=x(e.changedTouches);return t&(Ae|Le)&&(n=k(n.concat(r),"identifier",!0)),[n,r]}function V(){this.evTarget=tt,this.targetIds={},P.apply(this,arguments)}function G(e,t){var n=x(e.touches),r=this.targetIds;if(t&(Se|Ce)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=x(e.changedTouches),s=[],u=this.target;if(o=n.filter(function(e){return m(e.target,u)}),t===Se)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),t&(Ae|Le)&&delete r[a[i].identifier],i++;return s.length?[k(o.concat(s),"identifier",!0),s]:void 0}function Z(){P.apply(this,arguments);var e=p(this.handler,this);this.touch=new V(this.manager,e),this.mouse=new N(this.manager,e)}function X(e,t){this.manager=e,this.set(t)}function Y(e){if(g(e,st))return st;var t=g(e,ut),n=g(e,lt);return t&&n?st:t||n?t?ut:lt:g(e,at)?at:ot}function J(e){this.options=fe({},this.defaults,e||{}),this.id=O(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=ct,this.simultaneous={},this.requireFail=[]}function K(e){return e&vt?"cancel":e&pt?"end":e&ht?"move":e&ft?"start":""}function $(e){return e==Fe?"down":e==Be?"up":e==Re?"left":e==Ie?"right":""}function Q(e,t){var n=t.manager;return n?n.get(e):e}function ee(){J.apply(this,arguments)}function te(){ee.apply(this,arguments),this.pX=null,this.pY=null}function ne(){ee.apply(this,arguments)}function re(){J.apply(this,arguments),this._timer=null,this._input=null}function ie(){ee.apply(this,arguments)}function oe(){ee.apply(this,arguments)}function ae(){J.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function se(e,t){return t=t||{},t.recognizers=v(t.recognizers,se.defaults.preset),new ue(e,t)}function ue(e,t){this.options=fe({},se.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.element=e,this.input=T(this),this.touchAction=new X(this,this.options.touchAction),le(this,!0),c(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function le(e,t){var n=e.element;n.style&&c(e.options.cssProps,function(e,r){n.style[M(n.style,r)]=t?e:""})}function ce(e,t){var n=o.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var fe,he=["","webkit","Moz","MS","ms","o"],pe=o.createElement("div"),de="function",ve=Math.round,ye=Math.abs,_e=Date.now;fe="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var me=f(function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===s)&&(e[r[i]]=t[r[i]]),i++;return e},"extend","Use `assign`."),ge=f(function(e,t){return me(e,t,!0)},"merge","Use `assign`."),be=1,we=/mobile|tablet|ip(ad|hone|od)|android/i,xe="ontouchstart"in i,ke=M(i,"PointerEvent")!==s,Me=xe&&we.test(navigator.userAgent),Oe="touch",Ee="pen",Pe="mouse",Te="kinect",je=25,Se=1,Ce=2,Ae=4,Le=8,De=1,Re=2,Ie=4,Be=8,Fe=16,ze=Re|Ie,He=Be|Fe,Ne=ze|He,We=["x","y"],qe=["clientX","clientY"];P.prototype={handler:function(){},init:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(E(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(E(this.element),this.evWin,this.domHandler)}};var Ue={mousedown:Se,mousemove:Ce,mouseup:Ae},Ve="mousedown",Ge="mousemove mouseup";h(N,P,{handler:function(e){var t=Ue[e.type];t&Se&&0===e.button&&(this.pressed=!0),t&Ce&&1!==e.which&&(t=Ae),this.pressed&&this.allow&&(t&Ae&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Pe,srcEvent:e}))}});var Ze={pointerdown:Se,pointermove:Ce,pointerup:Ae,pointercancel:Le,pointerout:Le},Xe={2:Oe,3:Ee,4:Pe,5:Te},Ye="pointerdown",Je="pointermove pointerup pointercancel";i.MSPointerEvent&&!i.PointerEvent&&(Ye="MSPointerDown",Je="MSPointerMove MSPointerUp MSPointerCancel"),h(W,P,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Ze[r],o=Xe[e.pointerType]||e.pointerType,a=o==Oe,s=w(t,e.pointerId,"pointerId");i&Se&&(0===e.button||a)?0>s&&(t.push(e),s=t.length-1):i&(Ae|Le)&&(n=!0),0>s||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var Ke={touchstart:Se,touchmove:Ce,touchend:Ae,touchcancel:Le},$e="touchstart",Qe="touchstart touchmove touchend touchcancel";h(q,P,{handler:function(e){var t=Ke[e.type];if(t===Se&&(this.started=!0),this.started){var n=U.call(this,e,t);t&(Ae|Le)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Oe,srcEvent:e})}}});var et={touchstart:Se,touchmove:Ce,touchend:Ae,touchcancel:Le},tt="touchstart touchmove touchend touchcancel";h(V,P,{handler:function(e){var t=et[e.type],n=G.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Oe,srcEvent:e})}}),h(Z,P,{handler:function(e,t,n){var r=n.pointerType==Oe,i=n.pointerType==Pe;if(r)this.mouse.allow=!1;else if(i&&!this.mouse.allow)return;t&(Ae|Le)&&(this.mouse.allow=!0),this.callback(e,t,n)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var nt=M(pe.style,"touchAction"),rt=nt!==s,it="compute",ot="auto",at="manipulation",st="none",ut="pan-x",lt="pan-y";X.prototype={set:function(e){e==it&&(e=this.compute()),rt&&this.manager.element.style&&(this.manager.element.style[nt]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return c(this.manager.recognizers,function(t){d(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Y(e.join(" "))},preventDefaults:function(e){if(!rt){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var r=this.actions,i=g(r,st),o=g(r,lt),a=g(r,ut);if(i){var s=1===e.pointers.length,u=e.distance<2,l=e.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&n&ze||a&&n&He?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var ct=1,ft=2,ht=4,pt=8,dt=pt,vt=16,yt=32;J.prototype={defaults:{},set:function(e){return fe(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(l(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=Q(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return l(e,"dropRecognizeWith",this)?this:(e=Q(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(l(e,"requireFailure",this))return this;var t=this.requireFail;return e=Q(e,this),-1===w(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(l(e,"dropRequireFailure",this))return this;e=Q(e,this);var t=w(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){n.manager.emit(t,e)}var n=this,r=this.state;pt>r&&t(n.options.event+K(r)),t(n.options.event),e.additionalEvent&&t(e.additionalEvent),r>=pt&&t(n.options.event+K(r))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=yt)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(yt|ct)))return!1;e++}return!0},recognize:function(e){var t=fe({},e);return d(this.options.enable,[this,t])?(this.state&(dt|vt|yt)&&(this.state=ct),this.state=this.process(t),void(this.state&(ft|ht|pt|vt)&&this.tryEmit(t))):(this.reset(),void(this.state=yt))},process:function(e){},getTouchAction:function(){},reset:function(){}},h(ee,J,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(ft|ht),i=this.attrTest(e);return r&&(n&Le||!i)?t|vt:r||i?n&Ae?t|pt:t&ft?t|ht:ft:yt}}),h(te,ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ne},getTouchAction:function(){var e=this.options.direction,t=[];return e&ze&&t.push(lt),e&He&&t.push(ut),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(t.direction&ze?(i=0===o?De:0>o?Re:Ie,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?De:0>a?Be:Fe,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return ee.prototype.attrTest.call(this,e)&&(this.state&ft||!(this.state&ft)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=$(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),h(ne,ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[st]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&ft)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),h(re,J,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ot]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(Ae|Le)&&!i)this.reset();else if(e.eventType&Se)this.reset(),this._timer=u(function(){this.state=dt,this.tryEmit()},t.time,this);else if(e.eventType&Ae)return dt;return yt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===dt&&(e&&e.eventType&Ae?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=_e(),this.manager.emit(this.options.event,this._input)))}}),h(ie,ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[st]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&ft)}}),h(oe,ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ze|He,pointers:1},getTouchAction:function(){return te.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(ze|He)?t=e.overallVelocity:n&ze?t=e.overallVelocityX:n&He&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&ye(t)>this.options.velocity&&e.eventType&Ae},emit:function(e){var t=$(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),h(ae,J,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[at]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&Se&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=Ae)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<t.interval:!0,a=!this.pCenter||B(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e;var s=this.count%t.taps;if(0===s)return this.hasRequireFailures()?(this._timer=u(function(){this.state=dt,this.tryEmit()},t.interval,this),ft):dt}return yt},failTimeout:function(){return this._timer=u(function(){this.state=yt},this.options.interval,this),yt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==dt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),se.VERSION="2.0.6",se.defaults={domEvents:!1,touchAction:it,enable:!0,inputTarget:null,inputClass:null,preset:[[ie,{enable:!1}],[ne,{enable:!1},["rotate"]],[oe,{direction:ze}],[te,{direction:ze},["swipe"]],[ae],[ae,{event:"doubletap",taps:2},["tap"]],[re]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var _t=1,mt=2;ue.prototype={set:function(e){return fe(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?mt:_t},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&dt)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],t.stopped===mt||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&n.state&(ft|ht|pt)&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof J)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(l(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(l(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=w(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){var n=this.handlers;return c(b(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},off:function(e,t){var n=this.handlers;return c(b(e),function(e){t?n[e]&&n[e].splice(w(n[e],t),1):delete n[e]}),this},emit:function(e,t){this.options.domEvents&&ce(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&le(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},fe(se,{INPUT_START:Se,INPUT_MOVE:Ce,INPUT_END:Ae,INPUT_CANCEL:Le,STATE_POSSIBLE:ct,STATE_BEGAN:ft,STATE_CHANGED:ht,STATE_ENDED:pt,STATE_RECOGNIZED:dt,STATE_CANCELLED:vt,STATE_FAILED:yt,DIRECTION_NONE:De,DIRECTION_LEFT:Re,DIRECTION_RIGHT:Ie,DIRECTION_UP:Be,DIRECTION_DOWN:Fe,DIRECTION_HORIZONTAL:ze,DIRECTION_VERTICAL:He,DIRECTION_ALL:Ne,Manager:ue,Input:P,TouchAction:X,TouchInput:V,MouseInput:N,PointerEventInput:W,TouchMouseInput:Z,SingleTouchInput:q,Recognizer:J,AttrRecognizer:ee,Tap:ae,Pan:te,Swipe:oe,Pinch:ne,Rotate:ie,Press:re,on:y,off:_,each:c,merge:ge,extend:me,assign:fe,inherit:h,bindFn:p,prefixed:M});var gt="undefined"!=typeof i?i:"undefined"!=typeof self?self:{};gt.Hammer=se,r=function(){return se}.call(t,n,t,e),!(r!==s&&(e.exports=r))}(window,document,"Hammer")},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(47),l=r(u),c=n(57),f=r(c),h=n(60),p=r(h),d=n(40),v=r(d),y=n(24),_=r(y),m=n(3),g=r(m),b=function(e){function t(e,n){i(this,t);var r={distance:4e4};n=(0,g["default"])({},r,n),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,n),this._path=e}return o(t,e),a(t,[{key:"_onAdd",value:function(e){var n=this;s(Object.getPrototypeOf(t.prototype),"_onAdd",this).call(this,e);var r,i=new _["default"].PlaneBufferGeometry(2e5,2e5,1);r=this._world._environment._skybox?(0,p["default"])("#f5f5f3",this._world._environment._skybox.getRenderTarget()):(0,p["default"])("#f5f5f3");var o=new _["default"].Mesh(i,r);o.renderOrder=0,o.rotation.x=-90*Math.PI/180,o.receiveShadow=!0,this._baseLayer=o,this.add(o),setTimeout(function(){n._calculateLOD(),n._initEvents()},0)}},{key:"_initEvents",value:function(){this._throttledWorldUpdate=(0,v["default"])(this._onWorldUpdate,100),this._world.on("preUpdate",this._throttledWorldUpdate,this),this._world.on("move",this._onWorldMove,this)}},{key:"_onWorldUpdate",value:function(){this._calculateLOD(),this._outputTiles()}},{key:"_onWorldMove",value:function(e,t){this._moveBaseLayer(t)}},{key:"_moveBaseLayer",value:function(e){this._baseLayer.position.x=e.x,this._baseLayer.position.z=e.y}},{key:"_createTile",value:function(e,t){return new f["default"](e,this._path,t)}},{key:"destroy",value:function(){this._world.off("preUpdate",this._throttledWorldUpdate),this._world.off("move",this._onWorldMove),this._throttledWorldUpdate=null,this._baseLayer.geometry.dispose(),this._baseLayer.geometry=null,this._baseLayer.material.map&&(this._baseLayer.material.map.dispose(),this._baseLayer.material.map=null),this._baseLayer.material.dispose(),this._baseLayer.material=null,this._baseLayer=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=b;var w=function(e,t){return new b(e,t)};t.imageTileLayer=w},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(37),l=r(u),c=n(3),f=r(c),h=n(48),p=r(h),d=n(24),v=r(d),y=function(e){function t(e){var n=this;i(this,t);var r={picking:!1,maxCache:1e3,maxLOD:18},o=(0,f["default"])({},r,e);s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,o),this._tileCache=new p["default"](this._options.maxCache,function(e){n._destroyTile(e)}),this._tileList=[],this._minLOD=3,this._maxLOD=this._options.maxLOD,this._frustum=new v["default"].Frustum,this._tiles=new v["default"].Object3D,this._tilesPicking=new v["default"].Object3D}return o(t,e),a(t,[{key:"_onAdd",value:function(e){this.addToPicking(this._tilesPicking),this.add(this._tiles)}},{key:"_updateFrustum",value:function(){var e=this._world.getCamera(),t=new v["default"].Matrix4;t.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromMatrix(e.projectionMatrix),this._frustum.setFromMatrix((new v["default"].Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse))}},{key:"_tileInFrustum",value:function(e){var t=e.getBounds();return this._frustum.intersectsBox(new v["default"].Box3(new v["default"].Vector3(t[0],0,t[3]),new v["default"].Vector3(t[2],0,t[1])))}},{key:"_outputTiles",value:function(){var e=this;this._tiles&&(this._removeTiles(),this._tileList.forEach(function(t){t.isReady()&&(e._tiles.add(t.getMesh()),t.getPickingMesh()&&e._tilesPicking.add(t.getPickingMesh()))}))}},{key:"_calculateLOD",value:function(){var e=this;if(!this._stop&&this._world){var t=this._world.getCamera();this._updateFrustum(this._frustum,t);
var n=this._checklist;n=[],n.push(this._requestTile("0",this)),n.push(this._requestTile("1",this)),n.push(this._requestTile("2",this)),n.push(this._requestTile("3",this)),this._divide(n),this._tileList=n.filter(function(n,r){if(!e._tileInFrustum(n))return!1;if(e._options.distance&&e._options.distance>0){var i=n.getCenter(),o=new v["default"].Vector3(i[0],0,i[1]).sub(t.position).length();if(o>e._options.distance)return!1}return n.getMesh()||n.requestTileAsync(),!0})}}},{key:"_divide",value:function(e){for(var t,n,r=0;r!=e.length;)t=e[r],n=t.getQuadcode(),t.length!==this._maxLOD&&this._screenSpaceError(t)?(e.splice(r,1),e.push(this._requestTile(n+"0",this)),e.push(this._requestTile(n+"1",this)),e.push(this._requestTile(n+"2",this)),e.push(this._requestTile(n+"3",this))):r++}},{key:"_screenSpaceError",value:function(e){var t=this._minLOD,n=this._maxLOD,r=e.getQuadcode(),i=this._world.getCamera(),o=3;if(r.length===n)return!1;if(r.length<t)return!0;if(!this._tileInFrustum(e))return!1;var a=e.getCenter(),s=new v["default"].Vector3(a[0],0,a[1]).sub(i.position).length(),u=o*e.getSide()/s;return u>1}},{key:"_removeTiles",value:function(){if(this._tiles&&this._tiles.children){for(var e=this._tiles.children.length-1;e>=0;e--)this._tiles.remove(this._tiles.children[e]);if(this._tilesPicking&&this._tilesPicking.children)for(var e=this._tilesPicking.children.length-1;e>=0;e--)this._tilesPicking.remove(this._tilesPicking.children[e])}}},{key:"_createTile",value:function(e,t){}},{key:"_requestTile",value:function(e,t){var n=this._tileCache.getTile(e);return n||(n=this._createTile(e,t),this._tileCache.setTile(e,n)),n}},{key:"_destroyTile",value:function(e){this._tiles.remove(e.getMesh()),e.destroy()}},{key:"destroy",value:function(){if(this._tiles.children)for(var e=this._tiles.children.length-1;e>=0;e--)this._tiles.remove(this._tiles.children[e]);if(this.removeFromPicking(this._tilesPicking),this._tilesPicking.children)for(var e=this._tilesPicking.children.length-1;e>=0;e--)this._tilesPicking.remove(this._tilesPicking.children[e]);this._tileCache.destroy(),this._tileCache=null,this._tiles=null,this._tilesPicking=null,this._frustum=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=y,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(49),s=r(a),u=function(){function e(t,n){i(this,e),this._cache=(0,s["default"])({max:t,dispose:function(e,t){n(t)}})}return o(e,[{key:"isReady",value:function(){return!1}},{key:"getTile",value:function(e){return this._cache.get(e)}},{key:"setTile",value:function(e,t){this._cache.set(e,t)}},{key:"destroy",value:function(){this._cache.reset(),this._cache=null}}]),e}();t["default"]=u;var l=function(e,t){return new u(e,t)};t.tileCache=l},function(e,t,n){function r(e,t,n){var r;return y[t]?r=y[t]:(r=h(t),y[t]=r),2===arguments.length?e[r]:(e[r]=n,n)}function i(){return 1}function o(e){if(!(this instanceof o))return new o(e);"number"==typeof e&&(e={max:e}),e||(e={});var t=r(this,"max",e.max);(!t||"number"!=typeof t||0>=t)&&r(this,"max",1/0);var n=e.length||i;"function"!=typeof n&&(n=i),r(this,"lengthCalculator",n),r(this,"allowStale",e.stale||!1),r(this,"maxAge",e.maxAge||0),r(this,"dispose",e.dispose),this.reset()}function a(e,t,n,i){var o=n.value;u(e,o)&&(c(e,n),r(e,"allowStale")||(o=void 0)),o&&t.call(i,o.value,o.key,e)}function s(e,t,n){var i=r(e,"cache").get(t);if(i){var o=i.value;u(e,o)?(c(e,i),r(e,"allowStale")||(o=void 0)):n&&r(e,"lruList").unshiftNode(i),o&&(o=o.value)}return o}function u(e,t){if(!t||!t.maxAge&&!r(e,"maxAge"))return!1;var n=!1,i=Date.now()-t.now;return n=t.maxAge?i>t.maxAge:r(e,"maxAge")&&i>r(e,"maxAge")}function l(e){if(r(e,"length")>r(e,"max"))for(var t=r(e,"lruList").tail;r(e,"length")>r(e,"max")&&null!==t;){var n=t.prev;c(e,t),t=n}}function c(e,t){if(t){var n=t.value;r(e,"dispose")&&r(e,"dispose").call(this,n.key,n.value),r(e,"length",r(e,"length")-n.length),r(e,"cache")["delete"](n.key),r(e,"lruList").removeNode(t)}}function f(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}e.exports=o;var h,p=n(50),d=n(53),v=n(56),y={},_="function"==typeof Symbol;h=_?function(e){return Symbol["for"](e)}:function(e){return"_"+e},Object.defineProperty(o.prototype,"max",{set:function(e){(!e||"number"!=typeof e||0>=e)&&(e=1/0),r(this,"max",e),l(this)},get:function(){return r(this,"max")},enumerable:!0}),Object.defineProperty(o.prototype,"allowStale",{set:function(e){r(this,"allowStale",!!e)},get:function(){return r(this,"allowStale")},enumerable:!0}),Object.defineProperty(o.prototype,"maxAge",{set:function(e){(!e||"number"!=typeof e||0>e)&&(e=0),r(this,"maxAge",e),l(this)},get:function(){return r(this,"maxAge")},enumerable:!0}),Object.defineProperty(o.prototype,"lengthCalculator",{set:function(e){"function"!=typeof e&&(e=i),e!==r(this,"lengthCalculator")&&(r(this,"lengthCalculator",e),r(this,"length",0),r(this,"lruList").forEach(function(e){e.length=r(this,"lengthCalculator").call(this,e.value,e.key),r(this,"length",r(this,"length")+e.length)},this)),l(this)},get:function(){return r(this,"lengthCalculator")},enumerable:!0}),Object.defineProperty(o.prototype,"length",{get:function(){return r(this,"length")},enumerable:!0}),Object.defineProperty(o.prototype,"itemCount",{get:function(){return r(this,"lruList").length},enumerable:!0}),o.prototype.rforEach=function(e,t){t=t||this;for(var n=r(this,"lruList").tail;null!==n;){var i=n.prev;a(this,e,n,t),n=i}},o.prototype.forEach=function(e,t){t=t||this;for(var n=r(this,"lruList").head;null!==n;){var i=n.next;a(this,e,n,t),n=i}},o.prototype.keys=function(){return r(this,"lruList").toArray().map(function(e){return e.key},this)},o.prototype.values=function(){return r(this,"lruList").toArray().map(function(e){return e.value},this)},o.prototype.reset=function(){r(this,"dispose")&&r(this,"lruList")&&r(this,"lruList").length&&r(this,"lruList").forEach(function(e){r(this,"dispose").call(this,e.key,e.value)},this),r(this,"cache",new p),r(this,"lruList",new v),r(this,"length",0)},o.prototype.dump=function(){return r(this,"lruList").map(function(e){return u(this,e)?void 0:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}},this).toArray().filter(function(e){return e})},o.prototype.dumpLru=function(){return r(this,"lruList")},o.prototype.inspect=function(e,t){var n="LRUCache {",o=!1,a=r(this,"allowStale");a&&(n+="\n allowStale: true",o=!0);var s=r(this,"max");s&&s!==1/0&&(o&&(n+=","),n+="\n max: "+d.inspect(s,t),o=!0);var l=r(this,"maxAge");l&&(o&&(n+=","),n+="\n maxAge: "+d.inspect(l,t),o=!0);var c=r(this,"lengthCalculator");c&&c!==i&&(o&&(n+=","),n+="\n length: "+d.inspect(r(this,"length"),t),o=!0);var f=!1;return r(this,"lruList").forEach(function(e){f?n+=",\n ":(o&&(n+=",\n"),f=!0,n+="\n ");var r=d.inspect(e.key).split("\n").join("\n "),a={value:e.value};e.maxAge!==l&&(a.maxAge=e.maxAge),c!==i&&(a.length=e.length),u(this,e)&&(a.stale=!0),a=d.inspect(a,t).split("\n").join("\n "),n+=r+" => "+a}),(f||o)&&(n+="\n"),n+="}"},o.prototype.set=function(e,t,n){n=n||r(this,"maxAge");var i=n?Date.now():0,o=r(this,"lengthCalculator").call(this,t,e);if(r(this,"cache").has(e)){if(o>r(this,"max"))return c(this,r(this,"cache").get(e)),!1;var a=r(this,"cache").get(e),s=a.value;return r(this,"dispose")&&r(this,"dispose").call(this,e,s.value),s.now=i,s.maxAge=n,s.value=t,r(this,"length",r(this,"length")+(o-s.length)),s.length=o,this.get(e),l(this),!0}var u=new f(e,t,o,i,n);return u.length>r(this,"max")?(r(this,"dispose")&&r(this,"dispose").call(this,e,t),!1):(r(this,"length",r(this,"length")+u.length),r(this,"lruList").unshift(u),r(this,"cache").set(e,r(this,"lruList").head),l(this),!0)},o.prototype.has=function(e){if(!r(this,"cache").has(e))return!1;var t=r(this,"cache").get(e).value;return u(this,t)?!1:!0},o.prototype.get=function(e){return s(this,e,!0)},o.prototype.peek=function(e){return s(this,e,!1)},o.prototype.pop=function(){var e=r(this,"lruList").tail;return e?(c(this,e),e.value):null},o.prototype.del=function(e){c(this,r(this,"cache").get(e))},o.prototype.load=function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}},o.prototype.prune=function(){var e=this;r(this,"cache").forEach(function(t,n){s(e,n,!1)})}},function(e,t,n){(function(t){"pseudomap"===t.env.npm_package_name&&"test"===t.env.npm_lifecycle_script&&(t.env.TEST_PSEUDOMAP="true"),"function"!=typeof Map||t.env.TEST_PSEUDOMAP?e.exports=n(52):e.exports=Map}).call(t,n(51))},function(e,t){function n(){l=!1,a.length?u=a.concat(u):c=-1,u.length&&r()}function r(){if(!l){var e=setTimeout(n);l=!0;for(var t=u.length;t;){for(a=u,u=[];++c<t;)a&&a[c].run();c=-1,t=u.length}a=null,l=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function o(){}var a,s=e.exports={},u=[],l=!1,c=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new i(e,t)),1!==u.length||l||setTimeout(r,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t){function n(e){if(!(this instanceof n))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),e)if(e instanceof n||"function"==typeof Map&&e instanceof Map)e.forEach(function(e,t){this.set(t,e)},this);else{if(!Array.isArray(e))throw new TypeError("invalid argument");e.forEach(function(e){this.set(e[0],e[1])},this)}}function r(e,t){return e===t||e!==e&&t!==t}function i(e,t,n){this.key=e,this.value=t,this._index=n}function o(e,t){for(var n=0,i="_"+t,o=i;s.call(e,o);o=i+n++)if(r(e[o].key,t))return e[o]}function a(e,t,n){for(var o=0,a="_"+t,u=a;s.call(e,u);u=a+o++)if(r(e[u].key,t))return void(e[u].value=n);e.size++,e[u]=new i(t,n,u)}var s=Object.prototype.hasOwnProperty;e.exports=n,n.prototype.forEach=function(e,t){t=t||this,Object.keys(this._data).forEach(function(n){"size"!==n&&e.call(t,this._data[n].value,this._data[n].key)},this)},n.prototype.has=function(e){return!!o(this._data,e)},n.prototype.get=function(e){var t=o(this._data,e);return t&&t.value},n.prototype.set=function(e,t){a(this._data,e,t)},n.prototype["delete"]=function(e){var t=o(this._data,e);t&&(delete this._data[t._index],this._data.size--)},n.prototype.clear=function(){var e=Object.create(null);e.size=0,Object.defineProperty(this,"_data",{value:e,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(n.prototype,"size",{get:function(){return this._data.size},set:function(e){},enumerable:!0,configurable:!0}),n.prototype.values=n.prototype.keys=n.prototype.entries=function(){throw new Error("iterators are not implemented in this version")}},function(e,t,n){(function(e,r){function i(e,n){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(n)?r.showHidden=n:n&&t._extend(r,n),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function a(e,t){return e}function s(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,n,r){if(e.customInspect&&n&&E(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return g(i)||(i=u(e,i,r)),i}var o=l(e,n);if(o)return o;var a=Object.keys(n),v=s(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),O(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(n);if(0===a.length){if(E(n)){var y=n.name?": "+n.name:"";return e.stylize("[Function"+y+"]","special")}if(x(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(M(n))return e.stylize(Date.prototype.toString.call(n),"date");if(O(n))return c(n)}var _="",m=!1,b=["{","}"];if(d(n)&&(m=!0,b=["[","]"]),E(n)){var w=n.name?": "+n.name:"";_=" [Function"+w+"]"}if(x(n)&&(_=" "+RegExp.prototype.toString.call(n)),M(n)&&(_=" "+Date.prototype.toUTCString.call(n)),O(n)&&(_=" "+c(n)),0===a.length&&(!m||0==n.length))return b[0]+_+b[1];if(0>r)return x(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var k;return k=m?f(e,n,r,v,a):a.map(function(t){return h(e,n,r,v,t,m)}),e.seen.pop(),p(k,_,b)}function l(e,t){if(w(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i){for(var o=[],a=0,s=t.length;s>a;++a)C(t,String(a))?o.push(h(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,n,r,i,!0))}),o}function h(e,t,n,r,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},l.get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),C(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=y(n)?u(e,l.value,null):u(e,l.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),w(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function y(e){return null===e}function _(e){return null==e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function w(e){return void 0===e}function x(e){return k(e)&&"[object RegExp]"===T(e)}function k(e){return"object"==typeof e&&null!==e}function M(e){return k(e)&&"[object Date]"===T(e)}function O(e){return k(e)&&("[object Error]"===T(e)||e instanceof Error)}function E(e){return"function"==typeof e}function P(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function T(e){return Object.prototype.toString.call(e)}function j(e){return 10>e?"0"+e.toString(10):e.toString(10)}function S(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],t].join(" ")}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var A=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(e).replace(A,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),s=r[n];o>n;s=r[++n])a+=y(s)||!k(s)?" "+s:" "+i(s);return a},t.deprecate=function(n,i){function o(){if(!a){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),a=!0}return n.apply(this,arguments)}if(w(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var a=!1;return o};var L,D={};t.debuglog=function(e){if(w(L)&&(L=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!D[e])if(new RegExp("\\b"+e+"\\b","i").test(L)){var n=r.pid;D[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else D[e]=function(){};return D[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=v,t.isNull=y,t.isNullOrUndefined=_,t.isNumber=m,t.isString=g,t.isSymbol=b,t.isUndefined=w,t.isRegExp=x,t.isObject=k,t.isDate=M,t.isError=O,t.isFunction=E,t.isPrimitive=P,t.isBuffer=n(54);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",S(),t.format.apply(t,arguments))},t.inherits=n(55),t._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,function(){return this}(),n(51))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;i>r;r++)t.push(arguments[r]);return t}function r(e,t){e.tail=new o(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function i(e,t){e.head=new o(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function o(e,t,n,r){return this instanceof o?(this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,void(n?(n.prev=this,this.next=n):this.next=null)):new o(e,t,n,r)}e.exports=n,n.Node=o,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;t>e;e++)r(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;t>e;e++)i(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail.next=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head.prev=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},n.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&e>t;t++)n=n.next;return t===e&&null!==n?n.value:void 0},n.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&e>t;t++)n=n.prev;return t===e&&null!==n?n.value:void 0},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},n.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},n.prototype.slice=function(e,t){t=t||this.length,0>t&&(t+=this.length),e=e||0,0>e&&(e+=this.length);var r=new n;if(e>t||0>t)return r;0>e&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&e>i;i++)o=o.next;for(;null!==o&&t>i;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){t=t||this.length,0>t&&(t+=this.length),e=e||0,0>e&&(e+=this.length);var r=new n;if(e>t||0>t)return r;0>e&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this}},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(58),l=r(u),c=n(59),f=(r(c),n(24)),h=r(f),p=function(e){function t(e,n,r){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n,r)}return o(t,e),a(t,[{key:"requestTileAsync",value:function(){var e=this;setTimeout(function(){e._mesh||(e._mesh=e._createMesh(),e._requestTile())},0)}},{key:"destroy",value:function(){this._abortRequest(),this._image=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"_createMesh",value:function(){if(this._center){var e,t=new h["default"].Object3D,n=new h["default"].PlaneBufferGeometry(this._side,this._side,1);this._world._environment._skybox?(e=new h["default"].MeshStandardMaterial({depthWrite:!1}),e.roughness=1,e.metalness=.1,e.envMap=this._world._environment._skybox.getRenderTarget()):e=new h["default"].MeshBasicMaterial({depthWrite:!1});var r=new h["default"].Mesh(n,e);return r.rotation.x=-90*Math.PI/180,r.receiveShadow=!0,t.add(r),t.renderOrder=.1,t.position.x=this._center[0],t.position.z=this._center[1],t}}},{key:"_createDebugMesh",value:function(){var e=document.createElement("canvas");e.width=256,e.height=256;var t=e.getContext("2d");t.font="Bold 20px Helvetica Neue, Verdana, Arial",t.fillStyle="#ff0000",t.fillText(this._quadcode,20,e.width/2-5),t.fillText(this._tile.toString(),20,e.width/2+25);var n=new h["default"].Texture(e);n.magFilter=h["default"].LinearFilter,n.minFilter=h["default"].LinearMipMapLinearFilter,n.anisotropy=4,n.needsUpdate=!0;var r=new h["default"].MeshBasicMaterial({map:n,transparent:!0,depthWrite:!1}),i=new h["default"].PlaneBufferGeometry(this._side,this._side,1),o=new h["default"].Mesh(i,r);return o.rotation.x=-90*Math.PI/180,o.position.y=.1,o}},{key:"_requestTile",value:function(){var e=this,t={x:this._tile[0],y:this._tile[1],z:this._tile[2]},n=this._getTileURL(t),r=document.createElement("img");r.addEventListener("load",function(t){var n=new h["default"].Texture;n.image=r,n.needsUpdate=!0,n.magFilter=h["default"].LinearFilter,n.minFilter=h["default"].LinearMipMapLinearFilter,n.anisotropy=4,n.needsUpdate=!0,e._mesh&&e._mesh.children[0]&&e._mesh.children[0].material&&(e._mesh.children[0].material.map=n,e._mesh.children[0].material.needsUpdate=!0,e._texture=n,e._ready=!0)},!1),r.crossOrigin="",r.src=n,this._image=r}},{key:"_abortRequest",value:function(){this._image&&(this._image.src="")}}]),t}(l["default"]);t["default"]=p;var d=function(e,t,n){return new p(e,t,n)};t.imageTile=d},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),s=n(10),u=n(24),l=r(u),c=180/Math.PI,f=/\{([szxy])\}/g,h=function(){function e(t,n,r){i(this,e),this._layer=r,this._world=r._world,this._quadcode=t,this._path=n,this._ready=!1,this._tile=this._quadcodeToTile(t),this._boundsLatLon=this._tileBoundsWGS84(this._tile),this._boundsWorld=this._tileBoundsFromWGS84(this._boundsLatLon),this._center=this._boundsToCenter(this._boundsWorld),this._centerLatlon=this._world.pointToLatLon((0,a.point)(this._center[0],this._center[1])),this._side=this._getSide(this._boundsWorld),this._pointScale=this._world.pointScale(this._centerLatlon)}return o(e,[{key:"isReady",value:function(){return this._ready}},{key:"requestTileAsync",value:function(){}},{key:"getQuadcode",value:function(){return this._quadcode}},{key:"getBounds",value:function(){return this._boundsWorld}},{key:"getCenter",value:function(){return this._center}},{key:"getSide",value:function(){return this._side}},{key:"getMesh",value:function(){return this._mesh}},{key:"getPickingMesh",value:function(){return this._pickingMesh}},{key:"destroy",value:function(){this._layer=null,this._world=null,this._boundsLatLon=null,this._boundsWorld=null,this._center=null,this._mesh&&(this._mesh.children?this._mesh.children.forEach(function(e){e.geometry.dispose(),e.geometry=null,e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null}):(this._mesh.geometry.dispose(),this._mesh.geometry=null,this._mesh.material.map&&(this._mesh.material.map.dispose(),this._mesh.material.map=null),this._mesh.material.dispose(),this._mesh.material=null))}},{key:"_createMesh",value:function(){}},{key:"_createDebugMesh",value:function(){}},{key:"_getTileURL",value:function(e){return e.s||(e.s=String.fromCharCode(97+Math.floor(3*Math.random()))),f.lastIndex=0,this._path.replace(f,function(t,n){return e[n]})}},{key:"_quadcodeToTile",value:function(e){for(var t=0,n=0,r=e.length,i=r;i>0;i--){var o=1<<i-1,a=+e[r-i];1===a&&(t|=o),2===a&&(n|=o),3===a&&(t|=o,n|=o)}return[t,n,r]}},{key:"_tileBoundsFromWGS84",value:function(e){var t=this._layer._world.latLonToPoint((0,s.latLon)(e[1],e[0])),n=this._layer._world.latLonToPoint((0,s.latLon)(e[3],e[2]));return[t.x,t.y,n.x,n.y]}},{key:"_tileBoundsWGS84",value:function(e){var t=this._tile2lon(e[0]+1,e[2]),n=this._tile2lon(e[0],e[2]),r=this._tile2lat(e[1]+1,e[2]),i=this._tile2lat(e[1],e[2]);return[n,r,t,i]}},{key:"_tile2lon",value:function(e,t){return e/Math.pow(2,t)*360-180}},{key:"_tile2lat",value:function(e,t){var n=Math.PI-2*Math.PI*e/Math.pow(2,t);return c*Math.atan(.5*(Math.exp(n)-Math.exp(-n)))}},{key:"_boundsToCenter",value:function(e){var t=e[0]+(e[2]-e[0])/2,n=e[1]+(e[3]-e[1])/2;return[t,n]}},{key:"_getSide",value:function(e){return new l["default"].Vector3(e[0],0,e[3]).sub(new l["default"].Vector3(e[0],0,e[1])).length()}}]),e}();t["default"]=h,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);BoxHelper=function(e){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new o["default"].BufferGeometry;r.setIndex(new o["default"].BufferAttribute(t,1)),r.addAttribute("position",new o["default"].BufferAttribute(n,3)),o["default"].LineSegments.call(this,r,new o["default"].LineBasicMaterial({linewidth:2,color:16711680})),void 0!==e&&this.update(e)},BoxHelper.prototype=Object.create(o["default"].LineSegments.prototype),BoxHelper.prototype.constructor=BoxHelper,BoxHelper.prototype.update=function(){var e=new o["default"].Box3;return function(t){if(e.setFromObject(t),!e.isEmpty()){var n=e.min,r=e.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),t["default"]=BoxHelper,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(e,t){var n=document.createElement("canvas");n.width=1,n.height=1;var r=n.getContext("2d");r.fillStyle=e,r.fillRect(0,0,n.width,n.height);var i=new o["default"].Texture(n);i.needsUpdate=!0;var a;return t?(a=new o["default"].MeshStandardMaterial({depthWrite:!1}),a.roughness=1,a.metalness=.1,a.envMap=t):a=new o["default"].MeshBasicMaterial({map:i,depthWrite:!1}),a},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(47),l=r(u),c=n(3),f=r(c),h=n(62),p=r(h),d=n(40),v=r(d),y=n(24),_=(r(y),function(e){function t(e,n){i(this,t);var r={maxLOD:14,distance:2e3};n=(0,f["default"])({},r,n),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,n),
this._path=e}return o(t,e),a(t,[{key:"_onAdd",value:function(e){var n=this;s(Object.getPrototypeOf(t.prototype),"_onAdd",this).call(this,e),setTimeout(function(){n._calculateLOD(),n._initEvents()},0)}},{key:"_initEvents",value:function(){this._throttledWorldUpdate=(0,v["default"])(this._onWorldUpdate,100),this._world.on("preUpdate",this._throttledWorldUpdate,this),this._world.on("move",this._onWorldMove,this),this._world.on("controlsMove",this._onControlsMove,this)}},{key:"_onWorldUpdate",value:function(){this._pauseOutput||this._outputTiles()}},{key:"_onWorldMove",value:function(e,t){this._pauseOutput=!1,this._calculateLOD()}},{key:"_onControlsMove",value:function(){this._pauseOutput=!0}},{key:"_createTile",value:function(e,t){var n={};return this._options.filter&&(n.filter=this._options.filter),this._options.style&&(n.style=this._options.style),this._options.topojson&&(n.topojson=!0),this._options.picking&&(n.picking=!0),this._options.onClick&&(n.onClick=this._options.onClick),new p["default"](e,this._path,t,n)}},{key:"destroy",value:function(){this._world.off("preUpdate",this._throttledWorldUpdate),this._world.off("move",this._onWorldMove),this._throttledWorldUpdate=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]));t["default"]=_;var m=function(e,t){return new _(e,t)};t.geoJSONTileLayer=m},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(58),l=r(u),c=n(59),f=(r(c),n(24)),h=r(f),p=n(63),d=r(p),v=n(11),y=n(10),_=n(3),m=r(_),g=n(65),b=r(g),w=n(69),x=r(w),k=n(70),M=r(k),O=function(e){function t(e,n,r,o){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n,r),this._defaultStyle=b["default"].defaultStyle;var a={picking:!1,topojson:!1,filter:null,onClick:null,style:this._defaultStyle};this._options=(0,m["default"])({},a,o),"function"==typeof o.style?this._options.style=o.style:this._options.style=(0,m["default"])({},a.style,o.style)}return o(t,e),a(t,[{key:"requestTileAsync",value:function(){var e=this;setTimeout(function(){e._mesh||(e._mesh=e._createMesh(),e._options.picking&&(e._pickingMesh=e._createPickingMesh()),e._requestTile())},0)}},{key:"destroy",value:function(){this._abortRequest(),this._request=null,this._pickingMesh=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"_createMesh",value:function(){if(this._center){var e=new h["default"].Object3D;return e.position.x=this._center[0],e.position.z=this._center[1],e}}},{key:"_createPickingMesh",value:function(){if(this._center){var e=new h["default"].Object3D;return e.position.x=this._center[0],e.position.z=this._center[1],e}}},{key:"_createDebugMesh",value:function(){var e=document.createElement("canvas");e.width=256,e.height=256;var t=e.getContext("2d");t.font="Bold 20px Helvetica Neue, Verdana, Arial",t.fillStyle="#ff0000",t.fillText(this._quadcode,20,e.width/2-5),t.fillText(this._tile.toString(),20,e.width/2+25);var n=new h["default"].Texture(e);n.magFilter=h["default"].LinearFilter,n.minFilter=h["default"].LinearMipMapLinearFilter,n.anisotropy=4,n.needsUpdate=!0;var r=new h["default"].MeshBasicMaterial({map:n,transparent:!0,depthWrite:!1}),i=new h["default"].PlaneBufferGeometry(this._side,this._side,1),o=new h["default"].Mesh(i,r);return o.rotation.x=-90*Math.PI/180,o.position.y=.1,o}},{key:"_createShadowCanvas",value:function(){var e=document.createElement("canvas");return e.width=512,e.height=512,e}},{key:"_requestTile",value:function(){var e=this,t={x:this._tile[0],y:this._tile[1],z:this._tile[2]},n=this._getTileURL(t);this._request=(0,d["default"])({url:n,type:"json",crossOrigin:!0}).then(function(t){e._request=null,e._processTileData(t)})["catch"](function(t){console.error(t),e._request=null})}},{key:"_processTileData",value:function(e){var t=this;console.time(this._tile);var n=b["default"].mergeFeatures(e,this._options.topojson),r=n.features;this._options.filter&&(r=n.features.filter(this._options.filter));var i=this._options.style,o=(0,v.point)(0,0);o.x=-1*this._center[0],o.y=-1*this._center[1];var a={vertices:[],faces:[],colours:[],facesCount:0,allFlat:!0},s={vertices:[],colours:[],verticesCount:0};this._options.picking&&(a.pickingIds=[],s.pickingIds=[]);var u=new h["default"].Color;r.forEach(function(e){if("Polygon"===e.geometry.type||"LineString"===e.geometry.type||"MultiLineString"===e.geometry.type){"function"==typeof t._options.style&&(i=(0,m["default"])({},t._defaultStyle,t._options.style(e)));var n=e.geometry.coordinates;if("LineString"===e.geometry.type){u.set(i.lineColor),n=n.map(function(e){var n=(0,y.latLon)(e[1],e[0]),r=t._layer._world.latLonToPoint(n);return[r.x,r.y]});var r=0;i.lineHeight&&(r=t._world.metresToWorld(i.lineHeight,t._pointScale));var o=b["default"].lineStringAttributes(n,u,r);if(s.vertices.push(o.vertices),s.colours.push(o.colours),t._options.picking){var l=t._layer.getPickingId();s.pickingIds.push(l),t._options.onClick&&t._world.on("pick-"+l,function(n,r,i){t._options.onClick(e,n,r,i)})}s.verticesCount+=o.vertices.length}if("MultiLineString"===e.geometry.type){u.set(i.lineColor),n=n.map(function(e){return e.map(function(e){var n=(0,y.latLon)(e[1],e[0]),r=t._layer._world.latLonToPoint(n);return[r.x,r.y]})});var r=0;i.lineHeight&&(r=t._world.metresToWorld(i.lineHeight,t._pointScale));var c=b["default"].multiLineStringAttributes(n,u,r);if(s.vertices.push(c.vertices),s.colours.push(c.colours),t._options.picking){var l=t._layer.getPickingId();s.pickingIds.push(l),t._options.onClick&&t._world.on("pick-"+l,function(n,r,i){t._options.onClick(e,n,r,i)})}s.verticesCount+=c.vertices.length}if("Polygon"===e.geometry.type){u.set(i.color),n=n.map(function(e){return e.map(function(e){var n=(0,y.latLon)(e[1],e[0]),r=t._layer._world.latLonToPoint(n);return[r.x,r.y]})});var r=0;i.height&&(r=t._world.metresToWorld(i.height,t._pointScale));var f=b["default"].polygonAttributes(n,u,r);if(a.vertices.push(f.vertices),a.faces.push(f.faces),a.colours.push(f.colours),t._options.picking){var l=t._layer.getPickingId();a.pickingIds.push(l),t._options.onClick&&t._world.on("pick-"+l,function(n,r,i){t._options.onClick(e,n,r,i)})}a.allFlat&&!f.flat&&(a.allFlat=!1),a.facesCount+=f.faces.length}}});var l,c,f;if(s.vertices.length>0&&(l=x["default"].createLineGeometry(s,o),c=new h["default"].LineBasicMaterial({vertexColors:h["default"].VertexColors,linewidth:i.lineWidth,transparent:i.lineTransparent,opacity:i.lineOpacity,blending:i.lineBlending}),f=new h["default"].LineSegments(l,c),void 0!==i.lineRenderOrder&&(c.depthWrite=!1,f.renderOrder=i.lineRenderOrder),this._mesh.add(f),this._options.picking)){c=new M["default"],c.side=h["default"].BackSide,c.linewidth=i.lineWidth+c.linePadding;var p=new h["default"].LineSegments(l,c);this._pickingMesh.add(p)}if(a.facesCount>0&&(l=x["default"].createGeometry(a,o),this._world._environment._skybox?(c=new h["default"].MeshStandardMaterial({vertexColors:h["default"].VertexColors,side:h["default"].BackSide}),c.roughness=1,c.metalness=.1,c.envMapIntensity=3,c.envMap=this._world._environment._skybox.getRenderTarget()):c=new h["default"].MeshPhongMaterial({vertexColors:h["default"].VertexColors,side:h["default"].BackSide}),f=new h["default"].Mesh(l,c),f.castShadow=!0,f.receiveShadow=!0,a.allFlat&&(c.depthWrite=!1,f.renderOrder=1),this._mesh.add(f),this._options.picking)){c=new M["default"],c.side=h["default"].BackSide;var p=new h["default"].Mesh(l,c);this._pickingMesh.add(p)}this._ready=!0,console.timeEnd(this._tile),console.log(this._tile+": "+r.length+" features")}},{key:"_abortRequest",value:function(){this._request&&this._request.abort()}}]),t}(l["default"]);t["default"]=O;var E=function(e,t,n,r){return new O(e,t,n,r)};t.geoJSONTile=E},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():(__WEBPACK_AMD_DEFINE_FACTORY__=n,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}("reqwest",this,function(){function succeed(e){var t=protocolRe.exec(e.url);return t=t&&t[1]||context.location.protocol,httpsRe.test(t)?twoHundo.test(e.request.status):!!e.request.response}function handleReadyState(e,t,n){return function(){return e._aborted?n(e.request):e._timedOut?n(e.request,"Request is aborted: timeout"):void(e.request&&4==e.request[readyState]&&(e.request.onreadystatechange=noop,succeed(e)?t(e.request):n(e.request)))}}function setHeaders(e,t){var n,r=t.headers||{};r.Accept=r.Accept||defaultHeaders.accept[t.type]||defaultHeaders.accept["*"];var i="undefined"!=typeof FormData&&t.data instanceof FormData;t.crossOrigin||r[requestedWith]||(r[requestedWith]=defaultHeaders.requestedWith),r[contentType]||i||(r[contentType]=t.contentType||defaultHeaders.contentType);for(n in r)r.hasOwnProperty(n)&&"setRequestHeader"in e&&e.setRequestHeader(n,r[n])}function setCredentials(e,t){"undefined"!=typeof t.withCredentials&&"undefined"!=typeof e.withCredentials&&(e.withCredentials=!!t.withCredentials)}function generalCallback(e){lastValue=e}function urlappend(e,t){return e+(/\?/.test(e)?"&":"?")+t}function handleJsonp(e,t,n,r){var i=uniqid++,o=e.jsonpCallback||"callback",a=e.jsonpCallbackName||reqwest.getcallbackPrefix(i),s=new RegExp("((^|\\?|&)"+o+")=([^&]+)"),u=r.match(s),l=doc.createElement("script"),c=0,f=-1!==navigator.userAgent.indexOf("MSIE 10.0");return u?"?"===u[3]?r=r.replace(s,"$1="+a):a=u[3]:r=urlappend(r,o+"="+a),context[a]=generalCallback,l.type="text/javascript",l.src=r,l.async=!0,"undefined"==typeof l.onreadystatechange||f||(l.htmlFor=l.id="_reqwest_"+i),l.onload=l.onreadystatechange=function(){return l[readyState]&&"complete"!==l[readyState]&&"loaded"!==l[readyState]||c?!1:(l.onload=l.onreadystatechange=null,l.onclick&&l.onclick(),t(lastValue),lastValue=void 0,head.removeChild(l),void(c=1))},head.appendChild(l),{abort:function(){l.onload=l.onreadystatechange=null,n({},"Request is aborted: timeout",{}),lastValue=void 0,head.removeChild(l),c=1}}}function getRequest(e,t){var n,r=this.o,i=(r.method||"GET").toUpperCase(),o="string"==typeof r?r:r.url,a=r.processData!==!1&&r.data&&"string"!=typeof r.data?reqwest.toQueryString(r.data):r.data||null,s=!1;return"jsonp"!=r.type&&"GET"!=i||!a||(o=urlappend(o,a),a=null),"jsonp"==r.type?handleJsonp(r,e,t,o):(n=r.xhr&&r.xhr(r)||xhr(r),n.open(i,o,r.async===!1?!1:!0),setHeaders(n,r),setCredentials(n,r),context[xDomainRequest]&&n instanceof context[xDomainRequest]?(n.onload=e,n.onerror=t,n.onprogress=function(){},s=!0):n.onreadystatechange=handleReadyState(this,e,t),r.before&&r.before(n),s?setTimeout(function(){n.send(a)},200):n.send(a),n)}function Reqwest(e,t){this.o=e,this.fn=t,init.apply(this,arguments)}function setType(e){return null!==e?e.match("json")?"json":e.match("javascript")?"js":e.match("text")?"html":e.match("xml")?"xml":void 0:void 0}function init(o,fn){function complete(e){for(o.timeout&&clearTimeout(self.timeout),self.timeout=null;self._completeHandlers.length>0;)self._completeHandlers.shift()(e)}function success(resp){var type=o.type||resp&&setType(resp.getResponseHeader("Content-Type"));resp="jsonp"!==type?self.request:resp;var filteredResponse=globalSetupOptions.dataFilter(resp.responseText,type),r=filteredResponse;try{resp.responseText=r}catch(e){}if(r)switch(type){case"json":try{resp=context.JSON?context.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r;break;case"xml":resp=resp.responseXML&&resp.responseXML.parseError&&resp.responseXML.parseError.errorCode&&resp.responseXML.parseError.reason?null:resp.responseXML}for(self._responseArgs.resp=resp,self._fulfilled=!0,fn(resp),self._successHandler(resp);self._fulfillmentHandlers.length>0;)resp=self._fulfillmentHandlers.shift()(resp);complete(resp)}function timedOut(){self._timedOut=!0,self.request.abort()}function error(e,t,n){for(e=self.request,self._responseArgs.resp=e,self._responseArgs.msg=t,self._responseArgs.t=n,self._erred=!0;self._errorHandlers.length>0;)self._errorHandlers.shift()(e,t,n);complete(e)}this.url="string"==typeof o?o:o.url,this.timeout=null,this._fulfilled=!1,this._successHandler=function(){},this._fulfillmentHandlers=[],this._errorHandlers=[],this._completeHandlers=[],this._erred=!1,this._responseArgs={};var self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){timedOut()},o.timeout)),o.success&&(this._successHandler=function(){o.success.apply(o,arguments)}),o.error&&this._errorHandlers.push(function(){o.error.apply(o,arguments)}),o.complete&&this._completeHandlers.push(function(){o.complete.apply(o,arguments)}),this.request=getRequest.call(this,success,error)}function reqwest(e,t){return new Reqwest(e,t)}function normalize(e){return e?e.replace(/\r?\n/g,"\r\n"):""}function serial(e,t){var n,r,i,o,a=e.name,s=e.tagName.toLowerCase(),u=function(e){e&&!e.disabled&&t(a,normalize(e.attributes.value&&e.attributes.value.specified?e.value:e.text))};if(!e.disabled&&a)switch(s){case"input":/reset|button|image|file/i.test(e.type)||(n=/checkbox/i.test(e.type),r=/radio/i.test(e.type),i=e.value,(!(n||r)||e.checked)&&t(a,normalize(n&&""===i?"on":i)));break;case"textarea":t(a,normalize(e.value));break;case"select":if("select-one"===e.type.toLowerCase())u(e.selectedIndex>=0?e.options[e.selectedIndex]:null);else for(o=0;e.length&&o<e.length;o++)e.options[o].selected&&u(e.options[o])}}function eachFormElement(){var e,t,n=this,r=function(e,t){var r,i,o;for(r=0;r<t.length;r++)for(o=e[byTag](t[r]),i=0;i<o.length;i++)serial(o[i],n)};for(t=0;t<arguments.length;t++)e=arguments[t],/input|select|textarea/i.test(e.tagName)&&serial(e,n),r(e,["input","select","textarea"])}function serializeQueryString(){return reqwest.toQueryString(reqwest.serializeArray.apply(null,arguments))}function serializeHash(){var e={};return eachFormElement.apply(function(t,n){t in e?(e[t]&&!isArray(e[t])&&(e[t]=[e[t]]),e[t].push(n)):e[t]=n},arguments),e}function buildParams(e,t,n,r){var i,o,a,s=/\[\]$/;if(isArray(t))for(o=0;t&&o<t.length;o++)a=t[o],n||s.test(e)?r(e,a):buildParams(e+"["+("object"==typeof a?o:"")+"]",a,n,r);else if(t&&"[object Object]"===t.toString())for(i in t)buildParams(e+"["+i+"]",t[i],n,r);else r(e,t)}var context=this;if("window"in context)var doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0];else{var XHR2;try{XHR2=__webpack_require__(64)}catch(ex){throw new Error("Peer dependency `xhr2` required! Please npm install xhr2")}}var httpsRe=/^http/,protocolRe=/(^\w+):\/\//,twoHundo=/^(20\d|1223)$/,readyState="readyState",contentType="Content-Type",requestedWith="X-Requested-With",uniqid=0,callbackPrefix="reqwest_"+ +new Date,lastValue,xmlHttpRequest="XMLHttpRequest",xDomainRequest="XDomainRequest",noop=function(){},isArray="function"==typeof Array.isArray?Array.isArray:function(e){return e instanceof Array},defaultHeaders={contentType:"application/x-www-form-urlencoded",requestedWith:xmlHttpRequest,accept:{"*":"text/javascript, text/html, application/xml, text/xml, */*",xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript",js:"application/javascript, text/javascript"}},xhr=function(e){if(e.crossOrigin===!0){var t=context[xmlHttpRequest]?new XMLHttpRequest:null;if(t&&"withCredentials"in t)return t;if(context[xDomainRequest])return new XDomainRequest;throw new Error("Browser does not support cross-origin requests")}return context[xmlHttpRequest]?new XMLHttpRequest:XHR2?new XHR2:new ActiveXObject("Microsoft.XMLHTTP")},globalSetupOptions={dataFilter:function(e){return e}};return Reqwest.prototype={abort:function(){this._aborted=!0,this.request.abort()},retry:function(){init.call(this,this.o,this.fn)},then:function(e,t){return e=e||function(){},t=t||function(){},this._fulfilled?this._responseArgs.resp=e(this._responseArgs.resp):this._erred?t(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):(this._fulfillmentHandlers.push(e),this._errorHandlers.push(t)),this},always:function(e){return this._fulfilled||this._erred?e(this._responseArgs.resp):this._completeHandlers.push(e),this},fail:function(e){return this._erred?e(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):this._errorHandlers.push(e),this},"catch":function(e){return this.fail(e)}},reqwest.serializeArray=function(){var e=[];return eachFormElement.apply(function(t,n){e.push({name:t,value:n})},arguments),e},reqwest.serialize=function(){if(0===arguments.length)return"";var e,t,n=Array.prototype.slice.call(arguments,0);return e=n.pop(),e&&e.nodeType&&n.push(e)&&(e=null),e&&(e=e.type),t="map"==e?serializeHash:"array"==e?reqwest.serializeArray:serializeQueryString,t.apply(null,n)},reqwest.toQueryString=function(e,t){var n,r,i=t||!1,o=[],a=encodeURIComponent,s=function(e,t){t="function"==typeof t?t():null==t?"":t,o[o.length]=a(e)+"="+a(t)};if(isArray(e))for(r=0;e&&r<e.length;r++)s(e[r].name,e[r].value);else for(n in e)e.hasOwnProperty(n)&&buildParams(n,e[n],i,s);return o.join("&").replace(/%20/g,"+")},reqwest.getcallbackPrefix=function(){return callbackPrefix},reqwest.compat=function(e,t){return e&&(e.type&&(e.method=e.type)&&delete e.type,e.dataType&&(e.type=e.dataType),e.jsonpCallback&&(e.jsonpCallbackName=e.jsonpCallback)&&delete e.jsonpCallback,e.jsonp&&(e.jsonpCallback=e.jsonp)),new Reqwest(e,t)},reqwest.ajaxSetup=function(e){e=e||{};for(var t in e)globalSetupOptions[t]=e[t]},reqwest})},function(e,t){},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=n(66),s=r(a),u=n(67),l=r(u),c=(new o["default"].Color(16777215),new o["default"].Color(6710886),function(){var e={color:"#ffffff",height:0,lineOpacity:1,lineTransparent:!1,lineColor:"#ffffff",lineWidth:1,lineBlending:o["default"].NormalBlending},t=function(e,t){var n=[];if(t){for(var r in e.objects)n.push(s["default"].feature(e,e.objects[r]));return(0,l["default"])(n)}if(e.type)return Array.isArray(e)?(0,l["default"])(e):e;for(var i in e)e[i].type&&n.push(e[i]);return(0,l["default"])(n)};return{defaultStyle:e,collectFeatures:t}}());t["default"]=c,e.exports=t["default"]},function(e,t,n){!function(e,n){n(t)}(this,function(e){"use strict";function t(){}function n(e){if(!e)return t;var n,r,i=e.scale[0],o=e.scale[1],a=e.translate[0],s=e.translate[1];return function(e,t){t||(n=r=0),e[0]=(n+=e[0])*i+a,e[1]=(r+=e[1])*o+s}}function r(e){if(!e)return t;var n,r,i=e.scale[0],o=e.scale[1],a=e.translate[0],s=e.translate[1];return function(e,t){t||(n=r=0);var u=(e[0]-a)/i|0,l=(e[1]-s)/o|0;e[0]=u-n,e[1]=l-r,n=u,r=l}}function i(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function o(e,t){for(var n=0,r=e.length;r>n;){var i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function a(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return s(e,t)})}:s(e,t)}function s(e,t){var n={type:"Feature",id:t.id,properties:t.properties||{},geometry:u(e,t)};return null==t.id&&delete n.id,n}function u(e,t){function r(e,t){t.length&&t.pop();for(var n,r=f[0>e?~e:e],o=0,a=r.length;a>o;++o)t.push(n=r[o].slice()),c(n,o);0>e&&i(t,a)}function o(e){return e=e.slice(),c(e,0),e}function a(e){for(var t=[],n=0,i=e.length;i>n;++n)r(e[n],t);return t.length<2&&t.push(t[0].slice()),t}function s(e){for(var t=a(e);t.length<4;)t.push(t[0].slice());return t}function u(e){return e.map(s)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in h?{type:t,coordinates:h[t](e)}:null}var c=n(e.transform),f=e.arcs,h={Point:function(e){return o(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(o)},LineString:function(e){return a(e.arcs)},MultiLineString:function(e){return e.arcs.map(a)},Polygon:function(e){return u(e.arcs)},MultiPolygon:function(e){return e.arcs.map(u)}};return l(t)}function l(e,t){function n(t){var n,r=e.arcs[0>t?~t:t],i=r[0];return e.transform?(n=[0,0],r.forEach(function(e){n[0]+=e[0],n[1]+=e[1]})):n=r[r.length-1],0>t?[n,i]:[i,n]}function r(e,t){for(var n in e){var r=e[n];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){i[0>e?~e:e]=1}),s.push(r)}}var i={},o={},a={},s=[],u=-1;return t.forEach(function(n,r){var i,o=e.arcs[0>n?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=t[++u],t[u]=n,t[r]=i)}),t.forEach(function(e){var t,r,i=n(e),s=i[0],u=i[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=u,r=o[u]){delete o[r.start];var l=r===t?t:t.concat(r);o[l.start=t.start]=a[l.end=r.end]=l}else o[t.start]=a[t.end]=t;else if(t=o[u])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=u]=t}),r(a,o),r(o,a),t.forEach(function(e){i[0>e?~e:e]||s.push([e])}),s}function c(e){return u(e,f.apply(this,arguments))}function f(e,t,n){function r(e){var t=0>e?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function i(e){e.forEach(r)}function o(e){e.forEach(i)}function a(e){"GeometryCollection"===e.type?e.geometries.forEach(a):e.type in f&&(u=e,f[e.type](e.arcs))}var s=[];if(arguments.length>1){var u,c=[],f={LineString:i,MultiLineString:o,Polygon:o,MultiPolygon:function(e){e.forEach(o)}};a(t),c.forEach(arguments.length<3?function(e){s.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&s.push(e[0].i)})}else for(var h=0,p=e.arcs.length;p>h;++h)s.push(h);return{type:"MultiLineString",arcs:l(e,s)}}function h(e){var t=e[0],n=e[1],r=e[2];return Math.abs((t[0]-r[0])*(n[1]-t[1])-(t[0]-n[0])*(r[1]-t[1]))}function p(e){for(var t,n=-1,r=e.length,i=e[r-1],o=0;++n<r;)t=i,i=e[n],o+=t[0]*i[1]-t[1]*i[0];return o/2}function d(e){return u(e,v.apply(this,arguments))}function v(e,t){function n(e){e.forEach(function(t){t.forEach(function(t){(i[t=0>t?~t:t]||(i[t]=[])).push(e)})}),o.push(e)}function r(t){return p(u(e,{type:"Polygon",arcs:[t]}).coordinates[0])>0}var i={},o=[],a=[];return t.forEach(function(e){"Polygon"===e.type?n(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(n)}),o.forEach(function(e){if(!e._){var t=[],n=[e];for(e._=1,a.push(t);e=n.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){i[0>e?~e:e].forEach(function(e){e._||(e._=1,n.push(e))})})})}}),o.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:a.map(function(t){var n,o=[];if(t.forEach(function(e){e.forEach(function(e){e.forEach(function(e){i[0>e?~e:e].length<2&&o.push(e)})})}),o=l(e,o),(n=o.length)>1)for(var a,s=r(t[0][0]),u=0;n>u;++u)if(s===r(o[u])){a=o[0],o[0]=o[u],o[u]=a;break}return o})}}function y(e){function t(e,t){e.forEach(function(e){0>e&&(e=~e);var n=i[e];n?n.push(t):i[e]=[t]})}function n(e,n){e.forEach(function(e){t(e,n)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in s&&s[e.type](e.arcs,t)}var i={},a=e.map(function(){return[]}),s={LineString:t,MultiLineString:n,Polygon:n,MultiPolygon:function(e,t){e.forEach(function(e){n(e,t)})}};e.forEach(r);for(var u in i)for(var l=i[u],c=l.length,f=0;c>f;++f)for(var h=f+1;c>h;++h){var p,d=l[f],v=l[h];(p=a[d])[u=o(p,v)]!==v&&p.splice(u,0,v),(p=a[v])[u=o(p,d)]!==d&&p.splice(u,0,d)}return a}function _(e,t){return e[1][2]-t[1][2]}function m(){function e(e,t){for(;t>0;){var n=(t+1>>1)-1,i=r[n];if(_(e,i)>=0)break;r[i._=t]=i,r[e._=t=n]=e}}function t(e,t){for(;;){var n=t+1<<1,o=n-1,a=t,s=r[a];if(i>o&&_(r[o],s)<0&&(s=r[a=o]),i>n&&_(r[n],s)<0&&(s=r[a=n]),a===t)break;r[s._=t]=s,r[e._=t=a]=e}}var n={},r=[],i=0;return n.push=function(t){return e(r[t._=i]=t,i++),i},n.pop=function(){if(!(0>=i)){var e,n=r[0];return--i>0&&(e=r[i],t(r[e._=0]=e,0)),n}},n.remove=function(n){var o,a=n._;if(r[a]===n)return a!==--i&&(o=r[i],(_(o,n)<0?e:t)(r[o._=a]=o,a)),a},n}function g(e,t){function i(e){s.remove(e),e[1][2]=t(e),s.push(e)}var o=n(e.transform),a=r(e.transform),s=m();return t||(t=h),e.arcs.forEach(function(e){var n,r,u,l,c=[],f=0;for(r=0,u=e.length;u>r;++r)l=e[r],o(e[r]=[l[0],l[1],1/0],r);for(r=1,u=e.length-1;u>r;++r)n=e.slice(r-1,r+2),n[1][2]=t(n),c.push(n),s.push(n);for(r=0,u=c.length;u>r;++r)n=c[r],n.previous=c[r-1],n.next=c[r+1];for(;n=s.pop();){var h=n.previous,p=n.next;n[1][2]<f?n[1][2]=f:f=n[1][2],h&&(h.next=p,h[2]=n[2],i(h)),p&&(p.previous=h,p[0]=n[0],i(p))}e.forEach(a)}),e}var b="1.6.24";e.version=b,e.mesh=c,e.meshArcs=f,e.merge=d,e.mergeArcs=v,e.feature=a,e.neighbors=y,e.presimplify=g})},function(e,t,n){var r=n(68);e.exports=function(e){return{type:"FeatureCollection",features:e.reduce(function(e,t){return e.concat(r(t).features)},[])}}},function(e,t){function n(e){if(!e||!e.type)return null;var t=r[e.type];return t?"geometry"===t?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]}:"feature"===t?{type:"FeatureCollection",features:[e]}:"featurecollection"===t?e:void 0:null}e.exports=n;var r={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=function(){var e=function(e){var t={};e.forEach(function(e){for(var n in e)t[n]||(t[n]=0),t[n]+=e[n].length});var n={};for(var r in t)n[r]=new Float32Array(t[r]);var i={};return e.forEach(function(e){for(var t in e)i[t]||(i[t]=0),n[t].set(e[t],i[t]),i[t]+=e[t].length}),n},t=function(e,t){var n,r=new o["default"].BufferGeometry,i=new Float32Array(3*e.verticesCount),a=new Float32Array(3*e.verticesCount);e.pickingIds&&(n=new Float32Array(e.verticesCount));for(var s,u,l,c=0,f=0;f<e.vertices.length;f++){s=e.vertices[f],u=e.colours[f],n&&(l=e.pickingIds[f]);for(var h=0;h<s.length;h++){var p=s[h][0]+t.x,d=s[h][1],v=s[h][2]+t.y,y=u[h];i[3*c+0]=p,i[3*c+1]=d,i[3*c+2]=v,a[3*c+0]=y[0],a[3*c+1]=y[1],a[3*c+2]=y[2],n&&(n[c]=l),c++}}return r.addAttribute("position",new o["default"].BufferAttribute(i,3)),r.addAttribute("color",new o["default"].BufferAttribute(a,3)),n&&r.addAttribute("pickingId",new o["default"].BufferAttribute(n,1)),r.computeBoundingBox(),r},n=function(e,t){var n,r=new o["default"].BufferGeometry,i=new Float32Array(9*e.facesCount),a=new Float32Array(9*e.facesCount),s=new Float32Array(9*e.facesCount);e.pickingIds&&(n=new Float32Array(3*e.facesCount));for(var u,l,c,f,h,p=new o["default"].Vector3,d=new o["default"].Vector3,v=new o["default"].Vector3,y=new o["default"].Vector3,_=new o["default"].Vector3,m=0,g=0;g<e.faces.length;g++){l=e.faces[g],c=e.vertices[g],f=e.colours[g],n&&(h=e.pickingIds[g]);for(var b=0;b<l.length;b++){u=l[b][0];var w=c[u][0]+t.x,x=c[u][1],k=c[u][2]+t.y,M=f[b][0];u=l[b][1];var O=c[u][0]+t.x,E=c[u][1],P=c[u][2]+t.y,T=f[b][1];u=l[b][2];var j=c[u][0]+t.x,S=c[u][1],C=c[u][2]+t.y,A=f[b][2];p.set(w,x,k),d.set(O,E,P),v.set(j,S,C),y.subVectors(v,d),_.subVectors(p,d),y.cross(_),y.normalize();var L=y.x,D=y.y,R=y.z;i[9*m+0]=w,i[9*m+1]=x,i[9*m+2]=k,a[9*m+0]=L,a[9*m+1]=D,a[9*m+2]=R,s[9*m+0]=M[0],s[9*m+1]=M[1],s[9*m+2]=M[2],i[9*m+3]=O,i[9*m+4]=E,i[9*m+5]=P,a[9*m+3]=L,a[9*m+4]=D,a[9*m+5]=R,s[9*m+3]=T[0],s[9*m+4]=T[1],s[9*m+5]=T[2],i[9*m+6]=j,i[9*m+7]=S,i[9*m+8]=C,a[9*m+6]=L,a[9*m+7]=D,a[9*m+8]=R,s[9*m+6]=A[0],s[9*m+7]=A[1],s[9*m+8]=A[2],n&&(n[3*m+0]=h,n[3*m+1]=h,n[3*m+2]=h),m++}}return r.addAttribute("position",new o["default"].BufferAttribute(i,3)),r.addAttribute("normal",new o["default"].BufferAttribute(a,3)),r.addAttribute("color",new o["default"].BufferAttribute(s,3)),n&&r.addAttribute("pickingId",new o["default"].BufferAttribute(n,1)),r.computeBoundingBox(),r};return{mergeAttributes:e,createLineGeometry:t,createGeometry:n}}();t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=n(71),s=r(a),u=function(){o["default"].ShaderMaterial.call(this,{uniforms:{size:{type:"f",value:.01},scale:{type:"f",value:400}},vertexShader:s["default"].vertexShader,fragmentShader:s["default"].fragmentShader}),this.linePadding=2};u.prototype=Object.create(o["default"].ShaderMaterial.prototype),u.prototype.constructor=u,u.prototype.setPointSize=function(e){this.uniforms.size.value=e},u.prototype.setPointScale=function(e){this.uniforms.scale.value=e},t["default"]=u,e.exports=t["default"]},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={vertexShader:["attribute float pickingId;","","varying vec4 worldId;","","void main() {"," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );"," vec3 a = fract(vec3(1.0/255.0, 1.0/(255.0*255.0), 1.0/(255.0*255.0*255.0)) * pickingId);"," a -= a.xxy * vec3(0.0, 1.0/255.0, 1.0/255.0);"," worldId = vec4(a,1);"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#ifdef GL_ES\n","precision highp float;\n","#endif\n","","varying vec4 worldId;","","void main() {"," gl_FragColor = worldId;","}"].join("\n")};t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},s=n(61),u=r(s),l=n(3),c=r(l),f=function(e){function t(e,n){i(this,t);var r={topojson:!0};n=(0,c["default"])({},r,n),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n)}return o(t,e),t}(u["default"]);t["default"]=f;var h=function(e,t){return new f(e,t)};t.topoJSONTileLayer=h},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),
Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(74),l=r(u),c=n(3),f=r(c),h=n(63),p=r(h),d=n(65),v=r(d),y=n(69),_=r(y),m=n(70),g=r(m),b=n(75),w=r(b),x=n(78),k=r(x),M=n(79),O=r(M),E=function(e){function t(e,n){i(this,t);var r={output:!1,interactive:!1,topojson:!1,filter:null,onEachFeature:null,polygonMaterial:null,onPolygonMesh:null,onPolygonBufferAttributes:null,polylineMaterial:null,onPolylineMesh:null,onPolylineBufferAttributes:null,pointGeometry:null,pointMaterial:null,onPointMesh:null,style:v["default"].defaultStyle},o=(0,f["default"])({},r,n);"function"==typeof n.style?o.style=n.style:o.style=(0,f["default"])({},r.style,n.style),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,o),this._geojson=e}return o(t,e),a(t,[{key:"_onAdd",value:function(e){this.isOutput()&&(this._pickingMesh=new THREE.Object3D,this.addToPicking(this._pickingMesh)),"string"==typeof this._geojson?this._requestData(this._geojson):this._processData(this._geojson)}},{key:"_requestData",value:function(e){var t=this;this._request=(0,p["default"])({url:e,type:"json",crossOrigin:!0}).then(function(e){t._request=null,t._processData(e)})["catch"](function(e){console.error(e),t._request=null})}},{key:"_processData",value:function(e){var t=this;this._geojson=v["default"].collectFeatures(e,this._options.topojson);var n=this._geojson.features;this._options.filter&&(n=this._geojson.features.filter(this._options.filter));var r,i={},o=this._options.style;if(n.forEach(function(e){"function"==typeof t._options.style&&(o=(0,f["default"])({},v["default"].defaultStyle,t._options.style(e))),r=(0,f["default"])({},i,{output:!t.isOutput(),interactive:t._options.interactive,style:o});var n=t._featureToLayer(e,r);n&&(n.feature=e,t._options.onEachFeature&&t._options.onEachFeature(e,n),t.addLayer(n))}),this.isOutput()){var a=[],s=!0,u=[],l=[];if(this._layers.forEach(function(e){e instanceof w["default"]?(a.push(e.getBufferAttributes()),s&&!e.isFlat()&&(s=!1)):e instanceof k["default"]?u.push(e.getBufferAttributes()):e instanceof O["default"]&&l.push(e.getBufferAttributes())}),a.length>0){var c=_["default"].mergeAttributes(a);this._setPolygonMesh(c,s),this.add(this._polygonMesh)}if(u.length>0){var h=_["default"].mergeAttributes(u);this._setPolylineMesh(h),this.add(this._polylineMesh)}if(l.length>0){var p=_["default"].mergeAttributes(l);this._setPointMesh(p),this.add(this._pointMesh)}}}},{key:"_setPolygonMesh",value:function(e,t){var n=new THREE.BufferGeometry;n.addAttribute("position",new THREE.BufferAttribute(e.vertices,3)),n.addAttribute("normal",new THREE.BufferAttribute(e.normals,3)),n.addAttribute("color",new THREE.BufferAttribute(e.colours,3)),e.pickingIds&&n.addAttribute("pickingId",new THREE.BufferAttribute(e.pickingIds,1)),n.computeBoundingBox();var r;if(this._options.polygonMaterial&&this._options.polygonMaterial instanceof THREE.Material?r=this._options.material:this._world._environment._skybox?(r=new THREE.MeshStandardMaterial({vertexColors:THREE.VertexColors,side:THREE.BackSide}),r.roughness=1,r.metalness=.1,r.envMapIntensity=3,r.envMap=this._world._environment._skybox.getRenderTarget()):r=new THREE.MeshPhongMaterial({vertexColors:THREE.VertexColors,side:THREE.BackSide}),mesh=new THREE.Mesh(n,r),mesh.castShadow=!0,mesh.receiveShadow=!0,t&&(r.depthWrite=!1,mesh.renderOrder=1),this._options.interactive&&this._pickingMesh){r=new g["default"],r.side=THREE.BackSide;var i=new THREE.Mesh(n,r);this._pickingMesh.add(i)}"function"==typeof this._options.onPolygonMesh&&this._options.onPolygonMesh(mesh),this._polygonMesh=mesh}},{key:"_setPolylineMesh",value:function(e){var t=new THREE.BufferGeometry;t.addAttribute("position",new THREE.BufferAttribute(e.vertices,3)),t.addAttribute("color",new THREE.BufferAttribute(e.colours,3)),e.pickingIds&&t.addAttribute("pickingId",new THREE.BufferAttribute(e.pickingIds,1)),t.computeBoundingBox();var n="function"==typeof this._options.style?this._options.style(this._geojson.features[0]):this._options.style;n=(0,f["default"])({},v["default"].defaultStyle,n);var r;r=this._options.polylineMaterial&&this._options.polylineMaterial instanceof THREE.Material?this._options.material:new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,linewidth:n.lineWidth,transparent:n.lineTransparent,opacity:n.lineOpacity,blending:n.lineBlending});var i=new THREE.LineSegments(t,r);if(void 0!==n.lineRenderOrder&&(r.depthWrite=!1,i.renderOrder=n.lineRenderOrder),i.castShadow=!0,this._options.interactive&&this._pickingMesh){r=new g["default"],r.linewidth=n.lineWidth+r.linePadding;var o=new THREE.LineSegments(t,r);this._pickingMesh.add(o)}"function"==typeof this._options.onPolylineMesh&&this._options.onPolylineMesh(i),this._polylineMesh=i}},{key:"_setPointMesh",value:function(e){var t=new THREE.BufferGeometry;t.addAttribute("position",new THREE.BufferAttribute(e.vertices,3)),t.addAttribute("normal",new THREE.BufferAttribute(e.normals,3)),t.addAttribute("color",new THREE.BufferAttribute(e.colours,3)),e.pickingIds&&t.addAttribute("pickingId",new THREE.BufferAttribute(e.pickingIds,1)),t.computeBoundingBox();var n;if(this._options.pointMaterial&&this._options.pointMaterial instanceof THREE.Material?n=this._options.material:this._world._environment._skybox?(n=new THREE.MeshStandardMaterial({vertexColors:THREE.VertexColors}),n.roughness=1,n.metalness=.1,n.envMapIntensity=3,n.envMap=this._world._environment._skybox.getRenderTarget()):n=new THREE.MeshPhongMaterial({vertexColors:THREE.VertexColors}),mesh=new THREE.Mesh(t,n),mesh.castShadow=!0,this._options.interactive&&this._pickingMesh){n=new g["default"];var r=new THREE.Mesh(t,n);this._pickingMesh.add(r)}"function"==typeof this._options.onPointMesh&&this._options.onPointMesh(mesh),this._pointMesh=mesh}},{key:"_featureToLayer",value:function(e,t){var n=e.geometry,r=n.coordinates?n.coordinates:null;return r&&n?"Polygon"===n.type||"MultiPolygon"===n.type?("function"==typeof this._options.polygonMaterial&&(t.geometry=this._options.polygonMaterial(e)),"function"==typeof this._options.onPolygonMesh&&(t.onMesh=this._options.onPolygonMesh),"function"==typeof this._options.onPolygonBufferAttributes&&(t.onBufferAttributes=this._options.onPolygonBufferAttributes),new w["default"](r,t)):"LineString"===n.type||"MultiLineString"===n.type?("function"==typeof this._options.lineMaterial&&(t.geometry=this._options.lineMaterial(e)),"function"==typeof this._options.onPolylineMesh&&(t.onMesh=this._options.onPolylineMesh),"function"==typeof this._options.onPolylineBufferAttributes&&(t.onBufferAttributes=this._options.onPolylineBufferAttributes),new k["default"](r,t)):"Point"===n.type||"MultiPoint"===n.type?("function"==typeof this._options.pointGeometry&&(t.geometry=this._options.pointGeometry(e)),"function"==typeof this._options.pointMaterial&&(t.geometry=this._options.pointMaterial(e)),"function"==typeof this._options.onPointMesh&&(t.onMesh=this._options.onPointMesh),new O["default"](r,t)):void 0:void 0}},{key:"_abortRequest",value:function(){this._request&&this._request.abort()}},{key:"destroy",value:function(){this._abortRequest(),this._request=null,this._pickingMesh&&(this._pickingMesh=null),s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=E;var P=function(e,t){return new E(e,t)};t.geoJSONLayer=P},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(37),l=r(u),c=n(3),f=r(c),h=function(e){function t(e){i(this,t);var n={output:!1},r=(0,f["default"])({},n,e);s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,r),this._layers=[]}return o(t,e),a(t,[{key:"addLayer",value:function(e){this._layers.push(e),this._world.addLayer(e)}},{key:"removeLayer",value:function(e){var t=this._layers.indexOf(e);t>-1&&this._layers.splice(t,1),this._world.removeLayer(e)}},{key:"_onAdd",value:function(e){}},{key:"destroy",value:function(){for(var e=0;e<this._layers.length;e++)this._layers[e].destroy();this._layers=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=h;var p=function(e){return new h(e)};t.layerGroup=p},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},l=n(37),c=r(l),f=n(3),h=r(f),p=n(24),d=r(p),v=n(10),y=n(11),_=n(76),m=r(_),g=n(77),b=r(g),w=n(70),x=r(w),k=n(69),M=r(k),O=function(e){function t(e,n){o(this,t);var r={output:!0,interactive:!1,material:null,onMesh:null,onBufferAttributes:null,style:{color:"#ffffff",height:0}},i=(0,h["default"])({},r,n);u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,i),this._coordinates=t.isSingle(e)?[e]:e}return a(t,e),s(t,[{key:"_onAdd",value:function(e){this._setCoordinates(),this._options.interactive&&(this.isOutput()&&(this._pickingMesh=new d["default"].Object3D,this.addToPicking(this._pickingMesh)),this._setPickingId(),this._addPickingEvents()),this._setBufferAttributes(),this.isOutput()&&(this._setMesh(this._bufferAttributes),this.add(this._mesh))}},{key:"getCenter",value:function(){return this._coordinates[0][0][0]}},{key:"getBounds",value:function(){}},{key:"_setPickingId",value:function(){this._pickingId=this.getPickingId()}},{key:"_addPickingEvents",value:function(){var e=this;this._world.on("pick-"+this._pickingId,function(t,n,r){e.emit("click",e,t,n,r)})}},{key:"_setBufferAttributes",value:function(){var e,t=this;if("function"==typeof this._options.onBufferAttributes)e=this._options.onBufferAttributes(this);else{var n=0;this._options.style.height&&0!==this._options.style.height&&(n=this._world.metresToWorld(this._options.style.height,this._pointScale));var r=new d["default"].Color;r.set(this._options.style.color);var o=new d["default"].Color(16777215),a=new d["default"].Color(6710886);e=this._projectedCoordinates.map(function(e){var s=t._toEarcut(e),u=t._triangulate(s.vertices,s.holes,s.dimensions),l=[];for(i=0,il=s.vertices.length;i<il;i+=s.dimensions)l.push(s.vertices.slice(i,i+s.dimensions));var c,f=(0,b["default"])(l,u,{bottom:0,top:n}),h=r.clone().multiply(o),p=r.clone().multiply(a),d=f.positions,v=[],y=[];f.top.forEach(function(e,t){c=[],c.push([r.r,r.g,r.b]),c.push([r.r,r.g,r.b]),c.push([r.r,r.g,r.b]),v.push(e),y.push(c)}),t._flat=!0,f.sides&&(t._flat=!1,f.sides.forEach(function(e,t){c=[],t%2===0?(c.push([p.r,p.g,p.b]),c.push([p.r,p.g,p.b]),c.push([h.r,h.g,h.b])):(c.push([h.r,h.g,h.b]),c.push([h.r,h.g,h.b]),c.push([p.r,p.g,p.b])),v.push(e),y.push(c)}));var _={vertices:d,faces:v,colours:y,facesCount:v.length};return t._options.interactive&&t._pickingId&&(_.pickingId=t._pickingId),t._toAttributes(_)})}this._bufferAttributes=M["default"].mergeAttributes(e)}},{key:"getBufferAttributes",value:function(){return this._bufferAttributes}},{key:"_setMesh",value:function(e){var t=new d["default"].BufferGeometry;t.addAttribute("position",new d["default"].BufferAttribute(e.vertices,3)),t.addAttribute("normal",new d["default"].BufferAttribute(e.normals,3)),t.addAttribute("color",new d["default"].BufferAttribute(e.colours,3)),e.pickingIds&&t.addAttribute("pickingId",new d["default"].BufferAttribute(e.pickingIds,1)),t.computeBoundingBox();var n;this._options.material&&this._options.material instanceof d["default"].Material?n=this._options.material:this._world._environment._skybox?(n=new d["default"].MeshStandardMaterial({vertexColors:d["default"].VertexColors,side:d["default"].BackSide}),n.roughness=1,n.metalness=.1,n.envMapIntensity=3,n.envMap=this._world._environment._skybox.getRenderTarget()):n=new d["default"].MeshPhongMaterial({vertexColors:d["default"].VertexColors,side:d["default"].BackSide});var r=new d["default"].Mesh(t,n);if(r.castShadow=!0,r.receiveShadow=!0,this.isFlat()&&(n.depthWrite=!1,r.renderOrder=1),this._options.interactive&&this._pickingMesh){n=new x["default"],n.side=d["default"].BackSide;var i=new d["default"].Mesh(t,n);this._pickingMesh.add(i)}"function"==typeof this._options.onMesh&&this._options.onMesh(r),this._mesh=r}},{key:"_setCoordinates",value:function(){this._bounds=[],this._coordinates=this._convertCoordinates(this._coordinates),this._projectedBounds=[],this._projectedCoordinates=this._projectCoordinates()}},{key:"_convertCoordinates",value:function(e){return e.map(function(e){return e.map(function(e){return e.map(function(e){return(0,v.latLon)(e[1],e[0])})})})}},{key:"_projectCoordinates",value:function(){var e,t=this;return this._coordinates.map(function(n){return n.map(function(n){return n.map(function(n){return e=t._world.latLonToPoint(n),t._offset||(t._offset=(0,y.point)(0,0),t._offset.x=-1*e.x,t._offset.y=-1*e.y,t._pointScale=t._world.pointScale(n)),e})})})}},{key:"_toEarcut",value:function(e){for(var t=2,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)n.vertices.push(e[i][o].x),n.vertices.push(e[i][o].y);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n}},{key:"_triangulate",value:function(e,t,n){var r=(0,m["default"])(e,t,n),o=[];for(i=0,il=r.length;i<il;i+=3)o.push(r.slice(i,i+3));return o}},{key:"_toAttributes",value:function(e){var t,n=new Float32Array(9*e.facesCount),r=new Float32Array(9*e.facesCount),i=new Float32Array(9*e.facesCount);e.pickingId&&(t=new Float32Array(3*e.facesCount));var o,a,s=new d["default"].Vector3,u=new d["default"].Vector3,l=new d["default"].Vector3,c=new d["default"].Vector3,f=new d["default"].Vector3,h=e.faces,p=e.vertices,v=e.colours;t&&(a=e.pickingId);for(var y=0,_=0;_<h.length;_++){o=h[_][0];var m=p[o][0],g=p[o][1],b=p[o][2],w=v[_][0];o=h[_][1];var x=p[o][0],k=p[o][1],M=p[o][2],O=v[_][1];o=h[_][2];var E=p[o][0],P=p[o][1],T=p[o][2],j=v[_][2];s.set(m,g,b),u.set(x,k,M),l.set(E,P,T),c.subVectors(l,u),f.subVectors(s,u),c.cross(f),c.normalize();var S=c.x,C=c.y,A=c.z;n[9*y+0]=m,n[9*y+1]=g,n[9*y+2]=b,r[9*y+0]=S,r[9*y+1]=C,r[9*y+2]=A,i[9*y+0]=w[0],i[9*y+1]=w[1],i[9*y+2]=w[2],n[9*y+3]=x,n[9*y+4]=k,n[9*y+5]=M,r[9*y+3]=S,r[9*y+4]=C,r[9*y+5]=A,i[9*y+3]=O[0],i[9*y+4]=O[1],i[9*y+5]=O[2],n[9*y+6]=E,n[9*y+7]=P,n[9*y+8]=T,r[9*y+6]=S,r[9*y+7]=C,r[9*y+8]=A,i[9*y+6]=j[0],i[9*y+7]=j[1],i[9*y+8]=j[2],t&&(t[3*y+0]=a,t[3*y+1]=a,t[3*y+2]=a),y++}var L={vertices:n,normals:r,colours:i};return t&&(L.pickingIds=t),L}},{key:"isFlat",value:function(){return this._flat}},{key:"destroy",value:function(){this._pickingMesh&&(this._pickingMesh=null),u(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}],[{key:"isSingle",value:function(e){return!Array.isArray(e[0][0][0])}}]),t}(c["default"]);t["default"]=O;var E=function(e,t){return new O(e,t)};t.polygonLayer=E},function(e,t){"use strict";function n(e,t,n){n=n||2;var i=t&&t.length,a=i?t[0]*n:e.length,s=r(e,0,a,n,!0),u=[];if(!s)return u;var l,f,h,p,d,v,y;if(i&&(s=c(e,t,s,n)),e.length>80*n){l=h=e[0],f=p=e[1];for(var _=n;a>_;_+=n)d=e[_],v=e[_+1],l>d&&(l=d),f>v&&(f=v),d>h&&(h=d),v>p&&(p=v);y=Math.max(h-l,p-f)}return o(s,u,n,l,f,y),u}function r(e,t,n,r,i){var o,a,s,u=0;for(o=t,a=n-r;n>o;o+=r)u+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;if(i===u>0)for(o=t;n>o;o+=r)s=P(o,e[o],e[o+1],s);else for(o=n-r;o>=t;o-=r)s=P(o,e[o],e[o+1],s);return s}function i(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!w(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(T(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function o(e,t,n,r,c,f,h){if(e){!h&&f&&d(e,r,c,f);for(var p,v,y=e;e.prev!==e.next;)if(p=e.prev,v=e.next,f?s(e,r,c,f):a(e))t.push(p.i/n),t.push(e.i/n),t.push(v.i/n),T(e),e=v.next,y=v.next;else if(e=v,e===y){h?1===h?(e=u(e,t,n),o(e,t,n,r,c,f,2)):2===h&&l(e,t,n,r,c,f):o(i(e),t,n,r,c,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(b(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function s(e,t,n,r){var i=e.prev,o=e,a=e.next;if(b(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=y(s,u,t,n,r),h=y(l,c,t,n,r),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=f;){if(p!==e.prev&&p!==e.next&&m(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;x(i,r,r.next,o)&&M(i,o)&&M(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),T(r),T(r.next),r=e=o),r=r.next}while(r!==e);return r}function l(e,t,n,r,a,s){var u=e;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var c=E(u,l);return u=i(u,u.next),c=i(c,c.next),o(u,t,n,r,a,s),void o(c,t,n,r,a,s)}l=l.next}u=u.next}while(u!==e)}function c(e,t,n,o){var a,s,u,l,c,p=[];for(a=0,s=t.length;s>a;a++)u=t[a]*o,l=s-1>a?t[a+1]*o:e.length,c=r(e,u,l,o,!1),c===c.next&&(c.steiner=!0),p.push(_(c));for(p.sort(f),a=0;a<p.length;a++)h(p[a],n),n=i(n,n.next);return n}function f(e,t){return e.x-t.x}function h(e,t){if(t=p(e,t)){var n=E(t,e);i(n,n.next)}}function p(e,t){var n,r=t,i=e.x,o=e.y,a=-(1/0);do{if(o<=r.y&&o>=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);i>=s&&s>a&&(a=s,n=r.x<r.next.x?r:r.next)}r=r.next}while(r!==t);if(!n)return null;if(e.x===n.x)return n.prev;var u,l=n,c=1/0;for(r=n.next;r!==l;)i>=r.x&&r.x>=n.x&&m(o<n.y?i:a,o,n.x,n.y,o<n.y?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),(c>u||u===c&&r.x>n.x)&&M(r,e)&&(n=r,c=u)),r=r.next;return n}function d(e,t,n,r){var i=e;do null===i.z&&(i.z=y(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(e){var t,n,r,i,o,a,s,u,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;l>t&&(s++,r=r.nextZ,r);t++);for(u=l;s>0||u>0&&r;)0===s?(i=r,r=r.nextZ,u--):0!==u&&r?n.z<=r.z?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,s--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1);return e}function y(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function _(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function g(e,t){return w(e,t)||e.next.i!==t.i&&e.prev.i!==t.i&&!k(e,t)&&M(e,t)&&M(t,e)&&O(e,t)}function b(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function w(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,n,r){return b(e,t,n)>0!=b(e,t,r)>0&&b(n,r,e)>0!=b(n,r,t)>0}function k(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&x(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function M(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function O(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function E(e,t){var n=new j(e.i,e.x,e.y),r=new j(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function P(e,t,n,r){var i=new j(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function T(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function j(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.exports=n},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=function(e,t,n){function r(){a=e.map(function(e){return[e[0],h.top,e[1]]}),s=t,u=t}function i(){a=[],e.forEach(function(e){a.push([e[0],h.top,e[1]])}),e.forEach(function(e){a.push([e[0],h.bottom,e[1]])}),s=[];for(var n=0;p>n;n++)n===p-1?(s.push([n+p,p,n]),s.push([0,n,p])):(s.push([n+p,n+p+1,n]),s.push([n+1,n,n+p+1]));if(c=[].concat(s),h.closed){var r=t,i=r.map(function(e){return e.map(function(e){return e+p})});i=i.map(function(e){return[e[0],e[2],e[1]]}),s=s.concat(r).concat(i),u=r,l=i}}var a,s,u,l,c,f={top:1,bottom:0,closed:!0},h=(0,o["default"])({},f,n),p=e.length;return h.top===h.bottom?r():i(),{positions:a,faces:s,top:u,bottom:l,sides:c}};t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(37),l=r(u),c=n(3),f=r(c),h=n(24),p=r(h),d=n(10),v=n(11),y=n(70),_=r(y),m=n(69),g=r(m),b=function(e){function t(e,n){i(this,t);var r={output:!0,interactive:!1,material:null,onMesh:null,onBufferAttributes:null,style:{lineOpacity:1,lineTransparent:!1,lineColor:"#ffffff",lineWidth:1,lineBlending:p["default"].NormalBlending}},o=(0,f["default"])({},r,n);s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,o),this._coordinates=t.isSingle(e)?[e]:e,this._flat=!0}return o(t,e),a(t,[{key:"_onAdd",value:function(e){this._setCoordinates(),this._options.interactive&&(this.isOutput()&&(this._pickingMesh=new p["default"].Object3D,this.addToPicking(this._pickingMesh)),this._setPickingId(),this._addPickingEvents()),this._setBufferAttributes(),this.isOutput()&&(this._setMesh(this._bufferAttributes),this.add(this._mesh))}},{key:"getCenter",value:function(){return this._coordinates[0][0]}},{key:"getBounds",value:function(){}},{key:"_setPickingId",value:function(){this._pickingId=this.getPickingId()}},{key:"_addPickingEvents",value:function(){var e=this;this._world.on("pick-"+this._pickingId,function(t,n,r){e.emit("click",e,t,n,r)})}},{key:"_setBufferAttributes",value:function(){var e,t=this;if("function"==typeof this._options.onBufferAttributes)e=this._options.onBufferAttributes(this);else{var n=0;this._options.style.lineHeight&&(n=this._world.metresToWorld(this._options.style.lineHeight,this._pointScale));var r=new p["default"].Color;r.set(this._options.style.lineColor),e=this._projectedCoordinates.map(function(e){var i,o=[],a=[];e.forEach(function(t,s){a.push([r.r,r.g,r.b]),o.push([t.x,n,t.y]),i=e[s+1]?e[s+1]:t,a.push([r.r,r.g,r.b]),o.push([i.x,n,i.y])});var s={vertices:o,colours:a,verticesCount:o.length};return t._options.interactive&&t._pickingId&&(s.pickingId=t._pickingId),t._toAttributes(s)})}this._bufferAttributes=g["default"].mergeAttributes(e)}},{key:"getBufferAttributes",value:function(){return this._bufferAttributes}},{key:"_setMesh",value:function(e){var t=new p["default"].BufferGeometry;t.addAttribute("position",new p["default"].BufferAttribute(e.vertices,3)),t.addAttribute("color",new p["default"].BufferAttribute(e.colours,3)),e.pickingIds&&t.addAttribute("pickingId",new p["default"].BufferAttribute(e.pickingIds,1)),t.computeBoundingBox();var n,r=this._options.style;n=this._options.material&&this._options.material instanceof p["default"].Material?this._options.material:new p["default"].LineBasicMaterial({vertexColors:p["default"].VertexColors,linewidth:r.lineWidth,transparent:r.lineTransparent,opacity:r.lineOpacity,blending:r.lineBlending});var i=new p["default"].LineSegments(t,n);if(void 0!==r.lineRenderOrder&&(n.depthWrite=!1,i.renderOrder=r.lineRenderOrder),i.castShadow=!0,this._options.interactive&&this._pickingMesh){n=new _["default"],n.linewidth=r.lineWidth+n.linePadding;var o=new p["default"].LineSegments(t,n);this._pickingMesh.add(o)}"function"==typeof this._options.onMesh&&this._options.onMesh(i),this._mesh=i}},{key:"_setCoordinates",value:function(){this._bounds=[],this._coordinates=this._convertCoordinates(this._coordinates),this._projectedBounds=[],this._projectedCoordinates=this._projectCoordinates()}},{key:"_convertCoordinates",value:function(e){return e.map(function(e){return e.map(function(e){return(0,d.latLon)(e[1],e[0])})})}},{key:"_projectCoordinates",value:function(){var e,t=this;return this._coordinates.map(function(n){return n.map(function(n){return e=t._world.latLonToPoint(n),t._offset||(t._offset=(0,v.point)(0,0),t._offset.x=-1*e.x,t._offset.y=-1*e.y,t._pointScale=t._world.pointScale(n)),e})})}},{key:"_toAttributes",value:function(e){var t,n=new Float32Array(3*e.verticesCount),r=new Float32Array(3*e.verticesCount);e.pickingId&&(t=new Float32Array(e.verticesCount));var i,o=e.vertices,a=e.colours;t&&(i=e.pickingId);for(var s=0,u=0;u<o.length;u++){var l=o[u][0],c=o[u][1],f=o[u][2],h=a[u];n[3*s+0]=l,n[3*s+1]=c,n[3*s+2]=f,r[3*s+0]=h[0],r[3*s+1]=h[1],r[3*s+2]=h[2],t&&(t[s]=i),s++}var p={vertices:n,colours:r};return t&&(p.pickingIds=t),p}},{key:"isFlat",value:function(){return this._flat}},{key:"destroy",value:function(){this._pickingMesh&&(this._pickingMesh=null),s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}],[{key:"isSingle",value:function(e){return!Array.isArray(e[0][0])}}]),t}(l["default"]);t["default"]=b;var w=function(e,t){return new b(e,t)};t.polylineLayer=w},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(37),l=r(u),c=n(3),f=r(c),h=n(24),p=r(h),d=n(10),v=n(11),y=n(70),_=r(y),m=n(69),g=r(m),b=function(e){function t(e,n){i(this,t);var r={output:!0,interactive:!1,geometry:null,material:null,onMesh:null,style:{pointColor:"#ff0000"}},o=(0,f["default"])({},r,n);s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,o),this._coordinates=t.isSingle(e)?[e]:e,this._flat=!0}return o(t,e),a(t,[{key:"_onAdd",value:function(e){this._setCoordinates(),this._options.interactive&&(this.isOutput()&&(this._pickingMesh=new p["default"].Object3D,this.addToPicking(this._pickingMesh)),this._setPickingId(),this._addPickingEvents()),this._setBufferAttributes(),this.isOutput()&&(this._setMesh(this._bufferAttributes),this.add(this._mesh))}},{key:"getCenter",value:function(){return this._coordinates}},{key:"getBounds",value:function(){}},{key:"_setPickingId",value:function(){this._pickingId=this.getPickingId()}},{key:"_addPickingEvents",value:function(){var e=this;this._world.on("pick-"+this._pickingId,function(t,n,r){e.emit("click",e,t,n,r)})}},{key:"_setBufferAttributes",value:function(){var e=this,t=0;this._options.style.pointHeight&&(t=this._world.metresToWorld(this._options.style.pointHeight,this._pointScale));var n=new p["default"].Color;n.set(this._options.style.pointColor);var r;if(!this._options.geometry||!this._options.geometry instanceof p["default"].Geometry||!this._options.geometry instanceof p["default"].BufferGeometry){var i=this._world.metresToWorld(25,this._pointScale),o=this._world.metresToWorld(200,this._pointScale),a=new p["default"].BoxGeometry(i,o,i);a.translate(0,.5*o,0),r=(new p["default"].BufferGeometry).fromGeometry(a)}else r=this._options.geometry instanceof p["default"].BufferGeometry?this._options.geometry:(new p["default"].BufferGeometry).fromGeometry(this._options.geometry);var s=this._projectedCoordinates.map(function(i){var o=[],a=[],s=[],u=r.clone();u.translate(i.x,t,i.y);for(var o=u.attributes.position.clone().array,a=u.attributes.normal.clone().array,s=u.attributes.color.clone().array,l=0;l<s.length;l+=3)s[l]=n.r,s[l+1]=n.g,s[l+2]=n.b;var c={vertices:o,normals:a,colours:s};if(e._options.interactive&&e._pickingId){c.pickingIds=new Float32Array(o.length/3);for(var l=0;l<c.pickingIds.length;l++)c.pickingIds[l]=e._pickingId}return c});this._bufferAttributes=g["default"].mergeAttributes(s)}},{key:"getBufferAttributes",value:function(){return this._bufferAttributes}},{key:"_setMesh",value:function(e){var t=new p["default"].BufferGeometry;t.addAttribute("position",new p["default"].BufferAttribute(e.vertices,3)),t.addAttribute("normal",new p["default"].BufferAttribute(e.normals,3)),t.addAttribute("color",new p["default"].BufferAttribute(e.colours,3)),e.pickingIds&&t.addAttribute("pickingId",new p["default"].BufferAttribute(e.pickingIds,1)),t.computeBoundingBox();
var n;this._options.material&&this._options.material instanceof p["default"].Material?n=this._options.material:this._world._environment._skybox?(n=new p["default"].MeshStandardMaterial({vertexColors:p["default"].VertexColors}),n.roughness=1,n.metalness=.1,n.envMapIntensity=3,n.envMap=this._world._environment._skybox.getRenderTarget()):n=new p["default"].MeshBasicMaterial({vertexColors:p["default"].VertexColors});var r=new p["default"].Mesh(t,n);if(r.castShadow=!0,this._options.interactive&&this._pickingMesh){n=new _["default"];var i=new p["default"].Mesh(t,n);this._pickingMesh.add(i)}"function"==typeof this._options.onMesh&&this._options.onMesh(r),this._mesh=r}},{key:"_setCoordinates",value:function(){this._bounds=[],this._coordinates=this._convertCoordinates(this._coordinates),this._projectedBounds=[],this._projectedCoordinates=this._projectCoordinates()}},{key:"_convertCoordinates",value:function(e){return e.map(function(e){return(0,d.latLon)(e[1],e[0])})}},{key:"_projectCoordinates",value:function(){var e,t=this;return this._coordinates.map(function(n){return e=t._world.latLonToPoint(n),t._offset||(t._offset=(0,v.point)(0,0),t._offset.x=-1*e.x,t._offset.y=-1*e.y,t._pointScale=t._world.pointScale(n)),e})}},{key:"_toAttributes",value:function(e){var t,n=new Float32Array(3*e.verticesCount),r=new Float32Array(3*e.verticesCount);e.pickingId&&(t=new Float32Array(e.verticesCount));var i,o=e.vertices,a=e.colours;t&&(i=e.pickingId);for(var s=0,u=0;u<o.length;u++){var l=o[u][0],c=o[u][1],f=o[u][2],h=a[u];n[3*s+0]=l,n[3*s+1]=c,n[3*s+2]=f,r[3*s+0]=h[0],r[3*s+1]=h[1],r[3*s+2]=h[2],t&&(t[s]=i),s++}var p={vertices:n,colours:r};return t&&(p.pickingIds=t),p}},{key:"isFlat",value:function(){return this._flat}},{key:"destroy",value:function(){this._pickingMesh&&(this._pickingMesh=null),s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}],[{key:"isSingle",value:function(e){return!Array.isArray(e[0])}}]),t}(l["default"]);t["default"]=b;var w=function(e,t){return new b(e,t)};t.pointLayer=w},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},s=n(73),u=r(s),l=n(3),c=r(l),f=function(e){function t(e,n){i(this,t);var r={topojson:!0};n=(0,c["default"])({},r,n),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n)}return o(t,e),t}(u["default"]);t["default"]=f;var h=function(e,t){return new f(e,t)};t.topoJSONLayer=h}])});
//# sourceMappingURL=vizicities.min.js.map