/*! * * deck.gl.js (https://github.com/SuperMap/deck.gl.git) * license: MIT * * origin: 'https://github.com/uber/deck.gl.git' * fork: 'https://github.com/SuperMap/deck.gl.git' * branch: 'https://github.com/SuperMap/deck.gl/tree/deck.gl-for-iclient' * * */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.deckgl=t():e.deckgl=t()}(this,function(){return function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=n,i.c=r,i.i=function(e){return e},i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=288)}([function(e,t,n){var v=n(3),g=n(33),y=n(19),_=n(20),m=n(28),b="prototype",E=function(e,t,n){var r,i,o,a,s=e&E.F,u=e&E.G,c=e&E.S,l=e&E.P,f=e&E.B,d=u?v:c?v[t]||(v[t]={}):(v[t]||{})[b],h=u?g:g[t]||(g[t]={}),p=h[b]||(h[b]={});for(r in u&&(n=t),n)o=((i=!s&&d&&void 0!==d[r])?d:n)[r],a=f&&i?m(o,v):l&&"function"==typeof o?m(Function.call,o):o,d&&_(d,r,o,e&E.U),h[r]!=o&&y(h,r,a),l&&p[r]!=o&&(p[r]=o)};v.core=g,E.F=1,E.G=2,E.S=4,E.P=8,E.B=16,E.W=32,E.U=64,E.R=128,e.exports=E},function(E,e,w){"use strict";(function(t){function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i"+i+""};e.exports=function(t,e){var n={};n[t]=e(o),r(r.P+r.F*i(function(){var e=""[t]('"');return e!==e.toLowerCase()||3document.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l[c][a[n]];return l()};e.exports=Object.create||function(e,t){var n;return null!==e?(u[c]=i(e),n=new u,u[c]=null,n[s]=e):n=l(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(218),i=n(132).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(218),i=n(132);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var i=n(20);e.exports=function(e,t,n){for(var r in t)i(e,r,t[r],n);return e}},function(e,t,n){"use strict";var r=n(3),i=n(10),o=n(9),a=n(6)("species");e.exports=function(e){var t=r[e];o&&t&&!t[a]&&i.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){var r=n(36),i=Math.max,o=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):o(e,t)}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(249);n.d(t,"AnimationLoop",function(){return r.a}),n.d(t,"requestAnimationFrame",function(){return r.b}),n.d(t,"cancelAnimationFrame",function(){return r.c});var i=n(104);n.d(t,"Model",function(){return i.a})},function(e,t,n){"use strict";var r=n(663);n.d(t,"g",function(){return r.c}),n.d(t,"c",function(){return r.a}),n.d(t,"d",function(){return r.b}),n.d(t,"h",function(){return r.d});var i=n(664);n.d(t,"a",function(){return i.a}),n.d(t,"e",function(){return i.b});var o=n(265);n.d(t,"f",function(){return o.a});var a=n(164);n.d(t,"b",function(){return a.a});var s=n(665);n.d(t,"j",function(){return s.a});var u=n(264);n.d(t,"i",function(){return u.a});n(46)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(25);n.d(t,"GL",function(){return r.d}),n.d(t,"default",function(){return r.d});var i=n(268);n.d(t,"Image",function(){return i.e}),n.d(t,"WebGLRenderingContext",function(){return i.a}),n.d(t,"WebGLProgram",function(){return i.f}),n.d(t,"WebGLShader",function(){return i.g}),n.d(t,"WebGLBuffer",function(){return i.d}),n.d(t,"WebGLFramebuffer",function(){return i.h}),n.d(t,"WebGLRenderbuffer",function(){return i.i}),n.d(t,"WebGLTexture",function(){return i.j}),n.d(t,"WebGLUniformLocation",function(){return i.k}),n.d(t,"WebGLActiveInfo",function(){return i.l}),n.d(t,"WebGLShaderPrecisionFormat",function(){return i.m}),n.d(t,"WebGL2RenderingContext",function(){return i.b}),n.d(t,"webGLTypesAvailable",function(){return i.c});var o=n(7);n.d(t,"isWebGL",function(){return o.a}),n.d(t,"isWebGL2",function(){return o.b}),n.d(t,"createGLContext",function(){return o.d}),n.d(t,"deleteGLContext",function(){return o.e});var a=n(68);n.d(t,"withParameters",function(){return a.f}),n.d(t,"resetParameters",function(){return a.a});var s=n(165);n.d(t,"getContextInfo",function(){return s.a});var u=n(67);n.d(t,"Buffer",function(){return u.a});var c=n(111);n.d(t,"Shader",function(){return c.a}),n.d(t,"VertexShader",function(){return c.b}),n.d(t,"FragmentShader",function(){return c.c});var l=n(109);n.d(t,"Program",function(){return l.a});var f=n(69);n.d(t,"Framebuffer",function(){return f.a});var d=n(110);n.d(t,"Renderbuffer",function(){return d.a});var h=n(167);n.d(t,"Texture2D",function(){return h.a});var p=n(275);n.d(t,"TextureCube",function(){return p.a});var v=n(270);n.d(t,"draw",function(){return v.a});var g=n(107);n.d(t,"clear",function(){return g.a});var y=n(272);n.d(t,"readPixels",function(){return y.a});var _=n(168);n.d(t,"parseUniformName",function(){return _.a}),n.d(t,"getUniformSetter",function(){return _.b}),n.d(t,"checkUniformValues",function(){return _.c});var m=n(169);n.d(t,"VertexArray",function(){return m.a})},function(e,t,C){"use strict";var n,k=C(25),M=C(38),L=C(7),I=C(68),r=C(30),N=C(67),T=C(8),i=C(1),F=C.n(i),o=function(){function r(e,t){for(var n=0;nd.b.priority||"undefined"==typeof window)return this;i=i||"Framebuffer "+this.id;var o=this.copyToDataUrl({maxHeight:100});return d.b.image({priority:n,message:i,image:o},i),this}},{key:"bind",value:function(){var e=(0>> RENDERING MODEL "+this.id,{collapsed:_.b.priority<=2}),this.setProgramState({vertexArray:o}),this._logAttributesAndUniforms(2,a),this.onBeforeRender();var s=this.drawParams;s.isInstanced&&!this.isInstanced&&_.b.warn("Found instanced attributes on non-instanced model");var u=s.isIndexed,c=s.indexType,l=this.isInstanced,f=this.instanceCount;return this._timerQueryStart(),this.program.draw({parameters:i,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:o,transformFeedback:r,isIndexed:u,indexType:c,isInstanced:l,instanceCount:f}),this._timerQueryEnd(),this.onAfterRender(),this.unsetProgramState(),this.setNeedsRedraw(!1),_.b.groupEnd(2,">>> RENDERING MODEL "+this.id),this}},{key:"setProgramState",value:function(){var e=(0=e){var n=this._getAttributesTable({header:this.id+" attributes",program:this.program,attributes:Object.assign({},this.geometry.attributes,this.attributes)});_.b.table(e,n);var r=W.i(c.e)({header:this.id+" uniforms",program:this.program,uniforms:Object.assign({},this.uniforms,t)}),i=r.table,o=r.unusedTable,a=r.unusedCount;_.b.table(e,i),_.b.log(e,(a||"No")+" unused uniforms ",o)}else{var s=W.i(c.e)({header:this.id+" uniforms",program:this.program,uniforms:Object.assign({},this.uniforms,t),undefinedOnly:!0}),u=s.table;0>24&255),"index out of picking color range"),[e+1&255,e+1>>8&255,e+1>>8>>8&255]}},{key:"decodePickingColor",value:function(e){(0,h.default)(e instanceof Uint8Array);var t=r(e,3);return t[0]+256*t[1]+65536*t[2]-1}},{key:"initializeState",value:function(){throw new Error("Layer "+this+" has not defined initializeState")}},{key:"shouldUpdateState",value:function(e){e.oldProps,e.props,e.oldContext,e.context;return e.changeFlags.propsOrDataChanged}},{key:"updateState",value:function(e){e.oldProps,e.props,e.oldContext,e.context;var t=e.changeFlags,n=this.getAttributeManager();t.dataChanged&&n&&n.invalidateAll()}},{key:"finalizeState",value:function(){}},{key:"updateTransition",value:function(){var e=this.state,t=e.model,n=e.attributeManager,r=n&&n.updateTransition();t&&r&&t.setAttributes(n.getChangedAttributes({transition:!0}))}},{key:"draw",value:function(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this.getModels()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){i.value.draw(e)}}catch(e){n=!0,r=e}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}},{key:"getPickingInfo",value:function(e){var t=e.info,n=(e.mode,t.index);return 0<=n&&Array.isArray(this.props.data)&&(t.object=this.props.data[n]),t}},{key:"invalidateAttribute",value:function(){var e=0>>=1)&&(t+=t))1&r&&(n+=t);return n}},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,n){var r,i,o,a=n(28),s=n(208),u=n(134),c=n(131),l=n(3),f=l.process,d=l.setImmediate,h=l.clearImmediate,p=l.MessageChannel,v=l.Dispatch,g=0,y={},_="onreadystatechange",m=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},b=function(e){m.call(e.data)};d&&h||(d=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++g]=function(){s("function"==typeof e?e:Function(e),t)},r(g),g},h=function(e){delete y[e]},"process"==n(27)(f)?r=function(e){f.nextTick(a(m,e,1))}:v&&v.now?r=function(e){v.now(a(m,e,1))}:p?(o=(i=new p).port2,i.port1.onmessage=b,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",b,!1)):r=_ in c("script")?function(e){u.appendChild(c("script"))[_]=function(){u.removeChild(this),m.call(e)}}:function(e){setTimeout(a(m,e,1),0)}),e.exports={set:d,clear:h}},function(e,t,n){"use strict";var r=n(3),i=n(9),o=n(50),a=n(100),s=n(19),u=n(55),c=n(4),l=n(48),f=n(36),d=n(11),h=n(226),p=n(52).f,v=n(10).f,g=n(128),y=n(64),_="ArrayBuffer",m="DataView",b="prototype",E="Wrong index!",w=r[_],P=r[m],S=r.Math,A=r.RangeError,T=r.Infinity,x=w,O=S.abs,R=S.pow,C=S.floor,k=S.log,M=S.LN2,L="byteLength",I="byteOffset",N=i?"_b":"buffer",F=i?"_l":L,j=i?"_o":I;function D(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,u=(1<>1,l=23===t?R(2,-24)-R(2,-77):0,f=0,d=e<0||0===e&&1/e<0?1:0;for((e=O(e))!=e||e===T?(i=e!=e?1:0,r=u):(r=C(k(e)/M),e*(o=R(2,-r))<1&&(r--,o*=2),2<=(e+=1<=r+c?l/o:l*R(2,1-c))*o&&(r++,o/=2),u<=r+c?(i=0,r=u):1<=r+c?(i=(e*o-1)*R(2,t),r+=c):(i=e*R(2,c-1)*R(2,t),r=0));8<=t;a[f++]=255&i,i/=256,t-=8);for(r=r<>1,s=i-7,u=n-1,c=e[u--],l=127&c;for(c>>=7;0>=-s,s+=t;0>8&255]}function z(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function W(e){return D(e,52,8)}function X(e){return D(e,23,4)}function H(e,t,n){v(e[b],t,{get:function(){return this[n]}})}function Y(e,t,n,r){var i=h(+n);if(i+t>e[F])throw A(E);var o=e[N]._b,a=i+e[j],s=o.slice(a,a+t);return r?s:s.reverse()}function K(e,t,n,r,i,o){var a=h(+n);if(a+t>e[F])throw A(E);for(var s=e[N]._b,u=a+e[j],c=r(+i),l=0;lJ;)(Z=Q[J++])in w||s(w,Z,x[Z]);o||(q.constructor=w)}var $=new P(new w(2)),ee=P[b].setInt8;$.setInt8(0,2147483648),$.setInt8(1,2147483649),!$.getInt8(0)&&$.getInt8(1)||u(P[b],{setInt8:function(e,t){ee.call(this,e,t<<24>>24)},setUint8:function(e,t){ee.call(this,e,t<<24>>24)}},!0)}else w=function(e){l(this,w,_);var t=h(e);this._b=g.call(new Array(t),0),this[F]=t},P=function(e,t,n){l(this,P,m),l(e,w,m);var r=e[F],i=f(t);if(i<0||r>24},getUint8:function(e){return Y(this,1,e)[0]},getInt16:function(e){var t=Y(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Y(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return U(Y(this,4,e,arguments[1]))},getUint32:function(e){return U(Y(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return B(Y(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return B(Y(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){K(this,1,e,G,t)},setUint8:function(e,t){K(this,1,e,G,t)},setInt16:function(e,t){K(this,2,e,V,t,arguments[2])},setUint16:function(e,t){K(this,2,e,V,t,arguments[2])},setInt32:function(e,t){K(this,4,e,z,t,arguments[2])},setUint32:function(e,t){K(this,4,e,z,t,arguments[2])},setFloat32:function(e,t){K(this,4,e,X,t,arguments[2])},setFloat64:function(e,t){K(this,8,e,W,t,arguments[2])}});y(w,_),y(P,m),s(P[b],a.VIEW,!0),t[_]=w,t[m]=P},function(e,t,n){var r=n(3).navigator;e.exports=r&&r.userAgent||""},function(e,t,n){var r=n(3),i=n(33),o=n(50),a=n(227),s=n(10).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(71),i=n(6)("iterator"),o=n(63);e.exports=n(33).getIteratorMethod=function(e){if(null!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){"use strict";var r=n(43),i=n(211),o=n(63),a=n(24);e.exports=n(138)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(n,e,r){"use strict";(function(e){var t=r(74);if("production"!==e.env.NODE_ENV){t=function(e,t){if(void 0===t)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(0!==t.indexOf("Failed Composite propType: ")&&!e){for(var n=arguments.length,r=Array(2t.priority?-1:e.priority=L){var i=t.totalCount,o=t.visibleCount,a=t.compositeCount,s=t.pickableCount,u=i-a,c=u-o,l="";l+="RENDER #"+I+" "+o+" (of "+i+" layers) to "+n+" because "+r+" ",M.default.priority>L&&(l+="("+c+" hidden, "+a+" composite "+s+" unpickable)"),M.default.log(L,l)}}({renderStats:m,pass:p,redrawReason:g})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function r(e,t){for(var n=0;n",t),t.lifecycle=s.LIFECYCLE.MATCHED,e.lifecycle=s.LIFECYCLE.AWAITING_GC,t._transferState(e)):(h.default.log(4,"Matching layer is unchanged "+t.id),t.lifecycle=s.LIFECYCLE.MATCHED,t.oldProps=t.props)}},{key:"_updateLayer",value:function(t){h.default.log(4,"updating "+t+" because: "+t.printChangeFlags());var n=null;try{t._update()}catch(e){h.default.warn("error during update of "+_(t),e),n=e}return n}},{key:"_finalizeLayer",value:function(t){(0,c.default)(t.state),(0,c.default)(t.lifecycle!==s.LIFECYCLE.AWAITING_FINALIZATION),t.lifecycle=s.LIFECYCLE.AWAITING_FINALIZATION;var n=null;this.setNeedsRedraw("finalized "+_(t));try{t._finalize()}catch(e){h.default.warn("error during finalization of "+_(t),e),n=e}return t.lifecycle=s.LIFECYCLE.FINALIZED,(0,h.default)(2,"finalizing "+_(t)),n}},{key:"_validateEventHandling",value:function(){(this.onLayerClick||this.onLayerHover)&&this.layers.length&&!this.layers.some(function(e){return e.props.pickable})&&h.default.warn("You have supplied a top-level input event handler (e.g. `onLayerClick`), but none of your layers have set the `pickable` flag.")}},{key:"_onClick",value:function(e){e.offsetCenter&&this._pickAndCallback({callback:this._onLayerClick,event:e,mode:"click"})}},{key:"_onPointerMove",value:function(e){e.leftButton||e.rightButton||this._pickAndCallback({callback:this._onLayerHover,event:e,mode:"hover"})}},{key:"_onPointerLeave",value:function(e){this.pickObject({x:-1,y:-1,radius:this._pickingRadius,mode:"hover"})}},{key:"_pickAndCallback",value:function(e){var t=e.event.offsetCenter,n=this._pickingRadius,r=this.pickObject({x:t.x,y:t.y,radius:n,mode:e.mode});if(e.callback){var i=r.find(function(e){return 0<=e.index})||null;e.callback(i,r,e.event.srcEvent)}}},{key:"_initSeer",value:function(){this.layers.forEach(function(e){(0,v.initLayerInSeer)(e),(0,v.updateLayerInSeer)(e)})}},{key:"_editSeer",value:function(e){if("edit"===e.type&&"props"===e.valuePath[0]){(0,v.setPropOverrides)(e.itemKey,e.valuePath.slice(1),e.value);var t=this.layers.map(function(e){return new e.constructor(e.props)});this.updateLayers({newLayers:t})}}}]),i}();t.default=m},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function r(e,t){for(var n=0;n undefined";var l=t[c]&&n[c]&&t[c].equals;if(l&&!l.call(t[c],n[c]))return u+"."+c+" changed deeply: "+n[c]+" -> "+t[c];if(c in a)"function"===d(t[c])&&"function"==typeof n[c]&&(l=!0);if(!l&&n[c]!==t[c])return u+"."+c+" changed shallowly: "+n[c]+" -> "+t[c]}for(var f in t)if(!(f in i||f in n))return u+"."+f+" added: undefined -> "+t[f];return null}function s(e,t,n){var r=e.updateTriggers[n]||{};return o({oldProps:t.updateTriggers[n]||{},newProps:r,triggerName:n})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function r(e,t){for(var n=0;ni;)a(r,n=t[i++])&&(~u(o,n)||o.push(n));return o}},function(e,t,n){var u=n(53),c=n(24),l=n(73).f;e.exports=function(s){return function(e){for(var t,n=c(e),r=u(n),i=r.length,o=0,a=[];o>>0||(a.test(n)?16:10))}:r},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(2),i=n(5),o=n(142);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t,n){var l=n(11),f=n(147),d=n(34);e.exports=function(e,t,n,r){var i=String(d(e)),o=i.length,a=void 0===n?" ":String(n),s=l(t);if(s<=o||""==a)return i;var u=s-o,c=f.call(a,Math.ceil(u/a.length));return c.length>u&&(c=c.slice(0,u)),r?c+i:i+c}},function(e,t,n){var r=n(36),i=n(11);e.exports=function(e){if(void 0===e)return 0;var t=r(e),n=i(t);if(t!==n)throw RangeError("Wrong length!");return n}},function(e,t,n){t.f=n(6)},function(e,t,n){"use strict";var r=n(203),i=n(66);e.exports=n(88)("Map",function(e){return function(){return e(this,080*n){r=o=e[0],i=a=e[1];for(var p=n;po.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=b(s,u,t,n,r),d=b(c,l,t,n,r),h=e.prevZ,p=e.nextZ;h&&h.z>=f&&p&&p.z<=d;){if(h!==e.prev&&h!==e.next&&w(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=P(h.prev,h,h.next))return!1;if(h=h.prevZ,p!==e.prev&&p!==e.next&&w(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=P(p.prev,p,p.next))return!1;p=p.nextZ}for(;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&w(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=P(h.prev,h,h.next))return!1;h=h.prevZ}for(;p&&p.z<=d;){if(p!==e.prev&&p!==e.next&&w(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=P(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function d(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;!s(i,o)&&p(i,r,r.next,o)&&S(i,o)&&S(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 h(e,t,n,r,i,o){var a,s,u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(s=c,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(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&&p(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(a,s)&&S(a,s)&&S(s,a)&&function(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(a,s))){var l=A(u,c);return u=g(u,u.next),l=g(l,l.next),y(u,t,n,r,i,o),void y(l,t,n,r,i,o)}c=c.next}u=u.next}while(u!==e)}function _(e,t){return e.x-t.x}function m(e,t){if(t=function(e,t){var n,r=t,i=e.x,o=e.y,a=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&a=r.x&&r.x>=l&&i!==r.x&&w(on.x)&&S(r,e)&&(n=r,d=u),r=r.next;return n}(e,t)){var n=A(t,e);g(n,n.next)}}function b(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function E(e){for(var t=e,n=e;t.xl.priority)&&"undefined"!=typeof window){if("string"==typeof n){var s=new Image;s.onload=f.bind(null,s,i,a),s.src=n}var u=n.nodeName||"";if("img"===u.toLowerCase()&&f(n,i,a),"canvas"===u.toLowerCase()){var c=new Image;c.onload=f.bind(null,c,i,a),c.src=n.toDataURL()}}},deprecated:function(e,t){l.warn("`"+e+"` is deprecated and will be removed in a later version. Use `"+t+"` instead")},removed:function(e,t){l.error("`"+e+"` is no longer supported. Use `"+t+"` instead, check our Upgrade Guide for more details")},group:function(e,t){var n=(2r?"...":"]")}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return r?"0":"0.";if(r)return e.toFixed(0);if(100=a[0]&&o<=a[a.length-1]?r(o):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,r=t.elevationScaleFunc,i=t.elevationValueDomain,o=n.binMap[e.index]&&n.binMap[e.index].value,a=this.props.elevationDomain||i;return o>=a[0]&&o<=a[a.length-1]?r(o):-1}},{key:"getSubLayerProps",value:function(){var e=this.props,t=e.elevationScale,n=e.fp64,r=e.extruded,i=e.cellSize,o=e.coverage,a=e.lightSettings;return function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"getSubLayerProps",this).call(this,{id:"grid-cell",data:this.state.layerData,fp64:n,cellSize:i,coverage:o,lightSettings:a,elevationScale:t,extruded:r,getColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),updateTriggers:this.getUpdateTriggers()})}},{key:"getSubLayerClass",value:function(){return u.default}},{key:"renderLayers",value:function(){return new(this.getSubLayerClass())(this.getSubLayerProps())}}]),s}();(t.default=v).layerName="GridLayer",v.defaultProps=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME hexagon-cell-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME hexagon-cell-layer-vertex-shader-64\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\n// Custom uniforms\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform float extruded;\nuniform float coverage;\nuniform float elevationScale;\n\n// Result\nvarying vec4 vColor;\n\n// A magic number to scale elevation so that 1 unit approximate to 1 meter.\n#define ELEVATION_SCALE 0.8\n\nvoid main(void) {\n\n // rotate primitive position and normal\n mat2 rotationMatrix = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n\n vec2 rPos = rotationMatrix * positions.xz;\n vec2 rNorm = rotationMatrix * normals.xz; // the hexagon cells has y axis as the vertical axis\n\n vec3 rotatedPositions = vec3(rPos.x, positions.y, rPos.y);\n vec3 rotatedNormals = vec3(rNorm.x, rNorm.y, normals.y);\n\n // calculate elevation, if 3d not enabled set to 0\n // cylindar gemoetry height are between -0.5 to 0.5, transform it to between 0, 1\n float elevation = 0.0;\n\n if (extruded > 0.5) {\n elevation = project_scale(instancePositions.z * (positions.y + 0.5) *\n ELEVATION_SCALE * elevationScale);\n }\n\n // if alpha == 0.0 or z < 0.0, do not render element\n float noRender = float(instanceColors.a == 0.0 || instancePositions.z < 0.0);\n float dotRadius = radius * mix(coverage, 0.0, noRender);\n\n // project center of hexagon\n\n vec4 instancePositions64xy = vec4(\n instancePositions.x, instancePositions64xyLow.x,\n instancePositions.y, instancePositions64xyLow.y);\n\n vec2 projected_coord_xy[2];\n project_position_fp64(instancePositions64xy, projected_coord_xy);\n\n vec2 vertex_pos_localspace[4];\n vec4_fp64(vec4(rotatedPositions.xz * dotRadius, 0.0, 1.0), vertex_pos_localspace);\n\n vec2 vertex_pos_modelspace[4];\n vertex_pos_modelspace[0] = sum_fp64(vertex_pos_localspace[0], projected_coord_xy[0]);\n vertex_pos_modelspace[1] = sum_fp64(vertex_pos_localspace[1], projected_coord_xy[1]);\n vertex_pos_modelspace[2] = sum_fp64(vertex_pos_localspace[2], vec2(elevation, 0.0));\n vertex_pos_modelspace[3] = vec2(1.0, 0.0);\n\n vec4 position_worldspace = vec4(\n vertex_pos_modelspace[0].x, vertex_pos_modelspace[1].x,\n vertex_pos_modelspace[2].x, vertex_pos_modelspace[3].x);\n\n gl_Position = project_to_clipspace_fp64(vertex_pos_modelspace);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_worldspace = rotatedNormals;\n\n float lightWeight = 1.0;\n\n if (extruded > 0.5) {\n lightWeight = getLightWeight(\n position_worldspace.xyz, // the w component is always 1.0\n normals_worldspace\n );\n }\n\n vec3 lightWeightedColor = lightWeight * instanceColors.rgb;\n\n // Color: Either opacity-multiplied instance color, or picking color\n vColor = vec4(lightWeightedColor, opacity * instanceColors.a) / 255.0;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="\n#define SHADER_NAME hexagon-cell-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec3 instancePositions;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\n// Custom uniforms\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform float extruded;\nuniform float coverage;\nuniform float elevationScale;\n\n// Result\nvarying vec4 vColor;\n\n// A magic number to scale elevation so that 1 unit approximate to 1 meter.\n#define ELEVATION_SCALE 0.8\n\nvoid main(void) {\n\n // rotate primitive position and normal\n mat2 rotationMatrix = mat2(cos(angle), -sin(angle), sin(angle), cos(angle));\n\n vec2 rPos = rotationMatrix * positions.xz;\n vec2 rNorm = rotationMatrix * normals.xz; // the hexagon cells has y axis as the vertical axis\n\n vec3 rotatedPositions = vec3(rPos.x, positions.y, rPos.y);\n vec3 rotatedNormals = vec3(rNorm.x, rNorm.y, normals.y);\n\n // calculate elevation, if 3d not enabled set to 0\n // cylindar gemoetry height are between -0.5 to 0.5, transform it to between 0, 1\n float elevation = 0.0;\n\n if (extruded > 0.5) {\n elevation = project_scale(instancePositions.z * (positions.y + 0.5) *\n ELEVATION_SCALE * elevationScale);\n }\n\n // if ahpha == 0.0 or z < 0.0, do not render element\n float noRender = float(instanceColors.a == 0.0 || instancePositions.z < 0.0);\n float dotRadius = radius * mix(coverage, 0.0, noRender);\n\n // project center of hexagon\n vec4 centroidPosition = vec4(project_position(instancePositions.xy), elevation, 0.0);\n\n vec4 position_worldspace = centroidPosition + vec4(vec2(rotatedPositions.xz * dotRadius), 0., 1.);\n\n gl_Position = project_to_clipspace(position_worldspace);\n\n // Light calculations\n // Worldspace is the linear space after Mercator projection\n\n vec3 normals_worldspace = rotatedNormals;\n\n float lightWeight = 1.0;\n\n if (extruded > 0.5) {\n lightWeight = getLightWeight(\n position_worldspace.xyz, // the w component is always 1.0\n normals_worldspace\n );\n }\n\n vec3 lightWeightedColor = lightWeight * instanceColors.rgb;\n\n // opacity-multiplied instance color\n vColor = vec4(lightWeightedColor, opacity * instanceColors.a) / 255.0;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pointToHexbin=function(e,n){var t=e.data,r=e.radius,i=e.getPosition,o=u(r,n),a=t.map(function(e){return Object.assign({screenCoord:n.projectFlat(i(e))},e)});return{hexagons:(0,s.hexbin)().radius(o).x(function(e){return e.screenCoord[0]}).y(function(e){return e.screenCoord[1]})(a).map(function(e,t){return{centroid:n.unprojectFlat([e.x,e.y]),points:e,index:t}})}},t.getRadiusInPixel=u;var s=n(567);function u(e,t){return e*t.getDistanceScales().pixelsPerMeter[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function r(e,t){for(var n=0;n=e.upperPercentile&&(c.once(0,"HexagonLayer: lowerPercentile should not be bigger than upperPercentile. Assign to 0 by default"),e.lowerPercentile=p.lowerPercentile),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,e))}return function(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)}(s,o.CompositeLayer),i(s,[{key:"initializeState",value:function(){this.state={hexagons:[],hexagonVertices:null,sortedColorBins:null,sortedElevationBins:null,colorValueDomain:null,elevationValueDomain:null,colorScaleFunc:h,elevationScaleFunc:h,dimensionUpdaters:this.getDimensionUpdaters()}}},{key:"updateState",value:function(e){var t=this,n=e.oldProps,r=e.props,i=e.changeFlags,o=this.getDimensionChanges(n,r);i.dataChanged||this.needsReProjectPoints(n,r)?this.getHexagons():o&&o.forEach(function(e){return"function"==typeof e&&e.apply(t)})}},{key:"needsReProjectPoints",value:function(e,t){return e.radius!==t.radius||e.hexagonAggregator!==t.hexagonAggregator}},{key:"getDimensionUpdaters",value:function(){return{getColor:[{id:"value",triggers:["getColorValue"],updater:this.getSortedColorBins},{id:"domain",triggers:["lowerPercentile","upperPercentile"],updater:this.getColorValueDomain},{id:"scaleFunc",triggers:["colorDomain","colorRange"],updater:this.getColorScale}],getElevation:[{id:"value",triggers:["getElevationValue"],updater:this.getSortedElevationBins},{id:"domain",triggers:["elevationLowerPercentile","elevationUpperPercentile"],updater:this.getElevationValueDomain},{id:"scaleFunc",triggers:["elevationDomain","elevationRange"],updater:this.getElevationScale}]}}},{key:"getDimensionChanges",value:function(t,n){var e=this.state.dimensionUpdaters,r=[];for(var i in e){var o=e[i].find(function(e){return e.triggers.some(function(e){return t[e]!==n[e]})});o&&r.push(o.updater)}return r.length?r:null}},{key:"getHexagons",value:function(){var e=this.props.hexagonAggregator,t=this.context.viewport,n=e(this.props,t),r=n.hexagons,i=n.hexagonVertices;this.setState({hexagons:r,hexagonVertices:i}),this.getSortedBins()}},{key:"getPickingInfo",value:function(e){var t=e.info,n=this.state,r=n.sortedColorBins,i=n.sortedElevationBins,o=null;if(t.picked&&-1=a[0]&&o<=a[a.length-1]?r(o):[0,0,0,0];return s[3]=Number.isFinite(s[3])?s[3]:255,s}},{key:"_onGetSublayerElevation",value:function(e){var t=this.state,n=t.sortedElevationBins,r=t.elevationScaleFunc,i=t.elevationValueDomain,o=n.binMap[e.index]&&n.binMap[e.index].value,a=this.props.elevationDomain||i;return o>=a[0]&&o<=a[a.length-1]?r(o):-1}},{key:"getSubLayerProps",value:function(){var e=this.props,t=e.radius,n=e.elevationScale,r=e.extruded,i=e.coverage,o=e.lightSettings,a=e.fp64;return function e(t,n,r){null===t&&(t=Function.prototype);var i=Object.getOwnPropertyDescriptor(t,n);if(void 0===i){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,n,r)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(r):void 0}(s.prototype.__proto__||Object.getPrototypeOf(s.prototype),"getSubLayerProps",this).call(this,{id:"hexagon-cell",data:this.state.hexagons,fp64:a,hexagonVertices:this.state.hexagonVertices,radius:t,elevationScale:n,angle:Math.PI,extruded:r,coverage:i,lightSettings:o,getColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),updateTriggers:this.getUpdateTriggers()})}},{key:"getSubLayerClass",value:function(){return u.default}},{key:"renderLayers",value:function(){return new(this.getSubLayerClass())(this.getSubLayerProps())}}]),s}();(t.default=v).layerName="HexagonLayer",v.defaultProps=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="#define SHADER_NAME icon-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nconst float MIN_ALPHA = 0.05;\n\nvoid main(void) {\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n\n // if colorMode == 0, use pixel color from the texture\n // if colorMode == 1 or rendering picking buffer, use texture as transparency mask\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * mix(1.0, vColor.a, vColorMode);\n\n if (a < MIN_ALPHA) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n\n // use highlight color if this fragment belongs to the selected object.\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n\n // use picking color if rendering to picking FBO.\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n}\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='#define SHADER_NAME icon-layer-vertex-shader-64\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec2 instancePositions64xyLow;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n // scale icon height to match instanceSize\n float instanceScale = iconSize.y == 0.0 ? 0.0 : instanceSizes / iconSize.y;\n\n // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * sizeScale * instanceScale;\n pixelOffset.y *= -1.0;\n\n vec4 instancePositions64xy = vec4(\n instancePositions.x, instancePositions64xyLow.x,\n instancePositions.y, instancePositions64xyLow.y);\n\n vec2 projected_coord_xy[2];\n project_position_fp64(instancePositions64xy, projected_coord_xy);\n\n vec2 vertex_pos_modelspace[4];\n vertex_pos_modelspace[0] = projected_coord_xy[0];\n vertex_pos_modelspace[1] = projected_coord_xy[1];\n vertex_pos_modelspace[2] = vec2(project_scale(instancePositions.z), 0.0);\n vertex_pos_modelspace[3] = vec2(1.0, 0.0);\n\n gl_Position = project_to_clipspace_fp64(vertex_pos_modelspace);\n gl_Position += project_pixel_to_clipspace(pixelOffset);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n\n vColorMode = instanceColorModes;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n vec2 iconSize = instanceIconFrames.zw;\n // scale icon height to match instanceSize\n float instanceScale = iconSize.y == 0.0 ? 0.0 : instanceSizes / iconSize.y;\n\n // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * sizeScale * instanceScale;\n pixelOffset.y *= -1.0;\n\n vec3 center = project_position(instancePositions);\n gl_Position = project_to_clipspace(vec4(center, 1.0));\n gl_Position += project_pixel_to_clipspace(pixelOffset);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vTextureCoords.y = 1.0 - vTextureCoords.y;\n\n vColor = instanceColors / 255.;\n\n vColorMode = instanceColorModes;\n\n // Set color to be rendered to picking fbo (also used to check for selection highlight).\n picking_setPickingColor(instancePickingColors);\n}\n'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var f=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=function(){function r(e,t){for(var n=0;nl&&(l=c[b])}}}catch(e){d=!0,h=e}finally{try{!f&&v.return&&v.return()}finally{if(d)throw h}}this.setState({maxCount:l})}}]),i}();(t.default=c).layerName="ScreenGridLayer",c.defaultProps={cellSizePixels:100,minColor:[0,0,0,255],maxColor:[0,255,0,255],getPosition:function(e){return e.position},getWeight:function(e){return 1}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PolygonTesselatorExtruded=void 0;var r,i=function(){function r(e,t){for(var n=0;n>8&255,n+1>>8>>8&255];C({target:P,source:i,start:S,count:r*w}),S+=i.length*r*w}),P)})}return i(T,[{key:"indices",value:function(){return this.attributes.indices}},{key:"positions",value:function(){return this.attributes.positions}},{key:"normals",value:function(){return this.attributes.normals}},{key:"colors",value:function(){var e,t,n,i,r,o,a,s,u=(0 0"),(0,T.default)(Number.isFinite(s.height)&&0 0"),n.filter(function(e){return e.isPickable()}).length<1)return null;(0,E.drawPickingBuffer)(e,{layers:n,viewports:r,onViewportActive:i,useDevicePixels:o,pickingFBO:a,deviceRect:s,layerFilter:u,redrawReason:c});var l=s.x,f=s.y,d=s.width,h=s.height,p=new Uint8Array(d*h*4);return a.readPixels({x:l,y:f,width:d,height:h,pixelArray:p}),p}function m(e,t){var n=t.pickedColors,r=t.layers,i=t.deviceX,o=t.deviceY,a=t.deviceRadius,s=t.deviceRect;(0,T.default)(n);for(var u=s.x,c=s.y,l=s.width,f=s.height,d=a*a,h=-1,p=0,v=0;ve.counts?t:e.counts}),t}},{key:"getBinMap",value:function(){return this.sortedBins.reduce(function(e,t){return Object.assign(e,(n={},r=t.i,i=t,r in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n));var n,r,i},{})}}]),n}();t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultColorRange=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.get=function(e,t){var n=function(e){if("string"!=typeof e)return Array.isArray(e)?e:[e];var t=g[e];t||(t=e.split("."),g[e]=t);return t}(t),r=e,i=!0,o=!1,a=void 0;try{for(var s,u=n[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var c=s.value;if(null===(d=r)||"object"!==(void 0===d?"undefined":h(d)))return;var l=(f=r,void 0,Object.getPrototypeOf(f).get?v:p);r=l(r,c)}}catch(e){o=!0,a=e}finally{try{!i&&u.return&&u.return()}finally{if(o)throw a}}var f;var d;return r};var p=function(e,t){return e[t]},v=function(e,t){return e.get(t)},g={}},function(i,e,t){"use strict";(function(e,t){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="object"!==(void 0===e?"undefined":n(e))||"[object process]"!==String(e)||e.browser;i.exports={window:"undefined"!=typeof window?window:t,global:void 0!==t?t:window,document:"undefined"!=typeof document?document:{},isBrowser:r}}).call(e,t(26),t(47))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.inheritsFrom=function(e,t){for(;e;){if(e===t)return!0;e=Object.getPrototypeOf(e)}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};t.linearScale=function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]},t.quantizeScale=function(e,t,n){var r=(e[1]-e[0])/t.length,i=Math.floor((n-e[0])/r),o=Math.max(Math.min(i,t.length-1),0);return t[o]},t.getQuantizeScale=function(i,o){return function(e){var t=(i[1]-i[0])/o.length,n=Math.floor((e-i[0])/t),r=Math.max(Math.min(n,o.length-1),0);return o[r]}},t.getLinearScale=function(t,n){return function(e){return(e-t[0])/(t[1]-t[0])*(n[1]-n[0])+n[0]}},t.clamp=function(e,t){var n=o(e,2),r=n[0],i=n[1];return Math.min(i,Math.max(r,t))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=n(42),o=(r=i)&&r.__esModule?r:{default:r},h=n(16);var p=h.experimental.SphericalCoordinates;var a=function(e){function d(){var e=0a;)o.call(e,r=i[a++])&&t.push(r);return t}},function(e,t){e.exports=function(t,n){var r=n===Object(n)?function(e){return n[e]}:n;return function(e){return String(e).replace(t,r)}}},function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){var r=n(0),i=n(372)(/[\\^$*+?.()|[\]{}]/g,"\\$&");r(r.S,"RegExp",{escape:function(e){return i(e)}})},function(e,t,n){var r=n(0);r(r.P,"Array",{copyWithin:n(199)}),n(43)("copyWithin")},function(e,t,n){"use strict";var r=n(0),i=n(32)(4);r(r.P+r.F*!n(29)([].every,!0),"Array",{every:function(e){return i(this,e,arguments[1])}})},function(e,t,n){var r=n(0);r(r.P,"Array",{fill:n(128)}),n(43)("fill")},function(e,t,n){"use strict";var r=n(0),i=n(32)(2);r(r.P+r.F*!n(29)([].filter,!0),"Array",{filter:function(e){return i(this,e,arguments[1])}})},function(e,t,n){"use strict";var r=n(0),i=n(32)(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(e){return i(this,e,1>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var r=n(0),i=Math.exp;r(r.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},function(e,t,n){var r=n(0),i=n(139);r(r.S+r.F*(i!=Math.expm1),"Math",{expm1:i})},function(e,t,n){var r=n(0);r(r.S,"Math",{fround:n(212)})},function(e,t,n){var r=n(0),u=Math.abs;r(r.S,"Math",{hypot:function(e,t){for(var n,r,i=0,o=0,a=arguments.length,s=0;o>>16)*o+i*(65535&r>>>16)<<16>>>0)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,n){var r=n(0);r(r.S,"Math",{log1p:n(213)})},function(e,t,n){var r=n(0);r(r.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var r=n(0);r(r.S,"Math",{sign:n(140)})},function(e,t,n){var r=n(0),i=n(139),o=Math.exp;r(r.S+r.F*n(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},function(e,t,n){var r=n(0),i=n(139),o=Math.exp;r(r.S,"Math",{tanh:function(e){var t=i(e=+e),n=i(-e);return t==1/0?1:n==1/0?-1:(t-n)/(o(e)+o(-e))}})},function(e,t,n){var r=n(0);r(r.S,"Math",{trunc:function(e){return(0w;w++)i(v,b=E[w])&&!i(p,b)&&f(p,b,c(v,b));(p.prototype=g).constructor=p,n(20)(r,h,p)}},function(e,t,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var r=n(0),i=n(3).isFinite;r(r.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},function(e,t,n){var r=n(0);r(r.S,"Number",{isInteger:n(209)})},function(e,t,n){var r=n(0);r(r.S,"Number",{isNaN:function(e){return e!=e}})},function(e,t,n){var r=n(0),i=n(209),o=Math.abs;r(r.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},function(e,t,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var r=n(0),i=n(221);r(r.S+r.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(e,t,n){var r=n(0),i=n(222);r(r.S+r.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(e,t,n){"use strict";var r=n(0),c=n(36),l=n(198),f=n(147),i=1..toFixed,o=Math.floor,a=[0,0,0,0,0,0],d="Number.toFixed: incorrect invocation!",h=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*a[n],a[n]=r%1e7,r=o(r/1e7)},p=function(e){for(var t=6,n=0;0<=--t;)n+=a[t],a[t]=o(n/e),n=n%e*1e7},v=function(){for(var e=6,t="";0<=--e;)if(""!==t||0===e||0!==a[e]){var n=String(a[e]);t=""===t?n:t+f.call("0",7-n.length)+n}return t},g=function(e,t,n){return 0===t?n:t%2==1?g(e,t-1,n*e):g(e*e,t/2,n)};r(r.P+r.F*(!!i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(4)(function(){i.call({})})),"Number",{toFixed:function(e){var t,n,r,i,o=l(this,d),a=c(e),s="",u="0";if(a<0||20e;)t(r[e++]);c._c=[],c._n=!1,n&&!c._h&&M(c)})}},M=function(o){y.call(u,function(){var e,t,n,r=o._v,i=L(o);if(i&&(e=b(function(){T?S.emit("unhandledRejection",r,o):(t=u.onunhandledrejection)?t({promise:o,reason:r}):(n=u.console)&&n.error&&n.error("Unhandled promise rejection",r)}),o._h=T||L(o)?2:1),o._a=void 0,i&&e.e)throw e.v})},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},I=function(t){y.call(u,function(){var e;T?S.emit("rejectionHandled",t):(e=u.onrejectionhandled)&&e({promise:t,reason:t._v})})},N=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),k(t,!0))},F=function(e){var n,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===e)throw P("Promise can't be resolved itself");(n=C(e))?_(function(){var t={_w:r,_d:!1};try{n.call(e,c(F,t,1),c(N,t,1))}catch(e){N.call(t,e)}}):(r._v=e,r._s=1,k(r,!1))}catch(e){N.call({_w:r,_d:!1},e)}}};R||(A=function(e){p(this,A,w,"_h"),h(e),r.call(this);try{e(c(F,this,1),c(N,this,1))}catch(e){N.call(this,e)}},(r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(55)(A.prototype,{then:function(e,t){var n=O(g(this,A));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=T?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&k(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=c(F,e,1),this.reject=c(N,e,1)},m.f=O=function(e){return e===A||e===a?new o(e):i(e)}),f(f.G+f.W+f.F*!R,{Promise:A}),n(64)(A,w),n(56)(w),a=n(33)[w],f(f.S+f.F*!R,w,{reject:function(e){var t=O(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(s||!R),w,{resolve:function(e){return E(s&&this===a?A:this,e)}}),f(f.S+f.F*!(R&&n(93)(function(e){A.all(e).catch(x)})),w,{all:function(e){var a=this,t=O(a),s=t.resolve,u=t.reject,n=b(function(){var r=[],i=0,o=1;v(e,!1,function(e){var t=i++,n=!1;r.push(void 0),o++,a.resolve(e).then(function(e){n||(n=!0,r[t]=e,--o||s(r))},u)}),--o||s(r)});return n.e&&u(n.v),t.promise},race:function(e){var t=this,n=O(t),r=n.reject,i=b(function(){v(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t,n){var r=n(0),o=n(15),a=n(2),s=(n(3).Reflect||{}).apply,u=Function.apply;r(r.S+r.F*!n(4)(function(){s(function(){})}),"Reflect",{apply:function(e,t,n){var r=o(e),i=a(n);return s?s(r,t,i):u.call(r,t,i)}})},function(e,t,n){var r=n(0),s=n(51),u=n(15),c=n(2),l=n(5),i=n(4),f=n(202),d=(n(3).Reflect||{}).construct,h=i(function(){function e(){}return!(d(function(){},[],e)instanceof e)}),p=!i(function(){d(function(){})});r(r.S+r.F*(h||p),"Reflect",{construct:function(e,t){u(e),c(t);var n=arguments.length<3?e:u(arguments[2]);if(p&&!h)return d(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(f.apply(e,r))}var i=n.prototype,o=s(l(i)?i:Object.prototype),a=Function.apply.call(e,o,t);return l(a)?a:o}})},function(e,t,n){var r=n(10),i=n(0),o=n(2),a=n(37);i(i.S+i.F*n(4)(function(){Reflect.defineProperty(r.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,n){o(e),t=a(t,!0),o(n);try{return r.f(e,t,n),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0),i=n(22).f,o=n(2);r(r.S,"Reflect",{deleteProperty:function(e,t){var n=i(o(e),t);return!(n&&!n.configurable)&&delete e[t]}})},function(e,t,n){"use strict";var r=n(0),i=n(2),o=function(e){this._t=i(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(137)(o,"Object",function(){var e,t=this._k;do{if(this._i>=t.length)return{value:void 0,done:!0}}while(!((e=t[this._i++])in this._t));return{value:e,done:!1}}),r(r.S,"Reflect",{enumerate:function(e){return new o(e)}})},function(e,t,n){var r=n(22),i=n(0),o=n(2);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return r.f(o(e),t)}})},function(e,t,n){var r=n(0),i=n(23),o=n(2);r(r.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},function(e,t,n){var a=n(22),s=n(23),u=n(18),r=n(0),c=n(5),l=n(2);r(r.S,"Reflect",{get:function e(t,n){var r,i,o=arguments.length<3?t:arguments[2];return l(t)===o?t[n]:(r=a.f(t,n))?u(r,"value")?r.value:void 0!==r.get?r.get.call(o):void 0:c(i=s(t))?e(i,n,o):void 0}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{has:function(e,t){return t in e}})},function(e,t,n){var r=n(0),i=n(2),o=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(e){return i(e),!o||o(e)}})},function(e,t,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(220)})},function(e,t,n){var r=n(0),i=n(2),o=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(e){return!1}}})},function(e,t,n){var r=n(0),i=n(143);i&&r(r.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(e){return!1}}})},function(e,t,n){var u=n(10),c=n(22),l=n(23),f=n(18),r=n(0),d=n(54),h=n(2),p=n(5);r(r.S,"Reflect",{set:function e(t,n,r){var i,o,a=arguments.length<4?t:arguments[3],s=c.f(h(t),n);if(!s){if(p(o=l(t)))return e(o,n,r,a);s=d(0)}return f(s,"value")?!(!1===s.writable||!p(a)||((i=c.f(a,n)||d(0)).value=r,u.f(a,n,i),0)):void 0!==s.set&&(s.set.call(a,r),!0)}})},function(e,t,n){var r=n(3),o=n(135),i=n(10).f,a=n(52).f,s=n(92),u=n(90),c=r.RegExp,l=c,f=c.prototype,d=/a/g,h=/a/g,p=new c(d)!==d;if(n(9)&&(!p||n(4)(function(){return h[n(6)("match")]=!1,c(d)!=d||c(h)==h||"/a/i"!=c(d,"i")}))){c=function(e,t){var n=this instanceof c,r=s(e),i=void 0===t;return!n&&r&&e.constructor===c&&i?e:o(p?new l(r&&!i?e.source:e,t):l((r=e instanceof c)?e.source:e,r&&i?u.call(e):t),n?this:f,c)};for(var v=function(t){t in c||i(c,t,{configurable:!0,get:function(){return l[t]},set:function(e){l[t]=e}})},g=a(l),y=0;g.length>y;)v(g[y++]);(f.constructor=c).prototype=f,n(20)(r,"RegExp",c)}n(56)("RegExp")},function(e,t,n){n(89)("match",1,function(r,i,e){return[function(e){"use strict";var t=r(this),n=null==e?void 0:e[i];return void 0!==n?n.call(e,t):new RegExp(e)[i](String(t))},e]})},function(e,t,n){n(89)("replace",2,function(i,o,a){return[function(e,t){"use strict";var n=i(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,n,t):a.call(String(n),e,t)},a]})},function(e,t,n){n(89)("search",1,function(r,i,e){return[function(e){"use strict";var t=r(this),n=null==e?void 0:e[i];return void 0!==n?n.call(e,t):new RegExp(e)[i](String(t))},e]})},function(e,t,n){n(89)("split",2,function(i,o,a){"use strict";var h=n(92),p=a,v=[].push,e="split",g="length";if("c"=="abbc"[e](/(b)*/)[1]||4!="test"[e](/(?:)/,-1)[g]||2!="ab"[e](/(?:ab)*/)[g]||4!="."[e](/(.?)(.?)/)[g]||1<"."[e](/()()/)[g]||""[e](/.?/)[g]){var y=void 0===/()??/.exec("")[1];a=function(e,t){var n=String(this);if(void 0===e&&0===t)return[];if(!h(e))return p.call(n,e,t);var r,i,o,a,s,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=void 0===t?4294967295:t>>>0,d=new RegExp(e.source,c+"g");for(y||(r=new RegExp("^"+d.source+"$(?!\\s)",c));(i=d.exec(n))&&!(l<(o=i.index+i[0][g])&&(u.push(n.slice(l,i.index)),!y&&1=f));)d.lastIndex===i.index&&d.lastIndex++;return l===n[g]?!a&&d.test("")||u.push(""):u.push(n.slice(l)),u[g]>f?u.slice(0,f):u}}else"0"[e](void 0,0)[g]&&(a=function(e,t){return void 0===e&&0===t?[]:p.call(this,e,t)});return[function(e,t){var n=i(this),r=null==e?void 0:e[o];return void 0!==r?r.call(e,n,t):a.call(String(n),e,t)},a]})},function(e,t,n){"use strict";n(229);var r=n(2),i=n(90),o=n(9),a="toString",s=/./[a],u=function(e){n(20)(RegExp.prototype,a,e,!0)};n(4)(function(){return"/a/b"!=s.call({source:"a",flags:"b"})})?u(function(){var e=r(this);return"/".concat(e.source,"/","flags"in e?e.flags:!o&&e instanceof RegExp?i.call(e):void 0)}):s.name!=a&&u(function(){return s.call(this)})},function(e,t,n){"use strict";n(21)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(e,t,n){"use strict";n(21)("big",function(e){return function(){return e(this,"big","","")}})},function(e,t,n){"use strict";n(21)("blink",function(e){return function(){return e(this,"blink","","")}})},function(e,t,n){"use strict";n(21)("bold",function(e){return function(){return e(this,"b","","")}})},function(e,t,n){"use strict";var r=n(0),i=n(145)(!1);r(r.P,"String",{codePointAt:function(e){return i(this,e)}})},function(e,t,n){"use strict";var r=n(0),a=n(11),s=n(146),u="endsWith",c=""[u];r(r.P+r.F*n(133)(u),"String",{endsWith:function(e){var t=s(this,e,u),n=1>10),t%1024+56320))}return n.join("")}})},function(e,t,n){"use strict";var r=n(0),i=n(146);r(r.P+r.F*n(133)("includes"),"String",{includes:function(e){return!!~i(this,e,"includes").indexOf(e,1=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";n(21)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(e,t,n){var r=n(0),a=n(24),s=n(11);r(r.S,"String",{raw:function(e){for(var t=a(e.raw),n=s(t.length),r=arguments.length,i=[],o=0;oi;)a(B,t=n[i++])||t==N||t==u||r.push(t);return r},$=function(e){for(var t,n=e===G,r=C(n?U:b(e)),i=[],o=0;r.length>o;)!a(B,t=r[o++])||n&&!a(G,t)||i.push(B[t]);return i};V||(s((k=function(){if(this instanceof k)throw TypeError("Symbol is not a constructor!");var t=d(0te;)h(ee[te++]);for(var ne=x(h.store),re=0;ne.length>re;)v(ne[re++]);o(o.S+o.F*!V,"Symbol",{for:function(e){return a(D,e+="")?D[e]:D[e]=k(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in D)if(D[t]===e)return t},useSetter:function(){W=!0},useSimple:function(){W=!1}}),o(o.S+o.F*!V,"Object",{create:function(e,t){return void 0===t?P(e):Z(P(e),t)},defineProperty:K,defineProperties:Z,getOwnPropertyDescriptor:Q,getOwnPropertyNames:J,getOwnPropertySymbols:$}),M&&o(o.S+o.F*(!V||c(function(){var e=k();return"[null]"!=L([e])||"{}"!=L({a:e})||"{}"!=L(Object(e))})),"JSON",{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(m(t)||void 0!==e)&&!Y(e))return y(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),r[1]=t,L.apply(M,r)}}),k[I][F]||n(19)(k[I],F,k[I].valueOf),f(k,"Symbol"),f(Math,"Math",!0),f(r.JSON,"JSON",!0)},function(e,t,n){"use strict";var r=n(0),i=n(100),o=n(150),c=n(2),l=n(57),f=n(11),a=n(5),s=n(3).ArrayBuffer,d=n(99),h=o.ArrayBuffer,p=o.DataView,u=i.ABV&&s.isView,v=h.prototype.slice,g=i.VIEW,y="ArrayBuffer";r(r.G+r.W+r.F*(s!==h),{ArrayBuffer:h}),r(r.S+r.F*!i.CONSTR,y,{isView:function(e){return u&&u(e)||a(e)&&g in e}}),r(r.P+r.U+r.F*n(4)(function(){return!new h(2).slice(1,void 0).byteLength}),y,{slice:function(e,t){if(void 0!==v&&void 0===t)return v.call(c(this),e);for(var n=c(this).byteLength,r=l(e,n),i=l(void 0===t?n:t,n),o=new(d(this,h))(f(i-r)),a=new p(this),s=new p(o),u=0;r>>0,o=n>>>0;return(t>>>0)+(r>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{imulh:function(e,t){var n=+e,r=+t,i=65535&n,o=65535&r,a=n>>16,s=r>>16,u=(a*o>>>0)+(i*o>>>16);return a*s+(u>>16)+((i*s>>>0)+(65535&u)>>16)}})},function(e,t,n){var r=n(0);r(r.S,"Math",{isubh:function(e,t,n,r){var i=e>>>0,o=n>>>0;return(t>>>0)-(r>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(e,t,n){var r=n(0);r(r.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(e,t,n){var r=n(0),i=Math.PI/180;r(r.S,"Math",{radians:function(e){return e*i}})},function(e,t,n){var r=n(0);r(r.S,"Math",{scale:n(214)})},function(e,t,n){var r=n(0);r(r.S,"Math",{signbit:function(e){return(e=+e)!=e?e:0==e?1/e==1/0:0>>16,s=r>>>16,u=(a*o>>>0)+(i*o>>>16);return a*s+(u>>>16)+((i*s>>>0)+(65535&u)>>>16)}})},function(e,t,n){"use strict";var r=n(0),i=n(14),o=n(15),a=n(10);n(9)&&r(r.P+n(94),"Object",{__defineGetter__:function(e,t){a.f(i(this),e,{get:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){"use strict";var r=n(0),i=n(14),o=n(15),a=n(10);n(9)&&r(r.P+n(94),"Object",{__defineSetter__:function(e,t){a.f(i(this),e,{set:o(t),enumerable:!0,configurable:!0})}})},function(e,t,n){var r=n(0),i=n(219)(!0);r(r.S,"Object",{entries:function(e){return i(e)}})},function(e,t,n){var r=n(0),u=n(220),c=n(24),l=n(22),f=n(130);r(r.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,n,r=c(e),i=l.f,o=u(r),a={},s=0;o.length>s;)void 0!==(n=i(r,t=o[s++]))&&f(a,t,n);return a}})},function(e,t,n){"use strict";var r=n(0),i=n(14),o=n(37),a=n(23),s=n(22).f;n(9)&&r(r.P+n(94),"Object",{__lookupGetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=s(n,r))return t.get}while(n=a(n))}})},function(e,t,n){"use strict";var r=n(0),i=n(14),o=n(37),a=n(23),s=n(22).f;n(9)&&r(r.P+n(94),"Object",{__lookupSetter__:function(e){var t,n=i(this),r=o(e,!0);do{if(t=s(n,r))return t.set}while(n=a(n))}})},function(e,t,n){var r=n(0),i=n(219)(!1);r(r.S,"Object",{values:function(e){return i(e)}})},function(e,t,n){"use strict";var r=n(0),o=n(3),a=n(33),i=n(141)(),s=n(6)("observable"),u=n(15),c=n(2),l=n(48),f=n(55),d=n(19),h=n(49),p=h.RETURN,v=function(e){return null==e?void 0:u(e)},g=function(e){var t=e._c;t&&(e._c=void 0,t())},y=function(e){return void 0===e._o},_=function(e){y(e)||(e._o=void 0,g(e))},m=function(t,e){c(t),this._c=void 0,this._o=t,t=new b(this);try{var n=e(t),r=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){r.unsubscribe()}:u(n),this._c=n)}catch(e){return void t.error(e)}y(this)&&g(this)};m.prototype=f({},{unsubscribe:function(){_(this)}});var b=function(e){this._s=e};b.prototype=f({},{next:function(e){var t=this._s;if(!y(t)){var n=t._o;try{var r=v(n.next);if(r)return r.call(n,e)}catch(e){try{_(t)}finally{throw e}}}},error:function(e){var t=this._s;if(y(t))throw e;var n=t._o;t._o=void 0;try{var r=v(n.error);if(!r)throw e;e=r.call(n,e)}catch(e){try{g(t)}finally{throw e}}return g(t),e},complete:function(e){var t=this._s;if(!y(t)){var n=t._o;t._o=void 0;try{var r=v(n.complete);e=r?r.call(n,e):void 0}catch(e){try{g(t)}finally{throw e}}return g(t),e}}});var E=function(e){l(this,E,"Observable","_f")._f=u(e)};f(E.prototype,{subscribe:function(e){return new m(e,this._f)},forEach:function(r){var i=this;return new(a.Promise||o.Promise)(function(e,t){u(r);var n=i.subscribe({next:function(e){try{return r(e)}catch(e){t(e),n.unsubscribe()}},error:t,complete:e})})}}),f(E,{from:function(e){var t="function"==typeof this?this:E,n=v(c(e)[s]);if(n){var r=c(n.call(e));return r.constructor===t?r:new t(function(e){return r.subscribe(e)})}return new t(function(t){var n=!1;return i(function(){if(!n){try{if(h(e,!1,function(e){if(t.next(e),n)return p})===p)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function(){for(var e=0,t=arguments.length,r=new Array(t);et[0]&&(i=1),t[8]>t[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;n=Math.sqrt(t[3*i+i]-t[3*o+o]-t[3*a+a]+1),e[i]=.5*n,n=.5/n,e[3]=(t[3*o+a]-t[3*a+o])*n,e[o]=(t[3*o+i]+t[3*i+o])*n,e[a]=(t[3*a+i]+t[3*i+a])*n}return e}},function(e,t){e.exports=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}},function(e,t){e.exports=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e}},function(e,t,n){e.exports=n(619)},function(e,t,n){e.exports=n(245)},function(e,t){e.exports=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=r*l+a*s+i*c-o*u,e[1]=i*l+a*u+o*s-r*c,e[2]=o*l+a*c+r*u-i*s,e[3]=a*l-r*s-i*u-o*c,e}},function(e,t){e.exports=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=r*u+a*s,e[1]=i*u+o*s,e[2]=o*u-i*s,e[3]=a*u-r*s,e}},function(e,t){e.exports=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=r*u-o*s,e[1]=i*u+a*s,e[2]=o*u+r*s,e[3]=a*u-i*s,e}},function(e,t){e.exports=function(e,t,n){n*=.5;var r=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(n),u=Math.cos(n);return e[0]=r*u+i*s,e[1]=i*u-r*s,e[2]=o*u+a*s,e[3]=a*u-o*s,e}},function(e,t,n){var i=n(240),o=n(239),a=n(241),s=n(242),u=n(236),c=n(237);e.exports=function(e,t,n){var r=i(t,n);return r<-.999999?(o(l,f,t),a(l)<1e-6&&o(l,d,t),s(l,l),c(e,l,Math.PI),e):.999999\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",n=o.console&&(o.console.warn||o.console.log);return n&&n.call(o.console,i,t),r.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===v||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;nt[n]}):r.sort()),r}function R(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;og(c.y)?c.x:c.y,t.scale=a?(d=a.pointers,h=r,ne(h[0],h[1],Z)/ne(d[0],d[1],Z)):1,t.rotation=a?(l=a.pointers,f=r,re(f[1],f[0],Z)+re(l[1],l[0],Z)):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,i,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=B&&(Fg(l.y)?l.x:l.y,o=te(u,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}(n,t);var l,f;var d,h;var p=e.element;P(t.srcEvent.target,p)&&(p=t.srcEvent.target);t.target=p}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function J(e){for(var t=[],n=0;n=g(t)?e<0?G:V:t<0?z:W}function ne(e,t,n){n||(n=K);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function re(e,t,n){n||(n=K);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}q.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(k(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(k(this.element),this.evWin,this.domHandler)}};var ie={mousedown:j,mousemove:2,mouseup:D},oe="mousedown",ae="mousemove mouseup";function se(){this.evEl=oe,this.evWin=ae,this.pressed=!1,q.apply(this,arguments)}p(se,q,{handler:function(e){var t=ie[e.type];t&j&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=D),this.pressed&&(t&D&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var ue={pointerdown:j,pointermove:2,pointerup:D,pointercancel:B,pointerout:B},ce={2:N,3:"pen",4:"mouse",5:"kinect"},le="pointerdown",fe="pointermove pointerup pointercancel";function de(){this.evEl=le,this.evWin=fe,q.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(le="MSPointerDown",fe="MSPointerMove MSPointerUp MSPointerCancel"),p(de,q,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=ue[r],o=ce[e.pointerType]||e.pointerType,a=o==N,s=T(t,e.pointerId,"pointerId");i&j&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):i&(D|B)&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var he={touchstart:j,touchmove:2,touchend:D,touchcancel:B};function pe(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,q.apply(this,arguments)}p(pe,q,{handler:function(e){var t=he[e.type];if(t===j&&(this.started=!0),this.started){var n=function(e,t){var n=x(e.touches),r=x(e.changedTouches);t&(D|B)&&(n=O(n.concat(r),"identifier",!0));return[n,r]}.call(this,e,t);t&(D|B)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:N,srcEvent:e})}}});var ve={touchstart:j,touchmove:2,touchend:D,touchcancel:B},ge="touchstart touchmove touchend touchcancel";function ye(){this.evTarget=ge,this.targetIds={},q.apply(this,arguments)}p(ye,q,{handler:function(e){var t=ve[e.type],n=function(e,t){var n=x(e.touches),r=this.targetIds;if(t&(2|j)&&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 P(e.target,u)}),t===j)for(i=0;it.threshold&&i&t.direction},attrTest:function(e){return Ie.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Me(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),p(Fe,Ie,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},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)}}),p(je,Ce,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||e.eventType&(D|B)&&!i)this.reset();else if(e.eventType&j)this.reset(),this._timer=l(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&D)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&D?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=y(),this.manager.emit(this.options.event,this._input)))}}),p(De,Ie,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Se]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),p(Be,Ie,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:X|H,pointers:1},getTouchAction:function(){return Ne.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(X|H)?t=e.overallVelocity:n&X?t=e.overallVelocityX:n&H&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&g(t)>this.options.velocity&&e.eventType&D},emit:function(e){var t=Me(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),p(Ue,Ce,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Pe]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance>8&255,e+1>>16&255]},t.b=function(e){var t=o(e,3),n=t[0],r=t[1],i=t[2];return n+256*r+65536*i-1},t.c=function(){return r};var o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=new Uint8Array([0,0,0])},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"d",function(){return a}),n.d(t,"a",function(){return c}),n.d(t,"c",function(){return d});var r=n(173),i=n.n(r),s=n(261),u={},o=function(e){u[e.id]||(u[e.id]=e,i.a.listItem("luma.gl",e.id))},a=function(e,t){if(i.a.isReady()&&!i.a.throttle("luma.gl:"+e.id,1e3)){var n=Object.assign({},e.geometry.attributes,e.attributes),r=Object.assign({},e.uniforms,t);i.a.multiUpdate("luma.gl",e.id,[{path:"objects.uniforms",data:r},{path:"objects.attributes",data:n}])}},c=function(e){delete u[e],i.a.deleteItem("luma.gl",e)},l=function e(t,n,r){t&&(1 2) {\n return 0.0 / 0.0;\n }\n\n t = r - PI_2 * q;\n\n q = floor(t / PI_16 + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return 0.0 / 0.0;\n } else {\n t = t - PI_16 * q;\n }\n\n float u = 0.0;\n float v = 0.0;\n\n float sin_t, cos_t;\n float s, c;\n sincos_taylor_fp32(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0;\n v = SIN_TABLE_0;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1;\n v = SIN_TABLE_1;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2;\n v = SIN_TABLE_2;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3;\n v = SIN_TABLE_3;\n }\n if (k > 0) {\n s = u * sin_t + v * cos_t;\n c = u * cos_t - v * sin_t;\n } else {\n s = u * sin_t - v * cos_t;\n c = u * cos_t + v * sin_t;\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n return tan_taylor_fp32(a);\n#else\n return tan(a);\n#endif\n}\n",fs:null}},function(e,t,n){"use strict";t.a="uniform float ONE;\n\n/*\nAbout LUMA_FP64_CODE_ELIMINATION_WORKAROUND\n\nThe purpose of this workaround is to prevent shader compilers from\noptimizing away necessary arithmetic operations by swapping their sequences\nor transform the equation to some 'equivalent' from.\n\nThe method is to multiply an artifical variable, ONE, which will be known to\nthe compiler to be 1 only at runtime. The whole expression is then represented\nas a polynomial with respective to ONE. In the coefficients of all terms, only one a\nand one b should appear\n\nerr = (a + b) * ONE^6 - a * ONE^5 - (a + b) * ONE^4 + a * ONE^3 - b - (a + b) * ONE^2 + a * ONE\n*/\n\n// Divide float number to high and low floats to extend fraction bits\nvec2 split(float a) {\n const float SPLIT = 4097.0;\n float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float a_hi = t * ONE - (t - a);\n float a_lo = a * ONE - a_hi;\n#else\n float a_hi = t - (t - a);\n float a_lo = a - a_hi;\n#endif\n return vec2(a_hi, a_lo);\n}\n\n// Divide float number again when high float uses too many fraction bits\nvec2 split2(vec2 a) {\n vec2 b = split(a.x);\n b.y += a.y;\n return b;\n}\n\n// Special sum operation when a > b\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float sum = (a + b) * ONE;\n float err = b - (sum - a) * ONE;\n#else\n float sum = a + b;\n float err = b - (sum - a);\n#endif\n return vec2(sum, err);\n}\n\n// General sum operation\nvec2 twoSum(float a, float b) {\n float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n float v = s - a;\n float err = (a - (s - v)) + (b - v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float v = (s * ONE - a) * ONE;\n float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n float v = s - a;\n float err = (a - (s - v)) - (b + v);\n#endif\n return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n float prod = a * a;\n vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n float prod = a * b;\n vec2 a_fp64 = split(a);\n vec2 b_fp64 = split(b);\n float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSum(a.x, b.x);\n t = twoSum(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n vec2 s, t;\n s = twoSub(a.x, b.x);\n t = twoSub(a.y, b.y);\n s.y += t.x;\n s = quickTwoSum(s.x, s.y);\n s.y += t.y;\n s = quickTwoSum(s.x, s.y);\n return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n vec2 prod = twoProd(a.x, b.x);\n // y component is for the error\n prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n prod = split2(prod);\n#endif\n prod = quickTwoSum(prod.x, prod.y);\n return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n vec2 yn = a * xn;\n#endif\n float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n vec2 prod = twoProd(xn, diff);\n return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n float x = 1.0 / sqrt(a.x);\n float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n vec2 yn_sqr = twoSqr(yn);\n#endif\n float diff = sub_fp64(a, yn_sqr).x;\n vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n return sum_fp64(split(yn), prod);\n#else\n return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n"},function(e,t,n){"use strict";t.a="const vec2 E_FP64 = vec2(2.7182817459106445e+00, 8.254840366817007e-08);\nconst vec2 LOG2_FP64 = vec2(0.6931471824645996e+00, -1.9046542121259336e-09);\nconst vec2 PI_FP64 = vec2(3.1415927410125732, -8.742278012618954e-8);\nconst vec2 TWO_PI_FP64 = vec2(6.2831854820251465, -1.7484556025237907e-7);\nconst vec2 PI_2_FP64 = vec2(1.5707963705062866, -4.371139006309477e-8);\nconst vec2 PI_4_FP64 = vec2(0.7853981852531433, -2.1855695031547384e-8);\nconst vec2 PI_16_FP64 = vec2(0.19634954631328583, -5.463923757886846e-9);\nconst vec2 PI_16_2_FP64 = vec2(0.39269909262657166, -1.0927847515773692e-8);\nconst vec2 PI_16_3_FP64 = vec2(0.5890486240386963, -1.4906100798128818e-9);\nconst vec2 PI_180_FP64 = vec2(0.01745329238474369, 1.3519960498364902e-10);\n\nconst vec2 SIN_TABLE_0_FP64 = vec2(0.19509032368659973, -1.6704714833615242e-9);\nconst vec2 SIN_TABLE_1_FP64 = vec2(0.3826834261417389, 6.22335089017767e-9);\nconst vec2 SIN_TABLE_2_FP64 = vec2(0.5555702447891235, -1.1769521357507529e-8);\nconst vec2 SIN_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617041793133e-8);\n\nconst vec2 COS_TABLE_0_FP64 = vec2(0.9807852506637573, 2.9739473106360492e-8);\nconst vec2 COS_TABLE_1_FP64 = vec2(0.9238795042037964, 2.8307490351764386e-8);\nconst vec2 COS_TABLE_2_FP64 = vec2(0.8314695954322815, 1.6870263741530778e-8);\nconst vec2 COS_TABLE_3_FP64 = vec2(0.7071067690849304, 1.2101617152815436e-8);\n\nconst vec2 INVERSE_FACTORIAL_3_FP64 = vec2(1.666666716337204e-01, -4.967053879312289e-09); // 1/3!\nconst vec2 INVERSE_FACTORIAL_4_FP64 = vec2(4.16666679084301e-02, -1.2417634698280722e-09); // 1/4!\nconst vec2 INVERSE_FACTORIAL_5_FP64 = vec2(8.333333767950535e-03, -4.34617203337595e-10); // 1/5!\nconst vec2 INVERSE_FACTORIAL_6_FP64 = vec2(1.3888889225199819e-03, -3.3631094437103215e-11); // 1/6!\nconst vec2 INVERSE_FACTORIAL_7_FP64 = vec2(1.9841270113829523e-04, -2.725596874933456e-12); // 1/7!\nconst vec2 INVERSE_FACTORIAL_8_FP64 = vec2(2.4801587642286904e-05, -3.406996025904184e-13); // 1/8!\nconst vec2 INVERSE_FACTORIAL_9_FP64 = vec2(2.75573188446287533e-06, 3.7935713937038186e-14); // 1/9!\nconst vec2 INVERSE_FACTORIAL_10_FP64 = vec2(2.755731998149713e-07, -7.575112367869873e-15); // 1/10!\n\nfloat nint(float d) {\n if (d == floor(d)) return d;\n return floor(d + 0.5);\n}\n\nvec2 nint_fp64(vec2 a) {\n float hi = nint(a.x);\n float lo;\n vec2 tmp;\n if (hi == a.x) {\n lo = nint(a.y);\n tmp = quickTwoSum(hi, lo);\n } else {\n lo = 0.0;\n if (abs(hi - a.x) == 0.5 && a.y < 0.0) {\n hi -= 1.0;\n }\n tmp = vec2(hi, lo);\n }\n return tmp;\n}\n\n/* k_power controls how much range reduction we would like to have\nRange reduction uses the following method:\nassume a = k_power * r + m * log(2), k and m being integers.\nSet k_power = 4 (we can choose other k to trade accuracy with performance.\nwe only need to calculate exp(r) and using exp(a) = 2^m * exp(r)^k_power;\n*/\n\nvec2 exp_fp64(vec2 a) {\n // We need to make sure these two numbers match\n // as bit-wise shift is not available in GLSL 1.0\n const int k_power = 4;\n const float k = 16.0;\n\n const float inv_k = 1.0 / k;\n\n if (a.x <= -88.0) return vec2(0.0, 0.0);\n if (a.x >= 88.0) return vec2(1.0 / 0.0, 1.0 / 0.0);\n if (a.x == 0.0 && a.y == 0.0) return vec2(1.0, 0.0);\n if (a.x == 1.0 && a.y == 0.0) return E_FP64;\n\n float m = floor(a.x / LOG2_FP64.x + 0.5);\n vec2 r = sub_fp64(a, mul_fp64(LOG2_FP64, vec2(m, 0.0))) * inv_k;\n vec2 s, t, p;\n\n p = mul_fp64(r, r);\n s = sum_fp64(r, p * 0.5);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_3_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_4_FP64);\n\n s = sum_fp64(s, t);\n p = mul_fp64(p, r);\n t = mul_fp64(p, INVERSE_FACTORIAL_5_FP64);\n\n // s = sum_fp64(s, t);\n // p = mul_fp64(p, r);\n // t = mul_fp64(p, INVERSE_FACTORIAL_6_FP64);\n\n // s = sum_fp64(s, t);\n // p = mul_fp64(p, r);\n // t = mul_fp64(p, INVERSE_FACTORIAL_7_FP64);\n\n s = sum_fp64(s, t);\n\n\n // At this point, s = exp(r) - 1; but after following 4 recursions, we will get exp(r) ^ 512 - 1.\n for (int i = 0; i < k_power; i++) {\n s = sum_fp64(s * 2.0, mul_fp64(s, s));\n }\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = sum_fp64(s, vec2(ONE, 0.0));\n#else\n s = sum_fp64(s, vec2(1.0, 0.0));\n#endif\n\n return s * pow(2.0, m);\n// return r;\n}\n\nvec2 log_fp64(vec2 a)\n{\n if (a.x == 1.0 && a.y == 0.0) return vec2(0.0, 0.0);\n if (a.x <= 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n vec2 x = vec2(log(a.x), 0.0);\n vec2 s;\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n s = vec2(ONE, 0.0);\n#else\n s = vec2(1.0, 0.0);\n#endif\n\n x = sub_fp64(sum_fp64(x, mul_fp64(a, exp_fp64(-x))), s);\n return x;\n}\n\nvec2 sin_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n s = a;\n r = a;\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_3_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_5_FP64);\n s = sum_fp64(s, t);\n\n /* keep the following commented code in case we need them\n for extra accuracy from the Taylor expansion*/\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_7_FP64);\n // s = sum_fp64(s, t);\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_9_FP64);\n // s = sum_fp64(s, t);\n\n return s;\n}\n\nvec2 cos_taylor_fp64(vec2 a) {\n vec2 r, s, t, x;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n x = -mul_fp64(a, a);\n r = x;\n s = sum_fp64(vec2(1.0, 0.0), r * 0.5);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_4_FP64);\n s = sum_fp64(s, t);\n\n r = mul_fp64(r, x);\n t = mul_fp64(r, INVERSE_FACTORIAL_6_FP64);\n s = sum_fp64(s, t);\n\n /* keep the following commented code in case we need them\n for extra accuracy from the Taylor expansion*/\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_8_FP64);\n // s = sum_fp64(s, t);\n\n // r = mul_fp64(r, x);\n // t = mul_fp64(r, INVERSE_FACTORIAL_10_FP64);\n // s = sum_fp64(s, t);\n\n return s;\n}\n\nvoid sincos_taylor_fp64(vec2 a, out vec2 sin_t, out vec2 cos_t) {\n if (a.x == 0.0 && a.y == 0.0) {\n sin_t = vec2(0.0, 0.0);\n cos_t = vec2(1.0, 0.0);\n }\n\n sin_t = sin_taylor_fp64(a);\n cos_t = sqrt_fp64(sub_fp64(vec2(1.0, 0.0), mul_fp64(sin_t, sin_t)));\n}\n\nvec2 sin_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n // 2pi range reduction\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return sin_taylor_fp64(t);\n } else if (j == 1) {\n return cos_taylor_fp64(t);\n } else if (j == -1) {\n return -cos_taylor_fp64(t);\n } else {\n return -sin_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n }\n } else {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 cos_fp64(vec2 a) {\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(1.0, 0.0);\n }\n\n // 2pi range reduction\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n\n if (k == 0) {\n if (j == 0) {\n return cos_taylor_fp64(t);\n } else if (j == 1) {\n return -sin_taylor_fp64(t);\n } else if (j == -1) {\n return sin_taylor_fp64(t);\n } else {\n return -cos_taylor_fp64(t);\n }\n }\n\n int abs_k = int(abs(float(k)));\n\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n\n vec2 sin_t, cos_t;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n vec2 result = vec2(0.0, 0.0);\n if (j == 0) {\n if (k > 0) {\n result = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n result = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n } else if (j == 1) {\n if (k > 0) {\n result = -sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(v, cos_t), mul_fp64(u, sin_t));\n }\n } else if (j == -1) {\n if (k > 0) {\n result = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n } else {\n result = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n }\n } else {\n if (k > 0) {\n result = sub_fp64(mul_fp64(v, sin_t), mul_fp64(u, cos_t));\n } else {\n result = -sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n return result;\n}\n\nvec2 tan_fp64(vec2 a) {\n vec2 sin_a;\n vec2 cos_a;\n\n if (a.x == 0.0 && a.y == 0.0) {\n return vec2(0.0, 0.0);\n }\n\n // 2pi range reduction\n vec2 z = nint_fp64(div_fp64(a, TWO_PI_FP64));\n vec2 r = sub_fp64(a, mul_fp64(TWO_PI_FP64, z));\n\n vec2 t;\n float q = floor(r.x / PI_2_FP64.x + 0.5);\n int j = int(q);\n\n\n if (j < -2 || j > 2) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n }\n\n t = sub_fp64(r, mul_fp64(PI_2_FP64, vec2(q, 0.0)));\n\n q = floor(t.x / PI_16_FP64.x + 0.5);\n int k = int(q);\n int abs_k = int(abs(float(k)));\n\n // We just can't get PI/16 * 3.0 very accurately.\n // so let's just store it\n if (abs_k > 4) {\n return vec2(0.0 / 0.0, 0.0 / 0.0);\n } else {\n t = sub_fp64(t, mul_fp64(PI_16_FP64, vec2(q, 0.0)));\n }\n\n\n vec2 u = vec2(0.0, 0.0);\n vec2 v = vec2(0.0, 0.0);\n\n vec2 sin_t, cos_t;\n vec2 s, c;\n sincos_taylor_fp64(t, sin_t, cos_t);\n\n if (k == 0) {\n s = sin_t;\n c = cos_t;\n } else {\n#if defined(NVIDIA_FP64_WORKAROUND) || defined(INTEL_FP64_WORKAROUND)\n if (abs(float(abs_k) - 1.0) < 0.5) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs(float(abs_k) - 2.0) < 0.5) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs(float(abs_k) - 3.0) < 0.5) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs(float(abs_k) - 4.0) < 0.5) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#else\n if (abs_k == 1) {\n u = COS_TABLE_0_FP64;\n v = SIN_TABLE_0_FP64;\n } else if (abs_k == 2) {\n u = COS_TABLE_1_FP64;\n v = SIN_TABLE_1_FP64;\n } else if (abs_k == 3) {\n u = COS_TABLE_2_FP64;\n v = SIN_TABLE_2_FP64;\n } else if (abs_k == 4) {\n u = COS_TABLE_3_FP64;\n v = SIN_TABLE_3_FP64;\n }\n#endif\n if (k > 0) {\n s = sum_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sub_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n } else {\n s = sub_fp64(mul_fp64(u, sin_t), mul_fp64(v, cos_t));\n c = sum_fp64(mul_fp64(u, cos_t), mul_fp64(v, sin_t));\n }\n }\n\n if (j == 0) {\n sin_a = s;\n cos_a = c;\n } else if (j == 1) {\n sin_a = c;\n cos_a = -s;\n } else if (j == -1) {\n sin_a = -c;\n cos_a = s;\n } else {\n sin_a = -s;\n cos_a = -c;\n }\n return div_fp64(sin_a, cos_a);\n}\n\nvec2 radians_fp64(vec2 degree) {\n return mul_fp64(degree, PI_180_FP64);\n}\n\nvec2 mix_fp64(vec2 a, vec2 b, float x) {\n vec2 range = sub_fp64(b, a);\n return sum_fp64(a, mul_fp64(range, vec2(x, 0.0)));\n}\n\n// Vector functions\n// vec2 functions\nvoid vec2_sum_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sum_fp64(a[0], b[0]);\n out_val[1] = sum_fp64(a[1], b[1]);\n}\n\nvoid vec2_sub_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = sub_fp64(a[0], b[0]);\n out_val[1] = sub_fp64(a[1], b[1]);\n}\n\nvoid vec2_mul_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = mul_fp64(a[0], b[0]);\n out_val[1] = mul_fp64(a[1], b[1]);\n}\n\nvoid vec2_div_fp64(vec2 a[2], vec2 b[2], out vec2 out_val[2]) {\n out_val[0] = div_fp64(a[0], b[0]);\n out_val[1] = div_fp64(a[1], b[1]);\n}\n\nvoid vec2_mix_fp64(vec2 x[2], vec2 y[2], float a, out vec2 out_val[2]) {\n vec2 range[2];\n vec2_sub_fp64(y, x, range);\n vec2 portion[2];\n portion[0] = range[0] * a;\n portion[1] = range[1] * a;\n vec2_sum_fp64(x, portion, out_val);\n}\n\nvec2 vec2_length_fp64(vec2 x[2]) {\n return sqrt_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])));\n}\n\nvoid vec2_normalize_fp64(vec2 x[2], out vec2 out_val[2]) {\n vec2 length = vec2_length_fp64(x);\n vec2 length_vec2[2];\n length_vec2[0] = length;\n length_vec2[1] = length;\n\n vec2_div_fp64(x, length_vec2, out_val);\n}\n\nvec2 vec2_distance_fp64(vec2 x[2], vec2 y[2]) {\n vec2 diff[2];\n vec2_sub_fp64(x, y, diff);\n return vec2_length_fp64(diff);\n}\n\nvec2 vec2_dot_fp64(vec2 a[2], vec2 b[2]) {\n vec2 v[2];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n\n return sum_fp64(v[0], v[1]);\n}\n\n// vec3 functions\nvoid vec3_sub_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec3_sum_fp64(vec2 a[3], vec2 b[3], out vec2 out_val[3]) {\n for (int i = 0; i < 3; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvec2 vec3_length_fp64(vec2 x[3]) {\n return sqrt_fp64(sum_fp64(sum_fp64(mul_fp64(x[0], x[0]), mul_fp64(x[1], x[1])),\n mul_fp64(x[2], x[2])));\n}\n\nvec2 vec3_distance_fp64(vec2 x[3], vec2 y[3]) {\n vec2 diff[3];\n vec3_sub_fp64(x, y, diff);\n return vec3_length_fp64(diff);\n}\n\n// vec4 functions\nvoid vec4_fp64(vec4 a, out vec2 out_val[4]) {\n out_val[0].x = a[0];\n out_val[0].y = 0.0;\n\n out_val[1].x = a[1];\n out_val[1].y = 0.0;\n\n out_val[2].x = a[2];\n out_val[2].y = 0.0;\n\n out_val[3].x = a[3];\n out_val[3].y = 0.0;\n}\n\nvoid vec4_scalar_mul_fp64(vec2 a[4], vec2 b, out vec2 out_val[4]) {\n out_val[0] = mul_fp64(a[0], b);\n out_val[1] = mul_fp64(a[1], b);\n out_val[2] = mul_fp64(a[2], b);\n out_val[3] = mul_fp64(a[3], b);\n}\n\nvoid vec4_sum_fp64(vec2 a[4], vec2 b[4], out vec2 out_val[4]) {\n for (int i = 0; i < 4; i++) {\n out_val[i] = sum_fp64(a[i], b[i]);\n }\n}\n\nvoid vec4_dot_fp64(vec2 a[4], vec2 b[4], out vec2 out_val) {\n vec2 v[4];\n\n v[0] = mul_fp64(a[0], b[0]);\n v[1] = mul_fp64(a[1], b[1]);\n v[2] = mul_fp64(a[2], b[2]);\n v[3] = mul_fp64(a[3], b[3]);\n\n out_val = sum_fp64(sum_fp64(v[0], v[1]), sum_fp64(v[2], v[3]));\n}\n\nvoid mat4_vec4_mul_fp64(vec2 b[16], vec2 a[4], out vec2 out_val[4]) {\n vec2 tmp[4];\n\n for (int i = 0; i < 4; i++)\n {\n for (int j = 0; j < 4; j++)\n {\n tmp[j] = b[j + i * 4];\n }\n vec4_dot_fp64(a, tmp, out_val[i]);\n }\n}\n"},function(e,t,n){"use strict"},function(e,t,n){"use strict";n(649);var r=n(647),i=n(648),o=r.a+"\n"+i.a;t.a={name:"fp64",vs:o,fs:null};r.a},function(e,t,n){"use strict";t.a=" // empty\n"},function(e,t,n){"use strict";t.a="#ifdef GL_ES\nprecision highp float;\n#endif\n\n#define LIGHT_MAX 4\n\nvarying vec3 lighting_vLightWeighting;\n\nvec4 lighting_apply(vec4 color) {\n // set color from texture\n return vec4(color.rgb * lighting_vLightWeighting, color.a);\n}\n\n// spec-map.fs\n\nuniform mat4 viewMatrix;\n\n\nvarying vec4 lighting_vColor;\nvarying vec4 lighting_vTransformedNormal;\nvarying vec4 lighting_vPosition;\n\nuniform float shininess;\nuniform bool enableSpecularMap;\nuniform bool enableLights;\n\nuniform vec3 ambientColor;\nuniform vec3 directionalColor;\nuniform vec3 lightingDirection;\n\nuniform vec3 lighting_uPointLocation[LIGHT_MAX];\nuniform vec3 lighting_uPointColor[LIGHT_MAX];\nuniform float lighting_uPointSpecularEnable[LIGHT_MAX];\nuniform vec3 lighting_uPointSpecularColor[LIGHT_MAX];\nuniform int numberPoints;\n\n\nvec3 lighting__calculate_light_weighting() {\n\treturn lighting__calculate_light_weighting(shininess);\n}\n\nvec3 lighting__calculate_light_weighting(shininess) {\n vec3 normal = vTransformedNormal.xyz;\n vec3 eyeDirection = normalize(-vPosition.xyz);\n\n vec3 specularLight = vec3(0., 0., 0.);\n vec3 diffuseLight = vec3(0., 0., 0.);\n\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n vec3 transformedPointLocation = (viewMatrix * vec4(lighting_uPointLocation[i], 1.0)).xyz;\n vec3 lightDirection = normalize(transformedPointLocation - vPosition.xyz);\n\n if (lighting_uPointSpecularEnable > 0.) {\n vec3 reflectionDirection = reflect(-lightDirection, normal);\n float specularLightWeighting =\n pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininessVal);\n specularLight += specularLightWeighting * lighting_uPointSpecularColor[i];\n }\n\n float diffuseLightWeighting = max(dot(normal, lightDirection), 0.0);\n diffuseLight += diffuseLightWeighting * lighting_uPointColor[i];\n } else {\n break;\n }\n }\n\n return ambientColor + diffuseLight + specularLight;\n}\n\nvoid lighting_filterColor(fragmentColor) {\n if (!lighting_enable) {\n \treturn fragmentColor;\n } else {\n \tvec3 lightWeighting = lighting__calculate_light_weighting();\n \treturn vec4(fragmentColor.rgb * lightWeighting, fragmentColor.a);\n }\n}\n\n// render-tex.fs\n\nuniform vec3 material_uAmbientColor;\nuniform vec3 material_uDiffuseColor;\nuniform vec3 material_uSpecularColor;\nuniform vec3 material_uEmissiveColor;\n\nuniform bool hasTexture1;\nuniform sampler2D sampler1;\n\nuniform mat4 viewMatrix;\n\nvoid apply_lighting(color) {\n vec3 ambientLightWeighting = ambientColor;\n\n vec3 normal = vTransformedNormal.xyz;\n vec3 eyeDirection = normalize(-vPosition.xyz);\n\n vec3 specularLight = vec3(0.0, 0.0, 0.0);\n vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n vec3 transformedPointLocation = (viewMatrix * vec4(pointLocation[i], 1.0)).xyz;\n vec3 lightDirection = normalize(transformedPointLocation - vPosition.xyz);\n\n if (enableSpecularHighlights) {\n vec3 reflectionDirection = reflect(-lightDirection, normal);\n float specularLightWeighting =\n pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininess);\n specularLight += specularLightWeighting * pointSpecularColor[i];\n }\n\n float diffuseLightWeighting = max(dot(normal, lightDirection), 0.0);\n diffuseLight += diffuseLightWeighting * pointColor[i];\n } else {\n break;\n }\n }\n\n vec3 matAmbientColor = material_uAmbientColor * color.rgb;\n vec3 matDiffuseColor = material_uDiffuseColor * color.rgb;\n vec3 matSpecularColor = material_uSpecularColor * color.rgb;\n vec3 matEmissiveColor = material_uEmissiveColor * color.rgb;\n gl_FragColor = vec4(\n matAmbientColor * ambientLightWeighting\n + matDiffuseColor * diffuseLightWeighting\n + matSpecularColor * specularLightWeighting\n + matEmissiveColor,\n color.a\n );\n}\n\n/// frag-lighting\n\n vec3 lightWeighting;\n if (!enableLights) {\n lightWeighting = vec3(1.0, 1.0, 1.0);\n } else {\n vec3 lightDirection;\n float specularLightWeighting = 0.0;\n float diffuseLightWeighting = 0.0;\n vec3 specularLight = vec3(0.0, 0.0, 0.0);\n vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n\n vec3 transformedPointLocation;\n vec3 normal = vTransformedNormal.xyz;\n\n vec3 eyeDirection = normalize(-vPosition.xyz);\n vec3 reflectionDirection;\n\n vec3 pointWeight = vec3(0.0, 0.0, 0.0);\n\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n transformedPointLocation = (viewMatrix * vec4(pointLocation[i], 1.0)).xyz;\n lightDirection = normalize(transformedPointLocation - vPosition.xyz);\n\n if (enableSpecular[i] > 0.0) {\n reflectionDirection = reflect(-lightDirection, normal);\n specularLightWeighting = pow(max(dot(reflectionDirection, eyeDirection), 0.0), shininess);\n specularLight += specularLightWeighting * pointSpecularColor[i];\n }\n\n diffuseLightWeighting = max(dot(normal, lightDirection), 0.0);\n diffuseLight += diffuseLightWeighting * pointColor[i];\n } else {\n break;\n }\n }\n\n lightWeighting = ambientColor + diffuseLight + specularLight;\n }\n\n// reflection / refraction configs\nuniform float reflection;\nuniform float refraction;\n\n///\n // has cube texture then apply reflection\n // if (hasTextureCube1) {\n // vec3 nReflection = normalize(vReflection);\n // vec3 reflectionValue;\n // if (refraction > 0.0) {\n // reflectionValue = refract(nReflection, vNormal.xyz, refraction);\n // } else {\n // reflectionValue = -reflect(nReflection, vNormal.xyz);\n // }\n\n // // TODO(nico): check whether this is right.\n // vec4 cubeColor = textureCube(samplerCube1,\n // vec3(-reflectionValue.x, -reflectionValue.y, reflectionValue.z));\n // gl_FragColor = vec4(mix(gl_FragColor.xyz, cubeColor.xyz, reflection), 1.0);\n // }\n"},function(e,t,n){"use strict";t.a="#define LIGHT_MAX 4\n\n/*\n// lighting configuration\nuniform bool enableLights;\nuniform vec3 ambientColor;\nuniform vec3 directionalColor;\nuniform vec3 lightingDirection;\n\n// point lights configuration\nuniform vec3 pointLocation[LIGHT_MAX];\nuniform vec3 pointColor[LIGHT_MAX];\nuniform int numberPoints;\n\n// reflection / refraction configuration\nuniform bool useReflection;\n*/\n\nuniform bool lighting_uEnableLights;\nuniform vec3 lighting_uAmbientColor;\nuniform vec3 lighting_uDirection;\nuniform vec3 lighting_uDirectionalColor;\n\n// point lights configuration\nuniform int lighting_uPointCount;\nuniform vec3 lighting_uPointLocation[LIGHT_MAX];\nuniform vec3 lighting_uPointColor[LIGHT_MAX];\n\n// reflection / refraction configuration\nuniform bool lighting_uEnableReflections;\n\n// varyings\nvarying vec4 lighting_vPosition;\nvarying vec4 lighting_vNormal;\nvarying vec3 lighting_vColor;\nvarying vec3 lighting_vLightWeighting;\nvarying vec3 lighting_vReflection;\n\nvoid lighting_setPositionAndNormal(vec3 position, vec3 normal) {\n lighting_vPosition = worldMatrix * vec4(position, 1.);\n lighting_vNormal = worldInverseTransposeMatrix * vec4(normal, 1.);;\n}\n\nvoid lighting__getLightWeigting() {\n float directionalLightWeighting = max(dot(lighting_vNormal.xyz, lighting_uDirection), 0.);\n vec3 pointWeight = vec3(0., 0., 0.);\n for (int i = 0; i < LIGHT_MAX; i++) {\n if (i < numberPoints) {\n vec4 mvLightPosition = viewMatrix * vec4(lighting_uPointLocation[i], 1.);\n vec3 pointLightDirection = normalize(mvLightPosition.xyz - lighting_vPosition.xyz);\n pointWeight += max(dot(lighting_vNormal.xyz, pointLightDirection), 0.) * pointColor[i];\n } else {\n break;\n }\n }\n return ambientColor + (directionalColor * directionalLightWeighting) + pointWeight;\n}\n\nvoid lighting_apply(vec3 position, vec3 normal) {\n lighting_setPositionAndNormal(position, normal);\n\n // lighting code\n if(!lighting_uEnableLights) {\n lighting_vLightWeighting = vec3(1., 1., 1.);\n } else {\n lighting_vLightWeighting = lighting__getLightWeighting();\n }\n}\n\nvoid lighting_set_reflection(vec3 position) {\n // refraction / reflection code\n if (lighting_uEnableReflections) {\n lighting_vReflection = (viewInverseMatrix[3] - (worldMatrix * vec4(position, 1.))).xyz;\n } else {\n lighting_vReflection = vec3(1., 1., 1.);\n }\n}\n"},function(e,t,n){"use strict";var h=n(16),r=n(651),i=n(653),o=n(652),a=r.a+"\n"+i.a+"\n",s=r.a+"\n"+o.a+"\n";t.a={name:"lighting",vs:a,fs:s,getUniforms:function(e){var t,n,r,i,o=e.lightingEnable,a=void 0!==o&&o,s=e.lightingAmbientColor,u=void 0===s?[.2,.2,.2]:s,c=e.lightingDirection,l=void 0===c?[1,1,1]:c,f=(e.lightingDirectionalColor,e.lightingPointLights),d=void 0===f?[]:f;return Object.assign({lightingEnable:a,lightingAmbientColor:u},(n=(t=l).color,r=t.direction,i=new h.Vector3(r.x,r.y,r.z).normalize().scale(-1,-1,-1),{directionalColor:[n.r,n.g,n.b],lightingDirection:[i.x,i.y,i.z]}),function(e){var t=(e=e instanceof Array?e:[e]).length,n=[],r=[],i=[],o=[],a=!0,s=!1,u=void 0;try{for(var c,l=e[Symbol.iterator]();!(a=(c=l.next()).done);a=!0){var f=c.value,d=f.position,h=f.color,p=f.diffuse,v=f.specular,g=h||p;n.push(d.x,d.y,d.z),r.push(g.r,g.g,g.b),i.push(Number(Boolean(v))),v?o.push(v.r,v.g,v.b):o.push(0,0,0)}}catch(e){s=!0,u=e}finally{try{!a&&l.return&&l.return()}finally{if(s)throw u}}return{numberPoints:t,pointLocation:n,pointColor:r,enableSpecular:i,pointSpecularColor:o}}(d))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r="#ifdef MODULE_LOGDEPTH\n logdepth_adjustPosition(gl_Position);\n#endif\n",i="#ifdef MODULE_MATERIAL\n gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n logdepth_setFragDepth();\n#endif\n"},function(e,t,n){"use strict";var r={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingThreshold:1,pickingActive:!1};t.a={name:"picking",vs:"uniform vec3 picking_uSelectedColor;\nuniform float picking_uThreshold;\nuniform bool picking_uSelectedColorValid;\n\nvarying vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool isVertexPicked(vec3 vertexColor) {\n return\n picking_uSelectedColorValid &&\n abs(vertexColor.r - picking_uSelectedColor.r) < picking_uThreshold &&\n abs(vertexColor.g - picking_uSelectedColor.g) < picking_uThreshold &&\n abs(vertexColor.b - picking_uSelectedColor.b) < picking_uThreshold;\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n // Do the comparison with selected item color in vertex shader as it should mean fewer compares\n picking_vRGBcolor_Aselected.a =\n float(isVertexPicked(pickingColor));\n\n // Stores the picking color so that the fragment shader can render it during picking\n picking_vRGBcolor_Aselected.rgb = pickingColor * COLOR_SCALE;\n}\n",fs:"uniform bool picking_uActive; // true during rendering to offscreen picking buffer\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nvarying vec4 picking_vRGBcolor_Aselected;\n\nconst float COLOR_SCALE = 1. / 255.;\n\n/*\n * Returns highlight color if this item is selected.\n */\nvec4 picking_filterHighlightColor(vec4 color) {\n bool selected = bool(picking_vRGBcolor_Aselected.a);\n return selected ? (picking_uHighlightColor * COLOR_SCALE) : color;\n}\n\n/*\n * Returns picking color if picking enabled else unmodified argument.\n */\nvec4 picking_filterPickingColor(vec4 color) {\n vec3 pickingColor = picking_vRGBcolor_Aselected.rgb;\n return picking_uActive ? vec4(pickingColor, 1.0) : color;\n}\n",getUniforms:function(){var e=0.")}return t}(t);if(!oe[n]){oe[n]=!0;var r="";e&&e._owner&&e._owner!==C.current&&(r=" It was passed a child from "+$(e._owner)+"."),ee=e,b(!1,'Each child in an array or iterator should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.%s',n,r,ne()),ee=null}}}function se(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n