@carto/kepler.gl 0.0.19 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/umd/keplergl.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("styled-components"),require("react-dom"),require("redux"),require("react-redux")):"function"==typeof define&&define.amd?define(["react","styled-components","react-dom","redux","react-redux"],t):"object"==typeof exports?exports.KeplerGl=t(require("react"),require("styled-components"),require("react-dom"),require("redux"),require("react-redux")):e.KeplerGl=t(e.React,e.styled,e.ReactDOM,e.Redux,e.ReactRedux)}(this,(function(e,t,n,r,a){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1213)}([function(t,n){t.exports=e},function(e,t,n){e.exports=n(1243)()},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){var r=n(63);function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}return n.default=e,t&&t.set(e,n),n}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var r=n(1252);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(63),a=n(13);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?a(e):t}},function(e,n){e.exports=t},function(e,t){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";n.d(t,"q",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"h",(function(){return s})),n.d(t,"p",(function(){return l})),n.d(t,"o",(function(){return u})),n.d(t,"k",(function(){return c})),n.d(t,"l",(function(){return d})),n.d(t,"m",(function(){return f})),n.d(t,"n",(function(){return p})),n.d(t,"e",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return g})),n.d(t,"j",(function(){return y})),n.d(t,"i",(function(){return v})),n.d(t,"g",(function(){return A})),n.d(t,"b",(function(){return b}));var r=n(26);function a(e,t){if(e===t){var n=t[1],r=t[2],a=t[3],o=t[6],i=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=a,e[13]=i,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function o(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=t[4],s=t[5],l=t[6],u=t[7],c=t[8],d=t[9],f=t[10],p=t[11],h=t[12],m=t[13],g=t[14],y=t[15],v=n*s-r*i,A=n*l-a*i,b=n*u-o*i,_=r*l-a*s,E=r*u-o*s,x=a*u-o*l,M=c*m-d*h,w=c*g-f*h,O=c*y-p*h,S=d*g-f*m,T=d*y-p*m,C=f*y-p*g,L=v*C-A*T+b*S+_*O-E*w+x*M;return L?(L=1/L,e[0]=(s*C-l*T+u*S)*L,e[1]=(a*T-r*C-o*S)*L,e[2]=(m*x-g*E+y*_)*L,e[3]=(f*E-d*x-p*_)*L,e[4]=(l*O-i*C-u*w)*L,e[5]=(n*C-a*O+o*w)*L,e[6]=(g*b-h*x-y*A)*L,e[7]=(c*x-f*b+p*A)*L,e[8]=(i*T-s*O+u*M)*L,e[9]=(r*O-n*T-o*M)*L,e[10]=(h*E-m*b+y*v)*L,e[11]=(d*b-c*E-p*v)*L,e[12]=(s*w-i*S-l*M)*L,e[13]=(n*S-r*w+a*M)*L,e[14]=(m*A-h*_-g*v)*L,e[15]=(c*_-d*A+f*v)*L,e):null}function i(e){var t=e[0],n=e[1],r=e[2],a=e[3],o=e[4],i=e[5],s=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],h=e[13],m=e[14],g=e[15];return(t*i-n*o)*(d*g-f*m)-(t*s-r*o)*(c*g-f*h)+(t*l-a*o)*(c*m-d*h)+(n*s-r*i)*(u*g-f*p)-(n*l-a*i)*(u*m-d*p)+(r*l-a*s)*(u*h-c*p)}function s(e,t,n){var r=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],f=t[9],p=t[10],h=t[11],m=t[12],g=t[13],y=t[14],v=t[15],A=n[0],b=n[1],_=n[2],E=n[3];return e[0]=A*r+b*s+_*d+E*m,e[1]=A*a+b*l+_*f+E*g,e[2]=A*o+b*u+_*p+E*y,e[3]=A*i+b*c+_*h+E*v,A=n[4],b=n[5],_=n[6],E=n[7],e[4]=A*r+b*s+_*d+E*m,e[5]=A*a+b*l+_*f+E*g,e[6]=A*o+b*u+_*p+E*y,e[7]=A*i+b*c+_*h+E*v,A=n[8],b=n[9],_=n[10],E=n[11],e[8]=A*r+b*s+_*d+E*m,e[9]=A*a+b*l+_*f+E*g,e[10]=A*o+b*u+_*p+E*y,e[11]=A*i+b*c+_*h+E*v,A=n[12],b=n[13],_=n[14],E=n[15],e[12]=A*r+b*s+_*d+E*m,e[13]=A*a+b*l+_*f+E*g,e[14]=A*o+b*u+_*p+E*y,e[15]=A*i+b*c+_*h+E*v,e}function l(e,t,n){var r,a,o,i,s,l,u,c,d,f,p,h,m=n[0],g=n[1],y=n[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(r=t[0],a=t[1],o=t[2],i=t[3],s=t[4],l=t[5],u=t[6],c=t[7],d=t[8],f=t[9],p=t[10],h=t[11],e[0]=r,e[1]=a,e[2]=o,e[3]=i,e[4]=s,e[5]=l,e[6]=u,e[7]=c,e[8]=d,e[9]=f,e[10]=p,e[11]=h,e[12]=r*m+s*g+d*y+t[12],e[13]=a*m+l*g+f*y+t[13],e[14]=o*m+u*g+p*y+t[14],e[15]=i*m+c*g+h*y+t[15]),e}function u(e,t,n){var r=n[0],a=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*a,e[5]=t[5]*a,e[6]=t[6]*a,e[7]=t[7]*a,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function c(e,t,n,a){var o,i,s,l,u,c,d,f,p,h,m,g,y,v,A,b,_,E,x,M,w,O,S,T,C=a[0],L=a[1],P=a[2],R=Math.hypot(C,L,P);return R<r.b?null:(C*=R=1/R,L*=R,P*=R,o=Math.sin(n),s=1-(i=Math.cos(n)),l=t[0],u=t[1],c=t[2],d=t[3],f=t[4],p=t[5],h=t[6],m=t[7],g=t[8],y=t[9],v=t[10],A=t[11],b=C*C*s+i,_=L*C*s+P*o,E=P*C*s-L*o,x=C*L*s-P*o,M=L*L*s+i,w=P*L*s+C*o,O=C*P*s+L*o,S=L*P*s-C*o,T=P*P*s+i,e[0]=l*b+f*_+g*E,e[1]=u*b+p*_+y*E,e[2]=c*b+h*_+v*E,e[3]=d*b+m*_+A*E,e[4]=l*x+f*M+g*w,e[5]=u*x+p*M+y*w,e[6]=c*x+h*M+v*w,e[7]=d*x+m*M+A*w,e[8]=l*O+f*S+g*T,e[9]=u*O+p*S+y*T,e[10]=c*O+h*S+v*T,e[11]=d*O+m*S+A*T,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function d(e,t,n){var r=Math.sin(n),a=Math.cos(n),o=t[4],i=t[5],s=t[6],l=t[7],u=t[8],c=t[9],d=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*a+u*r,e[5]=i*a+c*r,e[6]=s*a+d*r,e[7]=l*a+f*r,e[8]=u*a-o*r,e[9]=c*a-i*r,e[10]=d*a-s*r,e[11]=f*a-l*r,e}function f(e,t,n){var r=Math.sin(n),a=Math.cos(n),o=t[0],i=t[1],s=t[2],l=t[3],u=t[8],c=t[9],d=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*a-u*r,e[1]=i*a-c*r,e[2]=s*a-d*r,e[3]=l*a-f*r,e[8]=o*r+u*a,e[9]=i*r+c*a,e[10]=s*r+d*a,e[11]=l*r+f*a,e}function p(e,t,n){var r=Math.sin(n),a=Math.cos(n),o=t[0],i=t[1],s=t[2],l=t[3],u=t[4],c=t[5],d=t[6],f=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*a+u*r,e[1]=i*a+c*r,e[2]=s*a+d*r,e[3]=l*a+f*r,e[4]=u*a-o*r,e[5]=c*a-i*r,e[6]=d*a-s*r,e[7]=f*a-l*r,e}function h(e,t){var n=t[0],r=t[1],a=t[2],o=t[4],i=t[5],s=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(n,r,a),e[1]=Math.hypot(o,i,s),e[2]=Math.hypot(l,u,c),e}function m(e,t){var n=t[0],r=t[1],a=t[2],o=t[3],i=n+n,s=r+r,l=a+a,u=n*i,c=r*i,d=r*s,f=a*i,p=a*s,h=a*l,m=o*i,g=o*s,y=o*l;return e[0]=1-d-h,e[1]=c+y,e[2]=f-g,e[3]=0,e[4]=c-y,e[5]=1-u-h,e[6]=p+m,e[7]=0,e[8]=f+g,e[9]=p-m,e[10]=1-u-d,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function g(e,t,n,r,a,o,i){var s=1/(n-t),l=1/(a-r),u=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(a+r)*l,e[10]=(i+o)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*u,e[15]=0,e}function y(e,t,n,r,a){var o,i=1/Math.tan(t/2);return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=a&&a!==1/0?(o=1/(r-a),e[10]=(a+r)*o,e[14]=2*a*r*o):(e[10]=-1,e[14]=-2*r),e}function v(e,t,n,r,a,o,i){var s=1/(t-n),l=1/(r-a),u=1/(o-i);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+n)*s,e[13]=(a+r)*l,e[14]=(i+o)*u,e[15]=1,e}function A(e,t,n,a){var o,i,s,l,u,c,d,f,p,h,m=t[0],g=t[1],y=t[2],v=a[0],A=a[1],b=a[2],_=n[0],E=n[1],x=n[2];return Math.abs(m-_)<r.b&&Math.abs(g-E)<r.b&&Math.abs(y-x)<r.b?function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}(e):(d=m-_,f=g-E,p=y-x,o=A*(p*=h=1/Math.hypot(d,f,p))-b*(f*=h),i=b*(d*=h)-v*p,s=v*f-A*d,(h=Math.hypot(o,i,s))?(o*=h=1/h,i*=h,s*=h):(o=0,i=0,s=0),l=f*s-p*i,u=p*o-d*s,c=d*i-f*o,(h=Math.hypot(l,u,c))?(l*=h=1/h,u*=h,c*=h):(l=0,u=0,c=0),e[0]=o,e[1]=l,e[2]=d,e[3]=0,e[4]=i,e[5]=u,e[6]=f,e[7]=0,e[8]=s,e[9]=c,e[10]=p,e[11]=0,e[12]=-(o*m+i*g+s*y),e[13]=-(l*m+u*g+c*y),e[14]=-(d*m+f*g+p*y),e[15]=1,e)}function b(e,t){var n=e[0],a=e[1],o=e[2],i=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],f=e[9],p=e[10],h=e[11],m=e[12],g=e[13],y=e[14],v=e[15],A=t[0],b=t[1],_=t[2],E=t[3],x=t[4],M=t[5],w=t[6],O=t[7],S=t[8],T=t[9],C=t[10],L=t[11],P=t[12],R=t[13],D=t[14],k=t[15];return Math.abs(n-A)<=r.b*Math.max(1,Math.abs(n),Math.abs(A))&&Math.abs(a-b)<=r.b*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(o-_)<=r.b*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(i-E)<=r.b*Math.max(1,Math.abs(i),Math.abs(E))&&Math.abs(s-x)<=r.b*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(l-M)<=r.b*Math.max(1,Math.abs(l),Math.abs(M))&&Math.abs(u-w)<=r.b*Math.max(1,Math.abs(u),Math.abs(w))&&Math.abs(c-O)<=r.b*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(d-S)<=r.b*Math.max(1,Math.abs(d),Math.abs(S))&&Math.abs(f-T)<=r.b*Math.max(1,Math.abs(f),Math.abs(T))&&Math.abs(p-C)<=r.b*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(h-L)<=r.b*Math.max(1,Math.abs(h),Math.abs(L))&&Math.abs(m-P)<=r.b*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(g-R)<=r.b*Math.max(1,Math.abs(g),Math.abs(R))&&Math.abs(y-D)<=r.b*Math.max(1,Math.abs(y),Math.abs(D))&&Math.abs(v-k)<=r.b*Math.max(1,Math.abs(v),Math.abs(k))}},function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"k",(function(){return r})),n.d(t,"i",(function(){return a.d})),n.d(t,"j",(function(){return a.e})),n.d(t,"g",(function(){return a.c})),n.d(t,"b",(function(){return a.b})),n.d(t,"a",(function(){return a.a})),n.d(t,"f",(function(){return o.a})),n.d(t,"n",(function(){return o.c})),n.d(t,"l",(function(){return o.b})),n.d(t,"o",(function(){return o.d})),n.d(t,"c",(function(){return g})),n.d(t,"m",(function(){return v})),n.d(t,"h",(function(){return y})),n.d(t,"e",(function(){return u})),n.d(t,"d",(function(){return c}));const r=new(n(1909).a)({id:"luma.gl"});var a=n(79),o=(n(820),n(206)),i=n(163),s=n(80),l=n(90);function u(e){const{luma:t}=e;if(e.canvas&&t){const{clientWidth:n}=t.canvasSizeInfo;return n?e.drawingBufferWidth/n:1}return 1}function c(e,t,n=!0){return function(e,t,n,r,a){const o=d(e[0],t,n);let i=f(e[1],t,r,a),s=d(e[0]+1,t,n);const l=s===n-1?s:s-1;let u;s=f(e[1]+1,t,r,a),a?(s=0===s?s:s+1,u=i,i=s):u=s===r-1?s:s-1;return{x:o,y:i,width:Math.max(l-o+1,1),height:Math.max(u-i+1,1)}}(t,u(e),e.drawingBufferWidth,e.drawingBufferHeight,n)}function d(e,t,n){return Math.min(Math.round(e*t),n-1)}function f(e,t,n,r){return r?Math.max(0,n-1-Math.round(e*t)):Math.min(Math.round(e*t),n-1)}const p=Object(s.isBrowser)(),h=p&&"undefined"!=typeof document,m={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function g(e={}){Object(l.a)(p,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),e=Object.assign({},m,e);const{width:t,height:n}=e;function o(t){if(e.throwOnError)throw new Error(t);return console.error(t),null}let i;e.onError=o;const{canvas:s}=e;return i=function(e,t){const{onError:n}=t;let r=null;const a=e=>r=e.statusMessage||r;e.addEventListener("webglcontextcreationerror",a,!1);const{webgl1:o=!0,webgl2:i=!0}=t;let s=null;i&&(s=s||e.getContext("webgl2",t),s=s||e.getContext("experimental-webgl2",t));o&&(s=s||e.getContext("webgl",t),s=s||e.getContext("experimental-webgl",t));if(e.removeEventListener("webglcontextcreationerror",a,!1),!s)return n(`Failed to create ${i&&!o?"WebGL2":"WebGL"} context: ${r||"Unknown error"}`);t.onContextLost&&e.addEventListener("webglcontextlost",t.onContextLost,!1);t.onContextRestored&&e.addEventListener("webglcontextrestored",t.onContextRestored,!1);return s}(function({canvas:e,width:t=800,height:n=600,onError:r}){let a;if("string"==typeof e){h&&"complete"===document.readyState||r(`createGLContext called on canvas '${e}' before page was loaded`),a=document.getElementById(e)}else e?a=e:(a=document.createElement("canvas"),a.id="lumagl-canvas",a.style.width=Number.isFinite(t)?t+"px":"100%",a.style.height=Number.isFinite(n)?n+"px":"100%",document.body.insertBefore(a,document.body.firstChild));return a}({canvas:s,width:t,height:n,onError:o}),e),i?(i=y(i,e),function(e){const t=Object(a.e)(e)?"WebGL2":"WebGL1",n=function(e){const t=e.getParameter(7936),n=e.getParameter(7937),r=e.getExtension("WEBGL_debug_renderer_info"),a=r&&e.getParameter(r.UNMASKED_VENDOR_WEBGL||7936),o=r&&e.getParameter(r.UNMASKED_RENDERER_WEBGL||7937);return{vendor:a||t,renderer:o||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}(e),o=n?`(${n.vendor},${n.renderer})`:"",i=e.debug?" debug":"";r.info(1,`${t}${i} context ${o}`)()}(i),i):null}function y(e,t={}){if(!e||e._instrumented)return e;e._version=e._version||function(e){if("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext)return 2;return 1}(e),e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{},t=Object.assign({},m,t);const{manageState:n,debug:a}=t;return n&&Object(i.c)(e,{copyState:!1,log:(...e)=>r.log(1,...e)()}),p&&a&&(s.global.makeDebugContext?(e=s.global.makeDebugContext(e,t),r.level=Math.max(r.level,1)):r.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),e._instrumented=!0,e}function v(e,t={}){if(e.canvas){return void function(e,t,n){let a="width"in n?n.width:e.canvas.clientWidth,o="height"in n?n.height:e.canvas.clientHeight;a&&o||(r.log(1,"Canvas clientWidth/clientHeight is 0")(),t=1,a=e.canvas.width||1,o=e.canvas.height||1);e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};const i=e.luma.canvasSizeInfo;if(i.clientWidth!==a||i.clientHeight!==o||i.devicePixelRatio!==t){let n=t;const i=Math.floor(a*n),s=Math.floor(o*n);e.canvas.width=i,e.canvas.height=s,e.drawingBufferWidth===i&&e.drawingBufferHeight===s||(r.warn("Device pixel ratio clamped")(),n=Math.min(e.drawingBufferWidth/a,e.drawingBufferHeight/o),e.canvas.width=Math.floor(a*n),e.canvas.height=Math.floor(o*n)),Object.assign(e.luma.canvasSizeInfo,{clientWidth:a,clientHeight:o,devicePixelRatio:t})}}(e,function(e){const t="undefined"==typeof window?1:window.devicePixelRatio||1;return Number.isFinite(e)?e<=0?1:e:e?t:1}(t.useDevicePixels),t)}const n=e.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in t&&"height"in t&&n.resize(t.width,t.height)}},function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function u(e){return void 0===e}function c(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function d(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n<e.length;++n)r.push(t(e[n],n));return r}function p(e,t){for(var n in t)s(t,n)&&(e[n]=t[n]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function h(e,t,n,r){return wt(e,t,n,r,!0).utc()}function m(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function g(e){if(null==e._isValid){var t=m(e),n=r.call(t.parsedDateParts,(function(e){return null!=e})),a=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(a=a&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return a;e._isValid=a}return e._isValid}function y(e){var t=h(NaN);return null!=e?p(m(t),e):m(t).userInvalidated=!0,t}r=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),r=n.length>>>0;for(t=0;t<r;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var v=a.momentProperties=[],A=!1;function b(e,t){var n,r,a;if(u(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),u(t._i)||(e._i=t._i),u(t._f)||(e._f=t._f),u(t._l)||(e._l=t._l),u(t._strict)||(e._strict=t._strict),u(t._tzm)||(e._tzm=t._tzm),u(t._isUTC)||(e._isUTC=t._isUTC),u(t._offset)||(e._offset=t._offset),u(t._pf)||(e._pf=m(t)),u(t._locale)||(e._locale=t._locale),v.length>0)for(n=0;n<v.length;n++)u(a=t[r=v[n]])||(e[r]=a);return e}function _(e){b(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===A&&(A=!0,a.updateOffset(this),A=!1)}function E(e){return e instanceof _||null!=e&&null!=e._isAMomentObject}function x(e){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function M(e,t){var n=!0;return p((function(){if(null!=a.deprecationHandler&&a.deprecationHandler(null,e),n){var r,o,i,l=[];for(o=0;o<arguments.length;o++){if(r="","object"==typeof arguments[o]){for(i in r+="\n["+o+"] ",arguments[0])s(arguments[0],i)&&(r+=i+": "+arguments[0][i]+", ");r=r.slice(0,-2)}else r=arguments[o];l.push(r)}x(e+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return t.apply(this,arguments)}),t)}var w,O={};function S(e,t){null!=a.deprecationHandler&&a.deprecationHandler(e,t),O[e]||(x(t),O[e]=!0)}function T(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e,t){var n,r=p({},e);for(n in t)s(t,n)&&(i(e[n])&&i(t[n])?(r[n]={},p(r[n],e[n]),p(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)s(e,n)&&!s(t,n)&&i(e[n])&&(r[n]=p({},r[n]));return r}function L(e){null!=e&&this.set(e)}function P(e,t,n){var r=""+Math.abs(e),a=t-r.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,w=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,D=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,k={},I={};function F(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(I[e]=a),t&&(I[t[0]]=function(){return P(a.apply(this,arguments),t[1],t[2])}),n&&(I[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function j(e,t){return e.isValid()?(t=B(t,e.localeData()),k[t]=k[t]||function(e){var t,n,r,a=e.match(R);for(t=0,n=a.length;t<n;t++)I[a[t]]?a[t]=I[a[t]]:a[t]=(r=a[t]).match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"");return function(t){var r,o="";for(r=0;r<n;r++)o+=T(a[r])?a[r].call(t,e):a[r];return o}}(t),k[t](e)):e.localeData().invalidDate()}function B(e,t){var n=5;function r(e){return t.longDateFormat(e)||e}for(D.lastIndex=0;n>=0&&D.test(e);)e=e.replace(D,r),D.lastIndex=0,n-=1;return e}var N={};function z(e,t){var n=e.toLowerCase();N[n]=N[n+"s"]=N[t]=e}function U(e){return"string"==typeof e?N[e]||N[e.toLowerCase()]:void 0}function H(e){var t,n,r={};for(n in e)s(e,n)&&(t=U(n))&&(r[t]=e[n]);return r}var V={};function G(e,t){V[e]=t}function Y(e){return e%4==0&&e%100!=0||e%400==0}function W(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function q(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=W(t)),n}function X(e,t){return function(n){return null!=n?(Z(this,e,n),a.updateOffset(this,t),this):K(this,e)}}function K(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Z(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Y(e.year())&&1===e.month()&&29===e.date()?(n=q(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ee(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var J,Q=/\d/,$=/\d\d/,ee=/\d{3}/,te=/\d{4}/,ne=/[+-]?\d{6}/,re=/\d\d?/,ae=/\d\d\d\d?/,oe=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,se=/\d{1,4}/,le=/[+-]?\d{1,6}/,ue=/\d+/,ce=/[+-]?\d+/,de=/Z|[+-]\d\d:?\d\d/gi,fe=/Z|[+-]\d\d(?::?\d\d)?/gi,pe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function he(e,t,n){J[e]=T(t)?t:function(e,r){return e&&n?n:t}}function me(e,t){return s(J,e)?J[e](t._strict,t._locale):new RegExp(ge(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a}))))}function ge(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}J={};var ye,ve={};function Ae(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),c(t)&&(r=function(e,n){n[t]=q(e)}),n=0;n<e.length;n++)ve[e[n]]=r}function be(e,t){Ae(e,(function(e,n,r,a){r._w=r._w||{},t(e,r._w,r,a)}))}function _e(e,t,n){null!=t&&s(ve,e)&&ve[e](t,n._a,n,e)}function Ee(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1===r?Y(e)?29:28:31-r%7%2}ye=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},F("M",["MM",2],"Mo",(function(){return this.month()+1})),F("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),F("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),z("month","M"),G("month",8),he("M",re),he("MM",re,$),he("MMM",(function(e,t){return t.monthsShortRegex(e)})),he("MMMM",(function(e,t){return t.monthsRegex(e)})),Ae(["M","MM"],(function(e,t){t[1]=q(e)-1})),Ae(["MMM","MMMM"],(function(e,t,n,r){var a=n._locale.monthsParse(e,r,n._strict);null!=a?t[1]=a:m(n).invalidMonth=e}));var xe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Me="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),we=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Oe=pe,Se=pe;function Te(e,t,n){var r,a,o,i=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=h([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=ye.call(this._shortMonthsParse,i))?a:null:-1!==(a=ye.call(this._longMonthsParse,i))?a:null:"MMM"===t?-1!==(a=ye.call(this._shortMonthsParse,i))||-1!==(a=ye.call(this._longMonthsParse,i))?a:null:-1!==(a=ye.call(this._longMonthsParse,i))||-1!==(a=ye.call(this._shortMonthsParse,i))?a:null}function Ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=q(t);else if(!c(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),Ee(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Le(e){return null!=e?(Ce(this,e),a.updateOffset(this,!0),this):K(this,"Month")}function Pe(){function e(e,t){return t.length-e.length}var t,n,r=[],a=[],o=[];for(t=0;t<12;t++)n=h([2e3,t]),r.push(this.monthsShort(n,"")),a.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(e),a.sort(e),o.sort(e),t=0;t<12;t++)r[t]=ge(r[t]),a[t]=ge(a[t]);for(t=0;t<24;t++)o[t]=ge(o[t]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Re(e){return Y(e)?366:365}F("Y",0,0,(function(){var e=this.year();return e<=9999?P(e,4):"+"+e})),F(0,["YY",2],0,(function(){return this.year()%100})),F(0,["YYYY",4],0,"year"),F(0,["YYYYY",5],0,"year"),F(0,["YYYYYY",6,!0],0,"year"),z("year","y"),G("year",1),he("Y",ce),he("YY",re,$),he("YYYY",se,te),he("YYYYY",le,ne),he("YYYYYY",le,ne),Ae(["YYYYY","YYYYYY"],0),Ae("YYYY",(function(e,t){t[0]=2===e.length?a.parseTwoDigitYear(e):q(e)})),Ae("YY",(function(e,t){t[0]=a.parseTwoDigitYear(e)})),Ae("Y",(function(e,t){t[0]=parseInt(e,10)})),a.parseTwoDigitYear=function(e){return q(e)+(q(e)>68?1900:2e3)};var De=X("FullYear",!0);function ke(e,t,n,r,a,o,i){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,a,o,i),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,a,o,i),s}function Ie(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Fe(e,t,n){var r=7+t-n;return-(7+Ie(e,0,r).getUTCDay()-t)%7+r-1}function je(e,t,n,r,a){var o,i,s=1+7*(t-1)+(7+n-r)%7+Fe(e,r,a);return s<=0?i=Re(o=e-1)+s:s>Re(e)?(o=e+1,i=s-Re(e)):(o=e,i=s),{year:o,dayOfYear:i}}function Be(e,t,n){var r,a,o=Fe(e.year(),t,n),i=Math.floor((e.dayOfYear()-o-1)/7)+1;return i<1?r=i+Ne(a=e.year()-1,t,n):i>Ne(e.year(),t,n)?(r=i-Ne(e.year(),t,n),a=e.year()+1):(a=e.year(),r=i),{week:r,year:a}}function Ne(e,t,n){var r=Fe(e,t,n),a=Fe(e+1,t,n);return(Re(e)-r+a)/7}function ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}F("w",["ww",2],"wo","week"),F("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),G("week",5),G("isoWeek",5),he("w",re),he("ww",re,$),he("W",re),he("WW",re,$),be(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=q(e)})),F("d",0,"do","day"),F("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),F("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),F("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),F("e",0,0,"weekday"),F("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),G("day",11),G("weekday",11),G("isoWeekday",11),he("d",re),he("e",re),he("E",re),he("dd",(function(e,t){return t.weekdaysMinRegex(e)})),he("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),he("dddd",(function(e,t){return t.weekdaysRegex(e)})),be(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:m(n).invalidWeekday=e})),be(["d","e","E"],(function(e,t,n,r){t[r]=q(e)}));var Ue="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),He="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ve="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ge=pe,Ye=pe,We=pe;function qe(e,t,n){var r,a,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=ye.call(this._weekdaysParse,i))?a:null:"ddd"===t?-1!==(a=ye.call(this._shortWeekdaysParse,i))?a:null:-1!==(a=ye.call(this._minWeekdaysParse,i))?a:null:"dddd"===t?-1!==(a=ye.call(this._weekdaysParse,i))||-1!==(a=ye.call(this._shortWeekdaysParse,i))||-1!==(a=ye.call(this._minWeekdaysParse,i))?a:null:"ddd"===t?-1!==(a=ye.call(this._shortWeekdaysParse,i))||-1!==(a=ye.call(this._weekdaysParse,i))||-1!==(a=ye.call(this._minWeekdaysParse,i))?a:null:-1!==(a=ye.call(this._minWeekdaysParse,i))||-1!==(a=ye.call(this._weekdaysParse,i))||-1!==(a=ye.call(this._shortWeekdaysParse,i))?a:null}function Xe(){function e(e,t){return t.length-e.length}var t,n,r,a,o,i=[],s=[],l=[],u=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=ge(this.weekdaysMin(n,"")),a=ge(this.weekdaysShort(n,"")),o=ge(this.weekdays(n,"")),i.push(r),s.push(a),l.push(o),u.push(r),u.push(a),u.push(o);i.sort(e),s.sort(e),l.sort(e),u.sort(e),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Ke(){return this.hours()%12||12}function Ze(e,t){F(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Je(e,t){return t._meridiemParse}F("H",["HH",2],0,"hour"),F("h",["hh",2],0,Ke),F("k",["kk",2],0,(function(){return this.hours()||24})),F("hmm",0,0,(function(){return""+Ke.apply(this)+P(this.minutes(),2)})),F("hmmss",0,0,(function(){return""+Ke.apply(this)+P(this.minutes(),2)+P(this.seconds(),2)})),F("Hmm",0,0,(function(){return""+this.hours()+P(this.minutes(),2)})),F("Hmmss",0,0,(function(){return""+this.hours()+P(this.minutes(),2)+P(this.seconds(),2)})),Ze("a",!0),Ze("A",!1),z("hour","h"),G("hour",13),he("a",Je),he("A",Je),he("H",re),he("h",re),he("k",re),he("HH",re,$),he("hh",re,$),he("kk",re,$),he("hmm",ae),he("hmmss",oe),he("Hmm",ae),he("Hmmss",oe),Ae(["H","HH"],3),Ae(["k","kk"],(function(e,t,n){var r=q(e);t[3]=24===r?0:r})),Ae(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),Ae(["h","hh"],(function(e,t,n){t[3]=q(e),m(n).bigHour=!0})),Ae("hmm",(function(e,t,n){var r=e.length-2;t[3]=q(e.substr(0,r)),t[4]=q(e.substr(r)),m(n).bigHour=!0})),Ae("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[3]=q(e.substr(0,r)),t[4]=q(e.substr(r,2)),t[5]=q(e.substr(a)),m(n).bigHour=!0})),Ae("Hmm",(function(e,t,n){var r=e.length-2;t[3]=q(e.substr(0,r)),t[4]=q(e.substr(r))})),Ae("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[3]=q(e.substr(0,r)),t[4]=q(e.substr(r,2)),t[5]=q(e.substr(a))}));var Qe,$e=X("Hours",!0),et={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:xe,monthsShort:Me,week:{dow:0,doy:6},weekdays:Ue,weekdaysMin:Ve,weekdaysShort:He,meridiemParse:/[ap]\.?m?\.?/i},tt={},nt={};function rt(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n<r;n+=1)if(e[n]!==t[n])return n;return r}function at(e){return e?e.toLowerCase().replace("_","-"):e}function ot(t){var r=null;if(void 0===tt[t]&&void 0!==e&&e&&e.exports)try{r=Qe._abbr,n(1324)("./"+t),it(r)}catch(e){tt[t]=null}return tt[t]}function it(e,t){var n;return e&&((n=u(t)?lt(e):st(e,t))?Qe=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Qe._abbr}function st(e,t){if(null!==t){var n,r=et;if(t.abbr=e,null!=tt[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=tt[e]._config;else if(null!=t.parentLocale)if(null!=tt[t.parentLocale])r=tt[t.parentLocale]._config;else{if(null==(n=ot(t.parentLocale)))return nt[t.parentLocale]||(nt[t.parentLocale]=[]),nt[t.parentLocale].push({name:e,config:t}),null;r=n._config}return tt[e]=new L(C(r,t)),nt[e]&&nt[e].forEach((function(e){st(e.name,e.config)})),it(e),tt[e]}return delete tt[e],null}function lt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Qe;if(!o(e)){if(t=ot(e))return t;e=[e]}return function(e){for(var t,n,r,a,o=0;o<e.length;){for(t=(a=at(e[o]).split("-")).length,n=(n=at(e[o+1]))?n.split("-"):null;t>0;){if(r=ot(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&rt(a,n)>=t-1)break;t--}o++}return Qe}(e)}function ut(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>Ee(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,m(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),m(e)._overflowWeeks&&-1===t&&(t=7),m(e)._overflowWeekday&&-1===t&&(t=8),m(e).overflow=t),e}var ct=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,dt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ft=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ht=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mt=/^\/?Date\((-?\d+)/i,gt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,yt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vt(e){var t,n,r,a,o,i,s=e._i,l=ct.exec(s)||dt.exec(s);if(l){for(m(e).iso=!0,t=0,n=pt.length;t<n;t++)if(pt[t][1].exec(l[1])){a=pt[t][0],r=!1!==pt[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=ht.length;t<n;t++)if(ht[t][1].exec(l[3])){o=(l[2]||" ")+ht[t][0];break}if(null==o)return void(e._isValid=!1)}if(!r&&null!=o)return void(e._isValid=!1);if(l[4]){if(!ft.exec(l[4]))return void(e._isValid=!1);i="Z"}e._f=a+(o||"")+(i||""),xt(e)}else e._isValid=!1}function At(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function bt(e){var t,n,r,a,o,i,s,l,u=gt.exec(e._i.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));if(u){if(n=u[4],r=u[3],a=u[2],o=u[5],i=u[6],s=u[7],l=[At(n),Me.indexOf(r),parseInt(a,10),parseInt(o,10),parseInt(i,10)],s&&l.push(parseInt(s,10)),t=l,!function(e,t,n){return!e||He.indexOf(e)===new Date(t[0],t[1],t[2]).getDay()||(m(n).weekdayMismatch=!0,n._isValid=!1,!1)}(u[1],t,e))return;e._a=t,e._tzm=function(e,t,n){if(e)return yt[e];if(t)return 0;var r=parseInt(n,10),a=r%100;return(r-a)/100*60+a}(u[8],u[9],u[10]),e._d=Ie.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),m(e).rfc2822=!0}else e._isValid=!1}function _t(e,t,n){return null!=e?e:null!=t?t:n}function Et(e){var t,n,r,o,i,s=[];if(!e._d){for(r=function(e){var t=new Date(a.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[2]&&null==e._a[1]&&function(e){var t,n,r,a,o,i,s,l,u;null!=(t=e._w).GG||null!=t.W||null!=t.E?(o=1,i=4,n=_t(t.GG,e._a[0],Be(Ot(),1,4).year),r=_t(t.W,1),((a=_t(t.E,1))<1||a>7)&&(l=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,u=Be(Ot(),o,i),n=_t(t.gg,e._a[0],u.year),r=_t(t.w,u.week),null!=t.d?((a=t.d)<0||a>6)&&(l=!0):null!=t.e?(a=t.e+o,(t.e<0||t.e>6)&&(l=!0)):a=o),r<1||r>Ne(n,o,i)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(s=je(n,r,a,o,i),e._a[0]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(i=_t(e._a[0],r[0]),(e._dayOfYear>Re(i)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=Ie(i,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?Ie:ke).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(m(e).weekdayMismatch=!0)}}function xt(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],m(e).empty=!0;var t,n,r,o,i,s,l=""+e._i,u=l.length,c=0;for(r=B(e._f,e._locale).match(R)||[],t=0;t<r.length;t++)o=r[t],(n=(l.match(me(o,e))||[])[0])&&((i=l.substr(0,l.indexOf(n))).length>0&&m(e).unusedInput.push(i),l=l.slice(l.indexOf(n)+n.length),c+=n.length),I[o]?(n?m(e).empty=!1:m(e).unusedTokens.push(o),_e(o,n,e)):e._strict&&!n&&m(e).unusedTokens.push(o);m(e).charsLeftOver=u-c,l.length>0&&m(e).unusedInput.push(l),e._a[3]<=12&&!0===m(e).bigHour&&e._a[3]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(s=m(e).era)&&(e._a[0]=e._locale.erasConvertYear(s,e._a[0])),Et(e),ut(e)}else bt(e);else vt(e)}function Mt(e){var t=e._i,n=e._f;return e._locale=e._locale||lt(e._l),null===t||void 0===n&&""===t?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),E(t)?new _(ut(t)):(d(t)?e._d=t:o(n)?function(e){var t,n,r,a,o,i,s=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<e._f.length;a++)o=0,i=!1,t=b({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],xt(t),g(t)&&(i=!0),o+=m(t).charsLeftOver,o+=10*m(t).unusedTokens.length,m(t).score=o,s?o<r&&(r=o,n=t):(null==r||o<r||i)&&(r=o,n=t,i&&(s=!0));p(e,n||t)}(e):n?xt(e):function(e){var t=e._i;u(t)?e._d=new Date(a.now()):d(t)?e._d=new Date(t.valueOf()):"string"==typeof t?function(e){var t=mt.exec(e._i);null===t?(vt(e),!1===e._isValid&&(delete e._isValid,bt(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:a.createFromInputFallback(e)))):e._d=new Date(+t[1])}(e):o(t)?(e._a=f(t.slice(0),(function(e){return parseInt(e,10)})),Et(e)):i(t)?function(e){if(!e._d){var t=H(e._i),n=void 0===t.day?t.date:t.day;e._a=f([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),Et(e)}}(e):c(t)?e._d=new Date(t):a.createFromInputFallback(e)}(e),g(e)||(e._d=null),e))}function wt(e,t,n,r,a){var s,u={};return!0!==t&&!1!==t||(r=t,t=void 0),!0!==n&&!1!==n||(r=n,n=void 0),(i(e)&&l(e)||o(e)&&0===e.length)&&(e=void 0),u._isAMomentObject=!0,u._useUTC=u._isUTC=a,u._l=n,u._i=e,u._f=t,u._strict=r,(s=new _(ut(Mt(u))))._nextDay&&(s.add(1,"d"),s._nextDay=void 0),s}function Ot(e,t,n,r){return wt(e,t,n,r,!1)}a.createFromInputFallback=M("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),a.ISO_8601=function(){},a.RFC_2822=function(){};var St=M("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ot.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:y()})),Tt=M("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ot.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:y()}));function Ct(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Ot();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}var Lt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Pt(e){var t=H(e),n=t.year||0,r=t.quarter||0,a=t.month||0,o=t.week||t.isoWeek||0,i=t.day||0,l=t.hour||0,u=t.minute||0,c=t.second||0,d=t.millisecond||0;this._isValid=function(e){var t,n,r=!1;for(t in e)if(s(e,t)&&(-1===ye.call(Lt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<Lt.length;++n)if(e[Lt[n]]){if(r)return!1;parseFloat(e[Lt[n]])!==q(e[Lt[n]])&&(r=!0)}return!0}(t),this._milliseconds=+d+1e3*c+6e4*u+1e3*l*60*60,this._days=+i+7*o,this._months=+a+3*r+12*n,this._data={},this._locale=lt(),this._bubble()}function Rt(e){return e instanceof Pt}function Dt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function kt(e,t){F(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+P(~~(e/60),2)+t+P(~~e%60,2)}))}kt("Z",":"),kt("ZZ",""),he("Z",fe),he("ZZ",fe),Ae(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Ft(fe,e)}));var It=/([\+\-]|\d\d)/gi;function Ft(e,t){var n,r,a=(t||"").match(e);return null===a?null:0===(r=60*(n=((a[a.length-1]||[])+"").match(It)||["-",0,0])[1]+q(n[2]))?0:"+"===n[0]?r:-r}function jt(e,t){var n,r;return t._isUTC?(n=t.clone(),r=(E(e)||d(e)?e.valueOf():Ot(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),a.updateOffset(n,!1),n):Ot(e).local()}function Bt(e){return-Math.round(e._d.getTimezoneOffset())}function Nt(){return!!this.isValid()&&this._isUTC&&0===this._offset}a.updateOffset=function(){};var zt=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ut=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ht(e,t){var n,r,a,o,i,l,u=e,d=null;return Rt(e)?u={ms:e._milliseconds,d:e._days,M:e._months}:c(e)||!isNaN(+e)?(u={},t?u[t]=+e:u.milliseconds=+e):(d=zt.exec(e))?(n="-"===d[1]?-1:1,u={y:0,d:q(d[2])*n,h:q(d[3])*n,m:q(d[4])*n,s:q(d[5])*n,ms:q(Dt(1e3*d[6]))*n}):(d=Ut.exec(e))?(n="-"===d[1]?-1:1,u={y:Vt(d[2],n),M:Vt(d[3],n),w:Vt(d[4],n),d:Vt(d[5],n),h:Vt(d[6],n),m:Vt(d[7],n),s:Vt(d[8],n)}):null==u?u={}:"object"==typeof u&&("from"in u||"to"in u)&&(o=Ot(u.from),i=Ot(u.to),a=o.isValid()&&i.isValid()?(i=jt(i,o),o.isBefore(i)?l=Gt(o,i):((l=Gt(i,o)).milliseconds=-l.milliseconds,l.months=-l.months),l):{milliseconds:0,months:0},(u={}).ms=a.milliseconds,u.M=a.months),r=new Pt(u),Rt(e)&&s(e,"_locale")&&(r._locale=e._locale),Rt(e)&&s(e,"_isValid")&&(r._isValid=e._isValid),r}function Vt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Gt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Yt(e,t){return function(n,r){var a;return null===r||isNaN(+r)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),a=n,n=r,r=a),Wt(this,Ht(n,r),e),this}}function Wt(e,t,n,r){var o=t._milliseconds,i=Dt(t._days),s=Dt(t._months);e.isValid()&&(r=null==r||r,s&&Ce(e,K(e,"Month")+s*n),i&&Z(e,"Date",K(e,"Date")+i*n),o&&e._d.setTime(e._d.valueOf()+o*n),r&&a.updateOffset(e,i||s))}Ht.fn=Pt.prototype,Ht.invalid=function(){return Ht(NaN)};var qt=Yt(1,"add"),Xt=Yt(-1,"subtract");function Kt(e){return"string"==typeof e||e instanceof String}function Zt(e){return E(e)||d(e)||Kt(e)||c(e)||function(e){var t=o(e),n=!1;return t&&(n=0===e.filter((function(t){return!c(t)&&Kt(e)})).length),t&&n}(e)||function(e){var t,n,r=i(e)&&!l(e),a=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(t=0;t<o.length;t+=1)n=o[t],a=a||s(e,n);return r&&a}(e)||null==e}function Jt(e){var t,n=i(e)&&!l(e),r=!1,a=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<a.length;t+=1)r=r||s(e,a[t]);return n&&r}function Qt(e,t){if(e.date()<t.date())return-Qt(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months");return-(n+(t-r<0?(t-r)/(r-e.clone().add(n-1,"months")):(t-r)/(e.clone().add(n+1,"months")-r)))||0}function $t(e){var t;return void 0===e?this._locale._abbr:(null!=(t=lt(e))&&(this._locale=t),this)}a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var en=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(e){return void 0===e?this.localeData():this.locale(e)}));function tn(){return this._locale}function nn(e,t){return(e%t+t)%t}function rn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-126227808e5:new Date(e,t,n).valueOf()}function an(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-126227808e5:Date.UTC(e,t,n)}function on(e,t){return t.erasAbbrRegex(e)}function sn(){var e,t,n=[],r=[],a=[],o=[],i=this.eras();for(e=0,t=i.length;e<t;++e)r.push(ge(i[e].name)),n.push(ge(i[e].abbr)),a.push(ge(i[e].narrow)),o.push(ge(i[e].name)),o.push(ge(i[e].abbr)),o.push(ge(i[e].narrow));this._erasRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+r.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}function ln(e,t){F(0,[e,e.length],0,t)}function un(e,t,n,r,a){var o;return null==e?Be(this,r,a).year:(t>(o=Ne(e,r,a))&&(t=o),cn.call(this,e,t,n,r,a))}function cn(e,t,n,r,a){var o=je(e,t,n,r,a),i=Ie(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}F("N",0,0,"eraAbbr"),F("NN",0,0,"eraAbbr"),F("NNN",0,0,"eraAbbr"),F("NNNN",0,0,"eraName"),F("NNNNN",0,0,"eraNarrow"),F("y",["y",1],"yo","eraYear"),F("y",["yy",2],0,"eraYear"),F("y",["yyy",3],0,"eraYear"),F("y",["yyyy",4],0,"eraYear"),he("N",on),he("NN",on),he("NNN",on),he("NNNN",(function(e,t){return t.erasNameRegex(e)})),he("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),Ae(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var a=n._locale.erasParse(e,r,n._strict);a?m(n).era=a:m(n).invalidEra=e})),he("y",ue),he("yy",ue),he("yyy",ue),he("yyyy",ue),he("yo",(function(e,t){return t._eraYearOrdinalRegex||ue})),Ae(["y","yy","yyy","yyyy"],0),Ae(["yo"],(function(e,t,n,r){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[0]=n._locale.eraYearOrdinalParse(e,a):t[0]=parseInt(e,10)})),F(0,["gg",2],0,(function(){return this.weekYear()%100})),F(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),ln("gggg","weekYear"),ln("ggggg","weekYear"),ln("GGGG","isoWeekYear"),ln("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),G("weekYear",1),G("isoWeekYear",1),he("G",ce),he("g",ce),he("GG",re,$),he("gg",re,$),he("GGGG",se,te),he("gggg",se,te),he("GGGGG",le,ne),he("ggggg",le,ne),be(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=q(e)})),be(["gg","GG"],(function(e,t,n,r){t[r]=a.parseTwoDigitYear(e)})),F("Q",0,"Qo","quarter"),z("quarter","Q"),G("quarter",7),he("Q",Q),Ae("Q",(function(e,t){t[1]=3*(q(e)-1)})),F("D",["DD",2],"Do","date"),z("date","D"),G("date",9),he("D",re),he("DD",re,$),he("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),Ae(["D","DD"],2),Ae("Do",(function(e,t){t[2]=q(e.match(re)[0])}));var dn=X("Date",!0);F("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),G("dayOfYear",4),he("DDD",ie),he("DDDD",ee),Ae(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=q(e)})),F("m",["mm",2],0,"minute"),z("minute","m"),G("minute",14),he("m",re),he("mm",re,$),Ae(["m","mm"],4);var fn=X("Minutes",!1);F("s",["ss",2],0,"second"),z("second","s"),G("second",15),he("s",re),he("ss",re,$),Ae(["s","ss"],5);var pn,hn,mn=X("Seconds",!1);for(F("S",0,0,(function(){return~~(this.millisecond()/100)})),F(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),F(0,["SSS",3],0,"millisecond"),F(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),F(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),F(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),F(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),F(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),F(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),z("millisecond","ms"),G("millisecond",16),he("S",ie,Q),he("SS",ie,$),he("SSS",ie,ee),pn="SSSS";pn.length<=9;pn+="S")he(pn,ue);function gn(e,t){t[6]=q(1e3*("0."+e))}for(pn="S";pn.length<=9;pn+="S")Ae(pn,gn);hn=X("Milliseconds",!1),F("z",0,0,"zoneAbbr"),F("zz",0,0,"zoneName");var yn=_.prototype;function vn(e){return e}yn.add=qt,yn.calendar=function(e,t){1===arguments.length&&(arguments[0]?Zt(arguments[0])?(e=arguments[0],t=void 0):Jt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Ot(),r=jt(n,this).startOf("day"),o=a.calendarFormat(this,r)||"sameElse",i=t&&(T(t[o])?t[o].call(this,n):t[o]);return this.format(i||this.localeData().calendar(o,this,Ot(n)))},yn.clone=function(){return new _(this)},yn.diff=function(e,t,n){var r,a,o;if(!this.isValid())return NaN;if(!(r=jt(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=U(t)){case"year":o=Qt(this,r)/12;break;case"month":o=Qt(this,r);break;case"quarter":o=Qt(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-a)/864e5;break;case"week":o=(this-r-a)/6048e5;break;default:o=this-r}return n?o:W(o)},yn.endOf=function(e){var t,n;if(void 0===(e=U(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?an:rn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1}return this._d.setTime(t),a.updateOffset(this,!0),this},yn.format=function(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=j(this,e);return this.localeData().postformat(t)},yn.from=function(e,t){return this.isValid()&&(E(e)&&e.isValid()||Ot(e).isValid())?Ht({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yn.fromNow=function(e){return this.from(Ot(),e)},yn.to=function(e,t){return this.isValid()&&(E(e)&&e.isValid()||Ot(e).isValid())?Ht({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},yn.toNow=function(e){return this.to(Ot(),e)},yn.get=function(e){return T(this[e=U(e)])?this[e]():this},yn.invalidAt=function(){return m(this).overflow},yn.isAfter=function(e,t){var n=E(e)?e:Ot(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=U(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())},yn.isBefore=function(e,t){var n=E(e)?e:Ot(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=U(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())},yn.isBetween=function(e,t,n,r){var a=E(e)?e:Ot(e),o=E(t)?t:Ot(t);return!!(this.isValid()&&a.isValid()&&o.isValid())&&(("("===(r=r||"()")[0]?this.isAfter(a,n):!this.isBefore(a,n))&&(")"===r[1]?this.isBefore(o,n):!this.isAfter(o,n)))},yn.isSame=function(e,t){var n,r=E(e)?e:Ot(e);return!(!this.isValid()||!r.isValid())&&("millisecond"===(t=U(t)||"millisecond")?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))},yn.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},yn.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},yn.isValid=function(){return g(this)},yn.lang=en,yn.locale=$t,yn.localeData=tn,yn.max=Tt,yn.min=St,yn.parsingFlags=function(){return p({},m(this))},yn.set=function(e,t){if("object"==typeof e){var n,r=function(e){var t,n=[];for(t in e)s(e,t)&&n.push({unit:t,priority:V[t]});return n.sort((function(e,t){return e.priority-t.priority})),n}(e=H(e));for(n=0;n<r.length;n++)this[r[n].unit](e[r[n].unit])}else if(T(this[e=U(e)]))return this[e](t);return this},yn.startOf=function(e){var t,n;if(void 0===(e=U(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?an:rn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=nn(t,6e4);break;case"second":t=this._d.valueOf(),t-=nn(t,1e3)}return this._d.setTime(t),a.updateOffset(this,!0),this},yn.subtract=Xt,yn.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},yn.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},yn.toDate=function(){return new Date(this.valueOf())},yn.toISOString=function(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?j(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):T(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",j(n,"Z")):j(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},yn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r="moment",a="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=a+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(yn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),yn.toJSON=function(){return this.isValid()?this.toISOString():null},yn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},yn.unix=function(){return Math.floor(this.valueOf()/1e3)},yn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},yn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},yn.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].name;if(r[e].until<=n&&n<=r[e].since)return r[e].name}return""},yn.eraNarrow=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].narrow;if(r[e].until<=n&&n<=r[e].since)return r[e].narrow}return""},yn.eraAbbr=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),r[e].since<=n&&n<=r[e].until)return r[e].abbr;if(r[e].until<=n&&n<=r[e].since)return r[e].abbr}return""},yn.eraYear=function(){var e,t,n,r,o=this.localeData().eras();for(e=0,t=o.length;e<t;++e)if(n=o[e].since<=o[e].until?1:-1,r=this.clone().startOf("day").valueOf(),o[e].since<=r&&r<=o[e].until||o[e].until<=r&&r<=o[e].since)return(this.year()-a(o[e].since).year())*n+o[e].offset;return this.year()},yn.year=De,yn.isLeapYear=function(){return Y(this.year())},yn.weekYear=function(e){return un.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},yn.isoWeekYear=function(e){return un.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},yn.quarter=yn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},yn.month=Le,yn.daysInMonth=function(){return Ee(this.year(),this.month())},yn.week=yn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},yn.isoWeek=yn.isoWeeks=function(e){var t=Be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},yn.weeksInYear=function(){var e=this.localeData()._week;return Ne(this.year(),e.dow,e.doy)},yn.weeksInWeekYear=function(){var e=this.localeData()._week;return Ne(this.weekYear(),e.dow,e.doy)},yn.isoWeeksInYear=function(){return Ne(this.year(),1,4)},yn.isoWeeksInISOWeekYear=function(){return Ne(this.isoWeekYear(),1,4)},yn.date=dn,yn.day=yn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},yn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},yn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},yn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},yn.hour=yn.hours=$e,yn.minute=yn.minutes=fn,yn.second=yn.seconds=mn,yn.millisecond=yn.milliseconds=hn,yn.utcOffset=function(e,t,n){var r,o=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=Ft(fe,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=Bt(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),o!==e&&(!t||this._changeInProgress?Wt(this,Ht(e-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:Bt(this)},yn.utc=function(e){return this.utcOffset(0,e)},yn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Bt(this),"m")),this},yn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Ft(de,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},yn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ot(e).utcOffset():0,(this.utcOffset()-e)%60==0)},yn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},yn.isLocal=function(){return!!this.isValid()&&!this._isUTC},yn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},yn.isUtc=Nt,yn.isUTC=Nt,yn.zoneAbbr=function(){return this._isUTC?"UTC":""},yn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},yn.dates=M("dates accessor is deprecated. Use date instead.",dn),yn.months=M("months accessor is deprecated. Use month instead",Le),yn.years=M("years accessor is deprecated. Use year instead",De),yn.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),yn.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!u(this._isDSTShifted))return this._isDSTShifted;var e,t={};return b(t,this),(t=Mt(t))._a?(e=t._isUTC?h(t._a):Ot(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var r,a=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),i=0;for(r=0;r<a;r++)(n&&e[r]!==t[r]||!n&&q(e[r])!==q(t[r]))&&i++;return i+o}(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}));var An=L.prototype;function bn(e,t,n,r){var a=lt(),o=h().set(r,t);return a[n](o,e)}function _n(e,t,n){if(c(e)&&(t=e,e=void 0),e=e||"",null!=t)return bn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=bn(e,r,n,"month");return a}function En(e,t,n,r){"boolean"==typeof e?(c(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,c(t)&&(n=t,t=void 0),t=t||"");var a,o=lt(),i=e?o._week.dow:0,s=[];if(null!=n)return bn(t,(n+i)%7,r,"day");for(a=0;a<7;a++)s[a]=bn(t,(a+i)%7,r,"day");return s}An.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return T(r)?r.call(t,n):r},An.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(R).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},An.invalidDate=function(){return this._invalidDate},An.ordinal=function(e){return this._ordinal.replace("%d",e)},An.preparse=vn,An.postformat=vn,An.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return T(a)?a(e,t,n,r):a.replace(/%d/i,e)},An.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return T(n)?n(t):n.replace(/%s/i,t)},An.set=function(e){var t,n;for(n in e)s(e,n)&&(T(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},An.eras=function(e,t){var n,r,o,i=this._eras||lt("en")._eras;for(n=0,r=i.length;n<r;++n){switch(typeof i[n].since){case"string":o=a(i[n].since).startOf("day"),i[n].since=o.valueOf()}switch(typeof i[n].until){case"undefined":i[n].until=1/0;break;case"string":o=a(i[n].until).startOf("day").valueOf(),i[n].until=o.valueOf()}}return i},An.erasParse=function(e,t,n){var r,a,o,i,s,l=this.eras();for(e=e.toUpperCase(),r=0,a=l.length;r<a;++r)if(o=l[r].name.toUpperCase(),i=l[r].abbr.toUpperCase(),s=l[r].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(i===e)return l[r];break;case"NNNN":if(o===e)return l[r];break;case"NNNNN":if(s===e)return l[r]}else if([o,i,s].indexOf(e)>=0)return l[r]},An.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?a(e.since).year():a(e.since).year()+(t-e.offset)*n},An.erasAbbrRegex=function(e){return s(this,"_erasAbbrRegex")||sn.call(this),e?this._erasAbbrRegex:this._erasRegex},An.erasNameRegex=function(e){return s(this,"_erasNameRegex")||sn.call(this),e?this._erasNameRegex:this._erasRegex},An.erasNarrowRegex=function(e){return s(this,"_erasNarrowRegex")||sn.call(this),e?this._erasNarrowRegex:this._erasRegex},An.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||we).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},An.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[we.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},An.monthsParse=function(e,t,n){var r,a,o;if(this._monthsParseExact)return Te.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=h([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},An.monthsRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||Pe.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Se),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},An.monthsShortRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||Pe.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Oe),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},An.week=function(e){return Be(e,this._week.dow,this._week.doy).week},An.firstDayOfYear=function(){return this._week.doy},An.firstDayOfWeek=function(){return this._week.dow},An.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?ze(n,this._week.dow):e?n[e.day()]:n},An.weekdaysMin=function(e){return!0===e?ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},An.weekdaysShort=function(e){return!0===e?ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},An.weekdaysParse=function(e,t,n){var r,a,o;if(this._weekdaysParseExact)return qe.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},An.weekdaysRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=Ge),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},An.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ye),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},An.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=We),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},An.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},An.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},it("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===q(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=M("moment.lang is deprecated. Use moment.locale instead.",it),a.langData=M("moment.langData is deprecated. Use moment.localeData instead.",lt);var xn=Math.abs;function Mn(e,t,n,r){var a=Ht(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function wn(e){return e<0?Math.floor(e):Math.ceil(e)}function On(e){return 4800*e/146097}function Sn(e){return 146097*e/4800}function Tn(e){return function(){return this.as(e)}}var Cn=Tn("ms"),Ln=Tn("s"),Pn=Tn("m"),Rn=Tn("h"),Dn=Tn("d"),kn=Tn("w"),In=Tn("M"),Fn=Tn("Q"),jn=Tn("y");function Bn(e){return function(){return this.isValid()?this._data[e]:NaN}}var Nn=Bn("milliseconds"),zn=Bn("seconds"),Un=Bn("minutes"),Hn=Bn("hours"),Vn=Bn("days"),Gn=Bn("months"),Yn=Bn("years"),Wn=Math.round,qn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Xn(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var Kn=Math.abs;function Zn(e){return(e>0)-(e<0)||+e}function Jn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,a,o,i,s,l=Kn(this._milliseconds)/1e3,u=Kn(this._days),c=Kn(this._months),d=this.asSeconds();return d?(e=W(l/60),t=W(e/60),l%=60,e%=60,n=W(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=d<0?"-":"",o=Zn(this._months)!==Zn(d)?"-":"",i=Zn(this._days)!==Zn(d)?"-":"",s=Zn(this._milliseconds)!==Zn(d)?"-":"",a+"P"+(n?o+n+"Y":"")+(c?o+c+"M":"")+(u?i+u+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+r+"S":"")):"P0D"}var Qn=Pt.prototype;return Qn.isValid=function(){return this._isValid},Qn.abs=function(){var e=this._data;return this._milliseconds=xn(this._milliseconds),this._days=xn(this._days),this._months=xn(this._months),e.milliseconds=xn(e.milliseconds),e.seconds=xn(e.seconds),e.minutes=xn(e.minutes),e.hours=xn(e.hours),e.months=xn(e.months),e.years=xn(e.years),this},Qn.add=function(e,t){return Mn(this,e,t,1)},Qn.subtract=function(e,t){return Mn(this,e,t,-1)},Qn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=U(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+On(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Sn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Qn.asMilliseconds=Cn,Qn.asSeconds=Ln,Qn.asMinutes=Pn,Qn.asHours=Rn,Qn.asDays=Dn,Qn.asWeeks=kn,Qn.asMonths=In,Qn.asQuarters=Fn,Qn.asYears=jn,Qn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12):NaN},Qn._bubble=function(){var e,t,n,r,a,o=this._milliseconds,i=this._days,s=this._months,l=this._data;return o>=0&&i>=0&&s>=0||o<=0&&i<=0&&s<=0||(o+=864e5*wn(Sn(s)+i),i=0,s=0),l.milliseconds=o%1e3,e=W(o/1e3),l.seconds=e%60,t=W(e/60),l.minutes=t%60,n=W(t/60),l.hours=n%24,i+=W(n/24),a=W(On(i)),s+=a,i-=wn(Sn(a)),r=W(s/12),s%=12,l.days=i,l.months=s,l.years=r,this},Qn.clone=function(){return Ht(this)},Qn.get=function(e){return e=U(e),this.isValid()?this[e+"s"]():NaN},Qn.milliseconds=Nn,Qn.seconds=zn,Qn.minutes=Un,Qn.hours=Hn,Qn.days=Vn,Qn.weeks=function(){return W(this.days()/7)},Qn.months=Gn,Qn.years=Yn,Qn.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,a=!1,o=qn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(a=e),"object"==typeof t&&(o=Object.assign({},qn,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=this.localeData(),r=function(e,t,n,r){var a=Ht(e).abs(),o=Wn(a.as("s")),i=Wn(a.as("m")),s=Wn(a.as("h")),l=Wn(a.as("d")),u=Wn(a.as("M")),c=Wn(a.as("w")),d=Wn(a.as("y")),f=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||i<=1&&["m"]||i<n.m&&["mm",i]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(f=f||c<=1&&["w"]||c<n.w&&["ww",c]),(f=f||u<=1&&["M"]||u<n.M&&["MM",u]||d<=1&&["y"]||["yy",d])[2]=t,f[3]=+e>0,f[4]=r,Xn.apply(null,f)}(this,!a,o,n),a&&(r=n.pastFuture(+this,r)),n.postformat(r)},Qn.toISOString=Jn,Qn.toString=Jn,Qn.toJSON=Jn,Qn.locale=$t,Qn.localeData=tn,Qn.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Jn),Qn.lang=en,F("X",0,0,"unix"),F("x",0,0,"valueOf"),he("x",ce),he("X",/[+-]?\d+(\.\d{1,3})?/),Ae("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),Ae("x",(function(e,t,n){n._d=new Date(q(e))})),
|
|
2
2
|
//! moment.js
|
|
3
|
-
a.version="2.29.1",t=Ot,a.fn=yn,a.min=function(){var e=[].slice.call(arguments,0);return Ct("isBefore",e)},a.max=function(){var e=[].slice.call(arguments,0);return Ct("isAfter",e)},a.now=function(){return Date.now?Date.now():+new Date},a.utc=h,a.unix=function(e){return Ot(1e3*e)},a.months=function(e,t){return _n(e,t,"months")},a.isDate=d,a.locale=it,a.invalid=y,a.duration=Ht,a.isMoment=E,a.weekdays=function(e,t,n){return En(e,t,n,"weekdays")},a.parseZone=function(){return Ot.apply(null,arguments).parseZone()},a.localeData=lt,a.isDuration=Rt,a.monthsShort=function(e,t){return _n(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return En(e,t,n,"weekdaysMin")},a.defineLocale=st,a.updateLocale=function(e,t){if(null!=t){var n,r,a=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(C(tt[e]._config,t)):(null!=(r=ot(e))&&(a=r._config),t=C(a,t),null==r&&(t.abbr=e),(n=new L(t)).parentLocale=tt[e],tt[e]=n),it(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===it()&&it(e)):null!=tt[e]&&delete tt[e]);return tt[e]},a.locales=function(){return w(tt)},a.weekdaysShort=function(e,t,n){return En(e,t,n,"weekdaysShort")},a.normalizeUnits=U,a.relativeTimeRounding=function(e){return void 0===e?Wn:"function"==typeof e&&(Wn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==qn[e]&&(void 0===t?qn[e]:(qn[e]=t,"s"===e&&(qn.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=yn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(156)(e))},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"i",(function(){return o})),n.d(t,"g",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"l",(function(){return l})),n.d(t,"m",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"t",(function(){return p})),n.d(t,"s",(function(){return h})),n.d(t,"u",(function(){return m})),n.d(t,"n",(function(){return g})),n.d(t,"o",(function(){return y})),n.d(t,"p",(function(){return v})),n.d(t,"b",(function(){return A})),n.d(t,"r",(function(){return _})),n.d(t,"k",(function(){return E})),n.d(t,"e",(function(){return x})),n.d(t,"h",(function(){return M})),n.d(t,"q",(function(){return w}));var r=n(26);function a(){var e=new r.a(3);return r.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function o(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function i(e,t,n){var a=new r.a(3);return a[0]=e,a[1]=t,a[2]=n,a}function s(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function l(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],r=t[1],a=t[2],o=n*n+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function d(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[0],s=n[1],l=n[2];return e[0]=a*l-o*s,e[1]=o*i-r*l,e[2]=r*s-a*i,e}function f(e,t,n,r){var a=t[0],o=t[1],i=t[2];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e[2]=i+r*(n[2]-i),e}function p(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o+n[15];return i=i||1,e[0]=(n[0]*r+n[4]*a+n[8]*o+n[12])/i,e[1]=(n[1]*r+n[5]*a+n[9]*o+n[13])/i,e[2]=(n[2]*r+n[6]*a+n[10]*o+n[14])/i,e}function h(e,t,n){var r=t[0],a=t[1],o=t[2];return e[0]=r*n[0]+a*n[3]+o*n[6],e[1]=r*n[1]+a*n[4]+o*n[7],e[2]=r*n[2]+a*n[5]+o*n[8],e}function m(e,t,n){var r=n[0],a=n[1],o=n[2],i=n[3],s=t[0],l=t[1],u=t[2],c=a*u-o*l,d=o*s-r*u,f=r*l-a*s,p=a*f-o*d,h=o*c-r*f,m=r*d-a*c,g=2*i;return c*=g,d*=g,f*=g,p*=2,h*=2,m*=2,e[0]=s+c+p,e[1]=l+d+h,e[2]=u+f+m,e}function g(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0],o[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),o[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function y(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),o[1]=a[1],o[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function v(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),o[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),o[2]=a[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function A(e,t){var n=e[0],r=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(n*n+r*r+a*a)*Math.sqrt(o*o+i*i+s*s),u=l&&c(e,t)/l;return Math.acos(Math.min(Math.max(u,-1),1))}var b,_=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},E=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},x=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],a=t[2]-e[2];return Math.hypot(n,r,a)},M=o,w=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r};b=a()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var r=u(n(1442)),a=u(n(1518)),o=u(n(1544)),i=u(n(1545)),s=u(n(1546)),l=u(n(1547));function u(e){return e&&e.__esModule?e:{default:e}}t.hover=i.default,t.handleHover=i.default,t.handleActive=s.default,t.loop=l.default;var c=t.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var s=(0,r.default)(n),l=(0,a.default)(e,s);return(0,o.default)(l)};t.default=c},function(e,t,n){"use strict";function r(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(6),a=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(18)),i=a(n(60)),s=a(n(5)),l=a(n(7)),u=a(n(9)),c=a(n(10)),d=a(n(8)),f=a(n(3)),p=r(n(0)),h=a(n(1));function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var a=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var g=function(e){(0,u.default)(n,e);var t=m(n);function n(){return(0,s.default)(this,n),t.apply(this,arguments)}return(0,l.default)(n,[{key:"render",value:function(){var e=this.props,t=e.height,n=e.width,r=e.viewBox,a=e.style,s=e.children,l=e.predefinedClassName,u=e.className,c=e.colors,d=e.totalColor,f=(0,i.default)(e,["height","width","viewBox","style","children","predefinedClassName","className","colors","totalColor"]),h=t,m=n||h,g=Array.isArray(c)&&d&&function(e,t){return new Array(e).fill(1).reduce((function(e,n,r){return"".concat(e,".cr").concat(r+1," {fill:").concat(t[r%t.length],";}")}),"")}(d,c);return p.default.createElement("svg",(0,o.default)({viewBox:r,width:m,height:h,style:a,className:"".concat(l," ").concat(u)},f),g?p.default.createElement("style",{type:"text/css"},g):null,s)}}]),n}(p.Component);t.default=g,(0,f.default)(g,"displayName","Base Icon"),(0,f.default)(g,"propTypes",{height:h.default.string,width:h.default.string,viewBox:h.default.string,children:h.default.node,predefinedClassName:h.default.string,className:h.default.string}),(0,f.default)(g,"defaultProps",{height:null,width:null,viewBox:"0 0 64 64",predefinedClassName:"",className:"",style:{fill:"currentColor"}})},function(e,t,n){"use strict";var r=n(6),a=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(18)),i=a(n(60)),s=a(n(5)),l=a(n(7)),u=a(n(9)),c=a(n(10)),d=a(n(8)),f=a(n(3)),p=r(n(0)),h=a(n(1));function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var a=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var g=function(e){(0,u.default)(n,e);var t=m(n);function n(){return(0,s.default)(this,n),t.apply(this,arguments)}return(0,l.default)(n,[{key:"render",value:function(){var e=this.props,t=e.height,n=e.width,r=e.viewBox,a=e.style,s=e.children,l=e.predefinedClassName,u=e.className,c=e.colors,d=e.totalColor,f=(0,i.default)(e,["height","width","viewBox","style","children","predefinedClassName","className","colors","totalColor"]),h=t,m=n||h,g=Array.isArray(c)&&d&&function(e,t){return new Array(e).fill(1).reduce((function(e,n,r){return"".concat(e,".cr").concat(r+1," {fill:").concat(t[r%t.length],";}")}),"")}(d,c);return p.default.createElement("svg",(0,o.default)({viewBox:r,width:m,height:h,style:a,className:"".concat(l," ").concat(u)},f),g?p.default.createElement("style",{type:"text/css"},g):null,s)}}]),n}(p.Component);t.default=g,(0,f.default)(g,"displayName","Base Icon"),(0,f.default)(g,"propTypes",{height:h.default.string,width:h.default.string,viewBox:h.default.string,children:h.default.node,predefinedClassName:h.default.string,className:h.default.string}),(0,f.default)(g,"defaultProps",{height:null,width:null,viewBox:"0 0 64 64",predefinedClassName:"",className:"",style:{fill:"currentColor"}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"h",(function(){return i})),n.d(t,"i",(function(){return s})),n.d(t,"k",(function(){return l})),n.d(t,"l",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"j",(function(){return d})),n.d(t,"g",(function(){return f})),n.d(t,"m",(function(){return p})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return m}));var r=Math.abs,a=Math.atan2,o=Math.cos,i=Math.max,s=Math.min,l=Math.sin,u=Math.sqrt,c=1e-12,d=Math.PI,f=d/2,p=2*d;function h(e){return e>1?0:e<-1?d:Math.acos(e)}function m(e){return e>=1?f:e<=-1?-f:Math.asin(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"COORDINATE_SYSTEM",(function(){return r.a})),n.d(t,"OPERATION",(function(){return r.c})),n.d(t,"UNIT",(function(){return r.e})),n.d(t,"LightingEffect",(function(){return a.a})),n.d(t,"AmbientLight",(function(){return o.a})),n.d(t,"DirectionalLight",(function(){return i.a})),n.d(t,"PointLight",(function(){return p})),n.d(t,"_CameraLight",(function(){return m})),n.d(t,"_SunLight",(function(){return M})),n.d(t,"PostProcessEffect",(function(){return D})),n.d(t,"_LayersPass",(function(){return I.a})),n.d(t,"Deck",(function(){return F.a})),n.d(t,"LayerManager",(function(){return j.a})),n.d(t,"AttributeManager",(function(){return B.a})),n.d(t,"Layer",(function(){return N.a})),n.d(t,"CompositeLayer",(function(){return z.a})),n.d(t,"DeckRenderer",(function(){return U.a})),n.d(t,"Viewport",(function(){return H.a})),n.d(t,"WebMercatorViewport",(function(){return V.a})),n.d(t,"_GlobeViewport",(function(){return K})),n.d(t,"picking",(function(){return J.a})),n.d(t,"project",(function(){return Q.a})),n.d(t,"project32",(function(){return $.a})),n.d(t,"gouraudLighting",(function(){return ee.a})),n.d(t,"phongLighting",(function(){return ee.b})),n.d(t,"shadow",(function(){return te.a})),n.d(t,"View",(function(){return ne.a})),n.d(t,"MapView",(function(){return re.a})),n.d(t,"FirstPersonView",(function(){return Ae})),n.d(t,"OrbitView",(function(){return Me})),n.d(t,"OrthographicView",(function(){return we.a})),n.d(t,"_GlobeView",(function(){return Ce})),n.d(t,"Controller",(function(){return le.a})),n.d(t,"MapController",(function(){return Oe.b})),n.d(t,"_GlobeController",(function(){return Te})),n.d(t,"FirstPersonController",(function(){return ye})),n.d(t,"OrbitController",(function(){return be.b})),n.d(t,"OrthographicController",(function(){return Le.a})),n.d(t,"Effect",(function(){return w.a})),n.d(t,"LayerExtension",(function(){return Pe.a})),n.d(t,"TRANSITION_EVENTS",(function(){return Re.a})),n.d(t,"TransitionInterpolator",(function(){return De.a})),n.d(t,"LinearInterpolator",(function(){return ke.a})),n.d(t,"FlyToInterpolator",(function(){return je})),n.d(t,"log",(function(){return Be.a})),n.d(t,"createIterable",(function(){return Ne.a})),n.d(t,"fp64LowPart",(function(){return ce.b})),n.d(t,"Tesselator",(function(){return ze.a})),n.d(t,"_fillArray",(function(){return Ue.a})),n.d(t,"_flatten",(function(){return Ue.b})),n.d(t,"_count",(function(){return He.a})),n.d(t,"_memoize",(function(){return Ve.a})),n.d(t,"_mergeShaders",(function(){return Ge.a})),n.d(t,"_compareProps",(function(){return Ye.a}));var r=n(34),a=n(339),o=n(423),i=n(241),s=n(344);const l=[255,255,255],u=1,c=[0,0,1],d=[0,0,1];let f=0;class p{constructor(e={}){const{color:t=l}=e,{intensity:n=u}=e,{position:r=d}=e;this.id=e.id||"point-".concat(f++),this.color=t,this.intensity=n,this.type="point",this.position=r,this.attenuation=function(e){if("attenuation"in e)return e.attenuation;if("intensity"in e)return[0,0,e.intensity];return c}(e),this.projectedLight={...this}}getProjectedLight({layer:e}){const{projectedLight:t}=this,n=e.context.viewport,{coordinateSystem:a,coordinateOrigin:o}=e.props,i=Object(s.b)(this.position,{viewport:n,coordinateSystem:a,coordinateOrigin:o,fromCoordinateSystem:n.isGeospatial?r.a.LNGLAT:r.a.CARTESIAN,fromCoordinateOrigin:[0,0,0]});return t.color=this.color,t.intensity=this.intensity,t.position=i,t}}var h=n(294);class m extends p{getProjectedLight({layer:e}){const{projectedLight:t}=this,n=e.context.viewport,{coordinateSystem:r,coordinateOrigin:a,modelMatrix:o}=e.props,{project_uCameraPosition:i}=Object(h.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a});return t.color=this.color,t.intensity=this.intensity,t.position=i,t}}const g=Math.PI/180,y=23.4397*g;function v(e,t,n){const r=g*-n,a=g*t,o=function(e){return function(e){return e/864e5-.5+2440588}(e)-2451545}(e),i=function(e){const t=function(e){const t=e,n=g*(1.9148*Math.sin(t)+.02*Math.sin(2*t)+3e-4*Math.sin(3*t));return t+n+102.9372*g+Math.PI}((n=e,g*(357.5291+.98560028*n)));var n;return{declination:_(t,0),rightAscension:b(t,0)}}(o),s=function(e,t){return g*(280.147+360.9856235*e)-t}(o,r)-i.rightAscension;return{azimuth:E(s,a,i.declination),altitude:x(s,a,i.declination)}}function A(e,t,n){const{azimuth:r,altitude:a}=v(e,t,n);return[Math.sin(r)*Math.cos(a),Math.cos(r)*Math.cos(a),-Math.sin(a)]}function b(e,t){const n=e;return Math.atan2(Math.sin(n)*Math.cos(y)-Math.tan(t)*Math.sin(y),Math.cos(n))}function _(e,t){const n=e;return Math.asin(Math.sin(t)*Math.cos(y)+Math.cos(t)*Math.sin(y)*Math.sin(n))}function E(e,t,n){const r=e,a=t,o=n;return Math.atan2(Math.sin(r),Math.cos(r)*Math.sin(a)-Math.tan(o)*Math.cos(a))}function x(e,t,n){const r=e,a=t,o=n;return Math.asin(Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos(r))}class M extends i.a{constructor({timestamp:e,...t}){super(t),this.timestamp=e}getProjectedLight({layer:e}){const{viewport:t}=e.context;if(t.resolution>0){const[e,t,n]=A(this.timestamp,0,0);this.direction=[e,-n,t]}else{const{latitude:e,longitude:n}=t;this.direction=A(this.timestamp,e,n)}return this}}var w=n(164),O=n(4),S=n(1905),T=n(16),C=n(464),L=n(454);class P extends L.a{constructor(e,t){super(e,t),Object(O.a)(this,"model",void 0);const{module:n,fs:r,id:a}=t;this.model=new S.a(e,{id:a,fs:r,modules:[n]})}render(e){const t=this.gl;Object(T.n)(t,{viewport:[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}),Object(T.o)(t,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},()=>this._renderPass(t,e))}delete(){this.model.delete(),this.model=null}_renderPass(e,t){const{inputBuffer:n}=t;Object(C.a)(e,{color:!0}),this.model.draw({moduleSettings:this.props.moduleSettings,uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}var R=n(640);class D extends w.a{constructor(e,t={}){super(t),this.id="".concat(e.name,"-pass"),Object(R.b)(e),this.module=e}postRender(e,t){this.passes||(this.passes=function(e,t,n,r){if(t.filter||t.sampler){const a=k(t);return[new P(e,{id:n,module:t,fs:a,moduleSettings:r})]}return(t.passes||[]).map((a,o)=>{const i=k(t,a),s="".concat(n,"-").concat(o);return new P(e,{id:s,module:t,fs:i,moduleSettings:r})})}(e,this.module,this.id,this.props));const{target:n}=t;let r=t.inputBuffer,a=t.swapBuffer;for(let e=0;e<this.passes.length;e++){n&&e===this.passes.length-1&&(a=n),this.passes[e].render({inputBuffer:r,outputBuffer:a});const t=a;a=r,r=t}return r}cleanup(){if(this.passes){for(const e of this.passes)e.delete();this.passes=null}}}function k(e,t=e){if(t.filter){return(e=>"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n"))("string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor"))}if(t.sampler){return(e=>"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n"))("string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor"))}return null}var I=n(165),F=n(1160),j=n(441),B=n(436),N=n(435),z=n(621),U=n(444),H=n(101),V=n(185),G=n(215),Y=n(19),W=n(48);const q=Math.PI/180,X=180/Math.PI;class K extends H.a{constructor(e={}){const{latitude:t=0,longitude:n=0,zoom:r=11,nearZMultiplier:a=.1,farZMultiplier:o=2,resolution:i=10}=e;let{width:s,height:l,altitude:u=1.5}=e;s=s||1,l=l||1,u=Math.max(.75,u);const c=(new G.a).lookAt({eye:[0,-u,0],up:[0,0,1]}),d=Math.pow(2,r);c.rotateX(t*q),c.rotateZ(-n*q),c.scale(d/l);const f=Math.atan(.5/u),p=512*d/l;super({...e,width:s,height:l,viewMatrix:c,longitude:n,latitude:t,zoom:r,fovyRadians:2*f,aspect:s/l,focalDistance:u,near:a,far:Math.min(2,1/p+1)*u*o}),this.resolution=i,this.distanceScales=function(){const e=Math.PI/180*256;return{unitsPerMeter:[256/6370972,256/6370972,256/6370972],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[e,e,256/6370972],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/e,1/e,24886.609375]}}()}get projectionMode(){return r.d.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(e={}){const t={targetZ:e.z||0},n=this.unproject([0,this.height/2],t),r=this.unproject([this.width/2,0],t),a=this.unproject([this.width,this.height/2],t),o=this.unproject([this.width/2,this.height],t);return a[0]<this.longitude&&(a[0]+=360),n[0]>this.longitude&&(n[0]-=360),[Math.min(n[0],a[0],r[0],o[0]),Math.min(n[1],a[1],r[1],o[1]),Math.max(n[0],a[0],r[0],o[0]),Math.max(n[1],a[1],r[1],o[1])]}unproject(e,{topLeft:t=!0,targetZ:n}={}){const[r,a,o]=e,i=t?a:this.height-a,{pixelUnprojectionMatrix:s}=this;let l;if(Number.isFinite(o))l=Z(s,[r,i,o,1]);else{const e=Z(s,[r,i,-1,1]),t=Z(s,[r,i,1,1]),a=256*((n||0)/6370972+1),o=Y.q(Y.r([],e,t)),u=Y.q(e),c=Y.q(t),d=4*((4*u*c-(o-u-c)**2)/16)/o,f=(Math.sqrt(u-d)-Math.sqrt(Math.max(0,a*a-d)))/Math.sqrt(o);l=Y.j([],e,t,f)}const[u,c,d]=this.unprojectPosition(l);return Number.isFinite(o)?[u,c,d]:Number.isFinite(n)?[u,c,n]:[u,c]}projectPosition(e){const[t,n,r=0]=e,a=t*q,o=n*q,i=Math.cos(o),s=256*(r/6370972+1);return[Math.sin(a)*i*s,-Math.cos(a)*i*s,Math.sin(o)*s]}unprojectPosition(e){const[t,n,r]=e,a=Y.h(e),o=Math.asin(r/a);return[Math.atan2(t,-n)*X,o*X,6370972*(a/256-1)]}projectFlat(e){return e}unprojectFlat(e){return e}panByPosition(e,t){const n=this.unproject(t);return{longitude:e[0]-n[0]+this.longitude,latitude:e[1]-n[1]+this.latitude}}}function Z(e,t){const n=W.n([],t,e);return W.k(n,n,1/n[3]),n}var J=n(825),Q=n(242),$=n(826),ee=n(1179),te=n(295),ne=n(143),re=n(424),ae=n(53),oe=n(47),ie=n(176);class se{constructor({phi:e=0,theta:t=0,radius:n=1,bearing:r,pitch:a,altitude:o,radiusScale:i=6371e3}={}){this.phi=e,this.theta=t,this.radius=n||o||1,this.radiusScale=i||1,void 0!==r&&(this.bearing=r),void 0!==a&&(this.pitch=a),this.check()}toString(){return this.formatString(oe.b)}formatString({printTypes:e=!1}){const t=oe.e;return"".concat(e?"Spherical":"","[rho:").concat(t(this.radius),",theta:").concat(t(this.theta),",phi:").concat(t(this.phi),"]")}equals(e){return Object(oe.d)(this.radius,e.radius)&&Object(oe.d)(this.theta,e.theta)&&Object(oe.d)(this.phi,e.phi)}exactEquals(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}get bearing(){return 180-Object(oe.c)(this.phi)}set bearing(e){this.phi=Math.PI-Object(oe.h)(e)}get pitch(){return Object(oe.c)(this.theta)}set pitch(e){this.theta=Object(oe.h)(e)}get longitude(){return Object(oe.c)(this.phi)}get latitude(){return Object(oe.c)(this.theta)}get lng(){return Object(oe.c)(this.phi)}get lat(){return Object(oe.c)(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}clone(){return(new se).copy(this)}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this.check()}fromLngLatZ([e,t,n]){this.radius=1+n/this.radiusScale,this.phi=Object(oe.h)(t),this.theta=Object(oe.h)(e)}fromVector3(e){return this.radius=Y.i(e),this.radius>0&&(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(oe.a)(e[2]/this.radius,-1,1))),this.check()}toVector3(){return new ie.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}check(){if(!(Number.isFinite(this.phi)&&Number.isFinite(this.theta)&&this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}var le=n(142),ue=n(296),ce=n(89);const de=[0,0,0],fe=0,pe=0,he=90,me=-90;class ge extends ue.a{constructor({width:e,height:t,position:n=de,bearing:r=pe,pitch:a=fe,longitude:o,latitude:i,maxPitch:s=he,minPitch:l=me,startRotatePos:u,startBearing:c,startPitch:d,startZoomPosition:f,startZoom:p}){super({width:e,height:t,position:n,bearing:r,pitch:a,longitude:o,latitude:i,maxPitch:s,minPitch:l}),this._state={startRotatePos:u,startBearing:c,startPitch:d,startZoomPosition:f,startZoom:p}}getDirection(e=!1){return new se({bearing:this._viewportProps.bearing,pitch:e?90:90+this._viewportProps.pitch}).toVector3().normalize()}panStart(){return this}pan(){return this}panEnd(){return this}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){const{startRotatePos:r,startBearing:a,startPitch:o}=this._state,{width:i,height:s}=this._viewportProps;if(!r||!Number.isFinite(a)||!Number.isFinite(o))return this;let l;if(e){l={bearing:a-180*((e[0]-r[0])/i),pitch:o-90*((e[1]-r[1])/s)}}else l={bearing:a-t,pitch:o-n};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this._viewportProps.position,startZoom:this._viewportProps.zoom})}zoom({scale:e}){let{startZoomPosition:t}=this._state;t||(t=this._viewportProps.position);const n=this.getDirection();return this._move(n,20*Math.log2(e),t)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}moveLeft(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:Math.PI/2}),e)}moveRight(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:-Math.PI/2}),e)}moveUp(e=20){const t=this.getDirection(!0);return this._move(t,e)}moveDown(e=20){const t=this.getDirection(!0);return this._move(t.negate(),e)}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}zoomIn(e=2){return this.zoom({scale:e})}zoomOut(e=2){return this.zoom({scale:1/e})}shortestPathFrom(e){const t=e.getViewportProps(),n={...this._viewportProps},{bearing:r,longitude:a}=n;return Math.abs(r-t.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(a-t.longitude)>180&&(n.longitude=a<0?a+360:a-360),n}_move(e,t,n=this._viewportProps.position){const r=e.scale(t);return this._getUpdatedState({position:new ie.a(n).add(r)})}_getUpdatedState(e){return new ge({...this._viewportProps,...this._state,...e})}_applyConstraints(e){const{pitch:t,maxPitch:n,minPitch:r,longitude:a,bearing:o}=e;return e.pitch=Object(oe.a)(t,r,n),(a<-180||a>180)&&(e.longitude=Object(ce.e)(a+180,360)-180),(o<-180||o>180)&&(e.bearing=Object(ce.e)(o+180,360)-180),e}}class ye extends le.a{constructor(e){super(ge,e)}get linearTransitionProps(){return["position","pitch","bearing"]}}class ve extends H.a{constructor(e){const{modelMatrix:t=null,bearing:n=0,pitch:r=0,up:a=[0,0,1]}=e,o=function({bearing:e,pitch:t}){return new se({bearing:e,pitch:t}).toVector3().normalize()}({bearing:n,pitch:-90===r?1e-4:90+r}),i=t?t.transformDirection(o):o,s=Object(ae.i)(e),l=Math.pow(2,s),u=(new G.a).lookAt({eye:[0,0,0],center:i,up:a}).scale(l);super({...e,zoom:s,viewMatrix:u})}}class Ae extends ne.a{constructor(e){super({...e,type:ve})}get controller(){return this._getControllerProps({type:ye})}}Ae.displayName="FirstPersonView";var be=n(284);const _e=Math.PI/180;function Ee({height:e,focalDistance:t,orbitAxis:n,rotationX:r,rotationOrbit:a,zoom:o}){const i="Z"===n?[0,0,1]:[0,1,0],s="Z"===n?[0,-t,0]:[0,0,t],l=(new G.a).lookAt({eye:s,up:i});l.rotateX(r*_e),"Z"===n?l.rotateZ(a*_e):l.rotateY(a*_e);const u=Math.pow(2,o)/(e||1);return l.scale(u),l}class xe extends H.a{constructor(e){const{height:t,projectionMatrix:n,fovy:r=50,orbitAxis:a,target:o=[0,0,0],rotationX:i=0,rotationOrbit:s=0,zoom:l=0}=e,u=n?n[5]/2:Object(ae.e)(r);super({...e,longitude:null,viewMatrix:Ee({height:t,focalDistance:u,orbitAxis:a,rotationX:i,rotationOrbit:s,zoom:l}),fovy:r,focalDistance:u,position:o,zoom:l}),Object(O.a)(this,"projectedCenter",void 0),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[n,r,a=this.projectedCenter[2]]=e,o=t?r:this.height-r,[i,s,l]=Object(ae.n)([n,o,a],this.pixelUnprojectionMatrix);return[i,s,l]}panByPosition(e,t){const n=this.project(e),r=[this.width/2+n[0]-t[0],this.height/2+n[1]-t[1],this.projectedCenter[2]];return{target:this.unproject(r)}}}Object(O.a)(xe,"displayName","OrbitView");class Me extends ne.a{constructor(e={}){const{orbitAxis:t="Z"}=e;super({...e,orbitAxis:t,type:xe})}get controller(){return this._getControllerProps({type:be.b})}}var we=n(426),Oe=n(282);class Se extends Oe.a{_applyConstraints(e){const{maxZoom:t,minZoom:n,zoom:r}=e;e.zoom=Object(oe.a)(r,n,t);const{longitude:a,latitude:o}=e;return(a<-180||a>180)&&(e.longitude=Object(ce.e)(a+180,360)-180),e.latitude=Object(oe.a)(o,-89,89),e}}class Te extends le.a{constructor(e){e.dragMode=e.dragMode||"pan",super(Se,e)}setProps(e){super.setProps(e),this.dragRotate=!1,this.touchRotate=!1}get linearTransitionProps(){return["longitude","latitude","zoom"]}}class Ce extends ne.a{constructor(e){super({...e,type:K})}get controller(){return this._getControllerProps({type:Te})}}Ce.displayName="GlobeView";var Le=n(427),Pe=n(620),Re=n(335),De=n(283),ke=n(336);const Ie=["bearing","pitch"],Fe={speed:1.2,curve:1.414};class je extends De.a{constructor(e={}){super({compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}),this.props={...Fe,...e}}interpolateProps(e,t,n){const r=Object(ae.d)(e,t,n,this.props);for(const a of Ie)r[a]=Object(oe.g)(e[a]||0,t[a]||0,n);return r}getDuration(e,t){let{transitionDuration:n}=t;return"auto"===n&&(n=Object(ae.h)(e,t,this.props)),n}}var Be=n(50),Ne=n(122),ze=n(827),Ue=n(150),He=n(428),Ve=n(184),Ge=n(422),Ye=n(337)},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return o}));var r=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)})},function(e,t,n){var r=n(1230),a=n(651),o=n(480),i=n(1231);e.exports=function(e){return r(e)||a(e)||o(e)||i()}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CheckMark=t.TruncatedTitleText=t.StyledFilterContent=t.MapControlButton=t.BottomWidgetInner=t.WidgetContainer=t.StyledType=t.StyledFilteredOption=t.StyledExportSection=t.StyledAttrbution=t.StyledMapContainer=t.StyledModalInputFootnote=t.StyledModalSection=t.StyledModalVerticalPanel=t.StyledModalContent=t.Table=t.SelectionButton=t.DatasetSquare=t.ButtonGroup=t.StyledPanelDropdown=t.StyledPanelHeader=t.InlineInput=t.TextAreaLight=t.TextArea=t.InputLight=t.Input=t.Button=t.Tooltip=t.SidePanelDivider=t.SidePanelSection=t.PanelContent=t.PanelHeaderContent=t.PanelHeaderTitle=t.PanelLabelBold=t.PanelLabelWrapper=t.PanelLabel=t.SBFlexboxNoMargin=t.SBFlexboxItem=t.SpaceBetweenFlexbox=t.CenterVerticalFlexbox=t.CenterFlexbox=t.IconRoundSmall=t.SelectTextBold=t.SelectText=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g,y,v,A,b,_,E,x,M,w,O,S,T,C,L,P,R,D,k,I,F,j,B,N,z,U,H,V,G,Y,W,q,X,K,Z,J,Q=r(n(12)),$=r(n(11)),ee=r(n(1169)),te=n(219),ne=r(n(36)),re=$.default.span(a||(a=(0,Q.default)(["\n color: ",";\n font-size: ",";\n font-weight: 400;\n\n i {\n font-size: 13px;\n margin-right: 6px;\n }\n"])),(function(e){return e.theme.labelColor}),(function(e){return e.theme.selectFontSize}));t.SelectText=re;var ae=(0,$.default)(re)(o||(o=(0,Q.default)(["\n color: ",";\n font-weight: 500;\n"])),(function(e){return e.theme.textColor}));t.SelectTextBold=ae;var oe=$.default.div(i||(i=(0,Q.default)(["\n display: flex;\n width: 18px;\n height: 18px;\n border-radius: 9px;\n background-color: ",";\n color: ",";\n align-items: center;\n justify-content: center;\n\n :hover {\n cursor: pointer;\n background-color: ",";\n }\n"])),(function(e){return e.theme.secondaryBtnBgdHover}),(function(e){return e.theme.secondaryBtnColor}),(function(e){return e.theme.secondaryBtnBgdHover}));t.IconRoundSmall=oe;var ie=$.default.div(s||(s=(0,Q.default)(["\n display: flex;\n align-items: center;\n"])));t.CenterFlexbox=ie;var se=$.default.div(l||(l=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"])));t.CenterVerticalFlexbox=se;var le=$.default.div(u||(u=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n margin-left: -16px;\n"])));t.SpaceBetweenFlexbox=le;var ue=$.default.div(c||(c=(0,Q.default)(["\n flex-grow: 1;\n margin-left: 16px;\n"])));t.SBFlexboxItem=ue;var ce=$.default.div(d||(d=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n"])));t.SBFlexboxNoMargin=ce;var de=$.default.label.attrs({className:"side-panel-panel__label"})(f||(f=(0,Q.default)(["\n color: ",";\n display: inline-block;\n font-size: 11px;\n font-weight: 400;\n margin-bottom: 4px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.labelColor}));t.PanelLabel=de;var fe=$.default.div.attrs({className:"side-panel-panel__label-wrapper"})(p||(p=(0,Q.default)(["\n display: flex;\n align-items: self-start;\n"])));t.PanelLabelWrapper=fe;var pe=(0,$.default)(de)(h||(h=(0,Q.default)(["\n font-weight: 500;\n"])));t.PanelLabelBold=pe;var he=$.default.span.attrs({className:"side-panel-panel__header__title"})(m||(m=(0,Q.default)(["\n color: ",";\n font-size: 13px;\n letter-spacing: 0.43px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.textColor}));t.PanelHeaderTitle=he;var me=$.default.div(g||(g=(0,Q.default)(["\n display: flex;\n align-items: center;\n color: ",";\n padding-left: 12px;\n\n .icon {\n color: ",";\n display: flex;\n align-items: center;\n margin-right: 12px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.labelColor}));t.PanelHeaderContent=me;var ge=$.default.div.attrs({className:"side-panel-panel__content"})(y||(y=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.PanelContent=ge;var ye=$.default.div.attrs({className:"side-panel-section"})(v||(v=(0,Q.default)(["\n margin-bottom: 12px;\n\n opacity: ",";\n pointer-events: ",";\n"])),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}));t.SidePanelSection=ye;var ve=$.default.div.attrs({className:"side-panel-divider"})(A||(A=(0,Q.default)(["\n border-bottom: "," solid\n ",";\n margin-bottom: ","px;\n height: ","px;\n"])),(function(e){return e.theme.sidepanelDividerBorder}),(function(e){return e.theme.panelBorderColor}),(function(e){return e.theme.sidepanelDividerMargin}),(function(e){return e.theme.sidepanelDividerHeight}));t.SidePanelDivider=ve;var Ae=(0,$.default)(ee.default)(b||(b=(0,Q.default)(["\n &.__react_component_tooltip {\n font-size: ",";\n font-weight: 400;\n padding: 7px 18px;\n box-shadow: ",";\n\n &.type-dark {\n background-color: ",";\n color: ",";\n &.place-bottom {\n :after {\n border-bottom-color: ",";\n }\n }\n\n &.place-top {\n :after {\n border-top-color: ",";\n }\n }\n\n &.place-right {\n :after {\n border-right-color: ",";\n }\n }\n\n &.place-left {\n :after {\n border-left-color: ",";\n }\n }\n }\n }\n"])),(function(e){return e.theme.tooltipFontSize}),(function(e){return e.theme.tooltipBoxShadow}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipColor}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}));t.Tooltip=Ae;var be=$.default.div.attrs((function(e){return{className:(0,ne.default)("button",e.className)}}))(_||(_=(0,Q.default)(["\n align-items: center;\n background-color: ",";\n border-radius: ",";\n color: ",";\n cursor: pointer;\n display: inline-flex;\n font-size: ",";\n font-weight: 500;\n font-family: ",";\n justify-content: center;\n letter-spacing: 0.3px;\n line-height: 14px;\n outline: 0;\n padding: ",";\n text-align: center;\n transition: ",";\n vertical-align: middle;\n width: ",";\n opacity: ",";\n pointer-events: ",";\n border: ",";\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n }\n\n svg {\n margin-right: ",";\n }\n"])),(function(e){return e.negative?e.theme.negativeBtnBgd:e.secondary?e.theme.secondaryBtnBgd:e.link?e.theme.linkBtnBgd:e.floating?e.theme.floatingBtnBgd:e.cta?e.theme.ctaBtnBgd:e.theme.primaryBtnBgd}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.negative?e.theme.negativeBtnColor:e.secondary?e.theme.secondaryBtnColor:e.link?e.theme.linkBtnColor:e.floating?e.theme.floatingBtnColor:e.cta?e.theme.ctaBtnColor:e.theme.primaryBtnColor}),(function(e){return e.large?e.theme.primaryBtnFontSizeLarge:e.small?e.theme.primaryBtnFontSizeSmall:e.theme.primaryBtnFontSizeDefault}),(function(e){return e.theme.btnFontFamily}),(function(e){return e.large?"14px 32px":e.small?"6px 9px":"9px 12px"}),(function(e){return e.theme.transition}),(function(e){return e.width||"auto"}),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.negative?e.theme.negativeBtnBorder:e.secondary?e.theme.secondaryBtnBorder:e.floating?e.theme.floatingBtnBorder:e.link?e.theme.linkBtnBorder:e.theme.primaryBtnBorder}),(function(e){return e.negative?e.theme.negativeBtnBgdHover:e.secondary?e.theme.secondaryBtnBgdHover:e.link?e.theme.linkBtnActBgdHover:e.floating?e.theme.floatingBtnBgdHover:e.cta?e.theme.ctaBtnBgdHover:e.theme.primaryBtnBgdHover}),(function(e){return e.negative?e.theme.negativeBtnActColor:e.secondary?e.theme.secondaryBtnActColor:e.link?e.theme.linkBtnActColor:e.floating?e.theme.floatingBtnActColor:e.cta?e.theme.ctaBtnActColor:e.theme.primaryBtnActColor}),(function(e){return e.large?"10px":e.small?"6px":"8px"}));t.Button=be;var _e=$.default.input(E||(E=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.Input=_e;var Ee=$.default.input(x||(x=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inputLT}));t.InputLight=Ee;var xe=$.default.textarea(M||(M=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.TextArea=xe;var Me=$.default.textarea(w||(w=(0,Q.default)(["\n "," height: auto;\n white-space: pre-wrap;\n"])),(function(e){return e.theme.inputLT}));t.TextAreaLight=Me;var we=(0,$.default)(_e)(O||(O=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inlineInput}));t.InlineInput=we;var Oe=$.default.div(S||(S=(0,Q.default)(["\n background-color: ",";\n border-left: 3px solid\n rgb(\n ","\n );\n padding: 0 10px 0 0;\n height: ","px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: ",";\n transition: ",";\n"])),(function(e){return e.active?e.theme.panelBackgroundHover:e.theme.panelBackground}),(function(e){return e.labelRCGColorValues?e.labelRCGColorValues.join(","):"transparent"}),(function(e){return e.theme.panelHeaderHeight}),(function(e){return e.theme.panelHeaderBorderRadius}),(function(e){return e.theme.transition}));t.StyledPanelHeader=Oe;var Se=$.default.div(T||(T=(0,Q.default)(["\n ","\n background-color: ",";\n overflow-y: auto;\n box-shadow: ",";\n border-radius: ",";\n max-height: 500px;\n position: relative;\n z-index: 999;\n"])),(function(e){return e.theme.panelDropdownScrollBar}),(function(e){return"light"===e.type?e.theme.modalDropdownBackground:e.theme.panelBackground}),(function(e){return e.theme.panelBoxShadow}),(function(e){return e.theme.panelBorderRadius}));t.StyledPanelDropdown=Se;var Te=$.default.div(C||(C=(0,Q.default)(["\n display: flex;\n .button {\n border-radius: 0;\n margin-left: 2px;\n }\n .button:first-child {\n border-bottom-left-radius: ",";\n border-top-left-radius: ",";\n margin-left: 0;\n }\n .button:last-child {\n border-bottom-right-radius: ",";\n border-top-right-radius: ",";\n }\n"])),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}));t.ButtonGroup=Te;var Ce=$.default.div(L||(L=(0,Q.default)(["\n display: inline-block;\n width: 8px;\n height: 8px;\n background-color: rgb(",");\n margin-right: 12px;\n"])),(function(e){return e.color.join(",")}));t.DatasetSquare=Ce;var Le=$.default.div(P||(P=(0,Q.default)(["\n position: relative;\n border-radius: 2px;\n border: 1px solid\n ",";\n color: ",";\n background-color: ",";\n\n cursor: pointer;\n font-weight: 500;\n margin-right: 6px;\n padding: 6px 16px;\n\n :hover {\n color: ",";\n border: 1px solid ",";\n }\n"])),(function(e){return e.selected?e.theme.selectionBtnBorderActColor:e.theme.selectionBtnBorderColor}),(function(e){return e.selected?e.theme.selectionBtnActColor:e.theme.selectionBtnColor}),(function(e){return e.selected?e.theme.selectionBtnActBgd:e.theme.selectionBtnBgd}),(function(e){return e.theme.selectionBtnActColor}),(function(e){return e.theme.selectionBtnBorderActColor}));t.SelectionButton=Le;var Pe=$.default.table(R||(R=(0,Q.default)(["\n width: 100%;\n border-spacing: 0;\n\n thead {\n tr th {\n background: ",";\n color: ",";\n padding: 18px 12px;\n text-align: start;\n }\n }\n\n tbody {\n tr td {\n border-bottom: ",";\n padding: 12px;\n }\n }\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.titleColorLT}),(function(e){return e.theme.panelBorderLT}));t.Table=Pe;var Re=$.default.div(D||(D=(0,Q.default)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction: row;\n font-size: 10px;\n padding: 24px ",";\n margin: 0 -",";\n justify-content: space-between;\n ",";\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.modalLateralPadding}),(function(e){return e.theme.modalLateralPadding}),te.media.portable(k||(k=(0,Q.default)(["\n flex-direction: column;\n padding: 16px ",";\n margin: 0 -",";\n "])),(function(e){return e.theme.modalPortableLateralPadding}),(function(e){return e.theme.modalPortableLateralPadding})));t.StyledModalContent=Re;var De=$.default.div.attrs({className:"modal-vertical-panel"})(I||(I=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n font-size: 12px;\n\n .modal-section:first-child {\n margin-top: 24px;\n ",";\n }\n\n input {\n margin-right: 8px;\n }\n"])),te.media.palm(F||(F=(0,Q.default)(["\n margin-top: 0;\n "]))));t.StyledModalVerticalPanel=De;var ke=$.default.div.attrs({className:"modal-section"})(j||(j=(0,Q.default)(["\n margin-bottom: 32px;\n\n .modal-section-title {\n font-weight: 500;\n }\n .modal-section-subtitle {\n color: ",";\n }\n\n input {\n margin-top: 8px;\n }\n\n ",";\n ",";\n"])),(function(e){return e.theme.subtextColorLT}),te.media.portable(B||(B=(0,Q.default)(["\n margin-bottom: 24px;\n "]))),te.media.palm(N||(N=(0,Q.default)(["\n margin-bottom: 16px;\n "]))));t.StyledModalSection=ke;var Ie=$.default.div.attrs({className:"modal-input__footnote"})(z||(z=(0,Q.default)(["\n display: flex;\n justify-content: flex-end;\n color: ",";\n font-size: 10px;\n"])),(function(e){return e.error?e.theme.errorColor:e.theme.subtextColorLT}));t.StyledModalInputFootnote=Ie;var Fe=$.default.div(U||(U=(0,Q.default)(["\n width: 100%;\n height: 100%;\n .mapboxgl-map {\n .mapboxgl-missing-css {\n display: none;\n }\n .mapboxgl-ctrl-attrib {\n display: none;\n }\n }\n"])));t.StyledMapContainer=Fe;var je=$.default.div.attrs({className:"mapbox-attribution-container"})(H||(H=(0,Q.default)(["\n bottom: 0;\n right: 0;\n position: absolute;\n display: block;\n margin: 0 10px 2px;\n z-index: 0;\n\n .attrition-logo {\n display: flex;\n font-size: 10px;\n justify-content: flex-end;\n align-items: center;\n color: ",";\n margin-bottom: -4px;\n\n a.mapboxgl-ctrl-logo {\n width: 72px;\n margin-left: 6px;\n }\n }\n a {\n font-size: 10px;\n }\n"])),(function(e){return e.theme.labelColor}));t.StyledAttrbution=je;var Be=$.default.div(V||(V=(0,Q.default)(["\n display: flex;\n flex-direction: row;\n margin: 35px 0;\n width: 100%;\n color: ",";\n font-size: 12px;\n opacity: ",";\n pointer-events: ",";\n\n .description {\n width: 185px;\n .title {\n font-weight: 500;\n }\n .subtitle {\n color: ",";\n font-size: 11px;\n }\n }\n .warning {\n color: ",";\n font-weight: 500;\n }\n .description.full {\n width: 100%;\n }\n .selection {\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n padding-left: 50px;\n\n select {\n background-color: white;\n border-radius: 1px;\n display: inline-block;\n font: inherit;\n line-height: 1.5em;\n padding: 0.5em 3.5em 0.5em 1em;\n margin: 0;\n box-sizing: border-box;\n appearance: none;\n width: 250px;\n height: 36px;\n\n background-image: linear-gradient(45deg, transparent 50%, gray 50%),\n linear-gradient(135deg, gray 50%, transparent 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px),\n calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n }\n\n select:focus {\n background-image: linear-gradient(45deg, green 50%, transparent 50%),\n linear-gradient(135deg, transparent 50%, green 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 15px) 1em, calc(100% - 20px) 1em, calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n border-color: green;\n outline: 0;\n }\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.disabled?.3:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.theme.subtextColorLT}),(function(e){return e.theme.errorColor}));t.StyledExportSection=Be;var Ne=(0,$.default)(Le)(G||(G=(0,Q.default)(["\n align-items: center;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin: 4px;\n padding: 8px 12px;\n width: 140px;\n\n .filter-option-title {\n color: ",";\n font-size: 12px;\n font-weight: 500;\n }\n .filter-option-subtitle {\n color: ",";\n font-size: 11px;\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.subtextColorLT}));t.StyledFilteredOption=Ne;var ze=(0,$.default)(Le)(Y||(Y=(0,Q.default)(["\n height: 100px;\n margin: 4px;\n padding: 6px 10px;\n width: 100px;\n"])));t.StyledType=ze;var Ue=$.default.div(W||(W=(0,Q.default)(["\n z-index: 1;\n"])));t.WidgetContainer=Ue;var He=$.default.div(q||(q=(0,Q.default)(["\n background-color: ",";\n padding: ",";\n position: relative;\n margin-top: ","px;\n"])),(function(e){return e.theme.bottomWidgetBgd}),(function(e){return"".concat(e.theme.bottomInnerPdVert,"px ").concat(e.theme.bottomInnerPdSide,"px")}),(function(e){return e.theme.bottomPanelGap}));t.BottomWidgetInner=He;var Ve=(0,$.default)(be).attrs({className:"map-control-button"})(X||(X=(0,Q.default)(["\n box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.16);\n height: 32px;\n width: 32px;\n padding: 0;\n border-radius: 0;\n background-color: ",";\n color: ",";\n border: ",";\n\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n border: ",";\n }\n svg {\n margin-right: 0;\n }\n"])),(function(e){return e.active?e.theme.floatingBtnBgdHover:e.theme.floatingBtnBgd}),(function(e){return e.active?e.theme.floatingBtnActColor:e.theme.floatingBtnColor}),(function(e){return e.active?e.theme.floatingBtnBorderHover:e.theme.floatingBtnBorder}),(function(e){return e.theme.floatingBtnBgdHover}),(function(e){return e.theme.floatingBtnActColor}),(function(e){return e.theme.floatingBtnBorderHover}));t.MapControlButton=Ve;var Ge=$.default.div(K||(K=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.StyledFilterContent=Ge;var Ye=$.default.div(Z||(Z=(0,Q.default)(["\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));t.TruncatedTitleText=Ye;var We=$.default.span.attrs({className:"checkbox-inner"})(J||(J=(0,Q.default)(["\n background-color: ",";\n position: absolute;\n top: 0;\n right: 0;\n display: block;\n width: 10px;\n height: 10px;\n border-top-left-radius: 2px;\n\n :after {\n position: absolute;\n display: table;\n border: 1px solid #fff;\n border-top: 0;\n border-left: 0;\n transform: rotate(45deg) scale(1) translate(-50%, -50%);\n opacity: 1;\n content: ' ';\n top: 40%;\n left: 30%;\n width: 3.2px;\n height: 6.22px;\n }\n"])),(function(e){return e.theme.selectionBtnBorderActColor}));t.CheckMark=We},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CheckMark=t.TruncatedTitleText=t.StyledFilterContent=t.MapControlButton=t.BottomWidgetInner=t.WidgetContainer=t.StyledType=t.StyledFilteredOption=t.StyledExportSection=t.StyledAttrbution=t.StyledMapContainer=t.StyledModalInputFootnote=t.StyledModalSection=t.StyledModalVerticalPanel=t.StyledModalContent=t.Table=t.SelectionButton=t.DatasetSquare=t.ButtonGroup=t.StyledPanelDropdown=t.StyledPanelHeader=t.InlineInput=t.TextAreaLight=t.TextArea=t.InputLight=t.Input=t.Button=t.Tooltip=t.SidePanelDivider=t.SidePanelSection=t.PanelContent=t.PanelHeaderContent=t.PanelHeaderTitle=t.PanelLabelBold=t.PanelLabelWrapper=t.PanelLabel=t.SBFlexboxNoMargin=t.SBFlexboxItem=t.SpaceBetweenFlexbox=t.CenterVerticalFlexbox=t.CenterFlexbox=t.IconRoundSmall=t.SelectTextBold=t.SelectText=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g,y,v,A,b,_,E,x,M,w,O,S,T,C,L,P,R,D,k,I,F,j,B,N,z,U,H,V,G,Y,W,q,X,K,Z,J,Q=r(n(12)),$=r(n(11)),ee=r(n(1169)),te=n(227),ne=r(n(36)),re=$.default.span(a||(a=(0,Q.default)(["\n color: ",";\n font-size: ",";\n font-weight: 400;\n\n i {\n font-size: 13px;\n margin-right: 6px;\n }\n"])),(function(e){return e.theme.labelColor}),(function(e){return e.theme.selectFontSize}));t.SelectText=re;var ae=(0,$.default)(re)(o||(o=(0,Q.default)(["\n color: ",";\n font-weight: 500;\n"])),(function(e){return e.theme.textColor}));t.SelectTextBold=ae;var oe=$.default.div(i||(i=(0,Q.default)(["\n display: flex;\n width: 18px;\n height: 18px;\n border-radius: 9px;\n background-color: ",";\n color: ",";\n align-items: center;\n justify-content: center;\n\n :hover {\n cursor: pointer;\n background-color: ",";\n }\n"])),(function(e){return e.theme.secondaryBtnBgdHover}),(function(e){return e.theme.secondaryBtnColor}),(function(e){return e.theme.secondaryBtnBgdHover}));t.IconRoundSmall=oe;var ie=$.default.div(s||(s=(0,Q.default)(["\n display: flex;\n align-items: center;\n"])));t.CenterFlexbox=ie;var se=$.default.div(l||(l=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"])));t.CenterVerticalFlexbox=se;var le=$.default.div(u||(u=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n margin-left: -16px;\n"])));t.SpaceBetweenFlexbox=le;var ue=$.default.div(c||(c=(0,Q.default)(["\n flex-grow: 1;\n margin-left: 16px;\n"])));t.SBFlexboxItem=ue;var ce=$.default.div(d||(d=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n"])));t.SBFlexboxNoMargin=ce;var de=$.default.label.attrs({className:"side-panel-panel__label"})(f||(f=(0,Q.default)(["\n color: ",";\n display: inline-block;\n font-size: 11px;\n font-weight: 400;\n margin-bottom: 4px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.labelColor}));t.PanelLabel=de;var fe=$.default.div.attrs({className:"side-panel-panel__label-wrapper"})(p||(p=(0,Q.default)(["\n display: flex;\n align-items: self-start;\n"])));t.PanelLabelWrapper=fe;var pe=(0,$.default)(de)(h||(h=(0,Q.default)(["\n font-weight: 500;\n"])));t.PanelLabelBold=pe;var he=$.default.span.attrs({className:"side-panel-panel__header__title"})(m||(m=(0,Q.default)(["\n color: ",";\n font-size: 13px;\n letter-spacing: 0.43px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.textColor}));t.PanelHeaderTitle=he;var me=$.default.div(g||(g=(0,Q.default)(["\n display: flex;\n align-items: center;\n color: ",";\n padding-left: 12px;\n\n .icon {\n color: ",";\n display: flex;\n align-items: center;\n margin-right: 12px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.labelColor}));t.PanelHeaderContent=me;var ge=$.default.div.attrs({className:"side-panel-panel__content"})(y||(y=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.PanelContent=ge;var ye=$.default.div.attrs({className:"side-panel-section"})(v||(v=(0,Q.default)(["\n margin-bottom: 12px;\n\n opacity: ",";\n pointer-events: ",";\n"])),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}));t.SidePanelSection=ye;var ve=$.default.div.attrs({className:"side-panel-divider"})(A||(A=(0,Q.default)(["\n border-bottom: "," solid\n ",";\n margin-bottom: ","px;\n height: ","px;\n"])),(function(e){return e.theme.sidepanelDividerBorder}),(function(e){return e.theme.panelBorderColor}),(function(e){return e.theme.sidepanelDividerMargin}),(function(e){return e.theme.sidepanelDividerHeight}));t.SidePanelDivider=ve;var Ae=(0,$.default)(ee.default)(b||(b=(0,Q.default)(["\n &.__react_component_tooltip {\n font-size: ",";\n font-weight: 400;\n padding: 7px 18px;\n box-shadow: ",";\n\n &.type-dark {\n background-color: ",";\n color: ",";\n &.place-bottom {\n :after {\n border-bottom-color: ",";\n }\n }\n\n &.place-top {\n :after {\n border-top-color: ",";\n }\n }\n\n &.place-right {\n :after {\n border-right-color: ",";\n }\n }\n\n &.place-left {\n :after {\n border-left-color: ",";\n }\n }\n }\n }\n"])),(function(e){return e.theme.tooltipFontSize}),(function(e){return e.theme.tooltipBoxShadow}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipColor}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}));t.Tooltip=Ae;var be=$.default.div.attrs((function(e){return{className:(0,ne.default)("button",e.className)}}))(_||(_=(0,Q.default)(["\n align-items: center;\n background-color: ",";\n border-radius: ",";\n color: ",";\n cursor: pointer;\n display: inline-flex;\n font-size: ",";\n font-weight: 500;\n font-family: ",";\n justify-content: center;\n letter-spacing: 0.3px;\n line-height: 14px;\n outline: 0;\n padding: ",";\n text-align: center;\n transition: ",";\n vertical-align: middle;\n width: ",";\n opacity: ",";\n pointer-events: ",";\n border: ",";\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n }\n\n svg {\n margin-right: ",";\n }\n"])),(function(e){return e.negative?e.theme.negativeBtnBgd:e.secondary?e.theme.secondaryBtnBgd:e.link?e.theme.linkBtnBgd:e.floating?e.theme.floatingBtnBgd:e.cta?e.theme.ctaBtnBgd:e.theme.primaryBtnBgd}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.negative?e.theme.negativeBtnColor:e.secondary?e.theme.secondaryBtnColor:e.link?e.theme.linkBtnColor:e.floating?e.theme.floatingBtnColor:e.cta?e.theme.ctaBtnColor:e.theme.primaryBtnColor}),(function(e){return e.large?e.theme.primaryBtnFontSizeLarge:e.small?e.theme.primaryBtnFontSizeSmall:e.theme.primaryBtnFontSizeDefault}),(function(e){return e.theme.btnFontFamily}),(function(e){return e.large?"14px 32px":e.small?"6px 9px":"9px 12px"}),(function(e){return e.theme.transition}),(function(e){return e.width||"auto"}),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.negative?e.theme.negativeBtnBorder:e.secondary?e.theme.secondaryBtnBorder:e.floating?e.theme.floatingBtnBorder:e.link?e.theme.linkBtnBorder:e.theme.primaryBtnBorder}),(function(e){return e.negative?e.theme.negativeBtnBgdHover:e.secondary?e.theme.secondaryBtnBgdHover:e.link?e.theme.linkBtnActBgdHover:e.floating?e.theme.floatingBtnBgdHover:e.cta?e.theme.ctaBtnBgdHover:e.theme.primaryBtnBgdHover}),(function(e){return e.negative?e.theme.negativeBtnActColor:e.secondary?e.theme.secondaryBtnActColor:e.link?e.theme.linkBtnActColor:e.floating?e.theme.floatingBtnActColor:e.cta?e.theme.ctaBtnActColor:e.theme.primaryBtnActColor}),(function(e){return e.large?"10px":e.small?"6px":"8px"}));t.Button=be;var _e=$.default.input(E||(E=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.Input=_e;var Ee=$.default.input(x||(x=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inputLT}));t.InputLight=Ee;var xe=$.default.textarea(M||(M=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.TextArea=xe;var Me=$.default.textarea(w||(w=(0,Q.default)(["\n "," height: auto;\n white-space: pre-wrap;\n"])),(function(e){return e.theme.inputLT}));t.TextAreaLight=Me;var we=(0,$.default)(_e)(O||(O=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inlineInput}));t.InlineInput=we;var Oe=$.default.div(S||(S=(0,Q.default)(["\n background-color: ",";\n border-left: 3px solid\n rgb(\n ","\n );\n padding: 0 10px 0 0;\n height: ","px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: ",";\n transition: ",";\n"])),(function(e){return e.active?e.theme.panelBackgroundHover:e.theme.panelBackground}),(function(e){return e.labelRCGColorValues?e.labelRCGColorValues.join(","):"transparent"}),(function(e){return e.theme.panelHeaderHeight}),(function(e){return e.theme.panelHeaderBorderRadius}),(function(e){return e.theme.transition}));t.StyledPanelHeader=Oe;var Se=$.default.div(T||(T=(0,Q.default)(["\n ","\n background-color: ",";\n overflow-y: auto;\n box-shadow: ",";\n border-radius: ",";\n max-height: 500px;\n position: relative;\n z-index: 999;\n"])),(function(e){return e.theme.panelDropdownScrollBar}),(function(e){return"light"===e.type?e.theme.modalDropdownBackground:e.theme.panelBackground}),(function(e){return e.theme.panelBoxShadow}),(function(e){return e.theme.panelBorderRadius}));t.StyledPanelDropdown=Se;var Te=$.default.div(C||(C=(0,Q.default)(["\n display: flex;\n .button {\n border-radius: 0;\n margin-left: 2px;\n }\n .button:first-child {\n border-bottom-left-radius: ",";\n border-top-left-radius: ",";\n margin-left: 0;\n }\n .button:last-child {\n border-bottom-right-radius: ",";\n border-top-right-radius: ",";\n }\n"])),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}));t.ButtonGroup=Te;var Ce=$.default.div(L||(L=(0,Q.default)(["\n display: inline-block;\n width: 8px;\n height: 8px;\n background-color: rgb(",");\n margin-right: 12px;\n"])),(function(e){return e.color.join(",")}));t.DatasetSquare=Ce;var Le=$.default.div(P||(P=(0,Q.default)(["\n position: relative;\n border-radius: 2px;\n border: 1px solid\n ",";\n color: ",";\n background-color: ",";\n\n cursor: pointer;\n font-weight: 500;\n margin-right: 6px;\n padding: 6px 16px;\n\n :hover {\n color: ",";\n border: 1px solid ",";\n }\n"])),(function(e){return e.selected?e.theme.selectionBtnBorderActColor:e.theme.selectionBtnBorderColor}),(function(e){return e.selected?e.theme.selectionBtnActColor:e.theme.selectionBtnColor}),(function(e){return e.selected?e.theme.selectionBtnActBgd:e.theme.selectionBtnBgd}),(function(e){return e.theme.selectionBtnActColor}),(function(e){return e.theme.selectionBtnBorderActColor}));t.SelectionButton=Le;var Pe=$.default.table(R||(R=(0,Q.default)(["\n width: 100%;\n border-spacing: 0;\n\n thead {\n tr th {\n background: ",";\n color: ",";\n padding: 18px 12px;\n text-align: start;\n }\n }\n\n tbody {\n tr td {\n border-bottom: ",";\n padding: 12px;\n }\n }\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.titleColorLT}),(function(e){return e.theme.panelBorderLT}));t.Table=Pe;var Re=$.default.div(D||(D=(0,Q.default)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction: row;\n font-size: 10px;\n padding: 24px ",";\n margin: 0 -",";\n justify-content: space-between;\n ",";\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.modalLateralPadding}),(function(e){return e.theme.modalLateralPadding}),te.media.portable(k||(k=(0,Q.default)(["\n flex-direction: column;\n padding: 16px ",";\n margin: 0 -",";\n "])),(function(e){return e.theme.modalPortableLateralPadding}),(function(e){return e.theme.modalPortableLateralPadding})));t.StyledModalContent=Re;var De=$.default.div.attrs({className:"modal-vertical-panel"})(I||(I=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n font-size: 12px;\n\n .modal-section:first-child {\n margin-top: 24px;\n ",";\n }\n\n input {\n margin-right: 8px;\n }\n"])),te.media.palm(F||(F=(0,Q.default)(["\n margin-top: 0;\n "]))));t.StyledModalVerticalPanel=De;var ke=$.default.div.attrs({className:"modal-section"})(j||(j=(0,Q.default)(["\n margin-bottom: 32px;\n\n .modal-section-title {\n font-weight: 500;\n }\n .modal-section-subtitle {\n color: ",";\n }\n\n input {\n margin-top: 8px;\n }\n\n ",";\n ",";\n"])),(function(e){return e.theme.subtextColorLT}),te.media.portable(B||(B=(0,Q.default)(["\n margin-bottom: 24px;\n "]))),te.media.palm(N||(N=(0,Q.default)(["\n margin-bottom: 16px;\n "]))));t.StyledModalSection=ke;var Ie=$.default.div.attrs({className:"modal-input__footnote"})(z||(z=(0,Q.default)(["\n display: flex;\n justify-content: flex-end;\n color: ",";\n font-size: 10px;\n"])),(function(e){return e.error?e.theme.errorColor:e.theme.subtextColorLT}));t.StyledModalInputFootnote=Ie;var Fe=$.default.div(U||(U=(0,Q.default)(["\n width: 100%;\n height: 100%;\n .mapboxgl-map {\n .mapboxgl-missing-css {\n display: none;\n }\n .mapboxgl-ctrl-attrib {\n display: none;\n }\n }\n"])));t.StyledMapContainer=Fe;var je=$.default.div.attrs({className:"mapbox-attribution-container"})(H||(H=(0,Q.default)(["\n bottom: 0;\n right: 0;\n position: absolute;\n display: block;\n margin: 0 10px 2px;\n z-index: 0;\n\n .attrition-logo {\n display: flex;\n font-size: 10px;\n justify-content: flex-end;\n align-items: center;\n color: ",";\n margin-bottom: -4px;\n\n a.mapboxgl-ctrl-logo {\n width: 72px;\n margin-left: 6px;\n }\n }\n a {\n font-size: 10px;\n }\n"])),(function(e){return e.theme.labelColor}));t.StyledAttrbution=je;var Be=$.default.div(V||(V=(0,Q.default)(["\n display: flex;\n flex-direction: row;\n margin: 35px 0;\n width: 100%;\n color: ",";\n font-size: 12px;\n opacity: ",";\n pointer-events: ",";\n\n .description {\n width: 185px;\n .title {\n font-weight: 500;\n }\n .subtitle {\n color: ",";\n font-size: 11px;\n }\n }\n .warning {\n color: ",";\n font-weight: 500;\n }\n .description.full {\n width: 100%;\n }\n .selection {\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n padding-left: 50px;\n\n select {\n background-color: white;\n border-radius: 1px;\n display: inline-block;\n font: inherit;\n line-height: 1.5em;\n padding: 0.5em 3.5em 0.5em 1em;\n margin: 0;\n box-sizing: border-box;\n appearance: none;\n width: 250px;\n height: 36px;\n\n background-image: linear-gradient(45deg, transparent 50%, gray 50%),\n linear-gradient(135deg, gray 50%, transparent 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px),\n calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n }\n\n select:focus {\n background-image: linear-gradient(45deg, green 50%, transparent 50%),\n linear-gradient(135deg, transparent 50%, green 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 15px) 1em, calc(100% - 20px) 1em, calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n border-color: green;\n outline: 0;\n }\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.disabled?.3:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.theme.subtextColorLT}),(function(e){return e.theme.errorColor}));t.StyledExportSection=Be;var Ne=(0,$.default)(Le)(G||(G=(0,Q.default)(["\n align-items: center;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin: 4px;\n padding: 8px 12px;\n width: 140px;\n\n .filter-option-title {\n color: ",";\n font-size: 12px;\n font-weight: 500;\n }\n .filter-option-subtitle {\n color: ",";\n font-size: 11px;\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.subtextColorLT}));t.StyledFilteredOption=Ne;var ze=(0,$.default)(Le)(Y||(Y=(0,Q.default)(["\n height: 100px;\n margin: 4px;\n padding: 6px 10px;\n width: 100px;\n"])));t.StyledType=ze;var Ue=$.default.div(W||(W=(0,Q.default)(["\n z-index: 1;\n"])));t.WidgetContainer=Ue;var He=$.default.div(q||(q=(0,Q.default)(["\n background-color: ",";\n padding: ",";\n position: relative;\n margin-top: ","px;\n"])),(function(e){return e.theme.bottomWidgetBgd}),(function(e){return"".concat(e.theme.bottomInnerPdVert,"px ").concat(e.theme.bottomInnerPdSide,"px")}),(function(e){return e.theme.bottomPanelGap}));t.BottomWidgetInner=He;var Ve=(0,$.default)(be).attrs({className:"map-control-button"})(X||(X=(0,Q.default)(["\n box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.16);\n height: 32px;\n width: 32px;\n padding: 0;\n border-radius: 0;\n background-color: ",";\n color: ",";\n border: ",";\n\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n border: ",";\n }\n svg {\n margin-right: 0;\n }\n"])),(function(e){return e.active?e.theme.floatingBtnBgdHover:e.theme.floatingBtnBgd}),(function(e){return e.active?e.theme.floatingBtnActColor:e.theme.floatingBtnColor}),(function(e){return e.active?e.theme.floatingBtnBorderHover:e.theme.floatingBtnBorder}),(function(e){return e.theme.floatingBtnBgdHover}),(function(e){return e.theme.floatingBtnActColor}),(function(e){return e.theme.floatingBtnBorderHover}));t.MapControlButton=Ve;var Ge=$.default.div(K||(K=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.StyledFilterContent=Ge;var Ye=$.default.div(Z||(Z=(0,Q.default)(["\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));t.TruncatedTitleText=Ye;var We=$.default.span.attrs({className:"checkbox-inner"})(J||(J=(0,Q.default)(["\n background-color: ",";\n position: absolute;\n top: 0;\n right: 0;\n display: block;\n width: 10px;\n height: 10px;\n border-top-left-radius: 2px;\n\n :after {\n position: absolute;\n display: table;\n border: 1px solid #fff;\n border-top: 0;\n border-left: 0;\n transform: rotate(45deg) scale(1) translate(-50%, -50%);\n opacity: 1;\n content: ' ';\n top: 40%;\n left: 30%;\n width: 3.2px;\n height: 6.22px;\n }\n"])),(function(e){return e.theme.selectionBtnBorderActColor}));t.CheckMark=We},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.MASK_LAYER_ID=t.MAP_CONTROLS=t.DATASET_FORMATS=t.LOADING_METHODS=t.MAP_INFO_CHARACTER=t.MAP_THUMBNAIL_DIMENSION=t.MAX_GPU_FILTERS=t.EDITOR_AVAILABLE_LAYERS=t.EDITOR_MODES=t.GEOCODER_ICON_SIZE=t.GEOCODER_ICON_COLOR=t.GEOCODER_GEO_OFFSET=t.GEOCODER_LAYER_ID=t.GEOCODER_DATASET_NAME=t.SPEED_CONTROL_STEP=t.SPEED_CONTROL_RANGE=t.DEFAULT_TIME_FORMAT=t.ANIMATION_WINDOW=t.FPS=t.BASE_SPEED=t.THROTTLE_NOTIFICATION_TIME=t.DEFAULT_NOTIFICATION_TOPICS=t.DEFAULT_NOTIFICATION_TYPES=t.DEFAULT_NOTIFICATION_MESSAGE=t.DEFAULT_UUID_COUNT=t.EXPORT_HTML_MAP_MODE_OPTIONS=t.EXPORT_MAP_FORMAT_OPTIONS=t.EXPORT_HTML_MAP_MODES=t.EXPORT_MAP_FORMATS=t.EXPORT_DATA_TYPE_OPTIONS=t.EXPORT_DATA_TYPE=t.EXPORT_IMG_RESOLUTION_OPTIONS=t.EXPORT_IMG_RATIO_OPTIONS=t.EXPORT_IMG_RATIOS=t.RESOLUTIONS=t.MAX_DEFAULT_TOOLTIPS=t.LAYER_BLENDINGS=t.NO_VALUE_COLOR=t.DEFAULT_TOOLTIP_FIELDS=t.DEFAULT_LAYER_COLOR=t.CHANNEL_SCALE_SUPPORTED_FIELDS=t.FIELD_OPTS=t.DEFAULT_AGGREGATION=t.notSupportAggrOpts=t.notSupportedScaleOpts=t.ordinalFieldAggrScaleFunctions=t.ordinalFieldScaleFunctions=t.linearFieldAggrScaleFunctions=t.linearFieldScaleFunctions=t.AGGREGATION_TYPES=t.CHANNEL_SCALES=t.HIGHLIGH_COLOR_3D=t.FIELD_COLORS=t.FILED_TYPE_DISPLAY=t.TABLE_OPTION_LIST=t.TABLE_OPTION=t.SORT_ORDER=t.ALL_FIELD_TYPES=t.SCALE_FUNC=t.SCALE_TYPES=t.FILTER_TYPES=t.TRIP_ARC_FIELDS=t.TRIP_POINT_FIELDS=t.ICON_FIELDS=t.GEOJSON_FIELDS=t.DEFAULT_MAP_STYLES=t.DEFAULT_LAYER_GROUPS=t.PANELS=t.SIDEBAR_PANELS=t.THEME=t.DIMENSIONS=t.KEPLER_GL_WEBSITE=t.KEPLER_GL_VERSION=t.KEPLER_GL_NAME=t.SHARE_MAP_ID=t.OVERWRITE_MAP_ID=t.SAVE_MAP_ID=t.EXPORT_MAP_ID=t.ADD_MAP_STYLE_ID=t.EXPORT_DATA_ID=t.EXPORT_IMAGE_ID=t.ADD_DATA_ID=t.DELETE_DATA_ID=t.DATA_TABLE_ID=t.DEFAULT_MAPBOX_API_URL=t.ICON_PREFIX=t.CLOUDFRONT=t.ACTION_PREFIX=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g=r(n(3)),y=r(n(137)),v=n(191),A=n(133),b=n(44),_=n(69),E=n(310),x=n(259);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){(0,g.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.ACTION_PREFIX="@@kepler.gl/";var O="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl";t.CLOUDFRONT=O;var S="".concat(O,"/geodude");t.ICON_PREFIX=S;t.DEFAULT_MAPBOX_API_URL="https://api.mapbox.com";t.DATA_TABLE_ID="dataTable";t.DELETE_DATA_ID="deleteData";t.ADD_DATA_ID="addData";t.EXPORT_IMAGE_ID="exportImage";t.EXPORT_DATA_ID="exportData";t.ADD_MAP_STYLE_ID="addMapStyle";t.EXPORT_MAP_ID="exportMap";t.SAVE_MAP_ID="saveMap";t.OVERWRITE_MAP_ID="overwriteMap";t.SHARE_MAP_ID="shareMap";t.KEPLER_GL_NAME="kepler.gl";t.KEPLER_GL_VERSION="0.0.19";t.KEPLER_GL_WEBSITE="http://kepler.gl/";t.DIMENSIONS={sidePanel:{width:300,margin:{top:20,left:20,bottom:30,right:20},headerHeight:96},mapControl:{width:184,padding:12}};var T=(0,y.default)({light:null,dark:null,base:null});t.THEME=T;var C=[{id:"layer",label:"sidebar.panels.layer",iconComponent:b.Layers,onClick:null},{id:"filter",label:"sidebar.panels.filter",iconComponent:b.FilterFunnel,onClick:null},{id:"interaction",label:"sidebar.panels.interaction",iconComponent:b.CursorClick,onClick:null},{id:"map",label:"sidebar.panels.basemap",iconComponent:b.Settings,onClick:null}];t.SIDEBAR_PANELS=C;var L=C;t.PANELS=L;var P=[{slug:"label",filter:function(e){return e.id.match(/(?=(label|place-|poi-))/)},defaultVisibility:!0},{slug:"road",filter:function(e){return e.id.match(/(?=(road|railway|tunnel|street|bridge))(?!.*label)/)},defaultVisibility:!0},{slug:"border",filter:function(e){return e.id.match(/border|boundaries/)},defaultVisibility:!1},{slug:"building",filter:function(e){return e.id.match(/building/)},defaultVisibility:!0},{slug:"water",filter:function(e){return e.id.match(/(?=(water|stream|ferry))/)},defaultVisibility:!0},{slug:"land",filter:function(e){return e.id.match(/(?=(parks|landcover|industrial|sand|hillshade))/)},defaultVisibility:!0},{slug:"3d building",filter:function(){return!1},defaultVisibility:!1}];t.DEFAULT_LAYER_GROUPS=P;var R=[{id:"dark",label:"Dark",url:"mapbox://styles/uberdata/cjoqbbf6l9k302sl96tyvka09",icon:"".concat(S,"/UBER_DARK_V2.png"),layerGroups:P},{id:"light",label:"Light",url:"mapbox://styles/uberdata/cjoqb9j339k1f2sl9t5ic5bn4",icon:"".concat(S,"/UBER_LIGHT_V2.png"),layerGroups:P},{id:"muted",label:"Muted Light",url:"mapbox://styles/uberdata/cjfyl03kp1tul2smf5v2tbdd4",icon:"".concat(S,"/UBER_MUTED_LIGHT.png"),layerGroups:P},{id:"muted_night",label:"Muted Night",url:"mapbox://styles/uberdata/cjfxhlikmaj1b2soyzevnywgs",icon:"".concat(S,"/UBER_MUTED_NIGHT.png"),layerGroups:P},{id:"satellite",label:"Satellite",url:"mapbox://styles/mapbox/satellite-v9",icon:"".concat(S,"/UBER_SATELLITE.png")}];t.DEFAULT_MAP_STYLES=R;t.GEOJSON_FIELDS={geojson:["_geojson","all_points","geojson"]};t.ICON_FIELDS={icon:["icon"]};t.TRIP_POINT_FIELDS=[["lat","lng"],["lat","lon"],["latitude","longitude"]];t.TRIP_ARC_FIELDS={lat0:"begintrip",lng0:"begintrip",lat1:"dropoff",lng1:"dropoff"};var D=(0,y.default)({range:null,select:null,input:null,timeRange:null,multiSelect:null,polygon:null});t.FILTER_TYPES=D;var k=(0,y.default)({ordinal:null,quantile:null,quantize:null,linear:null,sqrt:null,log:null,point:null});t.SCALE_TYPES=k;var I=(a={},(0,g.default)(a,k.linear,A.scaleLinear),(0,g.default)(a,k.quantize,A.scaleQuantize),(0,g.default)(a,k.quantile,A.scaleQuantile),(0,g.default)(a,k.ordinal,A.scaleOrdinal),(0,g.default)(a,k.sqrt,A.scaleSqrt),(0,g.default)(a,k.log,A.scaleLog),(0,g.default)(a,k.point,A.scalePoint),a);t.SCALE_FUNC=I;var F=(0,y.default)({boolean:null,date:null,geojson:null,integer:null,real:null,string:null,timestamp:null,point:null});t.ALL_FIELD_TYPES=F;var j=(0,y.default)({ASCENDING:null,DESCENDING:null,UNSORT:null});t.SORT_ORDER=j;var B=(0,y.default)({SORT_ASC:null,SORT_DES:null,UNSORT:null,PIN:null,UNPIN:null,COPY:null});t.TABLE_OPTION=B;var N=[{value:B.SORT_ASC,display:"Sort Ascending",icon:b.ArrowUp,condition:function(e){return e.sortMode!==j.ASCENDING}},{value:B.SORT_DES,display:"Sort Descending",icon:b.ArrowDown,condition:function(e){return e.sortMode!==j.DESCENDING}},{value:B.UNSORT,display:"Unsort Column",icon:b.Cancel,condition:function(e){return e.isSorted}},{value:B.PIN,display:"Pin Column",icon:b.Pin,condition:function(e){return!e.isPinned}},{value:B.UNPIN,display:"Unpin Column",icon:b.Cancel,condition:function(e){return e.isPinned}},{value:B.COPY,display:"Copy Column",icon:b.Clipboard}];t.TABLE_OPTION_LIST=N;var z=(o={},(0,g.default)(o,F.boolean,{label:"bool",color:"231, 189, 194"}),(0,g.default)(o,F.date,{label:"date",color:"160, 106, 206"}),(0,g.default)(o,F.geojson,{label:"geo",color:"106, 160, 206"}),(0,g.default)(o,F.integer,{label:"int",color:"248, 194, 28"}),(0,g.default)(o,F.real,{label:"float",color:"248, 194, 28"}),(0,g.default)(o,F.string,{label:"string",color:"140, 210, 205"}),(0,g.default)(o,F.timestamp,{label:"time",color:"106, 160, 56"}),(0,g.default)(o,F.point,{label:"point",color:"0, 172, 237"}),o);t.FILED_TYPE_DISPLAY=z;var U={default:"237, 88, 106"};t.FIELD_COLORS=U;t.HIGHLIGH_COLOR_3D=[255,255,255,60];var H=(0,y.default)({color:null,radius:null,size:null,colorAggr:null,sizeAggr:null});t.CHANNEL_SCALES=H;var V={count:"count",average:"average",maximum:"maximum",minimum:"minimum",median:"median",stdev:"stdev",sum:"sum",variance:"variance",mode:"mode",countUnique:"count unique"};t.AGGREGATION_TYPES=V;var G=(i={},(0,g.default)(i,H.color,[k.quantize,k.quantile]),(0,g.default)(i,H.radius,[k.sqrt]),(0,g.default)(i,H.size,[k.linear,k.sqrt,k.log]),i);t.linearFieldScaleFunctions=G;var Y=(u={},(0,g.default)(u,H.colorAggr,(s={},(0,g.default)(s,V.average,[k.quantize,k.quantile]),(0,g.default)(s,V.maximum,[k.quantize,k.quantile]),(0,g.default)(s,V.minimum,[k.quantize,k.quantile]),(0,g.default)(s,V.median,[k.quantize,k.quantile]),(0,g.default)(s,V.stdev,[k.quantize,k.quantile]),(0,g.default)(s,V.sum,[k.quantize,k.quantile]),(0,g.default)(s,V.variance,[k.quantize,k.quantile]),s)),(0,g.default)(u,H.sizeAggr,(l={},(0,g.default)(l,V.average,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.maximum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.minimum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.median,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.stdev,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.sum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.variance,[k.linear,k.sqrt,k.log]),l)),u);t.linearFieldAggrScaleFunctions=Y;var W=(c={},(0,g.default)(c,H.color,[k.ordinal]),(0,g.default)(c,H.radius,[k.point]),(0,g.default)(c,H.size,[k.point]),c);t.ordinalFieldScaleFunctions=W;var q=(f={},(0,g.default)(f,H.colorAggr,(d={},(0,g.default)(d,V.mode,[k.ordinal]),(0,g.default)(d,V.countUnique,[k.quantize,k.quantile]),d)),(0,g.default)(f,H.sizeAggr,{}),f);t.ordinalFieldAggrScaleFunctions=q;var X=(p={},(0,g.default)(p,H.color,[]),(0,g.default)(p,H.radius,[]),(0,g.default)(p,H.size,[]),p);t.notSupportedScaleOpts=X;var K=(h={},(0,g.default)(h,H.colorAggr,{}),(0,g.default)(h,H.sizeAggr,{}),h);t.notSupportAggrOpts=K;var Z=(m={},(0,g.default)(m,H.colorAggr,(0,g.default)({},V.count,[k.quantize,k.quantile])),(0,g.default)(m,H.sizeAggr,(0,g.default)({},V.count,[k.linear,k.sqrt,k.log])),m);t.DEFAULT_AGGREGATION=Z;var J={string:{type:"categorical",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[]}},real:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},timestamp:{type:"time",scale:w(w({},G),K),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE,E.TOOLTIP_FORMAT_TYPES.DATE_TIME]}},integer:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},boolean:{type:"boolean",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.BOOLEAN]}},date:{scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE]}},geojson:{type:"geometry",scale:w(w({},X),K),format:{legend:function(e){return"..."},tooltip:[]}}};t.FIELD_OPTS=J;var Q=Object.keys(H).reduce((function(e,t){return w(w({},e),{},(0,g.default)({},t,Object.keys(J).filter((function(e){return Object.keys(J[e].scale[t]).length}))))}),{});t.CHANNEL_SCALE_SUPPORTED_FIELDS=Q;t.DEFAULT_LAYER_COLOR={tripArc:"#9226C6",begintrip_lat:"#1E96BE",dropoff_lat:"#FF991F",request_lat:"#52A353"};t.DEFAULT_TOOLTIP_FIELDS=[];t.NO_VALUE_COLOR=[0,0,0,0];t.LAYER_BLENDINGS={additive:{label:"layerBlending.additive",blendFunc:["SRC_ALPHA","DST_ALPHA"],blendEquation:"FUNC_ADD"},normal:{label:"layerBlending.normal",blendFunc:["SRC_ALPHA","ONE_MINUS_SRC_ALPHA","ONE","ONE_MINUS_SRC_ALPHA"],blendEquation:["FUNC_ADD","FUNC_ADD"]},subtractive:{label:"layerBlending.subtractive",blendFunc:["ONE","ONE_MINUS_DST_COLOR","SRC_ALPHA","DST_ALPHA"],blendEquation:["FUNC_SUBTRACT","FUNC_ADD"]}};t.MAX_DEFAULT_TOOLTIPS=5;var $=(0,y.default)({ONE_X:null,TWO_X:null});t.RESOLUTIONS=$;var ee=(0,y.default)({SCREEN:null,FOUR_BY_THREE:null,SIXTEEN_BY_NINE:null,CUSTOM:null});t.EXPORT_IMG_RATIOS=ee;var te=[{id:ee.SCREEN,label:"modal.exportImage.ratioOriginalScreen",getSize:function(e,t){return{width:e,height:t}}},{id:ee.CUSTOM,hidden:!0,label:"modal.exportImage.ratioCustom",getSize:function(e,t){return{width:e,height:t}}},{id:ee.FOUR_BY_THREE,label:"modal.exportImage.ratio4_3",getSize:function(e,t){return{width:e,height:Math.round(.75*e)}}},{id:ee.SIXTEEN_BY_NINE,label:"modal.exportImage.ratio16_9",getSize:function(e,t){return{width:e,height:Math.round(.5625*e)}}}];t.EXPORT_IMG_RATIO_OPTIONS=te;var ne=[{id:$.ONE_X,label:"1x",available:!0,scale:1,getSize:function(e,t){return{width:e,height:t}}},{id:$.TWO_X,label:"2x",available:!0,scale:2,getSize:function(e,t){return{width:2*e,height:2*t}}}];t.EXPORT_IMG_RESOLUTION_OPTIONS=ne;var re=(0,y.default)({CSV:null});t.EXPORT_DATA_TYPE=re;var ae=[{id:re.CSV,label:re.CSV.toLowerCase(),available:!0}];t.EXPORT_DATA_TYPE_OPTIONS=ae;var oe=(0,y.default)({HTML:null,JSON:null});t.EXPORT_MAP_FORMATS=oe;var ie=(0,y.default)({READ:null,EDIT:null});t.EXPORT_HTML_MAP_MODES=ie;var se=Object.entries(oe).map((function(e){return{id:e[0],label:e[1].toLowerCase(),available:!0}}));t.EXPORT_MAP_FORMAT_OPTIONS=se;var le=Object.entries(ie).map((function(e){return{id:e[0],label:"modal.exportMap.html.".concat(e[1].toLowerCase()),available:!0,url:(0,_.getHTMLMapModeTileUrl)(e[1])}}));t.EXPORT_HTML_MAP_MODE_OPTIONS=le;t.DEFAULT_UUID_COUNT=6;t.DEFAULT_NOTIFICATION_MESSAGE="MESSAGE_NOT_PROVIDED";var ue=(0,y.default)({info:null,error:null,warning:null,success:null});t.DEFAULT_NOTIFICATION_TYPES=ue;var ce=(0,y.default)({global:null,file:null});t.DEFAULT_NOTIFICATION_TOPICS=ce;t.THROTTLE_NOTIFICATION_TIME=2500;t.BASE_SPEED=600;t.FPS=60;var de=(0,y.default)({free:null,incremental:null,point:null,interval:null});t.ANIMATION_WINDOW=de;t.DEFAULT_TIME_FORMAT="MM/DD/YY HH:mm:ssa";t.SPEED_CONTROL_RANGE=[0,10];t.SPEED_CONTROL_STEP=.001;t.GEOCODER_DATASET_NAME="geocoder_dataset";t.GEOCODER_LAYER_ID="geocoder_layer";t.GEOCODER_GEO_OFFSET=.05;t.GEOCODER_ICON_COLOR=[255,0,0];t.GEOCODER_ICON_SIZE=80;var fe={READ_ONLY:v.EditorModes.READ_ONLY,DRAW_POLYGON:v.EditorModes.DRAW_POLYGON,DRAW_RECTANGLE:v.EditorModes.DRAW_RECTANGLE,EDIT:v.EditorModes.EDIT_VERTEX};t.EDITOR_MODES=fe;var pe=[x.LAYER_TYPES.point,x.LAYER_TYPES.hexagon,x.LAYER_TYPES.arc,x.LAYER_TYPES.line,x.LAYER_TYPES.hexagonId];t.EDITOR_AVAILABLE_LAYERS=pe;t.MAX_GPU_FILTERS=4;t.MAP_THUMBNAIL_DIMENSION={width:300,height:200};t.MAP_INFO_CHARACTER={title:100,description:100};var he=(0,y.default)({upload:null,storage:null});t.LOADING_METHODS=he;var me=(0,y.default)({row:null,geojson:null,csv:null,keplergl:null});t.DATASET_FORMATS=me;var ge=(0,y.default)({visibleLayers:null,mapLegend:null,toggle3d:null,splitMap:null,mapDraw:null,mapLocale:null});t.MAP_CONTROLS=ge;t.MASK_LAYER_ID="mask_layer"},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.MASK_LAYER_ID=t.MAP_CONTROLS=t.DATASET_FORMATS=t.LOADING_METHODS=t.MAP_INFO_CHARACTER=t.MAP_THUMBNAIL_DIMENSION=t.MAX_GPU_FILTERS=t.EDITOR_AVAILABLE_LAYERS=t.EDITOR_MODES=t.GEOCODER_ICON_SIZE=t.GEOCODER_ICON_COLOR=t.GEOCODER_GEO_OFFSET=t.GEOCODER_LAYER_ID=t.GEOCODER_DATASET_NAME=t.SPEED_CONTROL_STEP=t.SPEED_CONTROL_RANGE=t.DEFAULT_TIME_FORMAT=t.ANIMATION_WINDOW=t.FPS=t.BASE_SPEED=t.THROTTLE_NOTIFICATION_TIME=t.DEFAULT_NOTIFICATION_TOPICS=t.DEFAULT_NOTIFICATION_TYPES=t.DEFAULT_NOTIFICATION_MESSAGE=t.DEFAULT_UUID_COUNT=t.EXPORT_HTML_MAP_MODE_OPTIONS=t.EXPORT_MAP_FORMAT_OPTIONS=t.EXPORT_HTML_MAP_MODES=t.EXPORT_MAP_FORMATS=t.EXPORT_DATA_TYPE_OPTIONS=t.EXPORT_DATA_TYPE=t.EXPORT_IMG_RESOLUTION_OPTIONS=t.EXPORT_IMG_RATIO_OPTIONS=t.EXPORT_IMG_RATIOS=t.RESOLUTIONS=t.MAX_DEFAULT_TOOLTIPS=t.LAYER_BLENDINGS=t.NO_VALUE_COLOR=t.DEFAULT_TOOLTIP_FIELDS=t.DEFAULT_LAYER_COLOR=t.CHANNEL_SCALE_SUPPORTED_FIELDS=t.FIELD_OPTS=t.DEFAULT_AGGREGATION=t.notSupportAggrOpts=t.notSupportedScaleOpts=t.ordinalFieldAggrScaleFunctions=t.ordinalFieldScaleFunctions=t.linearFieldAggrScaleFunctions=t.linearFieldScaleFunctions=t.AGGREGATION_TYPES=t.CHANNEL_SCALES=t.HIGHLIGH_COLOR_3D=t.FIELD_COLORS=t.FILED_TYPE_DISPLAY=t.TABLE_OPTION_LIST=t.TABLE_OPTION=t.SORT_ORDER=t.ALL_FIELD_TYPES=t.SCALE_FUNC=t.SCALE_TYPES=t.FILTER_TYPES=t.TRIP_ARC_FIELDS=t.TRIP_POINT_FIELDS=t.ICON_FIELDS=t.GEOJSON_FIELDS=t.DEFAULT_MAP_STYLES=t.DEFAULT_LAYER_GROUPS=t.PANELS=t.SIDEBAR_PANELS=t.THEME=t.DIMENSIONS=t.KEPLER_GL_WEBSITE=t.KEPLER_GL_VERSION=t.KEPLER_GL_NAME=t.SHARE_MAP_ID=t.OVERWRITE_MAP_ID=t.SAVE_MAP_ID=t.EXPORT_MAP_ID=t.ADD_MAP_STYLE_ID=t.EXPORT_DATA_ID=t.EXPORT_IMAGE_ID=t.ADD_DATA_ID=t.DELETE_DATA_ID=t.DATA_TABLE_ID=t.DEFAULT_MAPBOX_API_URL=t.ICON_PREFIX=t.CLOUDFRONT=t.ACTION_PREFIX=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g=r(n(3)),y=r(n(137)),v=n(191),A=n(133),b=n(45),_=n(70),E=n(323),x=n(271);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){(0,g.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.ACTION_PREFIX="@@kepler.gl/";var O="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl";t.CLOUDFRONT=O;var S="".concat(O,"/geodude");t.ICON_PREFIX=S;t.DEFAULT_MAPBOX_API_URL="https://api.mapbox.com";t.DATA_TABLE_ID="dataTable";t.DELETE_DATA_ID="deleteData";t.ADD_DATA_ID="addData";t.EXPORT_IMAGE_ID="exportImage";t.EXPORT_DATA_ID="exportData";t.ADD_MAP_STYLE_ID="addMapStyle";t.EXPORT_MAP_ID="exportMap";t.SAVE_MAP_ID="saveMap";t.OVERWRITE_MAP_ID="overwriteMap";t.SHARE_MAP_ID="shareMap";t.KEPLER_GL_NAME="kepler.gl";t.KEPLER_GL_VERSION="0.0.19";t.KEPLER_GL_WEBSITE="http://kepler.gl/";t.DIMENSIONS={sidePanel:{width:300,margin:{top:20,left:20,bottom:30,right:20},headerHeight:96},mapControl:{width:184,padding:12}};var T=(0,y.default)({light:null,dark:null,base:null});t.THEME=T;var C=[{id:"layer",label:"sidebar.panels.layer",iconComponent:b.Layers,onClick:null},{id:"filter",label:"sidebar.panels.filter",iconComponent:b.FilterFunnel,onClick:null},{id:"interaction",label:"sidebar.panels.interaction",iconComponent:b.CursorClick,onClick:null},{id:"map",label:"sidebar.panels.basemap",iconComponent:b.Settings,onClick:null}];t.SIDEBAR_PANELS=C;var L=C;t.PANELS=L;var P=[{slug:"label",filter:function(e){return e.id.match(/(?=(label|place-|poi-))/)},defaultVisibility:!0},{slug:"road",filter:function(e){return e.id.match(/(?=(road|railway|tunnel|street|bridge))(?!.*label)/)},defaultVisibility:!0},{slug:"border",filter:function(e){return e.id.match(/border|boundaries/)},defaultVisibility:!1},{slug:"building",filter:function(e){return e.id.match(/building/)},defaultVisibility:!0},{slug:"water",filter:function(e){return e.id.match(/(?=(water|stream|ferry))/)},defaultVisibility:!0},{slug:"land",filter:function(e){return e.id.match(/(?=(parks|landcover|industrial|sand|hillshade))/)},defaultVisibility:!0},{slug:"3d building",filter:function(){return!1},defaultVisibility:!1}];t.DEFAULT_LAYER_GROUPS=P;var R=[{id:"dark",label:"Dark",url:"mapbox://styles/uberdata/cjoqbbf6l9k302sl96tyvka09",icon:"".concat(S,"/UBER_DARK_V2.png"),layerGroups:P},{id:"light",label:"Light",url:"mapbox://styles/uberdata/cjoqb9j339k1f2sl9t5ic5bn4",icon:"".concat(S,"/UBER_LIGHT_V2.png"),layerGroups:P},{id:"muted",label:"Muted Light",url:"mapbox://styles/uberdata/cjfyl03kp1tul2smf5v2tbdd4",icon:"".concat(S,"/UBER_MUTED_LIGHT.png"),layerGroups:P},{id:"muted_night",label:"Muted Night",url:"mapbox://styles/uberdata/cjfxhlikmaj1b2soyzevnywgs",icon:"".concat(S,"/UBER_MUTED_NIGHT.png"),layerGroups:P},{id:"satellite",label:"Satellite",url:"mapbox://styles/mapbox/satellite-v9",icon:"".concat(S,"/UBER_SATELLITE.png")}];t.DEFAULT_MAP_STYLES=R;t.GEOJSON_FIELDS={geojson:["_geojson","all_points","geojson"]};t.ICON_FIELDS={icon:["icon"]};t.TRIP_POINT_FIELDS=[["lat","lng"],["lat","lon"],["latitude","longitude"]];t.TRIP_ARC_FIELDS={lat0:"begintrip",lng0:"begintrip",lat1:"dropoff",lng1:"dropoff"};var D=(0,y.default)({range:null,select:null,input:null,timeRange:null,multiSelect:null,polygon:null});t.FILTER_TYPES=D;var k=(0,y.default)({ordinal:null,quantile:null,quantize:null,linear:null,sqrt:null,log:null,point:null});t.SCALE_TYPES=k;var I=(a={},(0,g.default)(a,k.linear,A.scaleLinear),(0,g.default)(a,k.quantize,A.scaleQuantize),(0,g.default)(a,k.quantile,A.scaleQuantile),(0,g.default)(a,k.ordinal,A.scaleOrdinal),(0,g.default)(a,k.sqrt,A.scaleSqrt),(0,g.default)(a,k.log,A.scaleLog),(0,g.default)(a,k.point,A.scalePoint),a);t.SCALE_FUNC=I;var F=(0,y.default)({boolean:null,date:null,geojson:null,integer:null,real:null,string:null,timestamp:null,point:null});t.ALL_FIELD_TYPES=F;var j=(0,y.default)({ASCENDING:null,DESCENDING:null,UNSORT:null});t.SORT_ORDER=j;var B=(0,y.default)({SORT_ASC:null,SORT_DES:null,UNSORT:null,PIN:null,UNPIN:null,COPY:null});t.TABLE_OPTION=B;var N=[{value:B.SORT_ASC,display:"Sort Ascending",icon:b.ArrowUp,condition:function(e){return e.sortMode!==j.ASCENDING}},{value:B.SORT_DES,display:"Sort Descending",icon:b.ArrowDown,condition:function(e){return e.sortMode!==j.DESCENDING}},{value:B.UNSORT,display:"Unsort Column",icon:b.Cancel,condition:function(e){return e.isSorted}},{value:B.PIN,display:"Pin Column",icon:b.Pin,condition:function(e){return!e.isPinned}},{value:B.UNPIN,display:"Unpin Column",icon:b.Cancel,condition:function(e){return e.isPinned}},{value:B.COPY,display:"Copy Column",icon:b.Clipboard}];t.TABLE_OPTION_LIST=N;var z=(o={},(0,g.default)(o,F.boolean,{label:"bool",color:"231, 189, 194"}),(0,g.default)(o,F.date,{label:"date",color:"160, 106, 206"}),(0,g.default)(o,F.geojson,{label:"geo",color:"106, 160, 206"}),(0,g.default)(o,F.integer,{label:"int",color:"248, 194, 28"}),(0,g.default)(o,F.real,{label:"float",color:"248, 194, 28"}),(0,g.default)(o,F.string,{label:"string",color:"140, 210, 205"}),(0,g.default)(o,F.timestamp,{label:"time",color:"106, 160, 56"}),(0,g.default)(o,F.point,{label:"point",color:"0, 172, 237"}),o);t.FILED_TYPE_DISPLAY=z;var U={default:"237, 88, 106"};t.FIELD_COLORS=U;t.HIGHLIGH_COLOR_3D=[255,255,255,60];var H=(0,y.default)({color:null,radius:null,size:null,colorAggr:null,sizeAggr:null});t.CHANNEL_SCALES=H;var V={count:"count",average:"average",maximum:"maximum",minimum:"minimum",median:"median",stdev:"stdev",sum:"sum",variance:"variance",mode:"mode",countUnique:"count unique"};t.AGGREGATION_TYPES=V;var G=(i={},(0,g.default)(i,H.color,[k.quantize,k.quantile]),(0,g.default)(i,H.radius,[k.sqrt]),(0,g.default)(i,H.size,[k.linear,k.sqrt,k.log]),i);t.linearFieldScaleFunctions=G;var Y=(u={},(0,g.default)(u,H.colorAggr,(s={},(0,g.default)(s,V.average,[k.quantize,k.quantile]),(0,g.default)(s,V.maximum,[k.quantize,k.quantile]),(0,g.default)(s,V.minimum,[k.quantize,k.quantile]),(0,g.default)(s,V.median,[k.quantize,k.quantile]),(0,g.default)(s,V.stdev,[k.quantize,k.quantile]),(0,g.default)(s,V.sum,[k.quantize,k.quantile]),(0,g.default)(s,V.variance,[k.quantize,k.quantile]),s)),(0,g.default)(u,H.sizeAggr,(l={},(0,g.default)(l,V.average,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.maximum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.minimum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.median,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.stdev,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.sum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.variance,[k.linear,k.sqrt,k.log]),l)),u);t.linearFieldAggrScaleFunctions=Y;var W=(c={},(0,g.default)(c,H.color,[k.ordinal]),(0,g.default)(c,H.radius,[k.point]),(0,g.default)(c,H.size,[k.point]),c);t.ordinalFieldScaleFunctions=W;var q=(f={},(0,g.default)(f,H.colorAggr,(d={},(0,g.default)(d,V.mode,[k.ordinal]),(0,g.default)(d,V.countUnique,[k.quantize,k.quantile]),d)),(0,g.default)(f,H.sizeAggr,{}),f);t.ordinalFieldAggrScaleFunctions=q;var X=(p={},(0,g.default)(p,H.color,[]),(0,g.default)(p,H.radius,[]),(0,g.default)(p,H.size,[]),p);t.notSupportedScaleOpts=X;var K=(h={},(0,g.default)(h,H.colorAggr,{}),(0,g.default)(h,H.sizeAggr,{}),h);t.notSupportAggrOpts=K;var Z=(m={},(0,g.default)(m,H.colorAggr,(0,g.default)({},V.count,[k.quantize,k.quantile])),(0,g.default)(m,H.sizeAggr,(0,g.default)({},V.count,[k.linear,k.sqrt,k.log])),m);t.DEFAULT_AGGREGATION=Z;var J={string:{type:"categorical",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[]}},real:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},timestamp:{type:"time",scale:w(w({},G),K),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE,E.TOOLTIP_FORMAT_TYPES.DATE_TIME]}},integer:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},boolean:{type:"boolean",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.BOOLEAN]}},date:{scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE]}},geojson:{type:"geometry",scale:w(w({},X),K),format:{legend:function(e){return"..."},tooltip:[]}}};t.FIELD_OPTS=J;var Q=Object.keys(H).reduce((function(e,t){return w(w({},e),{},(0,g.default)({},t,Object.keys(J).filter((function(e){return Object.keys(J[e].scale[t]).length}))))}),{});t.CHANNEL_SCALE_SUPPORTED_FIELDS=Q;t.DEFAULT_LAYER_COLOR={tripArc:"#9226C6",begintrip_lat:"#1E96BE",dropoff_lat:"#FF991F",request_lat:"#52A353"};t.DEFAULT_TOOLTIP_FIELDS=[];t.NO_VALUE_COLOR=[0,0,0,0];t.LAYER_BLENDINGS={additive:{label:"layerBlending.additive",blendFunc:["SRC_ALPHA","DST_ALPHA"],blendEquation:"FUNC_ADD"},normal:{label:"layerBlending.normal",blendFunc:["SRC_ALPHA","ONE_MINUS_SRC_ALPHA","ONE","ONE_MINUS_SRC_ALPHA"],blendEquation:["FUNC_ADD","FUNC_ADD"]},subtractive:{label:"layerBlending.subtractive",blendFunc:["ONE","ONE_MINUS_DST_COLOR","SRC_ALPHA","DST_ALPHA"],blendEquation:["FUNC_SUBTRACT","FUNC_ADD"]}};t.MAX_DEFAULT_TOOLTIPS=5;var $=(0,y.default)({ONE_X:null,TWO_X:null});t.RESOLUTIONS=$;var ee=(0,y.default)({SCREEN:null,FOUR_BY_THREE:null,SIXTEEN_BY_NINE:null,CUSTOM:null});t.EXPORT_IMG_RATIOS=ee;var te=[{id:ee.SCREEN,label:"modal.exportImage.ratioOriginalScreen",getSize:function(e,t){return{width:e,height:t}}},{id:ee.CUSTOM,hidden:!0,label:"modal.exportImage.ratioCustom",getSize:function(e,t){return{width:e,height:t}}},{id:ee.FOUR_BY_THREE,label:"modal.exportImage.ratio4_3",getSize:function(e,t){return{width:e,height:Math.round(.75*e)}}},{id:ee.SIXTEEN_BY_NINE,label:"modal.exportImage.ratio16_9",getSize:function(e,t){return{width:e,height:Math.round(.5625*e)}}}];t.EXPORT_IMG_RATIO_OPTIONS=te;var ne=[{id:$.ONE_X,label:"1x",available:!0,scale:1,getSize:function(e,t){return{width:e,height:t}}},{id:$.TWO_X,label:"2x",available:!0,scale:2,getSize:function(e,t){return{width:2*e,height:2*t}}}];t.EXPORT_IMG_RESOLUTION_OPTIONS=ne;var re=(0,y.default)({CSV:null});t.EXPORT_DATA_TYPE=re;var ae=[{id:re.CSV,label:re.CSV.toLowerCase(),available:!0}];t.EXPORT_DATA_TYPE_OPTIONS=ae;var oe=(0,y.default)({HTML:null,JSON:null});t.EXPORT_MAP_FORMATS=oe;var ie=(0,y.default)({READ:null,EDIT:null});t.EXPORT_HTML_MAP_MODES=ie;var se=Object.entries(oe).map((function(e){return{id:e[0],label:e[1].toLowerCase(),available:!0}}));t.EXPORT_MAP_FORMAT_OPTIONS=se;var le=Object.entries(ie).map((function(e){return{id:e[0],label:"modal.exportMap.html.".concat(e[1].toLowerCase()),available:!0,url:(0,_.getHTMLMapModeTileUrl)(e[1])}}));t.EXPORT_HTML_MAP_MODE_OPTIONS=le;t.DEFAULT_UUID_COUNT=6;t.DEFAULT_NOTIFICATION_MESSAGE="MESSAGE_NOT_PROVIDED";var ue=(0,y.default)({info:null,error:null,warning:null,success:null});t.DEFAULT_NOTIFICATION_TYPES=ue;var ce=(0,y.default)({global:null,file:null});t.DEFAULT_NOTIFICATION_TOPICS=ce;t.THROTTLE_NOTIFICATION_TIME=2500;t.BASE_SPEED=600;t.FPS=60;var de=(0,y.default)({free:null,incremental:null,point:null,interval:null});t.ANIMATION_WINDOW=de;t.DEFAULT_TIME_FORMAT="MM/DD/YY HH:mm:ssa";t.SPEED_CONTROL_RANGE=[0,10];t.SPEED_CONTROL_STEP=.001;t.GEOCODER_DATASET_NAME="geocoder_dataset";t.GEOCODER_LAYER_ID="geocoder_layer";t.GEOCODER_GEO_OFFSET=.05;t.GEOCODER_ICON_COLOR=[255,0,0];t.GEOCODER_ICON_SIZE=80;var fe={READ_ONLY:v.EditorModes.READ_ONLY,DRAW_POLYGON:v.EditorModes.DRAW_POLYGON,DRAW_RECTANGLE:v.EditorModes.DRAW_RECTANGLE,EDIT:v.EditorModes.EDIT_VERTEX};t.EDITOR_MODES=fe;var pe=[x.LAYER_TYPES.point,x.LAYER_TYPES.hexagon,x.LAYER_TYPES.arc,x.LAYER_TYPES.line,x.LAYER_TYPES.hexagonId];t.EDITOR_AVAILABLE_LAYERS=pe;t.MAX_GPU_FILTERS=4;t.MAP_THUMBNAIL_DIMENSION={width:300,height:200};t.MAP_INFO_CHARACTER={title:100,description:100};var he=(0,y.default)({upload:null,storage:null});t.LOADING_METHODS=he;var me=(0,y.default)({row:null,geojson:null,csv:null,keplergl:null});t.DATASET_FORMATS=me;var ge=(0,y.default)({visibleLayers:null,mapLegend:null,toggle3d:null,splitMap:null,mapDraw:null,mapLocale:null});t.MAP_CONTROLS=ge;t.MASK_LAYER_ID="mask_layer"},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return l}));var r=n(50);const a={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(a,"IDENTITY",{get:()=>r.a.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},i={common:0,meters:1,pixels:2},s={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},l={DRAW:"draw",MASK:"mask"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"f",(function(){return m}));var r=n(26);function a(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function o(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function i(e){var t=e[0],n=e[1];return Math.hypot(t,n)}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e}function l(e,t,n,r){var a=t[0],o=t[1];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e}function u(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e}function c(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[2]*a+n[4],e[1]=n[1]*r+n[3]*a+n[5],e}function d(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[3]*a+n[6],e[1]=n[1]*r+n[4]*a+n[7],e}function f(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[4]*a+n[12],e[1]=n[1]*r+n[5]*a+n[13],e}var p,h,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e};p=new r.a(2),r.a!=Float32Array&&(p[0]=0,p[1]=0),h=p},function(e,t,n){var r;
|
|
3
|
+
a.version="2.29.1",t=Ot,a.fn=yn,a.min=function(){var e=[].slice.call(arguments,0);return Ct("isBefore",e)},a.max=function(){var e=[].slice.call(arguments,0);return Ct("isAfter",e)},a.now=function(){return Date.now?Date.now():+new Date},a.utc=h,a.unix=function(e){return Ot(1e3*e)},a.months=function(e,t){return _n(e,t,"months")},a.isDate=d,a.locale=it,a.invalid=y,a.duration=Ht,a.isMoment=E,a.weekdays=function(e,t,n){return En(e,t,n,"weekdays")},a.parseZone=function(){return Ot.apply(null,arguments).parseZone()},a.localeData=lt,a.isDuration=Rt,a.monthsShort=function(e,t){return _n(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return En(e,t,n,"weekdaysMin")},a.defineLocale=st,a.updateLocale=function(e,t){if(null!=t){var n,r,a=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(C(tt[e]._config,t)):(null!=(r=ot(e))&&(a=r._config),t=C(a,t),null==r&&(t.abbr=e),(n=new L(t)).parentLocale=tt[e],tt[e]=n),it(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===it()&&it(e)):null!=tt[e]&&delete tt[e]);return tt[e]},a.locales=function(){return w(tt)},a.weekdaysShort=function(e,t,n){return En(e,t,n,"weekdaysShort")},a.normalizeUnits=U,a.relativeTimeRounding=function(e){return void 0===e?Wn:"function"==typeof e&&(Wn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==qn[e]&&(void 0===t?qn[e]:(qn[e]=t,"s"===e&&(qn.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=yn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(156)(e))},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n.apply(this,arguments)}e.exports=n},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"i",(function(){return o})),n.d(t,"g",(function(){return i})),n.d(t,"a",(function(){return s})),n.d(t,"l",(function(){return l})),n.d(t,"m",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"t",(function(){return p})),n.d(t,"s",(function(){return h})),n.d(t,"u",(function(){return m})),n.d(t,"n",(function(){return g})),n.d(t,"o",(function(){return y})),n.d(t,"p",(function(){return v})),n.d(t,"b",(function(){return A})),n.d(t,"r",(function(){return _})),n.d(t,"k",(function(){return E})),n.d(t,"e",(function(){return x})),n.d(t,"h",(function(){return M})),n.d(t,"q",(function(){return w}));var r=n(26);function a(){var e=new r.a(3);return r.a!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function o(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function i(e,t,n){var a=new r.a(3);return a[0]=e,a[1]=t,a[2]=n,a}function s(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function l(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function u(e,t){var n=t[0],r=t[1],a=t[2],o=n*n+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function c(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function d(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[0],s=n[1],l=n[2];return e[0]=a*l-o*s,e[1]=o*i-r*l,e[2]=r*s-a*i,e}function f(e,t,n,r){var a=t[0],o=t[1],i=t[2];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e[2]=i+r*(n[2]-i),e}function p(e,t,n){var r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o+n[15];return i=i||1,e[0]=(n[0]*r+n[4]*a+n[8]*o+n[12])/i,e[1]=(n[1]*r+n[5]*a+n[9]*o+n[13])/i,e[2]=(n[2]*r+n[6]*a+n[10]*o+n[14])/i,e}function h(e,t,n){var r=t[0],a=t[1],o=t[2];return e[0]=r*n[0]+a*n[3]+o*n[6],e[1]=r*n[1]+a*n[4]+o*n[7],e[2]=r*n[2]+a*n[5]+o*n[8],e}function m(e,t,n){var r=n[0],a=n[1],o=n[2],i=n[3],s=t[0],l=t[1],u=t[2],c=a*u-o*l,d=o*s-r*u,f=r*l-a*s,p=a*f-o*d,h=o*c-r*f,m=r*d-a*c,g=2*i;return c*=g,d*=g,f*=g,p*=2,h*=2,m*=2,e[0]=s+c+p,e[1]=l+d+h,e[2]=u+f+m,e}function g(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0],o[1]=a[1]*Math.cos(r)-a[2]*Math.sin(r),o[2]=a[1]*Math.sin(r)+a[2]*Math.cos(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function y(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[2]*Math.sin(r)+a[0]*Math.cos(r),o[1]=a[1],o[2]=a[2]*Math.cos(r)-a[0]*Math.sin(r),e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function v(e,t,n,r){var a=[],o=[];return a[0]=t[0]-n[0],a[1]=t[1]-n[1],a[2]=t[2]-n[2],o[0]=a[0]*Math.cos(r)-a[1]*Math.sin(r),o[1]=a[0]*Math.sin(r)+a[1]*Math.cos(r),o[2]=a[2],e[0]=o[0]+n[0],e[1]=o[1]+n[1],e[2]=o[2]+n[2],e}function A(e,t){var n=e[0],r=e[1],a=e[2],o=t[0],i=t[1],s=t[2],l=Math.sqrt(n*n+r*r+a*a)*Math.sqrt(o*o+i*i+s*s),u=l&&c(e,t)/l;return Math.acos(Math.min(Math.max(u,-1),1))}var b,_=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},E=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},x=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],a=t[2]-e[2];return Math.hypot(n,r,a)},M=o,w=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r};b=a()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReactCSS=t.loop=t.handleActive=t.handleHover=t.hover=void 0;var r=u(n(1442)),a=u(n(1518)),o=u(n(1544)),i=u(n(1545)),s=u(n(1546)),l=u(n(1547));function u(e){return e&&e.__esModule?e:{default:e}}t.hover=i.default,t.handleHover=i.default,t.handleActive=s.default,t.loop=l.default;var c=t.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var s=(0,r.default)(n),l=(0,a.default)(e,s);return(0,o.default)(l)};t.default=c},function(e,t,n){"use strict";function r(e,t){if(!e)throw new Error(t||"luma.gl: assertion failed.")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(6),a=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(18)),i=a(n(60)),s=a(n(5)),l=a(n(7)),u=a(n(9)),c=a(n(10)),d=a(n(8)),f=a(n(3)),p=r(n(0)),h=a(n(1));function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var a=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var g=function(e){(0,u.default)(n,e);var t=m(n);function n(){return(0,s.default)(this,n),t.apply(this,arguments)}return(0,l.default)(n,[{key:"render",value:function(){var e=this.props,t=e.height,n=e.width,r=e.viewBox,a=e.style,s=e.children,l=e.predefinedClassName,u=e.className,c=e.colors,d=e.totalColor,f=(0,i.default)(e,["height","width","viewBox","style","children","predefinedClassName","className","colors","totalColor"]),h=t,m=n||h,g=Array.isArray(c)&&d&&function(e,t){return new Array(e).fill(1).reduce((function(e,n,r){return"".concat(e,".cr").concat(r+1," {fill:").concat(t[r%t.length],";}")}),"")}(d,c);return p.default.createElement("svg",(0,o.default)({viewBox:r,width:m,height:h,style:a,className:"".concat(l," ").concat(u)},f),g?p.default.createElement("style",{type:"text/css"},g):null,s)}}]),n}(p.Component);t.default=g,(0,f.default)(g,"displayName","Base Icon"),(0,f.default)(g,"propTypes",{height:h.default.string,width:h.default.string,viewBox:h.default.string,children:h.default.node,predefinedClassName:h.default.string,className:h.default.string}),(0,f.default)(g,"defaultProps",{height:null,width:null,viewBox:"0 0 64 64",predefinedClassName:"",className:"",style:{fill:"currentColor"}})},function(e,t,n){"use strict";var r=n(6),a=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=a(n(18)),i=a(n(60)),s=a(n(5)),l=a(n(7)),u=a(n(9)),c=a(n(10)),d=a(n(8)),f=a(n(3)),p=r(n(0)),h=a(n(1));function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var a=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.default)(this,n)}}var g=function(e){(0,u.default)(n,e);var t=m(n);function n(){return(0,s.default)(this,n),t.apply(this,arguments)}return(0,l.default)(n,[{key:"render",value:function(){var e=this.props,t=e.height,n=e.width,r=e.viewBox,a=e.style,s=e.children,l=e.predefinedClassName,u=e.className,c=e.colors,d=e.totalColor,f=(0,i.default)(e,["height","width","viewBox","style","children","predefinedClassName","className","colors","totalColor"]),h=t,m=n||h,g=Array.isArray(c)&&d&&function(e,t){return new Array(e).fill(1).reduce((function(e,n,r){return"".concat(e,".cr").concat(r+1," {fill:").concat(t[r%t.length],";}")}),"")}(d,c);return p.default.createElement("svg",(0,o.default)({viewBox:r,width:m,height:h,style:a,className:"".concat(l," ").concat(u)},f),g?p.default.createElement("style",{type:"text/css"},g):null,s)}}]),n}(p.Component);t.default=g,(0,f.default)(g,"displayName","Base Icon"),(0,f.default)(g,"propTypes",{height:h.default.string,width:h.default.string,viewBox:h.default.string,children:h.default.node,predefinedClassName:h.default.string,className:h.default.string}),(0,f.default)(g,"defaultProps",{height:null,width:null,viewBox:"0 0 64 64",predefinedClassName:"",className:"",style:{fill:"currentColor"}})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"h",(function(){return i})),n.d(t,"i",(function(){return s})),n.d(t,"k",(function(){return l})),n.d(t,"l",(function(){return u})),n.d(t,"f",(function(){return c})),n.d(t,"j",(function(){return d})),n.d(t,"g",(function(){return f})),n.d(t,"m",(function(){return p})),n.d(t,"b",(function(){return h})),n.d(t,"c",(function(){return m}));var r=Math.abs,a=Math.atan2,o=Math.cos,i=Math.max,s=Math.min,l=Math.sin,u=Math.sqrt,c=1e-12,d=Math.PI,f=d/2,p=2*d;function h(e){return e>1?0:e<-1?d:Math.acos(e)}function m(e){return e>=1?f:e<=-1?-f:Math.asin(e)}},function(e,t,n){"use strict";n.r(t),n.d(t,"COORDINATE_SYSTEM",(function(){return r.a})),n.d(t,"OPERATION",(function(){return r.c})),n.d(t,"UNIT",(function(){return r.e})),n.d(t,"LightingEffect",(function(){return a.a})),n.d(t,"AmbientLight",(function(){return o.a})),n.d(t,"DirectionalLight",(function(){return i.a})),n.d(t,"PointLight",(function(){return p})),n.d(t,"_CameraLight",(function(){return m})),n.d(t,"_SunLight",(function(){return M})),n.d(t,"PostProcessEffect",(function(){return D})),n.d(t,"_LayersPass",(function(){return I.a})),n.d(t,"Deck",(function(){return F.a})),n.d(t,"LayerManager",(function(){return j.a})),n.d(t,"AttributeManager",(function(){return B.a})),n.d(t,"Layer",(function(){return N.a})),n.d(t,"CompositeLayer",(function(){return z.a})),n.d(t,"DeckRenderer",(function(){return U.a})),n.d(t,"Viewport",(function(){return H.a})),n.d(t,"WebMercatorViewport",(function(){return V.a})),n.d(t,"_GlobeViewport",(function(){return K})),n.d(t,"picking",(function(){return J.a})),n.d(t,"project",(function(){return Q.a})),n.d(t,"project32",(function(){return $.a})),n.d(t,"gouraudLighting",(function(){return ee.a})),n.d(t,"phongLighting",(function(){return ee.b})),n.d(t,"shadow",(function(){return te.a})),n.d(t,"View",(function(){return ne.a})),n.d(t,"MapView",(function(){return re.a})),n.d(t,"FirstPersonView",(function(){return Ae})),n.d(t,"OrbitView",(function(){return Me})),n.d(t,"OrthographicView",(function(){return we.a})),n.d(t,"_GlobeView",(function(){return Ce})),n.d(t,"Controller",(function(){return le.a})),n.d(t,"MapController",(function(){return Oe.b})),n.d(t,"_GlobeController",(function(){return Te})),n.d(t,"FirstPersonController",(function(){return ye})),n.d(t,"OrbitController",(function(){return be.b})),n.d(t,"OrthographicController",(function(){return Le.a})),n.d(t,"Effect",(function(){return w.a})),n.d(t,"LayerExtension",(function(){return Pe.a})),n.d(t,"TRANSITION_EVENTS",(function(){return Re.a})),n.d(t,"TransitionInterpolator",(function(){return De.a})),n.d(t,"LinearInterpolator",(function(){return ke.a})),n.d(t,"FlyToInterpolator",(function(){return je})),n.d(t,"log",(function(){return Be.a})),n.d(t,"createIterable",(function(){return Ne.a})),n.d(t,"fp64LowPart",(function(){return ce.b})),n.d(t,"Tesselator",(function(){return ze.a})),n.d(t,"_fillArray",(function(){return Ue.a})),n.d(t,"_flatten",(function(){return Ue.b})),n.d(t,"_count",(function(){return He.a})),n.d(t,"_memoize",(function(){return Ve.a})),n.d(t,"_mergeShaders",(function(){return Ge.a})),n.d(t,"_compareProps",(function(){return Ye.a}));var r=n(34),a=n(339),o=n(423),i=n(241),s=n(344);const l=[255,255,255],u=1,c=[0,0,1],d=[0,0,1];let f=0;class p{constructor(e={}){const{color:t=l}=e,{intensity:n=u}=e,{position:r=d}=e;this.id=e.id||"point-".concat(f++),this.color=t,this.intensity=n,this.type="point",this.position=r,this.attenuation=function(e){if("attenuation"in e)return e.attenuation;if("intensity"in e)return[0,0,e.intensity];return c}(e),this.projectedLight={...this}}getProjectedLight({layer:e}){const{projectedLight:t}=this,n=e.context.viewport,{coordinateSystem:a,coordinateOrigin:o}=e.props,i=Object(s.b)(this.position,{viewport:n,coordinateSystem:a,coordinateOrigin:o,fromCoordinateSystem:n.isGeospatial?r.a.LNGLAT:r.a.CARTESIAN,fromCoordinateOrigin:[0,0,0]});return t.color=this.color,t.intensity=this.intensity,t.position=i,t}}var h=n(294);class m extends p{getProjectedLight({layer:e}){const{projectedLight:t}=this,n=e.context.viewport,{coordinateSystem:r,coordinateOrigin:a,modelMatrix:o}=e.props,{project_uCameraPosition:i}=Object(h.b)({viewport:n,modelMatrix:o,coordinateSystem:r,coordinateOrigin:a});return t.color=this.color,t.intensity=this.intensity,t.position=i,t}}const g=Math.PI/180,y=23.4397*g;function v(e,t,n){const r=g*-n,a=g*t,o=function(e){return function(e){return e/864e5-.5+2440588}(e)-2451545}(e),i=function(e){const t=function(e){const t=e,n=g*(1.9148*Math.sin(t)+.02*Math.sin(2*t)+3e-4*Math.sin(3*t));return t+n+102.9372*g+Math.PI}((n=e,g*(357.5291+.98560028*n)));var n;return{declination:_(t,0),rightAscension:b(t,0)}}(o),s=function(e,t){return g*(280.147+360.9856235*e)-t}(o,r)-i.rightAscension;return{azimuth:E(s,a,i.declination),altitude:x(s,a,i.declination)}}function A(e,t,n){const{azimuth:r,altitude:a}=v(e,t,n);return[Math.sin(r)*Math.cos(a),Math.cos(r)*Math.cos(a),-Math.sin(a)]}function b(e,t){const n=e;return Math.atan2(Math.sin(n)*Math.cos(y)-Math.tan(t)*Math.sin(y),Math.cos(n))}function _(e,t){const n=e;return Math.asin(Math.sin(t)*Math.cos(y)+Math.cos(t)*Math.sin(y)*Math.sin(n))}function E(e,t,n){const r=e,a=t,o=n;return Math.atan2(Math.sin(r),Math.cos(r)*Math.sin(a)-Math.tan(o)*Math.cos(a))}function x(e,t,n){const r=e,a=t,o=n;return Math.asin(Math.sin(a)*Math.sin(o)+Math.cos(a)*Math.cos(o)*Math.cos(r))}class M extends i.a{constructor({timestamp:e,...t}){super(t),this.timestamp=e}getProjectedLight({layer:e}){const{viewport:t}=e.context;if(t.resolution>0){const[e,t,n]=A(this.timestamp,0,0);this.direction=[e,-n,t]}else{const{latitude:e,longitude:n}=t;this.direction=A(this.timestamp,e,n)}return this}}var w=n(164),O=n(4),S=n(1905),T=n(16),C=n(464),L=n(454);class P extends L.a{constructor(e,t){super(e,t),Object(O.a)(this,"model",void 0);const{module:n,fs:r,id:a}=t;this.model=new S.a(e,{id:a,fs:r,modules:[n]})}render(e){const t=this.gl;Object(T.n)(t,{viewport:[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}),Object(T.o)(t,{framebuffer:e.outputBuffer,clearColor:[0,0,0,0]},()=>this._renderPass(t,e))}delete(){this.model.delete(),this.model=null}_renderPass(e,t){const{inputBuffer:n}=t;Object(C.a)(e,{color:!0}),this.model.draw({moduleSettings:this.props.moduleSettings,uniforms:{texture:n,texSize:[n.width,n.height]},parameters:{depthWrite:!1,depthTest:!1}})}}var R=n(640);class D extends w.a{constructor(e,t={}){super(t),this.id="".concat(e.name,"-pass"),Object(R.b)(e),this.module=e}postRender(e,t){this.passes||(this.passes=function(e,t,n,r){if(t.filter||t.sampler){const a=k(t);return[new P(e,{id:n,module:t,fs:a,moduleSettings:r})]}return(t.passes||[]).map((a,o)=>{const i=k(t,a),s="".concat(n,"-").concat(o);return new P(e,{id:s,module:t,fs:i,moduleSettings:r})})}(e,this.module,this.id,this.props));const{target:n}=t;let r=t.inputBuffer,a=t.swapBuffer;for(let e=0;e<this.passes.length;e++){n&&e===this.passes.length-1&&(a=n),this.passes[e].render({inputBuffer:r,outputBuffer:a});const t=a;a=r,r=t}return r}cleanup(){if(this.passes){for(const e of this.passes)e.delete();this.passes=null}}}function k(e,t=e){if(t.filter){return(e=>"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = texture2D(texture, texCoord);\n gl_FragColor = ".concat(e,"(gl_FragColor, texSize, texCoord);\n}\n"))("string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor"))}if(t.sampler){return(e=>"uniform sampler2D texture;\nuniform vec2 texSize;\n\nvarying vec2 position;\nvarying vec2 coordinate;\nvarying vec2 uv;\n\nvoid main() {\n vec2 texCoord = coordinate;\n\n gl_FragColor = ".concat(e,"(texture, texSize, texCoord);\n}\n"))("string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor"))}return null}var I=n(165),F=n(1160),j=n(441),B=n(436),N=n(435),z=n(621),U=n(444),H=n(101),V=n(185),G=n(215),Y=n(19),W=n(48);const q=Math.PI/180,X=180/Math.PI;class K extends H.a{constructor(e={}){const{latitude:t=0,longitude:n=0,zoom:r=11,nearZMultiplier:a=.1,farZMultiplier:o=2,resolution:i=10}=e;let{width:s,height:l,altitude:u=1.5}=e;s=s||1,l=l||1,u=Math.max(.75,u);const c=(new G.a).lookAt({eye:[0,-u,0],up:[0,0,1]}),d=Math.pow(2,r);c.rotateX(t*q),c.rotateZ(-n*q),c.scale(d/l);const f=Math.atan(.5/u),p=512*d/l;super({...e,width:s,height:l,viewMatrix:c,longitude:n,latitude:t,zoom:r,fovyRadians:2*f,aspect:s/l,focalDistance:u,near:a,far:Math.min(2,1/p+1)*u*o}),this.resolution=i,this.distanceScales=function(){const e=Math.PI/180*256;return{unitsPerMeter:[256/6370972,256/6370972,256/6370972],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[e,e,256/6370972],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/e,1/e,24886.609375]}}()}get projectionMode(){return r.d.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(e={}){const t={targetZ:e.z||0},n=this.unproject([0,this.height/2],t),r=this.unproject([this.width/2,0],t),a=this.unproject([this.width,this.height/2],t),o=this.unproject([this.width/2,this.height],t);return a[0]<this.longitude&&(a[0]+=360),n[0]>this.longitude&&(n[0]-=360),[Math.min(n[0],a[0],r[0],o[0]),Math.min(n[1],a[1],r[1],o[1]),Math.max(n[0],a[0],r[0],o[0]),Math.max(n[1],a[1],r[1],o[1])]}unproject(e,{topLeft:t=!0,targetZ:n}={}){const[r,a,o]=e,i=t?a:this.height-a,{pixelUnprojectionMatrix:s}=this;let l;if(Number.isFinite(o))l=Z(s,[r,i,o,1]);else{const e=Z(s,[r,i,-1,1]),t=Z(s,[r,i,1,1]),a=256*((n||0)/6370972+1),o=Y.q(Y.r([],e,t)),u=Y.q(e),c=Y.q(t),d=4*((4*u*c-(o-u-c)**2)/16)/o,f=(Math.sqrt(u-d)-Math.sqrt(Math.max(0,a*a-d)))/Math.sqrt(o);l=Y.j([],e,t,f)}const[u,c,d]=this.unprojectPosition(l);return Number.isFinite(o)?[u,c,d]:Number.isFinite(n)?[u,c,n]:[u,c]}projectPosition(e){const[t,n,r=0]=e,a=t*q,o=n*q,i=Math.cos(o),s=256*(r/6370972+1);return[Math.sin(a)*i*s,-Math.cos(a)*i*s,Math.sin(o)*s]}unprojectPosition(e){const[t,n,r]=e,a=Y.h(e),o=Math.asin(r/a);return[Math.atan2(t,-n)*X,o*X,6370972*(a/256-1)]}projectFlat(e){return e}unprojectFlat(e){return e}panByPosition(e,t){const n=this.unproject(t);return{longitude:e[0]-n[0]+this.longitude,latitude:e[1]-n[1]+this.latitude}}}function Z(e,t){const n=W.n([],t,e);return W.k(n,n,1/n[3]),n}var J=n(825),Q=n(242),$=n(826),ee=n(1179),te=n(295),ne=n(143),re=n(424),ae=n(53),oe=n(47),ie=n(176);class se{constructor({phi:e=0,theta:t=0,radius:n=1,bearing:r,pitch:a,altitude:o,radiusScale:i=6371e3}={}){this.phi=e,this.theta=t,this.radius=n||o||1,this.radiusScale=i||1,void 0!==r&&(this.bearing=r),void 0!==a&&(this.pitch=a),this.check()}toString(){return this.formatString(oe.b)}formatString({printTypes:e=!1}){const t=oe.e;return"".concat(e?"Spherical":"","[rho:").concat(t(this.radius),",theta:").concat(t(this.theta),",phi:").concat(t(this.phi),"]")}equals(e){return Object(oe.d)(this.radius,e.radius)&&Object(oe.d)(this.theta,e.theta)&&Object(oe.d)(this.phi,e.phi)}exactEquals(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}get bearing(){return 180-Object(oe.c)(this.phi)}set bearing(e){this.phi=Math.PI-Object(oe.h)(e)}get pitch(){return Object(oe.c)(this.theta)}set pitch(e){this.theta=Object(oe.h)(e)}get longitude(){return Object(oe.c)(this.phi)}get latitude(){return Object(oe.c)(this.theta)}get lng(){return Object(oe.c)(this.phi)}get lat(){return Object(oe.c)(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}clone(){return(new se).copy(this)}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this.check()}fromLngLatZ([e,t,n]){this.radius=1+n/this.radiusScale,this.phi=Object(oe.h)(t),this.theta=Object(oe.h)(e)}fromVector3(e){return this.radius=Y.i(e),this.radius>0&&(this.theta=Math.atan2(e[0],e[1]),this.phi=Math.acos(Object(oe.a)(e[2]/this.radius,-1,1))),this.check()}toVector3(){return new ie.a(0,0,this.radius).rotateX({radians:this.theta}).rotateZ({radians:this.phi})}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}check(){if(!(Number.isFinite(this.phi)&&Number.isFinite(this.theta)&&this.radius>0))throw new Error("SphericalCoordinates: some fields set to invalid numbers");return this}}var le=n(142),ue=n(296),ce=n(89);const de=[0,0,0],fe=0,pe=0,he=90,me=-90;class ge extends ue.a{constructor({width:e,height:t,position:n=de,bearing:r=pe,pitch:a=fe,longitude:o,latitude:i,maxPitch:s=he,minPitch:l=me,startRotatePos:u,startBearing:c,startPitch:d,startZoomPosition:f,startZoom:p}){super({width:e,height:t,position:n,bearing:r,pitch:a,longitude:o,latitude:i,maxPitch:s,minPitch:l}),this._state={startRotatePos:u,startBearing:c,startPitch:d,startZoomPosition:f,startZoom:p}}getDirection(e=!1){return new se({bearing:this._viewportProps.bearing,pitch:e?90:90+this._viewportProps.pitch}).toVector3().normalize()}panStart(){return this}pan(){return this}panEnd(){return this}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){const{startRotatePos:r,startBearing:a,startPitch:o}=this._state,{width:i,height:s}=this._viewportProps;if(!r||!Number.isFinite(a)||!Number.isFinite(o))return this;let l;if(e){l={bearing:a-180*((e[0]-r[0])/i),pitch:o-90*((e[1]-r[1])/s)}}else l={bearing:a-t,pitch:o-n};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this._viewportProps.position,startZoom:this._viewportProps.zoom})}zoom({scale:e}){let{startZoomPosition:t}=this._state;t||(t=this._viewportProps.position);const n=this.getDirection();return this._move(n,20*Math.log2(e),t)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}moveLeft(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:Math.PI/2}),e)}moveRight(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:-Math.PI/2}),e)}moveUp(e=20){const t=this.getDirection(!0);return this._move(t,e)}moveDown(e=20){const t=this.getDirection(!0);return this._move(t.negate(),e)}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}zoomIn(e=2){return this.zoom({scale:e})}zoomOut(e=2){return this.zoom({scale:1/e})}shortestPathFrom(e){const t=e.getViewportProps(),n={...this._viewportProps},{bearing:r,longitude:a}=n;return Math.abs(r-t.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(a-t.longitude)>180&&(n.longitude=a<0?a+360:a-360),n}_move(e,t,n=this._viewportProps.position){const r=e.scale(t);return this._getUpdatedState({position:new ie.a(n).add(r)})}_getUpdatedState(e){return new ge({...this._viewportProps,...this._state,...e})}_applyConstraints(e){const{pitch:t,maxPitch:n,minPitch:r,longitude:a,bearing:o}=e;return e.pitch=Object(oe.a)(t,r,n),(a<-180||a>180)&&(e.longitude=Object(ce.e)(a+180,360)-180),(o<-180||o>180)&&(e.bearing=Object(ce.e)(o+180,360)-180),e}}class ye extends le.a{constructor(e){super(ge,e)}get linearTransitionProps(){return["position","pitch","bearing"]}}class ve extends H.a{constructor(e){const{modelMatrix:t=null,bearing:n=0,pitch:r=0,up:a=[0,0,1]}=e,o=function({bearing:e,pitch:t}){return new se({bearing:e,pitch:t}).toVector3().normalize()}({bearing:n,pitch:-90===r?1e-4:90+r}),i=t?t.transformDirection(o):o,s=Object(ae.i)(e),l=Math.pow(2,s),u=(new G.a).lookAt({eye:[0,0,0],center:i,up:a}).scale(l);super({...e,zoom:s,viewMatrix:u})}}class Ae extends ne.a{constructor(e){super({...e,type:ve})}get controller(){return this._getControllerProps({type:ye})}}Ae.displayName="FirstPersonView";var be=n(284);const _e=Math.PI/180;function Ee({height:e,focalDistance:t,orbitAxis:n,rotationX:r,rotationOrbit:a,zoom:o}){const i="Z"===n?[0,0,1]:[0,1,0],s="Z"===n?[0,-t,0]:[0,0,t],l=(new G.a).lookAt({eye:s,up:i});l.rotateX(r*_e),"Z"===n?l.rotateZ(a*_e):l.rotateY(a*_e);const u=Math.pow(2,o)/(e||1);return l.scale(u),l}class xe extends H.a{constructor(e){const{height:t,projectionMatrix:n,fovy:r=50,orbitAxis:a,target:o=[0,0,0],rotationX:i=0,rotationOrbit:s=0,zoom:l=0}=e,u=n?n[5]/2:Object(ae.e)(r);super({...e,longitude:null,viewMatrix:Ee({height:t,focalDistance:u,orbitAxis:a,rotationX:i,rotationOrbit:s,zoom:l}),fovy:r,focalDistance:u,position:o,zoom:l}),Object(O.a)(this,"projectedCenter",void 0),this.projectedCenter=this.project(this.center)}unproject(e,{topLeft:t=!0}={}){const[n,r,a=this.projectedCenter[2]]=e,o=t?r:this.height-r,[i,s,l]=Object(ae.n)([n,o,a],this.pixelUnprojectionMatrix);return[i,s,l]}panByPosition(e,t){const n=this.project(e),r=[this.width/2+n[0]-t[0],this.height/2+n[1]-t[1],this.projectedCenter[2]];return{target:this.unproject(r)}}}Object(O.a)(xe,"displayName","OrbitView");class Me extends ne.a{constructor(e={}){const{orbitAxis:t="Z"}=e;super({...e,orbitAxis:t,type:xe})}get controller(){return this._getControllerProps({type:be.b})}}var we=n(426),Oe=n(282);class Se extends Oe.a{_applyConstraints(e){const{maxZoom:t,minZoom:n,zoom:r}=e;e.zoom=Object(oe.a)(r,n,t);const{longitude:a,latitude:o}=e;return(a<-180||a>180)&&(e.longitude=Object(ce.e)(a+180,360)-180),e.latitude=Object(oe.a)(o,-89,89),e}}class Te extends le.a{constructor(e){e.dragMode=e.dragMode||"pan",super(Se,e)}setProps(e){super.setProps(e),this.dragRotate=!1,this.touchRotate=!1}get linearTransitionProps(){return["longitude","latitude","zoom"]}}class Ce extends ne.a{constructor(e){super({...e,type:K})}get controller(){return this._getControllerProps({type:Te})}}Ce.displayName="GlobeView";var Le=n(427),Pe=n(620),Re=n(335),De=n(283),ke=n(336);const Ie=["bearing","pitch"],Fe={speed:1.2,curve:1.414};class je extends De.a{constructor(e={}){super({compare:["longitude","latitude","zoom","bearing","pitch"],extract:["width","height","longitude","latitude","zoom","bearing","pitch"],required:["width","height","latitude","longitude","zoom"]}),this.props={...Fe,...e}}interpolateProps(e,t,n){const r=Object(ae.d)(e,t,n,this.props);for(const a of Ie)r[a]=Object(oe.g)(e[a]||0,t[a]||0,n);return r}getDuration(e,t){let{transitionDuration:n}=t;return"auto"===n&&(n=Object(ae.h)(e,t,this.props)),n}}var Be=n(50),Ne=n(122),ze=n(827),Ue=n(150),He=n(428),Ve=n(184),Ge=n(422),Ye=n(337)},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return o}));var r=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)})},function(e,t,n){var r=n(1230),a=n(651),o=n(480),i=n(1231);e.exports=function(e){return r(e)||a(e)||o(e)||i()}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CheckMark=t.TruncatedTitleText=t.StyledFilterContent=t.MapControlButton=t.BottomWidgetInner=t.WidgetContainer=t.StyledType=t.StyledFilteredOption=t.StyledExportSection=t.StyledAttrbution=t.StyledMapContainer=t.StyledModalInputFootnote=t.StyledModalSection=t.StyledModalVerticalPanel=t.StyledModalContent=t.Table=t.SelectionButton=t.DatasetSquare=t.ButtonGroup=t.StyledPanelDropdown=t.StyledPanelHeader=t.InlineInput=t.TextAreaLight=t.TextArea=t.InputLight=t.Input=t.Button=t.Tooltip=t.SidePanelDivider=t.SidePanelSection=t.PanelContent=t.PanelHeaderContent=t.PanelHeaderTitle=t.PanelLabelBold=t.PanelLabelWrapper=t.PanelLabel=t.SBFlexboxNoMargin=t.SBFlexboxItem=t.SpaceBetweenFlexbox=t.CenterVerticalFlexbox=t.CenterFlexbox=t.IconRoundSmall=t.SelectTextBold=t.SelectText=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g,y,v,A,b,_,E,x,M,w,O,S,T,C,L,P,R,D,k,I,F,j,B,N,z,U,H,V,G,Y,W,q,X,K,Z,J,Q=r(n(12)),$=r(n(11)),ee=r(n(1169)),te=n(219),ne=r(n(36)),re=$.default.span(a||(a=(0,Q.default)(["\n color: ",";\n font-size: ",";\n font-weight: 400;\n\n i {\n font-size: 13px;\n margin-right: 6px;\n }\n"])),(function(e){return e.theme.labelColor}),(function(e){return e.theme.selectFontSize}));t.SelectText=re;var ae=(0,$.default)(re)(o||(o=(0,Q.default)(["\n color: ",";\n font-weight: 500;\n"])),(function(e){return e.theme.textColor}));t.SelectTextBold=ae;var oe=$.default.div(i||(i=(0,Q.default)(["\n display: flex;\n width: 18px;\n height: 18px;\n border-radius: 9px;\n background-color: ",";\n color: ",";\n align-items: center;\n justify-content: center;\n\n :hover {\n cursor: pointer;\n background-color: ",";\n }\n"])),(function(e){return e.theme.secondaryBtnBgdHover}),(function(e){return e.theme.secondaryBtnColor}),(function(e){return e.theme.secondaryBtnBgdHover}));t.IconRoundSmall=oe;var ie=$.default.div(s||(s=(0,Q.default)(["\n display: flex;\n align-items: center;\n"])));t.CenterFlexbox=ie;var se=$.default.div(l||(l=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"])));t.CenterVerticalFlexbox=se;var le=$.default.div(u||(u=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n margin-left: -16px;\n"])));t.SpaceBetweenFlexbox=le;var ue=$.default.div(c||(c=(0,Q.default)(["\n flex-grow: 1;\n margin-left: 16px;\n"])));t.SBFlexboxItem=ue;var ce=$.default.div(d||(d=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n"])));t.SBFlexboxNoMargin=ce;var de=$.default.label.attrs({className:"side-panel-panel__label"})(f||(f=(0,Q.default)(["\n color: ",";\n display: inline-block;\n font-size: 11px;\n font-weight: 400;\n margin-bottom: 4px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.labelColor}));t.PanelLabel=de;var fe=$.default.div.attrs({className:"side-panel-panel__label-wrapper"})(p||(p=(0,Q.default)(["\n display: flex;\n align-items: self-start;\n"])));t.PanelLabelWrapper=fe;var pe=(0,$.default)(de)(h||(h=(0,Q.default)(["\n font-weight: 500;\n"])));t.PanelLabelBold=pe;var he=$.default.span.attrs({className:"side-panel-panel__header__title"})(m||(m=(0,Q.default)(["\n color: ",";\n font-size: 13px;\n letter-spacing: 0.43px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.textColor}));t.PanelHeaderTitle=he;var me=$.default.div(g||(g=(0,Q.default)(["\n display: flex;\n align-items: center;\n color: ",";\n padding-left: 12px;\n\n .icon {\n color: ",";\n display: flex;\n align-items: center;\n margin-right: 12px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.labelColor}));t.PanelHeaderContent=me;var ge=$.default.div.attrs({className:"side-panel-panel__content"})(y||(y=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.PanelContent=ge;var ye=$.default.div.attrs({className:"side-panel-section"})(v||(v=(0,Q.default)(["\n margin-bottom: 12px;\n\n opacity: ",";\n pointer-events: ",";\n"])),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}));t.SidePanelSection=ye;var ve=$.default.div.attrs({className:"side-panel-divider"})(A||(A=(0,Q.default)(["\n border-bottom: "," solid\n ",";\n margin-bottom: ","px;\n height: ","px;\n"])),(function(e){return e.theme.sidepanelDividerBorder}),(function(e){return e.theme.panelBorderColor}),(function(e){return e.theme.sidepanelDividerMargin}),(function(e){return e.theme.sidepanelDividerHeight}));t.SidePanelDivider=ve;var Ae=(0,$.default)(ee.default)(b||(b=(0,Q.default)(["\n &.__react_component_tooltip {\n font-size: ",";\n font-weight: 400;\n padding: 7px 18px;\n box-shadow: ",";\n\n &.type-dark {\n background-color: ",";\n color: ",";\n &.place-bottom {\n :after {\n border-bottom-color: ",";\n }\n }\n\n &.place-top {\n :after {\n border-top-color: ",";\n }\n }\n\n &.place-right {\n :after {\n border-right-color: ",";\n }\n }\n\n &.place-left {\n :after {\n border-left-color: ",";\n }\n }\n }\n }\n"])),(function(e){return e.theme.tooltipFontSize}),(function(e){return e.theme.tooltipBoxShadow}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipColor}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}));t.Tooltip=Ae;var be=$.default.div.attrs((function(e){return{className:(0,ne.default)("button",e.className)}}))(_||(_=(0,Q.default)(["\n align-items: center;\n background-color: ",";\n border-radius: ",";\n color: ",";\n cursor: pointer;\n display: inline-flex;\n font-size: ",";\n font-weight: 500;\n font-family: ",";\n justify-content: center;\n letter-spacing: 0.3px;\n line-height: 14px;\n outline: 0;\n padding: ",";\n text-align: center;\n transition: ",";\n vertical-align: middle;\n width: ",";\n opacity: ",";\n pointer-events: ",";\n border: ",";\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n }\n\n svg {\n margin-right: ",";\n }\n"])),(function(e){return e.negative?e.theme.negativeBtnBgd:e.secondary?e.theme.secondaryBtnBgd:e.link?e.theme.linkBtnBgd:e.floating?e.theme.floatingBtnBgd:e.cta?e.theme.ctaBtnBgd:e.theme.primaryBtnBgd}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.negative?e.theme.negativeBtnColor:e.secondary?e.theme.secondaryBtnColor:e.link?e.theme.linkBtnColor:e.floating?e.theme.floatingBtnColor:e.cta?e.theme.ctaBtnColor:e.theme.primaryBtnColor}),(function(e){return e.large?e.theme.primaryBtnFontSizeLarge:e.small?e.theme.primaryBtnFontSizeSmall:e.theme.primaryBtnFontSizeDefault}),(function(e){return e.theme.btnFontFamily}),(function(e){return e.large?"14px 32px":e.small?"6px 9px":"9px 12px"}),(function(e){return e.theme.transition}),(function(e){return e.width||"auto"}),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.negative?e.theme.negativeBtnBorder:e.secondary?e.theme.secondaryBtnBorder:e.floating?e.theme.floatingBtnBorder:e.link?e.theme.linkBtnBorder:e.theme.primaryBtnBorder}),(function(e){return e.negative?e.theme.negativeBtnBgdHover:e.secondary?e.theme.secondaryBtnBgdHover:e.link?e.theme.linkBtnActBgdHover:e.floating?e.theme.floatingBtnBgdHover:e.cta?e.theme.ctaBtnBgdHover:e.theme.primaryBtnBgdHover}),(function(e){return e.negative?e.theme.negativeBtnActColor:e.secondary?e.theme.secondaryBtnActColor:e.link?e.theme.linkBtnActColor:e.floating?e.theme.floatingBtnActColor:e.cta?e.theme.ctaBtnActColor:e.theme.primaryBtnActColor}),(function(e){return e.large?"10px":e.small?"6px":"8px"}));t.Button=be;var _e=$.default.input(E||(E=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.Input=_e;var Ee=$.default.input(x||(x=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inputLT}));t.InputLight=Ee;var xe=$.default.textarea(M||(M=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.TextArea=xe;var Me=$.default.textarea(w||(w=(0,Q.default)(["\n "," height: auto;\n white-space: pre-wrap;\n"])),(function(e){return e.theme.inputLT}));t.TextAreaLight=Me;var we=(0,$.default)(_e)(O||(O=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inlineInput}));t.InlineInput=we;var Oe=$.default.div(S||(S=(0,Q.default)(["\n background-color: ",";\n border-left: 3px solid\n rgb(\n ","\n );\n padding: 0 10px 0 0;\n height: ","px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: ",";\n transition: ",";\n"])),(function(e){return e.active?e.theme.panelBackgroundHover:e.theme.panelBackground}),(function(e){return e.labelRCGColorValues?e.labelRCGColorValues.join(","):"transparent"}),(function(e){return e.theme.panelHeaderHeight}),(function(e){return e.theme.panelHeaderBorderRadius}),(function(e){return e.theme.transition}));t.StyledPanelHeader=Oe;var Se=$.default.div(T||(T=(0,Q.default)(["\n ","\n background-color: ",";\n overflow-y: auto;\n box-shadow: ",";\n border-radius: ",";\n max-height: 500px;\n position: relative;\n z-index: 999;\n"])),(function(e){return e.theme.panelDropdownScrollBar}),(function(e){return"light"===e.type?e.theme.modalDropdownBackground:e.theme.panelBackground}),(function(e){return e.theme.panelBoxShadow}),(function(e){return e.theme.panelBorderRadius}));t.StyledPanelDropdown=Se;var Te=$.default.div(C||(C=(0,Q.default)(["\n display: flex;\n .button {\n border-radius: 0;\n margin-left: 2px;\n }\n .button:first-child {\n border-bottom-left-radius: ",";\n border-top-left-radius: ",";\n margin-left: 0;\n }\n .button:last-child {\n border-bottom-right-radius: ",";\n border-top-right-radius: ",";\n }\n"])),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}));t.ButtonGroup=Te;var Ce=$.default.div(L||(L=(0,Q.default)(["\n display: inline-block;\n width: 8px;\n height: 8px;\n background-color: rgb(",");\n margin-right: 12px;\n"])),(function(e){return e.color.join(",")}));t.DatasetSquare=Ce;var Le=$.default.div(P||(P=(0,Q.default)(["\n position: relative;\n border-radius: 2px;\n border: 1px solid\n ",";\n color: ",";\n background-color: ",";\n\n cursor: pointer;\n font-weight: 500;\n margin-right: 6px;\n padding: 6px 16px;\n\n :hover {\n color: ",";\n border: 1px solid ",";\n }\n"])),(function(e){return e.selected?e.theme.selectionBtnBorderActColor:e.theme.selectionBtnBorderColor}),(function(e){return e.selected?e.theme.selectionBtnActColor:e.theme.selectionBtnColor}),(function(e){return e.selected?e.theme.selectionBtnActBgd:e.theme.selectionBtnBgd}),(function(e){return e.theme.selectionBtnActColor}),(function(e){return e.theme.selectionBtnBorderActColor}));t.SelectionButton=Le;var Pe=$.default.table(R||(R=(0,Q.default)(["\n width: 100%;\n border-spacing: 0;\n\n thead {\n tr th {\n background: ",";\n color: ",";\n padding: 18px 12px;\n text-align: start;\n }\n }\n\n tbody {\n tr td {\n border-bottom: ",";\n padding: 12px;\n }\n }\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.titleColorLT}),(function(e){return e.theme.panelBorderLT}));t.Table=Pe;var Re=$.default.div(D||(D=(0,Q.default)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction: row;\n font-size: 10px;\n padding: 24px ",";\n margin: 0 -",";\n justify-content: space-between;\n ",";\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.modalLateralPadding}),(function(e){return e.theme.modalLateralPadding}),te.media.portable(k||(k=(0,Q.default)(["\n flex-direction: column;\n padding: 16px ",";\n margin: 0 -",";\n "])),(function(e){return e.theme.modalPortableLateralPadding}),(function(e){return e.theme.modalPortableLateralPadding})));t.StyledModalContent=Re;var De=$.default.div.attrs({className:"modal-vertical-panel"})(I||(I=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n font-size: 12px;\n\n .modal-section:first-child {\n margin-top: 24px;\n ",";\n }\n\n input {\n margin-right: 8px;\n }\n"])),te.media.palm(F||(F=(0,Q.default)(["\n margin-top: 0;\n "]))));t.StyledModalVerticalPanel=De;var ke=$.default.div.attrs({className:"modal-section"})(j||(j=(0,Q.default)(["\n margin-bottom: 32px;\n\n .modal-section-title {\n font-weight: 500;\n }\n .modal-section-subtitle {\n color: ",";\n }\n\n input {\n margin-top: 8px;\n }\n\n ",";\n ",";\n"])),(function(e){return e.theme.subtextColorLT}),te.media.portable(B||(B=(0,Q.default)(["\n margin-bottom: 24px;\n "]))),te.media.palm(N||(N=(0,Q.default)(["\n margin-bottom: 16px;\n "]))));t.StyledModalSection=ke;var Ie=$.default.div.attrs({className:"modal-input__footnote"})(z||(z=(0,Q.default)(["\n display: flex;\n justify-content: flex-end;\n color: ",";\n font-size: 10px;\n"])),(function(e){return e.error?e.theme.errorColor:e.theme.subtextColorLT}));t.StyledModalInputFootnote=Ie;var Fe=$.default.div(U||(U=(0,Q.default)(["\n width: 100%;\n height: 100%;\n .mapboxgl-map {\n .mapboxgl-missing-css {\n display: none;\n }\n .mapboxgl-ctrl-attrib {\n display: none;\n }\n }\n"])));t.StyledMapContainer=Fe;var je=$.default.div.attrs({className:"mapbox-attribution-container"})(H||(H=(0,Q.default)(["\n bottom: 0;\n right: 0;\n position: absolute;\n display: block;\n margin: 0 10px 2px;\n z-index: 0;\n\n .attrition-logo {\n display: flex;\n font-size: 10px;\n justify-content: flex-end;\n align-items: center;\n color: ",";\n margin-bottom: -4px;\n\n a.mapboxgl-ctrl-logo {\n width: 72px;\n margin-left: 6px;\n }\n }\n a {\n font-size: 10px;\n }\n"])),(function(e){return e.theme.labelColor}));t.StyledAttrbution=je;var Be=$.default.div(V||(V=(0,Q.default)(["\n display: flex;\n flex-direction: row;\n margin: 35px 0;\n width: 100%;\n color: ",";\n font-size: 12px;\n opacity: ",";\n pointer-events: ",";\n\n .description {\n width: 185px;\n .title {\n font-weight: 500;\n }\n .subtitle {\n color: ",";\n font-size: 11px;\n }\n }\n .warning {\n color: ",";\n font-weight: 500;\n }\n .description.full {\n width: 100%;\n }\n .selection {\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n padding-left: 50px;\n\n select {\n background-color: white;\n border-radius: 1px;\n display: inline-block;\n font: inherit;\n line-height: 1.5em;\n padding: 0.5em 3.5em 0.5em 1em;\n margin: 0;\n box-sizing: border-box;\n appearance: none;\n width: 250px;\n height: 36px;\n\n background-image: linear-gradient(45deg, transparent 50%, gray 50%),\n linear-gradient(135deg, gray 50%, transparent 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px),\n calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n }\n\n select:focus {\n background-image: linear-gradient(45deg, green 50%, transparent 50%),\n linear-gradient(135deg, transparent 50%, green 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 15px) 1em, calc(100% - 20px) 1em, calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n border-color: green;\n outline: 0;\n }\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.disabled?.3:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.theme.subtextColorLT}),(function(e){return e.theme.errorColor}));t.StyledExportSection=Be;var Ne=(0,$.default)(Le)(G||(G=(0,Q.default)(["\n align-items: center;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin: 4px;\n padding: 8px 12px;\n width: 140px;\n\n .filter-option-title {\n color: ",";\n font-size: 12px;\n font-weight: 500;\n }\n .filter-option-subtitle {\n color: ",";\n font-size: 11px;\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.subtextColorLT}));t.StyledFilteredOption=Ne;var ze=(0,$.default)(Le)(Y||(Y=(0,Q.default)(["\n height: 100px;\n margin: 4px;\n padding: 6px 10px;\n width: 100px;\n"])));t.StyledType=ze;var Ue=$.default.div(W||(W=(0,Q.default)(["\n z-index: 1;\n"])));t.WidgetContainer=Ue;var He=$.default.div(q||(q=(0,Q.default)(["\n background-color: ",";\n padding: ",";\n position: relative;\n margin-top: ","px;\n"])),(function(e){return e.theme.bottomWidgetBgd}),(function(e){return"".concat(e.theme.bottomInnerPdVert,"px ").concat(e.theme.bottomInnerPdSide,"px")}),(function(e){return e.theme.bottomPanelGap}));t.BottomWidgetInner=He;var Ve=(0,$.default)(be).attrs({className:"map-control-button"})(X||(X=(0,Q.default)(["\n box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.16);\n height: 32px;\n width: 32px;\n padding: 0;\n border-radius: 0;\n background-color: ",";\n color: ",";\n border: ",";\n\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n border: ",";\n }\n svg {\n margin-right: 0;\n }\n"])),(function(e){return e.active?e.theme.floatingBtnBgdHover:e.theme.floatingBtnBgd}),(function(e){return e.active?e.theme.floatingBtnActColor:e.theme.floatingBtnColor}),(function(e){return e.active?e.theme.floatingBtnBorderHover:e.theme.floatingBtnBorder}),(function(e){return e.theme.floatingBtnBgdHover}),(function(e){return e.theme.floatingBtnActColor}),(function(e){return e.theme.floatingBtnBorderHover}));t.MapControlButton=Ve;var Ge=$.default.div(K||(K=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.StyledFilterContent=Ge;var Ye=$.default.div(Z||(Z=(0,Q.default)(["\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));t.TruncatedTitleText=Ye;var We=$.default.span.attrs({className:"checkbox-inner"})(J||(J=(0,Q.default)(["\n background-color: ",";\n position: absolute;\n top: 0;\n right: 0;\n display: block;\n width: 10px;\n height: 10px;\n border-top-left-radius: 2px;\n\n :after {\n position: absolute;\n display: table;\n border: 1px solid #fff;\n border-top: 0;\n border-left: 0;\n transform: rotate(45deg) scale(1) translate(-50%, -50%);\n opacity: 1;\n content: ' ';\n top: 40%;\n left: 30%;\n width: 3.2px;\n height: 6.22px;\n }\n"])),(function(e){return e.theme.selectionBtnBorderActColor}));t.CheckMark=We},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CheckMark=t.TruncatedTitleText=t.StyledFilterContent=t.MapControlButton=t.BottomWidgetInner=t.WidgetContainer=t.StyledType=t.StyledFilteredOption=t.StyledExportSection=t.StyledAttrbution=t.StyledMapContainer=t.StyledModalInputFootnote=t.StyledModalSection=t.StyledModalVerticalPanel=t.StyledModalContent=t.Table=t.SelectionButton=t.DatasetSquare=t.ButtonGroup=t.StyledPanelDropdown=t.StyledPanelHeader=t.InlineInput=t.TextAreaLight=t.TextArea=t.InputLight=t.Input=t.Button=t.Tooltip=t.SidePanelDivider=t.SidePanelSection=t.PanelContent=t.PanelHeaderContent=t.PanelHeaderTitle=t.PanelLabelBold=t.PanelLabelWrapper=t.PanelLabel=t.SBFlexboxNoMargin=t.SBFlexboxItem=t.SpaceBetweenFlexbox=t.CenterVerticalFlexbox=t.CenterFlexbox=t.IconRoundSmall=t.SelectTextBold=t.SelectText=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g,y,v,A,b,_,E,x,M,w,O,S,T,C,L,P,R,D,k,I,F,j,B,N,z,U,H,V,G,Y,W,q,X,K,Z,J,Q=r(n(12)),$=r(n(11)),ee=r(n(1169)),te=n(227),ne=r(n(36)),re=$.default.span(a||(a=(0,Q.default)(["\n color: ",";\n font-size: ",";\n font-weight: 400;\n\n i {\n font-size: 13px;\n margin-right: 6px;\n }\n"])),(function(e){return e.theme.labelColor}),(function(e){return e.theme.selectFontSize}));t.SelectText=re;var ae=(0,$.default)(re)(o||(o=(0,Q.default)(["\n color: ",";\n font-weight: 500;\n"])),(function(e){return e.theme.textColor}));t.SelectTextBold=ae;var oe=$.default.div(i||(i=(0,Q.default)(["\n display: flex;\n width: 18px;\n height: 18px;\n border-radius: 9px;\n background-color: ",";\n color: ",";\n align-items: center;\n justify-content: center;\n\n :hover {\n cursor: pointer;\n background-color: ",";\n }\n"])),(function(e){return e.theme.secondaryBtnBgdHover}),(function(e){return e.theme.secondaryBtnColor}),(function(e){return e.theme.secondaryBtnBgdHover}));t.IconRoundSmall=oe;var ie=$.default.div(s||(s=(0,Q.default)(["\n display: flex;\n align-items: center;\n"])));t.CenterFlexbox=ie;var se=$.default.div(l||(l=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n align-items: center;\n"])));t.CenterVerticalFlexbox=se;var le=$.default.div(u||(u=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n margin-left: -16px;\n"])));t.SpaceBetweenFlexbox=le;var ue=$.default.div(c||(c=(0,Q.default)(["\n flex-grow: 1;\n margin-left: 16px;\n"])));t.SBFlexboxItem=ue;var ce=$.default.div(d||(d=(0,Q.default)(["\n display: flex;\n justify-content: space-between;\n"])));t.SBFlexboxNoMargin=ce;var de=$.default.label.attrs({className:"side-panel-panel__label"})(f||(f=(0,Q.default)(["\n color: ",";\n display: inline-block;\n font-size: 11px;\n font-weight: 400;\n margin-bottom: 4px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.labelColor}));t.PanelLabel=de;var fe=$.default.div.attrs({className:"side-panel-panel__label-wrapper"})(p||(p=(0,Q.default)(["\n display: flex;\n align-items: self-start;\n"])));t.PanelLabelWrapper=fe;var pe=(0,$.default)(de)(h||(h=(0,Q.default)(["\n font-weight: 500;\n"])));t.PanelLabelBold=pe;var he=$.default.span.attrs({className:"side-panel-panel__header__title"})(m||(m=(0,Q.default)(["\n color: ",";\n font-size: 13px;\n letter-spacing: 0.43px;\n text-transform: capitalize;\n"])),(function(e){return e.theme.textColor}));t.PanelHeaderTitle=he;var me=$.default.div(g||(g=(0,Q.default)(["\n display: flex;\n align-items: center;\n color: ",";\n padding-left: 12px;\n\n .icon {\n color: ",";\n display: flex;\n align-items: center;\n margin-right: 12px;\n }\n"])),(function(e){return e.theme.textColor}),(function(e){return e.theme.labelColor}));t.PanelHeaderContent=me;var ge=$.default.div.attrs({className:"side-panel-panel__content"})(y||(y=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.PanelContent=ge;var ye=$.default.div.attrs({className:"side-panel-section"})(v||(v=(0,Q.default)(["\n margin-bottom: 12px;\n\n opacity: ",";\n pointer-events: ",";\n"])),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}));t.SidePanelSection=ye;var ve=$.default.div.attrs({className:"side-panel-divider"})(A||(A=(0,Q.default)(["\n border-bottom: "," solid\n ",";\n margin-bottom: ","px;\n height: ","px;\n"])),(function(e){return e.theme.sidepanelDividerBorder}),(function(e){return e.theme.panelBorderColor}),(function(e){return e.theme.sidepanelDividerMargin}),(function(e){return e.theme.sidepanelDividerHeight}));t.SidePanelDivider=ve;var Ae=(0,$.default)(ee.default)(b||(b=(0,Q.default)(["\n &.__react_component_tooltip {\n font-size: ",";\n font-weight: 400;\n padding: 7px 18px;\n box-shadow: ",";\n\n &.type-dark {\n background-color: ",";\n color: ",";\n &.place-bottom {\n :after {\n border-bottom-color: ",";\n }\n }\n\n &.place-top {\n :after {\n border-top-color: ",";\n }\n }\n\n &.place-right {\n :after {\n border-right-color: ",";\n }\n }\n\n &.place-left {\n :after {\n border-left-color: ",";\n }\n }\n }\n }\n"])),(function(e){return e.theme.tooltipFontSize}),(function(e){return e.theme.tooltipBoxShadow}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipColor}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}),(function(e){return e.theme.tooltipBg}));t.Tooltip=Ae;var be=$.default.div.attrs((function(e){return{className:(0,ne.default)("button",e.className)}}))(_||(_=(0,Q.default)(["\n align-items: center;\n background-color: ",";\n border-radius: ",";\n color: ",";\n cursor: pointer;\n display: inline-flex;\n font-size: ",";\n font-weight: 500;\n font-family: ",";\n justify-content: center;\n letter-spacing: 0.3px;\n line-height: 14px;\n outline: 0;\n padding: ",";\n text-align: center;\n transition: ",";\n vertical-align: middle;\n width: ",";\n opacity: ",";\n pointer-events: ",";\n border: ",";\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n }\n\n svg {\n margin-right: ",";\n }\n"])),(function(e){return e.negative?e.theme.negativeBtnBgd:e.secondary?e.theme.secondaryBtnBgd:e.link?e.theme.linkBtnBgd:e.floating?e.theme.floatingBtnBgd:e.cta?e.theme.ctaBtnBgd:e.theme.primaryBtnBgd}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.negative?e.theme.negativeBtnColor:e.secondary?e.theme.secondaryBtnColor:e.link?e.theme.linkBtnColor:e.floating?e.theme.floatingBtnColor:e.cta?e.theme.ctaBtnColor:e.theme.primaryBtnColor}),(function(e){return e.large?e.theme.primaryBtnFontSizeLarge:e.small?e.theme.primaryBtnFontSizeSmall:e.theme.primaryBtnFontSizeDefault}),(function(e){return e.theme.btnFontFamily}),(function(e){return e.large?"14px 32px":e.small?"6px 9px":"9px 12px"}),(function(e){return e.theme.transition}),(function(e){return e.width||"auto"}),(function(e){return e.disabled?.4:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.negative?e.theme.negativeBtnBorder:e.secondary?e.theme.secondaryBtnBorder:e.floating?e.theme.floatingBtnBorder:e.link?e.theme.linkBtnBorder:e.theme.primaryBtnBorder}),(function(e){return e.negative?e.theme.negativeBtnBgdHover:e.secondary?e.theme.secondaryBtnBgdHover:e.link?e.theme.linkBtnActBgdHover:e.floating?e.theme.floatingBtnBgdHover:e.cta?e.theme.ctaBtnBgdHover:e.theme.primaryBtnBgdHover}),(function(e){return e.negative?e.theme.negativeBtnActColor:e.secondary?e.theme.secondaryBtnActColor:e.link?e.theme.linkBtnActColor:e.floating?e.theme.floatingBtnActColor:e.cta?e.theme.ctaBtnActColor:e.theme.primaryBtnActColor}),(function(e){return e.large?"10px":e.small?"6px":"8px"}));t.Button=be;var _e=$.default.input(E||(E=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.Input=_e;var Ee=$.default.input(x||(x=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inputLT}));t.InputLight=Ee;var xe=$.default.textarea(M||(M=(0,Q.default)(["\n ",";\n"])),(function(e){return e.secondary?e.theme.secondaryInput:e.theme.input}));t.TextArea=xe;var Me=$.default.textarea(w||(w=(0,Q.default)(["\n "," height: auto;\n white-space: pre-wrap;\n"])),(function(e){return e.theme.inputLT}));t.TextAreaLight=Me;var we=(0,$.default)(_e)(O||(O=(0,Q.default)(["\n ",";\n"])),(function(e){return e.theme.inlineInput}));t.InlineInput=we;var Oe=$.default.div(S||(S=(0,Q.default)(["\n background-color: ",";\n border-left: 3px solid\n rgb(\n ","\n );\n padding: 0 10px 0 0;\n height: ","px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-radius: ",";\n transition: ",";\n"])),(function(e){return e.active?e.theme.panelBackgroundHover:e.theme.panelBackground}),(function(e){return e.labelRCGColorValues?e.labelRCGColorValues.join(","):"transparent"}),(function(e){return e.theme.panelHeaderHeight}),(function(e){return e.theme.panelHeaderBorderRadius}),(function(e){return e.theme.transition}));t.StyledPanelHeader=Oe;var Se=$.default.div(T||(T=(0,Q.default)(["\n ","\n background-color: ",";\n overflow-y: auto;\n box-shadow: ",";\n border-radius: ",";\n max-height: 500px;\n position: relative;\n z-index: 999;\n"])),(function(e){return e.theme.panelDropdownScrollBar}),(function(e){return"light"===e.type?e.theme.modalDropdownBackground:e.theme.panelBackground}),(function(e){return e.theme.panelBoxShadow}),(function(e){return e.theme.panelBorderRadius}));t.StyledPanelDropdown=Se;var Te=$.default.div(C||(C=(0,Q.default)(["\n display: flex;\n .button {\n border-radius: 0;\n margin-left: 2px;\n }\n .button:first-child {\n border-bottom-left-radius: ",";\n border-top-left-radius: ",";\n margin-left: 0;\n }\n .button:last-child {\n border-bottom-right-radius: ",";\n border-top-right-radius: ",";\n }\n"])),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}),(function(e){return e.theme.primaryBtnRadius}));t.ButtonGroup=Te;var Ce=$.default.div(L||(L=(0,Q.default)(["\n display: inline-block;\n width: 8px;\n height: 8px;\n background-color: rgb(",");\n margin-right: 12px;\n"])),(function(e){return e.color.join(",")}));t.DatasetSquare=Ce;var Le=$.default.div(P||(P=(0,Q.default)(["\n position: relative;\n border-radius: 2px;\n border: 1px solid\n ",";\n color: ",";\n background-color: ",";\n\n cursor: pointer;\n font-weight: 500;\n margin-right: 6px;\n padding: 6px 16px;\n\n :hover {\n color: ",";\n border: 1px solid ",";\n }\n"])),(function(e){return e.selected?e.theme.selectionBtnBorderActColor:e.theme.selectionBtnBorderColor}),(function(e){return e.selected?e.theme.selectionBtnActColor:e.theme.selectionBtnColor}),(function(e){return e.selected?e.theme.selectionBtnActBgd:e.theme.selectionBtnBgd}),(function(e){return e.theme.selectionBtnActColor}),(function(e){return e.theme.selectionBtnBorderActColor}));t.SelectionButton=Le;var Pe=$.default.table(R||(R=(0,Q.default)(["\n width: 100%;\n border-spacing: 0;\n\n thead {\n tr th {\n background: ",";\n color: ",";\n padding: 18px 12px;\n text-align: start;\n }\n }\n\n tbody {\n tr td {\n border-bottom: ",";\n padding: 12px;\n }\n }\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.titleColorLT}),(function(e){return e.theme.panelBorderLT}));t.Table=Pe;var Re=$.default.div(D||(D=(0,Q.default)(["\n background: ",";\n color: ",";\n display: flex;\n flex-direction: row;\n font-size: 10px;\n padding: 24px ",";\n margin: 0 -",";\n justify-content: space-between;\n ",";\n"])),(function(e){return e.theme.panelBackgroundLT}),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.modalLateralPadding}),(function(e){return e.theme.modalLateralPadding}),te.media.portable(k||(k=(0,Q.default)(["\n flex-direction: column;\n padding: 16px ",";\n margin: 0 -",";\n "])),(function(e){return e.theme.modalPortableLateralPadding}),(function(e){return e.theme.modalPortableLateralPadding})));t.StyledModalContent=Re;var De=$.default.div.attrs({className:"modal-vertical-panel"})(I||(I=(0,Q.default)(["\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n font-size: 12px;\n\n .modal-section:first-child {\n margin-top: 24px;\n ",";\n }\n\n input {\n margin-right: 8px;\n }\n"])),te.media.palm(F||(F=(0,Q.default)(["\n margin-top: 0;\n "]))));t.StyledModalVerticalPanel=De;var ke=$.default.div.attrs({className:"modal-section"})(j||(j=(0,Q.default)(["\n margin-bottom: 32px;\n\n .modal-section-title {\n font-weight: 500;\n }\n .modal-section-subtitle {\n color: ",";\n }\n\n input {\n margin-top: 8px;\n }\n\n ",";\n ",";\n"])),(function(e){return e.theme.subtextColorLT}),te.media.portable(B||(B=(0,Q.default)(["\n margin-bottom: 24px;\n "]))),te.media.palm(N||(N=(0,Q.default)(["\n margin-bottom: 16px;\n "]))));t.StyledModalSection=ke;var Ie=$.default.div.attrs({className:"modal-input__footnote"})(z||(z=(0,Q.default)(["\n display: flex;\n justify-content: flex-end;\n color: ",";\n font-size: 10px;\n"])),(function(e){return e.error?e.theme.errorColor:e.theme.subtextColorLT}));t.StyledModalInputFootnote=Ie;var Fe=$.default.div(U||(U=(0,Q.default)(["\n width: 100%;\n height: 100%;\n .mapboxgl-map {\n .mapboxgl-missing-css {\n display: none;\n }\n .mapboxgl-ctrl-attrib {\n display: none;\n }\n }\n"])));t.StyledMapContainer=Fe;var je=$.default.div.attrs({className:"mapbox-attribution-container"})(H||(H=(0,Q.default)(["\n bottom: 0;\n right: 0;\n position: absolute;\n display: block;\n margin: 0 10px 2px;\n z-index: 0;\n\n .attrition-logo {\n display: flex;\n font-size: 10px;\n justify-content: flex-end;\n align-items: center;\n color: ",";\n margin-bottom: -4px;\n\n a.mapboxgl-ctrl-logo {\n width: 72px;\n margin-left: 6px;\n }\n }\n a {\n font-size: 10px;\n }\n"])),(function(e){return e.theme.labelColor}));t.StyledAttrbution=je;var Be=$.default.div(V||(V=(0,Q.default)(["\n display: flex;\n flex-direction: row;\n margin: 35px 0;\n width: 100%;\n color: ",";\n font-size: 12px;\n opacity: ",";\n pointer-events: ",";\n\n .description {\n width: 185px;\n .title {\n font-weight: 500;\n }\n .subtitle {\n color: ",";\n font-size: 11px;\n }\n }\n .warning {\n color: ",";\n font-weight: 500;\n }\n .description.full {\n width: 100%;\n }\n .selection {\n display: flex;\n flex-wrap: wrap;\n flex: 1;\n padding-left: 50px;\n\n select {\n background-color: white;\n border-radius: 1px;\n display: inline-block;\n font: inherit;\n line-height: 1.5em;\n padding: 0.5em 3.5em 0.5em 1em;\n margin: 0;\n box-sizing: border-box;\n appearance: none;\n width: 250px;\n height: 36px;\n\n background-image: linear-gradient(45deg, transparent 50%, gray 50%),\n linear-gradient(135deg, gray 50%, transparent 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 20px) calc(1em + 2px), calc(100% - 15px) calc(1em + 2px),\n calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n }\n\n select:focus {\n background-image: linear-gradient(45deg, green 50%, transparent 50%),\n linear-gradient(135deg, transparent 50%, green 50%), linear-gradient(to right, #ccc, #ccc);\n background-position: calc(100% - 15px) 1em, calc(100% - 20px) 1em, calc(100% - 2.5em) 4.5em;\n background-size: 5px 5px, 5px 5px, 1px 1.5em;\n background-repeat: no-repeat;\n border-color: green;\n outline: 0;\n }\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.disabled?.3:1}),(function(e){return e.disabled?"none":"all"}),(function(e){return e.theme.subtextColorLT}),(function(e){return e.theme.errorColor}));t.StyledExportSection=Be;var Ne=(0,$.default)(Le)(G||(G=(0,Q.default)(["\n align-items: center;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin: 4px;\n padding: 8px 12px;\n width: 140px;\n\n .filter-option-title {\n color: ",";\n font-size: 12px;\n font-weight: 500;\n }\n .filter-option-subtitle {\n color: ",";\n font-size: 11px;\n }\n"])),(function(e){return e.theme.textColorLT}),(function(e){return e.theme.subtextColorLT}));t.StyledFilteredOption=Ne;var ze=(0,$.default)(Le)(Y||(Y=(0,Q.default)(["\n height: 100px;\n margin: 4px;\n padding: 6px 10px;\n width: 100px;\n"])));t.StyledType=ze;var Ue=$.default.div(W||(W=(0,Q.default)(["\n z-index: 1;\n"])));t.WidgetContainer=Ue;var He=$.default.div(q||(q=(0,Q.default)(["\n background-color: ",";\n padding: ",";\n position: relative;\n margin-top: ","px;\n"])),(function(e){return e.theme.bottomWidgetBgd}),(function(e){return"".concat(e.theme.bottomInnerPdVert,"px ").concat(e.theme.bottomInnerPdSide,"px")}),(function(e){return e.theme.bottomPanelGap}));t.BottomWidgetInner=He;var Ve=(0,$.default)(be).attrs({className:"map-control-button"})(X||(X=(0,Q.default)(["\n box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.16);\n height: 32px;\n width: 32px;\n padding: 0;\n border-radius: 0;\n background-color: ",";\n color: ",";\n border: ",";\n\n :hover,\n :focus,\n :active,\n &.active {\n background-color: ",";\n color: ",";\n border: ",";\n }\n svg {\n margin-right: 0;\n }\n"])),(function(e){return e.active?e.theme.floatingBtnBgdHover:e.theme.floatingBtnBgd}),(function(e){return e.active?e.theme.floatingBtnActColor:e.theme.floatingBtnColor}),(function(e){return e.active?e.theme.floatingBtnBorderHover:e.theme.floatingBtnBorder}),(function(e){return e.theme.floatingBtnBgdHover}),(function(e){return e.theme.floatingBtnActColor}),(function(e){return e.theme.floatingBtnBorderHover}));t.MapControlButton=Ve;var Ge=$.default.div(K||(K=(0,Q.default)(["\n background-color: ",";\n padding: 12px;\n"])),(function(e){return e.theme.panelContentBackground}));t.StyledFilterContent=Ge;var Ye=$.default.div(Z||(Z=(0,Q.default)(["\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n"])));t.TruncatedTitleText=Ye;var We=$.default.span.attrs({className:"checkbox-inner"})(J||(J=(0,Q.default)(["\n background-color: ",";\n position: absolute;\n top: 0;\n right: 0;\n display: block;\n width: 10px;\n height: 10px;\n border-top-left-radius: 2px;\n\n :after {\n position: absolute;\n display: table;\n border: 1px solid #fff;\n border-top: 0;\n border-left: 0;\n transform: rotate(45deg) scale(1) translate(-50%, -50%);\n opacity: 1;\n content: ' ';\n top: 40%;\n left: 30%;\n width: 3.2px;\n height: 6.22px;\n }\n"])),(function(e){return e.theme.selectionBtnBorderActColor}));t.CheckMark=We},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.MASK_LAYER_ID=t.MAP_CONTROLS=t.DATASET_FORMATS=t.LOADING_METHODS=t.MAP_INFO_CHARACTER=t.MAP_THUMBNAIL_DIMENSION=t.MAX_GPU_FILTERS=t.EDITOR_AVAILABLE_LAYERS=t.EDITOR_MODES=t.GEOCODER_ICON_SIZE=t.GEOCODER_ICON_COLOR=t.GEOCODER_GEO_OFFSET=t.GEOCODER_LAYER_ID=t.GEOCODER_DATASET_NAME=t.SPEED_CONTROL_STEP=t.SPEED_CONTROL_RANGE=t.DEFAULT_TIME_FORMAT=t.ANIMATION_WINDOW=t.FPS=t.BASE_SPEED=t.THROTTLE_NOTIFICATION_TIME=t.DEFAULT_NOTIFICATION_TOPICS=t.DEFAULT_NOTIFICATION_TYPES=t.DEFAULT_NOTIFICATION_MESSAGE=t.DEFAULT_UUID_COUNT=t.EXPORT_HTML_MAP_MODE_OPTIONS=t.EXPORT_MAP_FORMAT_OPTIONS=t.EXPORT_HTML_MAP_MODES=t.EXPORT_MAP_FORMATS=t.EXPORT_DATA_TYPE_OPTIONS=t.EXPORT_DATA_TYPE=t.EXPORT_IMG_RESOLUTION_OPTIONS=t.EXPORT_IMG_RATIO_OPTIONS=t.EXPORT_IMG_RATIOS=t.RESOLUTIONS=t.MAX_DEFAULT_TOOLTIPS=t.LAYER_BLENDINGS=t.NO_VALUE_COLOR=t.DEFAULT_TOOLTIP_FIELDS=t.DEFAULT_LAYER_COLOR=t.CHANNEL_SCALE_SUPPORTED_FIELDS=t.FIELD_OPTS=t.DEFAULT_AGGREGATION=t.notSupportAggrOpts=t.notSupportedScaleOpts=t.ordinalFieldAggrScaleFunctions=t.ordinalFieldScaleFunctions=t.linearFieldAggrScaleFunctions=t.linearFieldScaleFunctions=t.AGGREGATION_TYPES=t.CHANNEL_SCALES=t.HIGHLIGH_COLOR_3D=t.FIELD_COLORS=t.FILED_TYPE_DISPLAY=t.TABLE_OPTION_LIST=t.TABLE_OPTION=t.SORT_ORDER=t.ALL_FIELD_TYPES=t.SCALE_FUNC=t.SCALE_TYPES=t.FILTER_TYPES=t.TRIP_ARC_FIELDS=t.TRIP_POINT_FIELDS=t.ICON_FIELDS=t.GEOJSON_FIELDS=t.DEFAULT_MAP_STYLES=t.DEFAULT_LAYER_GROUPS=t.PANELS=t.SIDEBAR_PANELS=t.THEME=t.DIMENSIONS=t.KEPLER_GL_WEBSITE=t.KEPLER_GL_VERSION=t.KEPLER_GL_NAME=t.SHARE_MAP_ID=t.OVERWRITE_MAP_ID=t.SAVE_MAP_ID=t.EXPORT_MAP_ID=t.ADD_MAP_STYLE_ID=t.EXPORT_DATA_ID=t.EXPORT_IMAGE_ID=t.ADD_DATA_ID=t.DELETE_DATA_ID=t.DATA_TABLE_ID=t.DEFAULT_MAPBOX_API_URL=t.ICON_PREFIX=t.CLOUDFRONT=t.ACTION_PREFIX=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g=r(n(3)),y=r(n(137)),v=n(191),A=n(133),b=n(44),_=n(69),E=n(310),x=n(259);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){(0,g.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.ACTION_PREFIX="@@kepler.gl/";var O="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl";t.CLOUDFRONT=O;var S="".concat(O,"/geodude");t.ICON_PREFIX=S;t.DEFAULT_MAPBOX_API_URL="https://api.mapbox.com";t.DATA_TABLE_ID="dataTable";t.DELETE_DATA_ID="deleteData";t.ADD_DATA_ID="addData";t.EXPORT_IMAGE_ID="exportImage";t.EXPORT_DATA_ID="exportData";t.ADD_MAP_STYLE_ID="addMapStyle";t.EXPORT_MAP_ID="exportMap";t.SAVE_MAP_ID="saveMap";t.OVERWRITE_MAP_ID="overwriteMap";t.SHARE_MAP_ID="shareMap";t.KEPLER_GL_NAME="kepler.gl";t.KEPLER_GL_VERSION="0.0.20";t.KEPLER_GL_WEBSITE="http://kepler.gl/";t.DIMENSIONS={sidePanel:{width:300,margin:{top:20,left:20,bottom:30,right:20},headerHeight:96},mapControl:{width:184,padding:12}};var T=(0,y.default)({light:null,dark:null,base:null});t.THEME=T;var C=[{id:"layer",label:"sidebar.panels.layer",iconComponent:b.Layers,onClick:null},{id:"filter",label:"sidebar.panels.filter",iconComponent:b.FilterFunnel,onClick:null},{id:"interaction",label:"sidebar.panels.interaction",iconComponent:b.CursorClick,onClick:null},{id:"map",label:"sidebar.panels.basemap",iconComponent:b.Settings,onClick:null}];t.SIDEBAR_PANELS=C;var L=C;t.PANELS=L;var P=[{slug:"label",filter:function(e){return e.id.match(/(?=(label|place-|poi-))/)},defaultVisibility:!0},{slug:"road",filter:function(e){return e.id.match(/(?=(road|railway|tunnel|street|bridge))(?!.*label)/)},defaultVisibility:!0},{slug:"border",filter:function(e){return e.id.match(/border|boundaries/)},defaultVisibility:!1},{slug:"building",filter:function(e){return e.id.match(/building/)},defaultVisibility:!0},{slug:"water",filter:function(e){return e.id.match(/(?=(water|stream|ferry))/)},defaultVisibility:!0},{slug:"land",filter:function(e){return e.id.match(/(?=(parks|landcover|industrial|sand|hillshade))/)},defaultVisibility:!0},{slug:"3d building",filter:function(){return!1},defaultVisibility:!1}];t.DEFAULT_LAYER_GROUPS=P;var R=[{id:"dark",label:"Dark",url:"mapbox://styles/uberdata/cjoqbbf6l9k302sl96tyvka09",icon:"".concat(S,"/UBER_DARK_V2.png"),layerGroups:P},{id:"light",label:"Light",url:"mapbox://styles/uberdata/cjoqb9j339k1f2sl9t5ic5bn4",icon:"".concat(S,"/UBER_LIGHT_V2.png"),layerGroups:P},{id:"muted",label:"Muted Light",url:"mapbox://styles/uberdata/cjfyl03kp1tul2smf5v2tbdd4",icon:"".concat(S,"/UBER_MUTED_LIGHT.png"),layerGroups:P},{id:"muted_night",label:"Muted Night",url:"mapbox://styles/uberdata/cjfxhlikmaj1b2soyzevnywgs",icon:"".concat(S,"/UBER_MUTED_NIGHT.png"),layerGroups:P},{id:"satellite",label:"Satellite",url:"mapbox://styles/mapbox/satellite-v9",icon:"".concat(S,"/UBER_SATELLITE.png")}];t.DEFAULT_MAP_STYLES=R;t.GEOJSON_FIELDS={geojson:["_geojson","all_points","geojson"]};t.ICON_FIELDS={icon:["icon"]};t.TRIP_POINT_FIELDS=[["lat","lng"],["lat","lon"],["latitude","longitude"]];t.TRIP_ARC_FIELDS={lat0:"begintrip",lng0:"begintrip",lat1:"dropoff",lng1:"dropoff"};var D=(0,y.default)({range:null,select:null,input:null,timeRange:null,multiSelect:null,polygon:null});t.FILTER_TYPES=D;var k=(0,y.default)({ordinal:null,quantile:null,quantize:null,linear:null,sqrt:null,log:null,point:null});t.SCALE_TYPES=k;var I=(a={},(0,g.default)(a,k.linear,A.scaleLinear),(0,g.default)(a,k.quantize,A.scaleQuantize),(0,g.default)(a,k.quantile,A.scaleQuantile),(0,g.default)(a,k.ordinal,A.scaleOrdinal),(0,g.default)(a,k.sqrt,A.scaleSqrt),(0,g.default)(a,k.log,A.scaleLog),(0,g.default)(a,k.point,A.scalePoint),a);t.SCALE_FUNC=I;var F=(0,y.default)({boolean:null,date:null,geojson:null,integer:null,real:null,string:null,timestamp:null,point:null});t.ALL_FIELD_TYPES=F;var j=(0,y.default)({ASCENDING:null,DESCENDING:null,UNSORT:null});t.SORT_ORDER=j;var B=(0,y.default)({SORT_ASC:null,SORT_DES:null,UNSORT:null,PIN:null,UNPIN:null,COPY:null});t.TABLE_OPTION=B;var N=[{value:B.SORT_ASC,display:"Sort Ascending",icon:b.ArrowUp,condition:function(e){return e.sortMode!==j.ASCENDING}},{value:B.SORT_DES,display:"Sort Descending",icon:b.ArrowDown,condition:function(e){return e.sortMode!==j.DESCENDING}},{value:B.UNSORT,display:"Unsort Column",icon:b.Cancel,condition:function(e){return e.isSorted}},{value:B.PIN,display:"Pin Column",icon:b.Pin,condition:function(e){return!e.isPinned}},{value:B.UNPIN,display:"Unpin Column",icon:b.Cancel,condition:function(e){return e.isPinned}},{value:B.COPY,display:"Copy Column",icon:b.Clipboard}];t.TABLE_OPTION_LIST=N;var z=(o={},(0,g.default)(o,F.boolean,{label:"bool",color:"231, 189, 194"}),(0,g.default)(o,F.date,{label:"date",color:"160, 106, 206"}),(0,g.default)(o,F.geojson,{label:"geo",color:"106, 160, 206"}),(0,g.default)(o,F.integer,{label:"int",color:"248, 194, 28"}),(0,g.default)(o,F.real,{label:"float",color:"248, 194, 28"}),(0,g.default)(o,F.string,{label:"string",color:"140, 210, 205"}),(0,g.default)(o,F.timestamp,{label:"time",color:"106, 160, 56"}),(0,g.default)(o,F.point,{label:"point",color:"0, 172, 237"}),o);t.FILED_TYPE_DISPLAY=z;var U={default:"237, 88, 106"};t.FIELD_COLORS=U;t.HIGHLIGH_COLOR_3D=[255,255,255,60];var H=(0,y.default)({color:null,radius:null,size:null,colorAggr:null,sizeAggr:null});t.CHANNEL_SCALES=H;var V={count:"count",average:"average",maximum:"maximum",minimum:"minimum",median:"median",stdev:"stdev",sum:"sum",variance:"variance",mode:"mode",countUnique:"count unique"};t.AGGREGATION_TYPES=V;var G=(i={},(0,g.default)(i,H.color,[k.quantize,k.quantile]),(0,g.default)(i,H.radius,[k.sqrt]),(0,g.default)(i,H.size,[k.linear,k.sqrt,k.log]),i);t.linearFieldScaleFunctions=G;var Y=(u={},(0,g.default)(u,H.colorAggr,(s={},(0,g.default)(s,V.average,[k.quantize,k.quantile]),(0,g.default)(s,V.maximum,[k.quantize,k.quantile]),(0,g.default)(s,V.minimum,[k.quantize,k.quantile]),(0,g.default)(s,V.median,[k.quantize,k.quantile]),(0,g.default)(s,V.stdev,[k.quantize,k.quantile]),(0,g.default)(s,V.sum,[k.quantize,k.quantile]),(0,g.default)(s,V.variance,[k.quantize,k.quantile]),s)),(0,g.default)(u,H.sizeAggr,(l={},(0,g.default)(l,V.average,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.maximum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.minimum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.median,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.stdev,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.sum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.variance,[k.linear,k.sqrt,k.log]),l)),u);t.linearFieldAggrScaleFunctions=Y;var W=(c={},(0,g.default)(c,H.color,[k.ordinal]),(0,g.default)(c,H.radius,[k.point]),(0,g.default)(c,H.size,[k.point]),c);t.ordinalFieldScaleFunctions=W;var q=(f={},(0,g.default)(f,H.colorAggr,(d={},(0,g.default)(d,V.mode,[k.ordinal]),(0,g.default)(d,V.countUnique,[k.quantize,k.quantile]),d)),(0,g.default)(f,H.sizeAggr,{}),f);t.ordinalFieldAggrScaleFunctions=q;var X=(p={},(0,g.default)(p,H.color,[]),(0,g.default)(p,H.radius,[]),(0,g.default)(p,H.size,[]),p);t.notSupportedScaleOpts=X;var K=(h={},(0,g.default)(h,H.colorAggr,{}),(0,g.default)(h,H.sizeAggr,{}),h);t.notSupportAggrOpts=K;var Z=(m={},(0,g.default)(m,H.colorAggr,(0,g.default)({},V.count,[k.quantize,k.quantile])),(0,g.default)(m,H.sizeAggr,(0,g.default)({},V.count,[k.linear,k.sqrt,k.log])),m);t.DEFAULT_AGGREGATION=Z;var J={string:{type:"categorical",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[]}},real:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},timestamp:{type:"time",scale:w(w({},G),K),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE,E.TOOLTIP_FORMAT_TYPES.DATE_TIME]}},integer:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},boolean:{type:"boolean",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.BOOLEAN]}},date:{scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE]}},geojson:{type:"geometry",scale:w(w({},X),K),format:{legend:function(e){return"..."},tooltip:[]}}};t.FIELD_OPTS=J;var Q=Object.keys(H).reduce((function(e,t){return w(w({},e),{},(0,g.default)({},t,Object.keys(J).filter((function(e){return Object.keys(J[e].scale[t]).length}))))}),{});t.CHANNEL_SCALE_SUPPORTED_FIELDS=Q;t.DEFAULT_LAYER_COLOR={tripArc:"#9226C6",begintrip_lat:"#1E96BE",dropoff_lat:"#FF991F",request_lat:"#52A353"};t.DEFAULT_TOOLTIP_FIELDS=[];t.NO_VALUE_COLOR=[0,0,0,0];t.LAYER_BLENDINGS={additive:{label:"layerBlending.additive",blendFunc:["SRC_ALPHA","DST_ALPHA"],blendEquation:"FUNC_ADD"},normal:{label:"layerBlending.normal",blendFunc:["SRC_ALPHA","ONE_MINUS_SRC_ALPHA","ONE","ONE_MINUS_SRC_ALPHA"],blendEquation:["FUNC_ADD","FUNC_ADD"]},subtractive:{label:"layerBlending.subtractive",blendFunc:["ONE","ONE_MINUS_DST_COLOR","SRC_ALPHA","DST_ALPHA"],blendEquation:["FUNC_SUBTRACT","FUNC_ADD"]}};t.MAX_DEFAULT_TOOLTIPS=5;var $=(0,y.default)({ONE_X:null,TWO_X:null});t.RESOLUTIONS=$;var ee=(0,y.default)({SCREEN:null,FOUR_BY_THREE:null,SIXTEEN_BY_NINE:null,CUSTOM:null});t.EXPORT_IMG_RATIOS=ee;var te=[{id:ee.SCREEN,label:"modal.exportImage.ratioOriginalScreen",getSize:function(e,t){return{width:e,height:t}}},{id:ee.CUSTOM,hidden:!0,label:"modal.exportImage.ratioCustom",getSize:function(e,t){return{width:e,height:t}}},{id:ee.FOUR_BY_THREE,label:"modal.exportImage.ratio4_3",getSize:function(e,t){return{width:e,height:Math.round(.75*e)}}},{id:ee.SIXTEEN_BY_NINE,label:"modal.exportImage.ratio16_9",getSize:function(e,t){return{width:e,height:Math.round(.5625*e)}}}];t.EXPORT_IMG_RATIO_OPTIONS=te;var ne=[{id:$.ONE_X,label:"1x",available:!0,scale:1,getSize:function(e,t){return{width:e,height:t}}},{id:$.TWO_X,label:"2x",available:!0,scale:2,getSize:function(e,t){return{width:2*e,height:2*t}}}];t.EXPORT_IMG_RESOLUTION_OPTIONS=ne;var re=(0,y.default)({CSV:null});t.EXPORT_DATA_TYPE=re;var ae=[{id:re.CSV,label:re.CSV.toLowerCase(),available:!0}];t.EXPORT_DATA_TYPE_OPTIONS=ae;var oe=(0,y.default)({HTML:null,JSON:null});t.EXPORT_MAP_FORMATS=oe;var ie=(0,y.default)({READ:null,EDIT:null});t.EXPORT_HTML_MAP_MODES=ie;var se=Object.entries(oe).map((function(e){return{id:e[0],label:e[1].toLowerCase(),available:!0}}));t.EXPORT_MAP_FORMAT_OPTIONS=se;var le=Object.entries(ie).map((function(e){return{id:e[0],label:"modal.exportMap.html.".concat(e[1].toLowerCase()),available:!0,url:(0,_.getHTMLMapModeTileUrl)(e[1])}}));t.EXPORT_HTML_MAP_MODE_OPTIONS=le;t.DEFAULT_UUID_COUNT=6;t.DEFAULT_NOTIFICATION_MESSAGE="MESSAGE_NOT_PROVIDED";var ue=(0,y.default)({info:null,error:null,warning:null,success:null});t.DEFAULT_NOTIFICATION_TYPES=ue;var ce=(0,y.default)({global:null,file:null});t.DEFAULT_NOTIFICATION_TOPICS=ce;t.THROTTLE_NOTIFICATION_TIME=2500;t.BASE_SPEED=600;t.FPS=60;var de=(0,y.default)({free:null,incremental:null,point:null,interval:null});t.ANIMATION_WINDOW=de;t.DEFAULT_TIME_FORMAT="MM/DD/YY HH:mm:ssa";t.SPEED_CONTROL_RANGE=[0,10];t.SPEED_CONTROL_STEP=.001;t.GEOCODER_DATASET_NAME="geocoder_dataset";t.GEOCODER_LAYER_ID="geocoder_layer";t.GEOCODER_GEO_OFFSET=.05;t.GEOCODER_ICON_COLOR=[255,0,0];t.GEOCODER_ICON_SIZE=80;var fe={READ_ONLY:v.EditorModes.READ_ONLY,DRAW_POLYGON:v.EditorModes.DRAW_POLYGON,DRAW_RECTANGLE:v.EditorModes.DRAW_RECTANGLE,EDIT:v.EditorModes.EDIT_VERTEX};t.EDITOR_MODES=fe;var pe=[x.LAYER_TYPES.point,x.LAYER_TYPES.hexagon,x.LAYER_TYPES.arc,x.LAYER_TYPES.line,x.LAYER_TYPES.hexagonId];t.EDITOR_AVAILABLE_LAYERS=pe;t.MAX_GPU_FILTERS=4;t.MAP_THUMBNAIL_DIMENSION={width:300,height:200};t.MAP_INFO_CHARACTER={title:100,description:100};var he=(0,y.default)({upload:null,storage:null});t.LOADING_METHODS=he;var me=(0,y.default)({row:null,geojson:null,csv:null,keplergl:null});t.DATASET_FORMATS=me;var ge=(0,y.default)({visibleLayers:null,mapLegend:null,toggle3d:null,splitMap:null,mapDraw:null,mapLocale:null});t.MAP_CONTROLS=ge;t.MASK_LAYER_ID="mask_layer"},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.MASK_LAYER_ID=t.MAP_CONTROLS=t.DATASET_FORMATS=t.LOADING_METHODS=t.MAP_INFO_CHARACTER=t.MAP_THUMBNAIL_DIMENSION=t.MAX_GPU_FILTERS=t.EDITOR_AVAILABLE_LAYERS=t.EDITOR_MODES=t.GEOCODER_ICON_SIZE=t.GEOCODER_ICON_COLOR=t.GEOCODER_GEO_OFFSET=t.GEOCODER_LAYER_ID=t.GEOCODER_DATASET_NAME=t.SPEED_CONTROL_STEP=t.SPEED_CONTROL_RANGE=t.DEFAULT_TIME_FORMAT=t.ANIMATION_WINDOW=t.FPS=t.BASE_SPEED=t.THROTTLE_NOTIFICATION_TIME=t.DEFAULT_NOTIFICATION_TOPICS=t.DEFAULT_NOTIFICATION_TYPES=t.DEFAULT_NOTIFICATION_MESSAGE=t.DEFAULT_UUID_COUNT=t.EXPORT_HTML_MAP_MODE_OPTIONS=t.EXPORT_MAP_FORMAT_OPTIONS=t.EXPORT_HTML_MAP_MODES=t.EXPORT_MAP_FORMATS=t.EXPORT_DATA_TYPE_OPTIONS=t.EXPORT_DATA_TYPE=t.EXPORT_IMG_RESOLUTION_OPTIONS=t.EXPORT_IMG_RATIO_OPTIONS=t.EXPORT_IMG_RATIOS=t.RESOLUTIONS=t.MAX_DEFAULT_TOOLTIPS=t.LAYER_BLENDINGS=t.NO_VALUE_COLOR=t.DEFAULT_TOOLTIP_FIELDS=t.DEFAULT_LAYER_COLOR=t.CHANNEL_SCALE_SUPPORTED_FIELDS=t.FIELD_OPTS=t.DEFAULT_AGGREGATION=t.notSupportAggrOpts=t.notSupportedScaleOpts=t.ordinalFieldAggrScaleFunctions=t.ordinalFieldScaleFunctions=t.linearFieldAggrScaleFunctions=t.linearFieldScaleFunctions=t.AGGREGATION_TYPES=t.CHANNEL_SCALES=t.HIGHLIGH_COLOR_3D=t.FIELD_COLORS=t.FILED_TYPE_DISPLAY=t.TABLE_OPTION_LIST=t.TABLE_OPTION=t.SORT_ORDER=t.ALL_FIELD_TYPES=t.SCALE_FUNC=t.SCALE_TYPES=t.FILTER_TYPES=t.TRIP_ARC_FIELDS=t.TRIP_POINT_FIELDS=t.ICON_FIELDS=t.GEOJSON_FIELDS=t.DEFAULT_MAP_STYLES=t.DEFAULT_LAYER_GROUPS=t.PANELS=t.SIDEBAR_PANELS=t.THEME=t.DIMENSIONS=t.KEPLER_GL_WEBSITE=t.KEPLER_GL_VERSION=t.KEPLER_GL_NAME=t.SHARE_MAP_ID=t.OVERWRITE_MAP_ID=t.SAVE_MAP_ID=t.EXPORT_MAP_ID=t.ADD_MAP_STYLE_ID=t.EXPORT_DATA_ID=t.EXPORT_IMAGE_ID=t.ADD_DATA_ID=t.DELETE_DATA_ID=t.DATA_TABLE_ID=t.DEFAULT_MAPBOX_API_URL=t.ICON_PREFIX=t.CLOUDFRONT=t.ACTION_PREFIX=void 0;var a,o,i,s,l,u,c,d,f,p,h,m,g=r(n(3)),y=r(n(137)),v=n(191),A=n(133),b=n(45),_=n(70),E=n(323),x=n(271);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){(0,g.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.ACTION_PREFIX="@@kepler.gl/";var O="https://d1a3f4spazzrp4.cloudfront.net/kepler.gl";t.CLOUDFRONT=O;var S="".concat(O,"/geodude");t.ICON_PREFIX=S;t.DEFAULT_MAPBOX_API_URL="https://api.mapbox.com";t.DATA_TABLE_ID="dataTable";t.DELETE_DATA_ID="deleteData";t.ADD_DATA_ID="addData";t.EXPORT_IMAGE_ID="exportImage";t.EXPORT_DATA_ID="exportData";t.ADD_MAP_STYLE_ID="addMapStyle";t.EXPORT_MAP_ID="exportMap";t.SAVE_MAP_ID="saveMap";t.OVERWRITE_MAP_ID="overwriteMap";t.SHARE_MAP_ID="shareMap";t.KEPLER_GL_NAME="kepler.gl";t.KEPLER_GL_VERSION="0.0.20";t.KEPLER_GL_WEBSITE="http://kepler.gl/";t.DIMENSIONS={sidePanel:{width:300,margin:{top:20,left:20,bottom:30,right:20},headerHeight:96},mapControl:{width:184,padding:12}};var T=(0,y.default)({light:null,dark:null,base:null});t.THEME=T;var C=[{id:"layer",label:"sidebar.panels.layer",iconComponent:b.Layers,onClick:null},{id:"filter",label:"sidebar.panels.filter",iconComponent:b.FilterFunnel,onClick:null},{id:"interaction",label:"sidebar.panels.interaction",iconComponent:b.CursorClick,onClick:null},{id:"map",label:"sidebar.panels.basemap",iconComponent:b.Settings,onClick:null}];t.SIDEBAR_PANELS=C;var L=C;t.PANELS=L;var P=[{slug:"label",filter:function(e){return e.id.match(/(?=(label|place-|poi-))/)},defaultVisibility:!0},{slug:"road",filter:function(e){return e.id.match(/(?=(road|railway|tunnel|street|bridge))(?!.*label)/)},defaultVisibility:!0},{slug:"border",filter:function(e){return e.id.match(/border|boundaries/)},defaultVisibility:!1},{slug:"building",filter:function(e){return e.id.match(/building/)},defaultVisibility:!0},{slug:"water",filter:function(e){return e.id.match(/(?=(water|stream|ferry))/)},defaultVisibility:!0},{slug:"land",filter:function(e){return e.id.match(/(?=(parks|landcover|industrial|sand|hillshade))/)},defaultVisibility:!0},{slug:"3d building",filter:function(){return!1},defaultVisibility:!1}];t.DEFAULT_LAYER_GROUPS=P;var R=[{id:"dark",label:"Dark",url:"mapbox://styles/uberdata/cjoqbbf6l9k302sl96tyvka09",icon:"".concat(S,"/UBER_DARK_V2.png"),layerGroups:P},{id:"light",label:"Light",url:"mapbox://styles/uberdata/cjoqb9j339k1f2sl9t5ic5bn4",icon:"".concat(S,"/UBER_LIGHT_V2.png"),layerGroups:P},{id:"muted",label:"Muted Light",url:"mapbox://styles/uberdata/cjfyl03kp1tul2smf5v2tbdd4",icon:"".concat(S,"/UBER_MUTED_LIGHT.png"),layerGroups:P},{id:"muted_night",label:"Muted Night",url:"mapbox://styles/uberdata/cjfxhlikmaj1b2soyzevnywgs",icon:"".concat(S,"/UBER_MUTED_NIGHT.png"),layerGroups:P},{id:"satellite",label:"Satellite",url:"mapbox://styles/mapbox/satellite-v9",icon:"".concat(S,"/UBER_SATELLITE.png")}];t.DEFAULT_MAP_STYLES=R;t.GEOJSON_FIELDS={geojson:["_geojson","all_points","geojson"]};t.ICON_FIELDS={icon:["icon"]};t.TRIP_POINT_FIELDS=[["lat","lng"],["lat","lon"],["latitude","longitude"]];t.TRIP_ARC_FIELDS={lat0:"begintrip",lng0:"begintrip",lat1:"dropoff",lng1:"dropoff"};var D=(0,y.default)({range:null,select:null,input:null,timeRange:null,multiSelect:null,polygon:null});t.FILTER_TYPES=D;var k=(0,y.default)({ordinal:null,quantile:null,quantize:null,linear:null,sqrt:null,log:null,point:null});t.SCALE_TYPES=k;var I=(a={},(0,g.default)(a,k.linear,A.scaleLinear),(0,g.default)(a,k.quantize,A.scaleQuantize),(0,g.default)(a,k.quantile,A.scaleQuantile),(0,g.default)(a,k.ordinal,A.scaleOrdinal),(0,g.default)(a,k.sqrt,A.scaleSqrt),(0,g.default)(a,k.log,A.scaleLog),(0,g.default)(a,k.point,A.scalePoint),a);t.SCALE_FUNC=I;var F=(0,y.default)({boolean:null,date:null,geojson:null,integer:null,real:null,string:null,timestamp:null,point:null});t.ALL_FIELD_TYPES=F;var j=(0,y.default)({ASCENDING:null,DESCENDING:null,UNSORT:null});t.SORT_ORDER=j;var B=(0,y.default)({SORT_ASC:null,SORT_DES:null,UNSORT:null,PIN:null,UNPIN:null,COPY:null});t.TABLE_OPTION=B;var N=[{value:B.SORT_ASC,display:"Sort Ascending",icon:b.ArrowUp,condition:function(e){return e.sortMode!==j.ASCENDING}},{value:B.SORT_DES,display:"Sort Descending",icon:b.ArrowDown,condition:function(e){return e.sortMode!==j.DESCENDING}},{value:B.UNSORT,display:"Unsort Column",icon:b.Cancel,condition:function(e){return e.isSorted}},{value:B.PIN,display:"Pin Column",icon:b.Pin,condition:function(e){return!e.isPinned}},{value:B.UNPIN,display:"Unpin Column",icon:b.Cancel,condition:function(e){return e.isPinned}},{value:B.COPY,display:"Copy Column",icon:b.Clipboard}];t.TABLE_OPTION_LIST=N;var z=(o={},(0,g.default)(o,F.boolean,{label:"bool",color:"231, 189, 194"}),(0,g.default)(o,F.date,{label:"date",color:"160, 106, 206"}),(0,g.default)(o,F.geojson,{label:"geo",color:"106, 160, 206"}),(0,g.default)(o,F.integer,{label:"int",color:"248, 194, 28"}),(0,g.default)(o,F.real,{label:"float",color:"248, 194, 28"}),(0,g.default)(o,F.string,{label:"string",color:"140, 210, 205"}),(0,g.default)(o,F.timestamp,{label:"time",color:"106, 160, 56"}),(0,g.default)(o,F.point,{label:"point",color:"0, 172, 237"}),o);t.FILED_TYPE_DISPLAY=z;var U={default:"237, 88, 106"};t.FIELD_COLORS=U;t.HIGHLIGH_COLOR_3D=[255,255,255,60];var H=(0,y.default)({color:null,radius:null,size:null,colorAggr:null,sizeAggr:null});t.CHANNEL_SCALES=H;var V={count:"count",average:"average",maximum:"maximum",minimum:"minimum",median:"median",stdev:"stdev",sum:"sum",variance:"variance",mode:"mode",countUnique:"count unique"};t.AGGREGATION_TYPES=V;var G=(i={},(0,g.default)(i,H.color,[k.quantize,k.quantile]),(0,g.default)(i,H.radius,[k.sqrt]),(0,g.default)(i,H.size,[k.linear,k.sqrt,k.log]),i);t.linearFieldScaleFunctions=G;var Y=(u={},(0,g.default)(u,H.colorAggr,(s={},(0,g.default)(s,V.average,[k.quantize,k.quantile]),(0,g.default)(s,V.maximum,[k.quantize,k.quantile]),(0,g.default)(s,V.minimum,[k.quantize,k.quantile]),(0,g.default)(s,V.median,[k.quantize,k.quantile]),(0,g.default)(s,V.stdev,[k.quantize,k.quantile]),(0,g.default)(s,V.sum,[k.quantize,k.quantile]),(0,g.default)(s,V.variance,[k.quantize,k.quantile]),s)),(0,g.default)(u,H.sizeAggr,(l={},(0,g.default)(l,V.average,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.maximum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.minimum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.median,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.stdev,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.sum,[k.linear,k.sqrt,k.log]),(0,g.default)(l,V.variance,[k.linear,k.sqrt,k.log]),l)),u);t.linearFieldAggrScaleFunctions=Y;var W=(c={},(0,g.default)(c,H.color,[k.ordinal]),(0,g.default)(c,H.radius,[k.point]),(0,g.default)(c,H.size,[k.point]),c);t.ordinalFieldScaleFunctions=W;var q=(f={},(0,g.default)(f,H.colorAggr,(d={},(0,g.default)(d,V.mode,[k.ordinal]),(0,g.default)(d,V.countUnique,[k.quantize,k.quantile]),d)),(0,g.default)(f,H.sizeAggr,{}),f);t.ordinalFieldAggrScaleFunctions=q;var X=(p={},(0,g.default)(p,H.color,[]),(0,g.default)(p,H.radius,[]),(0,g.default)(p,H.size,[]),p);t.notSupportedScaleOpts=X;var K=(h={},(0,g.default)(h,H.colorAggr,{}),(0,g.default)(h,H.sizeAggr,{}),h);t.notSupportAggrOpts=K;var Z=(m={},(0,g.default)(m,H.colorAggr,(0,g.default)({},V.count,[k.quantize,k.quantile])),(0,g.default)(m,H.sizeAggr,(0,g.default)({},V.count,[k.linear,k.sqrt,k.log])),m);t.DEFAULT_AGGREGATION=Z;var J={string:{type:"categorical",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[]}},real:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},timestamp:{type:"time",scale:w(w({},G),K),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE,E.TOOLTIP_FORMAT_TYPES.DATE_TIME]}},integer:{type:"numerical",scale:w(w({},G),Y),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DECIMAL,E.TOOLTIP_FORMAT_TYPES.PERCENTAGE]}},boolean:{type:"boolean",scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.BOOLEAN]}},date:{scale:w(w({},W),q),format:{legend:function(e){return e},tooltip:[E.TOOLTIP_FORMAT_TYPES.NONE,E.TOOLTIP_FORMAT_TYPES.DATE]}},geojson:{type:"geometry",scale:w(w({},X),K),format:{legend:function(e){return"..."},tooltip:[]}}};t.FIELD_OPTS=J;var Q=Object.keys(H).reduce((function(e,t){return w(w({},e),{},(0,g.default)({},t,Object.keys(J).filter((function(e){return Object.keys(J[e].scale[t]).length}))))}),{});t.CHANNEL_SCALE_SUPPORTED_FIELDS=Q;t.DEFAULT_LAYER_COLOR={tripArc:"#9226C6",begintrip_lat:"#1E96BE",dropoff_lat:"#FF991F",request_lat:"#52A353"};t.DEFAULT_TOOLTIP_FIELDS=[];t.NO_VALUE_COLOR=[0,0,0,0];t.LAYER_BLENDINGS={additive:{label:"layerBlending.additive",blendFunc:["SRC_ALPHA","DST_ALPHA"],blendEquation:"FUNC_ADD"},normal:{label:"layerBlending.normal",blendFunc:["SRC_ALPHA","ONE_MINUS_SRC_ALPHA","ONE","ONE_MINUS_SRC_ALPHA"],blendEquation:["FUNC_ADD","FUNC_ADD"]},subtractive:{label:"layerBlending.subtractive",blendFunc:["ONE","ONE_MINUS_DST_COLOR","SRC_ALPHA","DST_ALPHA"],blendEquation:["FUNC_SUBTRACT","FUNC_ADD"]}};t.MAX_DEFAULT_TOOLTIPS=5;var $=(0,y.default)({ONE_X:null,TWO_X:null});t.RESOLUTIONS=$;var ee=(0,y.default)({SCREEN:null,FOUR_BY_THREE:null,SIXTEEN_BY_NINE:null,CUSTOM:null});t.EXPORT_IMG_RATIOS=ee;var te=[{id:ee.SCREEN,label:"modal.exportImage.ratioOriginalScreen",getSize:function(e,t){return{width:e,height:t}}},{id:ee.CUSTOM,hidden:!0,label:"modal.exportImage.ratioCustom",getSize:function(e,t){return{width:e,height:t}}},{id:ee.FOUR_BY_THREE,label:"modal.exportImage.ratio4_3",getSize:function(e,t){return{width:e,height:Math.round(.75*e)}}},{id:ee.SIXTEEN_BY_NINE,label:"modal.exportImage.ratio16_9",getSize:function(e,t){return{width:e,height:Math.round(.5625*e)}}}];t.EXPORT_IMG_RATIO_OPTIONS=te;var ne=[{id:$.ONE_X,label:"1x",available:!0,scale:1,getSize:function(e,t){return{width:e,height:t}}},{id:$.TWO_X,label:"2x",available:!0,scale:2,getSize:function(e,t){return{width:2*e,height:2*t}}}];t.EXPORT_IMG_RESOLUTION_OPTIONS=ne;var re=(0,y.default)({CSV:null});t.EXPORT_DATA_TYPE=re;var ae=[{id:re.CSV,label:re.CSV.toLowerCase(),available:!0}];t.EXPORT_DATA_TYPE_OPTIONS=ae;var oe=(0,y.default)({HTML:null,JSON:null});t.EXPORT_MAP_FORMATS=oe;var ie=(0,y.default)({READ:null,EDIT:null});t.EXPORT_HTML_MAP_MODES=ie;var se=Object.entries(oe).map((function(e){return{id:e[0],label:e[1].toLowerCase(),available:!0}}));t.EXPORT_MAP_FORMAT_OPTIONS=se;var le=Object.entries(ie).map((function(e){return{id:e[0],label:"modal.exportMap.html.".concat(e[1].toLowerCase()),available:!0,url:(0,_.getHTMLMapModeTileUrl)(e[1])}}));t.EXPORT_HTML_MAP_MODE_OPTIONS=le;t.DEFAULT_UUID_COUNT=6;t.DEFAULT_NOTIFICATION_MESSAGE="MESSAGE_NOT_PROVIDED";var ue=(0,y.default)({info:null,error:null,warning:null,success:null});t.DEFAULT_NOTIFICATION_TYPES=ue;var ce=(0,y.default)({global:null,file:null});t.DEFAULT_NOTIFICATION_TOPICS=ce;t.THROTTLE_NOTIFICATION_TIME=2500;t.BASE_SPEED=600;t.FPS=60;var de=(0,y.default)({free:null,incremental:null,point:null,interval:null});t.ANIMATION_WINDOW=de;t.DEFAULT_TIME_FORMAT="MM/DD/YY HH:mm:ssa";t.SPEED_CONTROL_RANGE=[0,10];t.SPEED_CONTROL_STEP=.001;t.GEOCODER_DATASET_NAME="geocoder_dataset";t.GEOCODER_LAYER_ID="geocoder_layer";t.GEOCODER_GEO_OFFSET=.05;t.GEOCODER_ICON_COLOR=[255,0,0];t.GEOCODER_ICON_SIZE=80;var fe={READ_ONLY:v.EditorModes.READ_ONLY,DRAW_POLYGON:v.EditorModes.DRAW_POLYGON,DRAW_RECTANGLE:v.EditorModes.DRAW_RECTANGLE,EDIT:v.EditorModes.EDIT_VERTEX};t.EDITOR_MODES=fe;var pe=[x.LAYER_TYPES.point,x.LAYER_TYPES.hexagon,x.LAYER_TYPES.arc,x.LAYER_TYPES.line,x.LAYER_TYPES.hexagonId];t.EDITOR_AVAILABLE_LAYERS=pe;t.MAX_GPU_FILTERS=4;t.MAP_THUMBNAIL_DIMENSION={width:300,height:200};t.MAP_INFO_CHARACTER={title:100,description:100};var he=(0,y.default)({upload:null,storage:null});t.LOADING_METHODS=he;var me=(0,y.default)({row:null,geojson:null,csv:null,keplergl:null});t.DATASET_FORMATS=me;var ge=(0,y.default)({visibleLayers:null,mapLegend:null,toggle3d:null,splitMap:null,mapDraw:null,mapLocale:null});t.MAP_CONTROLS=ge;t.MASK_LAYER_ID="mask_layer"},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return a}))},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"d",(function(){return o})),n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return l}));var r=n(50);const a={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(a,"IDENTITY",{get:()=>r.a.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0});const o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},i={common:0,meters:1,pixels:2},s={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},l={DRAW:"draw",MASK:"mask"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"g",(function(){return u})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return f})),n.d(t,"f",(function(){return m}));var r=n(26);function a(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e}function o(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e}function i(e){var t=e[0],n=e[1];return Math.hypot(t,n)}function s(e,t){return e[0]=-t[0],e[1]=-t[1],e}function l(e,t,n,r){var a=t[0],o=t[1];return e[0]=a+r*(n[0]-a),e[1]=o+r*(n[1]-o),e}function u(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e}function c(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[2]*a+n[4],e[1]=n[1]*r+n[3]*a+n[5],e}function d(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[3]*a+n[6],e[1]=n[1]*r+n[4]*a+n[7],e}function f(e,t,n){var r=t[0],a=t[1];return e[0]=n[0]*r+n[4]*a+n[12],e[1]=n[1]*r+n[5]*a+n[13],e}var p,h,m=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e};p=new r.a(2),r.a!=Float32Array&&(p[0]=0,p[1]=0),h=p},function(e,t,n){var r;
|
|
4
4
|
/*!
|
|
5
5
|
Copyright (c) 2017 Jed Watson.
|
|
6
6
|
Licensed under the MIT License (MIT), see
|
|
@@ -16,7 +16,7 @@ a.version="2.29.1",t=Ot,a.fn=yn,a.min=function(){var e=[].slice.call(arguments,0
|
|
|
16
16
|
* @license MIT, see LICENSE.txt for details
|
|
17
17
|
*
|
|
18
18
|
* @author Scott Andrews
|
|
19
|
-
*/var r,a,o,i;function s(e){return e}function l(e){return e}function u(e){return e}function c(e){if(!(this instanceof c))return new c(e);a(this,e)}function d(e){var t,n,a,d;return t=(e=e||{}).init||s,n=e.request||l,a=e.success||e.response||u,d=e.error||function(){return Promise.resolve((e.response||u).apply(this,arguments)).then(Promise.reject.bind(Promise))},function(s,l){return"object"==typeof s&&(l=s),"function"!=typeof s&&(s=e.client||r),l=t(l||{}),i((function e(t){var r,i;return r={},i={arguments:Array.prototype.slice.call(arguments),client:e},(t="string"==typeof t?{path:t}:t||{}).originator=t.originator||e,o(n.call(r,t,l,i),(function(e){var t,n,o;return o=s,e instanceof c&&(n=e.abort,o=e.client||o,t=e.response,e=e.request),t=t||Promise.resolve(e).then((function(e){return Promise.resolve(o(e)).then((function(e){return a.call(r,e,l,i)}),(function(e){return d.call(r,e,l,i)}))})),n?Promise.race([t,n]):t}),(function(e){return Promise.reject({request:t,error:e})}))}),s)}}r=n(1102),a=n(414),o=n(602),i=n(601),d.ComplexRequest=c,e.exports=d},function(e,t,n){"use strict";n.r(t),n.d(t,"GreatCircleLayer",(function(){return a})),n.d(t,"S2Layer",(function(){return A})),n.d(t,"TileLayer",(function(){return Rt})),n.d(t,"TripsLayer",(function(){return kt})),n.d(t,"H3ClusterLayer",(function(){return Bt})),n.d(t,"H3HexagonLayer",(function(){return Gt})),n.d(t,"Tile3DLayer",(function(){return Po})),n.d(t,"TerrainLayer",(function(){return jo})),n.d(t,"MVTLayer",(function(){return Pi})),n.d(t,"_getURLFromTemplate",(function(){return rt}));var r=n(1173);class a extends r.a{}a.layerName="GreatCircleLayer",a.defaultProps={getHeight:{type:"accessor",value:0},greatCircle:!0};var o=n(621),i=n(829),s=n(303),l=n.n(s);const u=180/Math.PI;function c(e,t,n){const r=1<<t;return[(e[0]+n[0])/r,(e[1]+n[1])/r]}function d(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function f(e){return[d(e[0]),d(e[1])]}function p(e,[t,n]){switch(e){case 0:return[1,t,n];case 1:return[-t,1,n];case 2:return[-t,-n,1];case 3:return[-1,-n,-t];case 4:return[n,-1,-t];case 5:return[n,t,-1];default:throw new Error("Invalid face")}}function h([e,t,n]){const r=Math.atan2(n,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*u,r*u]}function m(e,t,n,r){if(0===r){1===n&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);const r=t[0];t[0]=t[1],t[1]=r}}function g(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){const t=e.padEnd(16,"0");return l.a.fromString(t,16)}(e)}return function(e){let t=l.a.fromString(e,!0,10).toString(2);for(;t.length<64;)t="0"+t;const n=t.lastIndexOf("1"),r=t.substring(0,3),a=t.substring(3,n),o=a.length/2,i=l.a.fromString(r,!0,2).toString(10);let s=l.a.fromString(a,!0,2).toString(4);for(;s.length<o;)s="0"+s;return"".concat(i,"/").concat(s)}(e.toString())}function y(e){return function({face:e,ij:t,level:n}){const r=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(100*Math.pow(2,-n))),o=new Float64Array(4*a*2+2);let i=0,s=0;for(let l=0;l<4;l++){const u=r[l].slice(0),d=r[l+1],m=(d[0]-u[0])/a,g=(d[1]-u[1])/a;for(let r=0;r<a;r++){u[0]+=m,u[1]+=g;const r=h(p(e,f(c(t,n,u))));Math.abs(r[1])>89.999&&(r[0]=s);const a=r[0]-s;r[0]+=a>180?-360:a<-180?360:0,o[i++]=r[0],o[i++]=r[1],s=r[0]}}return o[i++]=o[0],o[i++]=o[1],o}(function(e){const t=e.split("/"),n=parseInt(t[0],10),r=t[1],a=r.length,o=[0,0];let i;for(let e=a-1;e>=0;e--){i=a-e;const t=r[e];let n=0,s=0;"1"===t?s=1:"2"===t?(n=1,s=1):"3"===t&&(n=1);const l=Math.pow(2,i-1);m(l,o,n,s),o[0]+=l*n,o[1]+=l*s}if(n%2==1){const e=o[0];o[0]=o[1],o[1]=e}return{face:n,ij:o,level:i}}(g(e)))}const v={...i.a.defaultProps,getS2Token:{type:"accessor",value:e=>e.token}};class A extends o.a{renderLayers(){const{data:e,getS2Token:t}=this.props,{elevationScale:n,extruded:r,wireframe:a,filled:o,stroked:s,lineWidthUnits:l,lineWidthScale:u,lineWidthMinPixels:c,lineWidthMaxPixels:d,lineJointRounded:f,lineMiterLimit:p,lineDashJustified:h,getElevation:m,getFillColor:g,getLineColor:v,getLineWidth:A,getLineDashArray:b}=this.props,{updateTriggers:_,material:E}=this.props;return new(this.getSubLayerClass("cell",i.a))({filled:o,wireframe:a,extruded:r,elevationScale:n,stroked:s,lineWidthUnits:l,lineWidthScale:u,lineWidthMinPixels:c,lineWidthMaxPixels:d,lineJointRounded:f,lineMiterLimit:p,lineDashJustified:h,material:E,getElevation:m,getFillColor:g,getLineColor:v,getLineWidth:A,getLineDashArray:b},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:_.getElevation,getFillColor:_.getFillColor,getLineColor:_.getLineColor,getLineWidth:_.getLineWidth,getLineDashArray:_.getLineDashArray}}),{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(e,n)=>y(t(e,n))})}}A.layerName="S2Layer",A.defaultProps=v;var b=n(150),_=n(1167),E=n(50);class x{constructor({x:e,y:t,z:n}){this.x=e,this.y=t,this.z=n,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get data(){return this.isLoading?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const e=this.content?this.content.byteLength:0;return Number.isFinite(e)||E.a.error("byteLength not defined in tile data")(),e}async _loadData({getData:e,requestScheduler:t,onLoad:n,onError:r}){const{x:a,y:o,z:i,bbox:s}=this,l=this._loaderId;this._abortController=new AbortController;const{signal:u}=this._abortController,c=await t.scheduleRequest(this,e=>e.isSelected?1:-1);if(!c)return void(this._isCancelled=!0);if(this._isCancelled)return void c.done();let d,f=null;try{f=await e({x:a,y:o,z:i,bbox:s,signal:u})}catch(e){d=e||!0}finally{c.done()}l===this._loaderId&&(this._loader=void 0,this.content=f,!this._isCancelled||f?(this._isLoaded=!0,this._isCancelled=!1,d?r(d,this):n(this)):this._isLoaded=!1)}loadData(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}}const M=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function w(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}Math.PI,Math.PI;const O={};function S(e,{precision:t=O.precision||4}={}){return e=function(e){return Math.round(e/O.EPSILON)*O.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function T(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function C(e,t,n){const r=O.EPSILON;n&&(O.EPSILON=n);try{if(e===t)return!0;if(T(e)&&T(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!C(e[n],t[n]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=O.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{O.EPSILON=r}}O.EPSILON=1e-12,O.debug=!1,O.precision=4,O.printTypes=!1,O.printDegrees=!1,O.printRowMajor=!0;class L extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return w(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}to(e){return e===this?this:T(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(O)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+S(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!C(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){void 0===n&&(n=t,t=e,e=this);for(let r=0;r<this.ELEMENTS;++r){const a=e[r];this[r]=a+n*(t[r]-a)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(O.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}function P(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function R(e,t,n=""){if(O.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}const D={};function k(e,t){D[e]||(D[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}class I extends L{get ELEMENTS(){return w(!1),0}copy(e){return w(!1),this}get x(){return this[0]}set x(e){this[0]=P(e)}get y(){return this[1]}set y(e){this[1]=P(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){const r=this[n]-e[n];t+=r*r}return P(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return P(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return w(e>=0&&e<this.ELEMENTS,"index is out of range"),P(this[e])}setComponent(e,t){return w(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}var F=n(19);function j(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}const B=[0,0,0],N={};class z extends I{static get ZERO(){return N.ZERO=N.ZERO||Object.freeze(new z(0,0,0,0))}constructor(e=0,t=0,n=0){super(-0,-0,-0),1===arguments.length&&T(e)?this.copy(e):(O.debug&&(P(e),P(t),P(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return O.debug&&(P(e.x),P(e.y),P(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=P(e)}angle(e){return F.b(this,e)}cross(e){return F.d(this,this,e),this.check()}rotateX({radians:e,origin:t=B}){return F.n(this,this,t,e),this.check()}rotateY({radians:e,origin:t=B}){return F.o(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=B}){return F.p(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return F.t(this,this,e),this.check()}transformAsVector(e){return j(this,this,e),this.check()}transformByMatrix3(e){return F.s(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,n){const r=t[0],a=t[1];e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return F.u(this,this,e),this.check()}}const U=new z,H=new z;class V{constructor(e=[0,0,0],t=[0,0,0],n=null){n=n||U.copy(e).add(t).scale(.5),this.center=new z(n),this.halfDiagonal=new z(t).subtract(this.center),this.minimum=new z(e),this.maximum=new z(t)}clone(){return new V(this.minimum,this.maximum,this.center)}equals(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){const{halfDiagonal:t}=this,n=H.from(e.normal),r=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),a=this.center.dot(n)+e.distance;return a-r>0?M.INSIDE:a+r<0?M.OUTSIDE:M.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=U.from(e).subtract(this.center),{halfDiagonal:n}=this;let r,a=0;return r=Math.abs(t.x)-n.x,r>0&&(a+=r*r),r=Math.abs(t.y)-n.y,r>0&&(a+=r*r),r=Math.abs(t.z)-n.z,r>0&&(a+=r*r),a}}var G=n(14);const Y=new z,W=new z;class q{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new z,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=Y.from(t),this.center=(new z).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new q(this.center,this.radius)}union(e){const t=this.center,n=this.radius,r=e.center,a=e.radius,o=Y.copy(r).subtract(t),i=o.magnitude();if(n>=i+a)return this.clone();if(a>=i+n)return e.clone();const s=.5*(n+i+a);return W.copy(o).scale((-n+s)/i).add(t),this.center.copy(W),this.radius=s,this}expand(e){const t=(e=Y.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=G.e(Y,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Y.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const t=this.center,n=this.radius,r=e.normal.dot(t)+e.distance;return r<-n?M.OUTSIDE:r<n?M.INTERSECTING:M.INSIDE}}class X extends L{get ELEMENTS(){return w(!1),0}get RANK(){return w(!1),0}toString(){let e="[";if(O.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=P(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}var K=n(81),Z=n(35);const J=Object.freeze([1,0,0,0,1,0,0,0,1]),Q=Object.freeze([0,0,0,0,0,0,0,0,0]),$=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),ee={};class te extends X{static get IDENTITY(){return ee.IDENTITY=ee.IDENTITY||Object.freeze(new te(J)),ee.IDENTITY}static get ZERO(){return ee.ZERO=ee.ZERO||Object.freeze(new te(Q)),ee.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return $}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}set(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=r,this[2]=i,this[3]=t,this[4]=a,this[5]=s,this[6]=n,this[7]=o,this[8]=l,this.check()}determinant(){return K.b(this)}identity(){return this.copy(J)}fromQuaternion(e){return K.c(this,e),this.check()}transpose(){return K.i(this,this),this.check()}invert(){return K.d(this,this),this.check()}multiplyLeft(e){return K.e(this,e,this),this.check()}multiplyRight(e){return K.e(this,this,e),this.check()}rotate(e){return K.f(this,this,e),this.check()}scale(e){return Array.isArray(e)?K.g(this,this,e):K.g(this,this,[e,e,e]),this.check()}translate(e){return K.h(this,this,e),this.check()}transform(e,t){switch(e.length){case 2:t=Z.i(t||[-0,-0],e,this);break;case 3:t=F.s(t||[-0,-0,-0],e,this);break;case 4:t=function(e,t,n){const r=t[0],a=t[1],o=t[2];return e[0]=n[0]*r+n[3]*a+n[6]*o,e[1]=n[1]*r+n[4]*a+n[7]*o,e[2]=n[2]*r+n[5]*a+n[8]*o,e[3]=t[3],e}(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return R(t,e.length),t}transformVector(e,t){return k("Matrix3.transformVector"),this.transform(e,t)}transformVector2(e,t){return k("Matrix3.transformVector"),this.transform(e,t)}transformVector3(e,t){return k("Matrix3.transformVector"),this.transform(e,t)}}var ne=n(38),re=n(48);const ae=[0,0,0,1];class oe extends L{constructor(e=0,t=0,n=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,n,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this.check()}fromMatrix3(e){return ne.e(this,e),this.check()}identity(){return ne.f(this),this.check()}fromAxisRotation(e,t){return ne.p(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=P(e)}get y(){return this[1]}set y(e){this[1]=P(e)}get z(){return this[2]}set z(e){this[2]=P(e)}get w(){return this[3]}set w(e){this[3]=P(e)}len(){return ne.h(this)}lengthSquared(){return ne.r(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ne.d(this,e)}rotationTo(e,t){return ne.n(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return ne.a(this,this,e),this.check()}calculateW(){return ne.b(this,this),this.check()}conjugate(){return ne.c(this,this),this.check()}invert(){return ne.g(this,this),this.check()}lerp(e,t,n){return ne.i(this,e,t,n),this.check()}multiplyRight(e,t){return w(!t),ne.j(this,this,e),this.check()}multiplyLeft(e,t){return w(!t),ne.j(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return ne.k(this,this,e),this.check()}rotateY(e){return ne.l(this,this,e),this.check()}rotateZ(e){return ne.m(this,this,e),this.check()}scale(e){return ne.o(this,this,e),this.check()}slerp(e,t,n){switch(arguments.length){case 1:({start:e=ae,target:t,ratio:n}=arguments[0]);break;case 2:[t,n]=arguments,e=this}return ne.q(this,e,t,n),this.check()}transformVector4(e,t=e){return re.o(t,e,this),R(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}}const ie=new z,se=new z,le=new z,ue=new z,ce=new z,de=new z,fe=new z,pe=0,he=1,me=2,ge=3,ye=4,ve=5,Ae=6,be=7,_e=8;class Ee{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new z).from(e),this.halfAxes=new te(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new z(e).len(),new z(t).len(),new z(n).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new z(e).normalize(),a=new z(t).normalize(),o=new z(n).normalize();return(new oe).fromMatrix3(new te([...r,...a,...o]))}fromCenterHalfSizeQuaternion(e,t,n){const r=new oe(n),a=(new te).fromQuaternion(r);return a[0]=a[0]*t[0],a[1]=a[1]*t[0],a[2]=a[2]*t[0],a[3]=a[3]*t[1],a[4]=a[4]*t[1],a[5]=a[5]*t[1],a[6]=a[6]*t[2],a[7]=a[7]*t[2],a[8]=a[8]*t[2],this.center=(new z).from(e),this.halfAxes=a,this}clone(){return new Ee(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new q){const t=this.halfAxes,n=t.getColumn(0,le),r=t.getColumn(1,ue),a=t.getColumn(2,ce),o=ie.copy(n).add(r).add(a);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,n=e.normal,r=this.halfAxes,a=n.x,o=n.y,i=n.z,s=Math.abs(a*r[pe]+o*r[he]+i*r[me])+Math.abs(a*r[ge]+o*r[ye]+i*r[ve])+Math.abs(a*r[Ae]+o*r[be]+i*r[_e]),l=n.dot(t)+e.distance;return l<=-s?M.OUTSIDE:l>=s?M.INSIDE:M.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=se.from(e).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,le),a=n.getColumn(1,ue),o=n.getColumn(2,ce),i=r.magnitude(),s=a.magnitude(),l=o.magnitude();r.normalize(),a.normalize(),o.normalize();let u,c=0;return u=Math.abs(t.dot(r))-i,u>0&&(c+=u*u),u=Math.abs(t.dot(a))-s,u>0&&(c+=u*u),u=Math.abs(t.dot(o))-l,u>0&&(c+=u*u),c}computePlaneDistances(e,t,n=[-0,-0]){let r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const o=this.center,i=this.halfAxes,s=i.getColumn(0,le),l=i.getColumn(1,ue),u=i.getColumn(2,ce),c=de.copy(s).add(l).add(u).add(o),d=fe.copy(c).subtract(e);let f=t.dot(d);return r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),n[0]=r,n[1]=a,n}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,le);t.transformAsPoint(e);const n=this.halfAxes.getColumn(1,ue);n.transformAsPoint(e);const r=this.halfAxes.getColumn(2,ce);return r.transformAsPoint(e),this.halfAxes=new te([...t,...n,...r]),this}getTransform(){throw new Error("not implemented")}}const xe=new z,Me=new z;class we{constructor(e=[0,0,1],t=0){this.normal=new z,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return w(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=xe.from(e),this.normal.from(t).normalize();const n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,t,n,r){return this.normal.set(e,t,n),w(C(this.normal.len(),1)),this.distance=r,this}clone(e){return new we(this.normal,this.distance)}equals(e){return C(this.distance,e.distance)&&C(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=Me.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}projectPointOntoPlane(e,t=[0,0,0]){e=xe.from(e);const n=this.getPointDistance(e),r=Me.copy(this.normal).scale(n);return e.subtract(r).to(t)}}const Oe=[new z([1,0,0]),new z([0,1,0]),new z([0,0,1])],Se=new z,Te=new z;new we(new z(1,0,0),0);class Ce{static get MASK_OUTSIDE(){return 4294967295}static get MASK_INSIDE(){return 0}static get MASK_INDETERMINATE(){return 2147483647}constructor(e=[]){this.planes=e,w(this.planes.every(e=>e instanceof we))}fromBoundingSphere(e){this.planes.length=2*Oe.length;const t=e.center,n=e.radius;let r=0;for(const e of Oe){let a=this.planes[r],o=this.planes[r+1];a||(a=this.planes[r]=new we),o||(o=this.planes[r+1]=new we);const i=Se.copy(e).scale(-n).add(t);e.dot(i);a.fromPointNormal(i,e);const s=Se.copy(e).scale(n).add(t),l=Te.copy(e).negate();l.dot(s);o.fromPointNormal(s,l),r+=2}return this}computeVisibility(e){w(e);let t=M.INSIDE;for(const n of this.planes){switch(e.intersectPlane(n)){case M.OUTSIDE:return M.OUTSIDE;case M.INTERSECTING:t=M.INTERSECTING}}return t}computeVisibilityWithPlaneMask(e,t){if(w(e,"boundingVolume is required."),w(Number.isFinite(t),"parentPlaneMask is required."),t===Ce.MASK_OUTSIDE||t===Ce.MASK_INSIDE)return t;let n=Ce.MASK_INSIDE;const r=this.planes;for(let a=0;a<this.planes.length;++a){const o=a<31?1<<a:0;if(a<31&&0==(t&o))continue;const i=r[a],s=e.intersectPlane(i);if(s===M.OUTSIDE)return Ce.MASK_OUTSIDE;s===M.INTERSECTING&&(n|=o)}return n}}Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15});new z,new z,new z,new z,new z;new z,new z,new z,new z,new z,new z,new z,new z,new z,new z,new z,new z,Math.PI;var Le=1e-15,Pe=1e-20;Math.PI,Math.PI,Math.PI,Math.PI;const Re=new te,De=new te,ke=new te,Ie=new te,Fe=new te;function je(e,t={}){const n=Pe;let r=0,a=0;const o=De,i=ke;o.identity(),i.copy(e);const s=n*function(e){let t=0;for(let n=0;n<9;++n){const r=e[n];t+=r*r}return Math.sqrt(t)}(i);for(;a<10&&ze(i)>s;)Ue(i,Ie),Fe.copy(Ie).transpose(),i.multiplyRight(Ie),i.multiplyLeft(Fe),o.multiplyRight(Ie),++r>2&&(++a,r=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=i.toTarget(t.diagonal),t}const Be=[1,0,0],Ne=[2,2,1];function ze(e){let t=0;for(let n=0;n<3;++n){const r=e[Re.getElementIndex(Ne[n],Be[n])];t+=2*r*r}return Math.sqrt(t)}function Ue(e,t){const n=Le;let r=0,a=1;for(let t=0;t<3;++t){const n=Math.abs(e[Re.getElementIndex(Ne[t],Be[t])]);n>r&&(a=t,r=n)}const o=Be[a],i=Ne[a];let s=1,l=0;if(Math.abs(e[Re.getElementIndex(i,o)])>n){const t=(e[Re.getElementIndex(i,i)]-e[Re.getElementIndex(o,o)])/2/e[Re.getElementIndex(i,o)];let n;n=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),s=1/Math.sqrt(1+n*n),l=n*s}return te.IDENTITY.to(t),t[Re.getElementIndex(o,o)]=t[Re.getElementIndex(i,i)]=s,t[Re.getElementIndex(i,o)]=l,t[Re.getElementIndex(o,i)]=-l,t}const He=new z,Ve=new z,Ge=new z,Ye=new z,We=new z,qe=new te,Xe={diagonal:new te,unitary:new te};var Ke=n(53);const Ze=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Je=Ze.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Qe=Je.concat([[.25,.5],[.75,.5]]);class $e{constructor(e,t,n){this.x=e,this.y=t,this.z=n}get children(){if(!this._children){const e=2*this.x,t=2*this.y,n=this.z+1;this._children=[new $e(e,t,n),new $e(e,t+1,n),new $e(e+1,t,n),new $e(e+1,t+1,n)]}return this._children}update(e){const{viewport:t,cullingVolume:n,elevationBounds:r,minZ:a,maxZ:o,bounds:i,offset:s,project:l}=e,u=this.getBoundingVolume(r,s,l);if(i&&!this.insideBounds(i))return!1;if(n.computeVisibility(u)<0)return!1;if(!this.childVisible){let{z:e}=this;if(e<o&&e>=a){const n=u.distanceTo(t.cameraPosition)*t.scale/t.height;e+=Math.floor(Math.log2(n))}if(e>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const t of this.children)t.update(e);return!0}getSelected(e=[]){if(this.selected&&e.push(this),this._children)for(const t of this._children)t.getSelected(e);return e}insideBounds([e,t,n,r]){const a=512/Math.pow(2,this.z);return this.x*a<n&&this.y*a<r&&(this.x+1)*a>e&&(this.y+1)*a>t}getBoundingVolume(e,t,n){if(n){const t=this.z<1?Qe:this.z<2?Je:Ze,r=[];for(const a of t){const t=ot(this.x+a[0],this.y+a[1],this.z);t[2]=e[0],r.push(n(t)),e[0]!==e[1]&&(t[2]=e[1],r.push(n(t)))}return function(e,t=new Ee){if(!e||0===e.length)return t.halfAxes=new te([0,0,0,0,0,0,0,0,0]),t.center=new z,t;const n=e.length,r=new z(0,0,0);for(const t of e)r.add(t);const a=1/n;r.multiplyByScalar(a);let o=0,i=0,s=0,l=0,u=0,c=0;for(const t of e){const e=He.copy(t).subtract(r);o+=e.x*e.x,i+=e.x*e.y,s+=e.x*e.z,l+=e.y*e.y,u+=e.y*e.z,c+=e.z*e.z}o*=a,i*=a,s*=a,l*=a,u*=a,c*=a;const d=qe;d[0]=o,d[1]=i,d[2]=s,d[3]=i,d[4]=l,d[5]=u,d[6]=s,d[7]=u,d[8]=c;const{unitary:f}=je(d,Xe),p=t.halfAxes.copy(f);let h=p.getColumn(0,Ge),m=p.getColumn(1,Ye),g=p.getColumn(2,We),y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,A=-Number.MAX_VALUE,b=Number.MAX_VALUE,_=Number.MAX_VALUE,E=Number.MAX_VALUE;for(const t of e)He.copy(t),y=Math.max(He.dot(h),y),v=Math.max(He.dot(m),v),A=Math.max(He.dot(g),A),b=Math.min(He.dot(h),b),_=Math.min(He.dot(m),_),E=Math.min(He.dot(g),E);h=h.multiplyByScalar(.5*(b+y)),m=m.multiplyByScalar(.5*(_+v)),g=g.multiplyByScalar(.5*(E+A)),t.center.copy(h).add(m).add(g);const x=Ve.set(y-b,v-_,A-E).multiplyByScalar(.5),M=new te([x[0],0,0,0,x[1],0,0,0,x[2]]);return t.halfAxes.multiplyRight(M),t}(r)}const r=512/Math.pow(2,this.z),a=this.x*r+512*t,o=512-(this.y+1)*r;return new V([a,o,e[0]],[a+r,o+r,e[1]])}}const et=[-1/0,-1/0,1/0,1/0],tt={type:"url",value:null,validate:(e,t)=>t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every(e=>"string"==typeof e),equals:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}};function nt(e,t){const n=[t.transformPoint([e[0],e[1]]),t.transformPoint([e[2],e[1]]),t.transformPoint([e[0],e[3]]),t.transformPoint([e[2],e[3]])];return[Math.min(...n.map(e=>e[0])),Math.min(...n.map(e=>e[1])),Math.max(...n.map(e=>e[0])),Math.max(...n.map(e=>e[1]))]}function rt(e,t){if(!e||!e.length)return null;if(Array.isArray(e)){e=e[Math.abs(t.x+t.y)%e.length]}const{x:n,y:r,z:a}=t;return e.replace(/\{x\}/g,n).replace(/\{y\}/g,r).replace(/\{z\}/g,a).replace(/\{-y\}/g,Math.pow(2,a)-r-1)}function at(e,t){return 512*Math.pow(2,e)/t}function ot(e,t,n){const r=at(n,512),a=e/r*360-180,o=Math.PI-2*Math.PI*t/r;return[a,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function it(e,t,n,r){const a=at(n,r);return[e/a*512,t/a*512]}function st(e,t,n,r,a=512){if(e.isGeospatial){const[e,a]=ot(t,n,r),[o,i]=ot(t+1,n+1,r);return{west:e,north:a,east:o,south:i}}const[o,i]=it(t,n,r,a),[s,l]=it(t+1,n+1,r,a);return{left:o,top:i,right:s,bottom:l}}function lt(e,t,n,r,a){const o=function(e,t,n){let r;if(t&&2===t.length){const[n,a]=t,o=e.getBounds({z:n}),i=e.getBounds({z:a});r=[Math.min(o[0],i[0]),Math.min(o[1],i[1]),Math.max(o[2],i[2]),Math.max(o[3],i[3])]}else r=e.getBounds();return e.isGeospatial?[Math.max(r[0],n[0]),Math.max(r[1],n[1]),Math.min(r[2],n[2]),Math.min(r[3],n[3])]:[Math.max(Math.min(r[0],n[2]),n[0]),Math.max(Math.min(r[1],n[3]),n[1]),Math.min(Math.max(r[2],n[0]),n[2]),Math.min(Math.max(r[3],n[1]),n[3])]}(e,null,r),i=at(t,n),[s,l,u,c]=function(e,t,n){if(n){return nt(e,n).map(e=>e*t/512)}return e.map(e=>e*t/512)}(o,i,a),d=[];for(let e=Math.floor(s);e<u;e++)for(let n=Math.floor(l);n<c;n++)d.push({x:e,y:n,z:t});return d}function ut({viewport:e,maxZoom:t,minZoom:n,zRange:r,extent:a,tileSize:o=512,modelMatrix:i,modelMatrixInverse:s,zoomOffset:l=0}){let u=e.isGeospatial?Math.round(e.zoom+Math.log2(512/o))+l:Math.ceil(e.zoom)+l;if(Number.isFinite(n)&&u<n){if(!a)return[];u=n}Number.isFinite(t)&&u>t&&(u=t);let c=a;return i&&s&&a&&!e.isGeospatial&&(c=nt(a,i)),e.isGeospatial?function(e,t,n,r){const a=e.resolution?e.projectPosition:null,o=Object.values(e.getFrustumPlanes()).map(({normal:e,distance:t})=>new we(e.clone().negate(),t)),i=new Ce(o),s=e.distanceScales.unitsPerMeter[2],l=n&&n[0]*s||0,u=n&&n[1]*s||0,c=e.pitch<=60?t:0;if(r){const[e,t,n,a]=r,o=Object(Ke.l)([e,a]),i=Object(Ke.l)([n,t]);r=[o[0],512-o[1],i[0],512-i[1]]}const d=new $e(0,0,0),f={viewport:e,project:a,cullingVolume:i,elevationBounds:[l,u],minZ:c,maxZ:t,bounds:r,offset:0};if(d.update(f),e.subViewports&&e.subViewports.length>1){for(f.offset=-1;d.update(f)&&!(--f.offset<-3););for(f.offset=1;d.update(f)&&!(++f.offset>3););}return d.getSelected()}(e,u,r,a):lt(e,u,o,c||et,s)}var ct=n(806);function dt(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}Math.PI,Math.PI;const ft={};function pt(e,{precision:t=ft.precision||4}={}){return e=function(e){return Math.round(e/ft.EPSILON)*ft.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function ht(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mt(e,t,n){return ht(e)?e.map((e,r)=>mt(e,t[r],n)):n*t+(1-n)*e}function gt(e,t,n){const r=ft.EPSILON;n&&(ft.EPSILON=n);try{if(e===t)return!0;if(ht(e)&&ht(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!gt(e[n],t[n]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=ft.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{ft.EPSILON=r}}function yt(e,t,n=""){if(ft.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}ft.EPSILON=1e-12,ft.debug=!1,ft.precision=4,ft.printTypes=!1,ft.printDegrees=!1,ft.printRowMajor=!0;const vt={};function At(e,t){vt[e]||(vt[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}class bt extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return dt(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}to(e){return e===this?this:ht(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(ft)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+pt(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!gt(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){void 0===n&&(n=t,t=e,e=this);for(let r=0;r<this.ELEMENTS;++r){const a=e[r];this[r]=a+n*(t[r]-a)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(ft.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}class _t extends bt{get ELEMENTS(){return dt(!1),0}get RANK(){return dt(!1),0}toString(){let e="[";if(ft.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=function(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}const Et=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),xt=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Mt=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),wt={};class Ot extends _t{static get IDENTITY(){return wt.IDENTITY=wt.IDENTITY||Object.freeze(new Ot(Et)),wt.IDENTITY}static get ZERO(){return wt.ZERO=wt.ZERO||Object.freeze(new Ot(xt)),wt.ZERO}get INDICES(){return Mt}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this[9]=u,this[10]=c,this[11]=d,this[12]=f,this[13]=p,this[14]=h,this[15]=m,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=a,this[2]=l,this[3]=f,this[4]=t,this[5]=o,this[6]=u,this[7]=p,this[8]=n,this[9]=i,this[10]=c,this[11]=h,this[12]=r,this[13]=s,this[14]=d,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Et)}fromQuaternion(e){return G.c(this,e),this.check()}frustum({left:e,right:t,bottom:n,top:r,near:a,far:o}){return o===1/0?Ot._computeInfinitePerspectiveOffCenter(this,e,t,n,r,a):G.d(this,e,t,n,r,a,o),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,n,r,a,o){const i=2*o/(n-t),s=2*o/(a-r),l=(n+t)/(n-t),u=(a+r)/(a-r),c=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=l,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}lookAt(e,t,n){return 1===arguments.length&&({eye:e,center:t,up:n}=e),t=t||[0,0,0],n=n||[0,1,0],G.g(this,e,t,n),this.check()}ortho({left:e,right:t,bottom:n,top:r,near:a=.1,far:o=500}){return G.i(this,e,t,n,r,a,o),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:n=1,near:r=.1,far:a=500}){if(e>2*Math.PI)throw Error("radians");const o=e/2,i=n*Math.tan(o),s=i*t;return(new Ot).ortho({left:-s,right:s,bottom:-i,top:i,near:r,far:a})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:a=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return G.j(this,e,n,r,a),this.check()}determinant(){return G.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*a,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*a,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*a,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*a,e[8]=this[10]*o,e}transpose(){return G.q(this,this),this.check()}invert(){return G.f(this,this),this.check()}multiplyLeft(e){return G.h(this,e,this),this.check()}multiplyRight(e){return G.h(this,this,e),this.check()}rotateX(e){return G.l(this,this,e),this.check()}rotateY(e){return G.m(this,this,e),this.check()}rotateZ(e){return G.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return G.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?G.o(this,this,e):G.o(this,this,[e,e,e]),this.check()}translate(e){return G.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(yt(t=re.n(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:n}=e;switch(n){case 2:t=Z.j(t||[-0,-0],e,this);break;case 3:t=F.t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return yt(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=function(e,t,n){const r=t[0],a=t[1],o=n[3]*r+n[7]*a||1;return e[0]=(n[0]*r+n[4]*a)/o,e[1]=(n[1]*r+n[5]*a)/o,e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return yt(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return At("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return At("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return At("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}const St={"best-available":function(e){for(const t of e)t.state=0;for(const t of e)t.isSelected&&!Ct(t)&&Lt(t);for(const t of e)t.isVisible=Boolean(2&t.state)},"no-overlap":function(e){for(const t of e)t.state=0;for(const t of e)t.isSelected&&Ct(t);const t=Array.from(e).sort((e,t)=>e.z-t.z);for(const e of t)if(e.isVisible=Boolean(2&e.state),e.isVisible||1&e.state)for(const t of e.children)t.state=1;else e.isSelected&&Lt(e)},never:()=>{}};class Tt{constructor(e){this.opts=e,this.onTileLoad=e=>{this.opts.onTileLoad(e),this.opts.maxCacheByteSize&&(this._cacheByteSize+=e.byteLength,this._resizeCache())},this._requestScheduler=new ct.a({maxRequests:e.maxRequests,throttleRequests:e.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Ot,this._modelMatrixInverse=new Ot,this.setOptions(e)}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles.every(e=>e.isLoaded)}get needsReload(){return this._selectedTiles.some(e=>e.needsReload)}setOptions(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}finalize(){for(const e of this._cache.values())e.isLoading&&e.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const e of this._cache.keys()){const t=this._cache.get(e);this._selectedTiles.includes(t)?t.setNeedsReload():this._cache.delete(e)}}update(e,{zRange:t,modelMatrix:n}={}){const r=new Ot(n),a=!r.equals(this._modelMatrix);if(!e.equals(this._viewport)||a){a&&(this._modelMatrixInverse=r.clone().invert(),this._modelMatrix=r),this._viewport=e;const n=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=n.map(e=>this._getTile(e,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(e=>this._getTile({x:e.x,y:e.y,z:e.z})));const o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}getTileIndices({viewport:e,maxZoom:t,minZoom:n,zRange:r,modelMatrix:a,modelMatrixInverse:o}){const{tileSize:i,extent:s,zoomOffset:l}=this.opts;return ut({viewport:e,maxZoom:t,minZoom:n,zRange:r,tileSize:i,extent:s,modelMatrix:a,modelMatrixInverse:o,zoomOffset:l})}getTileMetadata({x:e,y:t,z:n}){const{tileSize:r}=this.opts;return{bbox:st(this._viewport,e,t,n,r)}}getParentIndex(e){return e.x=Math.floor(e.x/2),e.y=Math.floor(e.y/2),e.z-=1,e}updateTileStates(){const e=this.opts.refinementStrategy||"best-available",t=new Array(this._cache.size);let n=0;for(const e of this._cache.values())t[n++]=e.isVisible,e.isSelected=!1,e.isVisible=!1;for(const e of this._selectedTiles)e.isSelected=!0,e.isVisible=!0;("function"==typeof e?e:St[e])(Array.from(this._cache.values())),n=0;for(const e of this._cache.values())if(t[n++]!==e.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:e}=this.opts,t=[];let n=0;for(const e of this._cache.values())e.isLoading&&(n++,e.isSelected||e.isVisible||t.push(e));for(;e>0&&n>e&&t.length>0;){t.shift().abort(),n--}}_rebuildTree(){const{_cache:e}=this;for(const t of e.values())t.parent=null,t.children.length=0;for(const t of e.values()){const e=this._getNearestAncestor(t.x,t.y,t.z);t.parent=e,e&&e.children.push(t)}}_resizeCache(){const{_cache:e,opts:t}=this,n=t.maxCacheSize||(t.maxCacheByteSize?1/0:5*this.selectedTiles.length),r=t.maxCacheByteSize||1/0;if(e.size>n||this._cacheByteSize>r){for(const[a,o]of e)if(o.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?o.byteLength:0,e.delete(a),this.opts.onTileUnload(o)),e.size<=n&&this._cacheByteSize<=r)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((e,t)=>e.z-t.z),this._dirty=!1)}_getTile({x:e,y:t,z:n},r){const a="".concat(e,",").concat(t,",").concat(n);let o=this._cache.get(a),i=!1;return!o&&r?(o=new x({x:e,y:t,z:n}),Object.assign(o,this.getTileMetadata(o)),i=!0,this._cache.set(a,o),this._dirty=!0):o&&o.needsReload&&(i=!0),i&&o.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),o}_getNearestAncestor(e,t,n){const{_minZoom:r=0}=this;let a={x:e,y:t,z:n};for(;a.z>r;){a=this.getParentIndex(a);const e=this._getTile(a);if(e)return e}return null}}function Ct(e){for(;e;){if(e.isLoaded||e.content)return e.state|=2,!0;e=e.parent}return!1}function Lt(e){for(const t of e.children)t.isLoaded||t.content?t.state|=2:Lt(t)}const Pt={data:[],dataComparator:tt.equals,renderSubLayers:{type:"function",value:e=>new _.a(e),compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:e=>console.error(e),compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0};class Rt extends o.a{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var e;null===(e=this.state.tileset)||void 0===e||e.finalize()}get isLoaded(){const{tileset:e}=this.state;return e.selectedTiles.every(e=>e.isLoaded&&e.layers&&e.layers.every(e=>e.isLoaded))}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,changeFlags:t}){let{tileset:n}=this.state;const r=t.propsOrDataChanged||t.updateTriggersChanged,a=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);n?r&&(n.setOptions(this._getTilesetOptions(e)),a?n.reloadAll():this.state.tileset.tiles.forEach(e=>{e.layers=null})):(n=new Tt(this._getTilesetOptions(e)),this.setState({tileset:n})),this._updateTileset()}_getTilesetOptions(e){const{tileSize:t,maxCacheSize:n,maxCacheByteSize:r,refinementStrategy:a,extent:o,maxZoom:i,minZoom:s,maxRequests:l,zoomOffset:u}=e;return{maxCacheSize:n,maxCacheByteSize:r,maxZoom:i,minZoom:s,tileSize:t,refinementStrategy:a,extent:o,maxRequests:l,zoomOffset:u,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const{tileset:e}=this.state,{zRange:t,modelMatrix:n}=this.props,r=e.update(this.context.viewport,{zRange:t,modelMatrix:n}),{isLoaded:a}=e,o=this.state.isLoaded!==a,i=this.state.frameNumber!==r;a&&(o||i)&&this._onViewportLoad(),i&&this.setState({frameNumber:r}),this.state.isLoaded=a}_onViewportLoad(){const{tileset:e}=this.state,{onViewportLoad:t}=this.props;t&&t(e.selectedTiles)}_onTileLoad(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}_onTileError(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}_onTileUnload(e){this.props.onTileUnload(e)}getTileData(e){const{data:t,getTileData:n,fetch:r}=this.props,{signal:a}=e;return e.url=rt(t,e),n?n(e):e.url?r(e.url,{propName:"data",layer:this,signal:a}):null}renderSubLayers(e){return this.props.renderSubLayers(e)}getSubLayerPropsByTile(e){return null}getPickingInfo({info:e,sourceLayer:t}){return e.tile=t.props.tile,e}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}renderLayers(){return this.state.tileset.tiles.map(e=>{const t=this.getSubLayerPropsByTile(e);if(e.isLoaded||e.content)if(e.layers)t&&e.layers[0]&&Object.keys(t).some(n=>e.layers[0].props[n]!==t[n])&&(e.layers=e.layers.map(e=>e.clone(t)));else{const n=this.renderSubLayers({...this.props,id:"".concat(this.id,"-").concat(e.x,"-").concat(e.y,"-").concat(e.z),data:e.content,_offset:0,tile:e});e.layers=Object(b.b)(n,Boolean).map(n=>n.clone({tile:e,...t}))}else;return e.layers})}filterSubLayer({layer:e}){return e.props.tile.isVisible}}Rt.layerName="TileLayer",Rt.defaultProps=Pt;var Dt=n(290);class kt extends Dt.a{getShaders(){const e=super.getShaders();return e.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},e}initializeState(e){super.initializeState(e);this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(e){const{fadeTrail:t,trailLength:n,currentTime:r}=this.props;e.uniforms={...e.uniforms,fadeTrail:t,trailLength:n,currentTime:r},super.draw(e)}}kt.layerName="TripsLayer",kt.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var It=n(112),Ft=n(122);const jt={...i.a.defaultProps,getHexagons:{type:"accessor",value:e=>e.hexagons}};class Bt extends o.a{updateState({props:e,oldProps:t,changeFlags:n}){if(n.dataChanged||n.updateTriggers&&n.updateTriggers.getHexagons){const{data:t,getHexagons:n}=e,r=[],{iterable:a,objectInfo:o}=Object(Ft.a)(t);for(const e of a){o.index++;const t=n(e,o),a=Object(It.h3SetToMultiPolygon)(t,!0);for(const t of a)r.push(this.getSubLayerRow({polygon:t},e,o.index))}this.setState({polygons:r})}}renderLayers(){const{elevationScale:e,extruded:t,wireframe:n,filled:r,stroked:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:c,lineDashJustified:d,material:f,getFillColor:p,getLineColor:h,getLineWidth:m,getLineDashArray:g,getElevation:y,transitions:v,updateTriggers:A}=this.props;return new(this.getSubLayerClass("cluster-region",i.a))({filled:r,wireframe:n,extruded:t,elevationScale:e,stroked:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:c,lineDashJustified:d,material:f,transitions:v,getFillColor:this.getSubLayerAccessor(p),getLineColor:this.getSubLayerAccessor(h),getLineWidth:this.getSubLayerAccessor(m),getLineDashArray:this.getSubLayerAccessor(g),getElevation:this.getSubLayerAccessor(y)},this.getSubLayerProps({id:"cluster-region",updateTriggers:A}),{data:this.state.polygons,getPolygon:e=>e.polygon})}}Bt.defaultProps=jt,Bt.layerName="H3ClusterLayer";var Nt=n(439);function zt(e,t){t=void 0===t?e[0][0]:t;for(const n of e){const e=n[0]-t;e>180?n[0]-=360:e<-180&&(n[0]+=360)}}function Ut(e,t,n){const r=e(t,n),[a,o]=Object(It.h3ToGeo)(r);return[o,a]}function Ht(e,t=1,n){const r=Object(It.h3ToGeoBoundary)(e,!0);if(1!==t?function(e,t,n){const[r,a]=Object(It.h3ToGeo)(e),o=t.length;zt(t,a);const i=t[0]===t[o-1]?o-1:o;for(let e=0;e<i;e++)t[e][0]=mt(a,t[e][0],n),t[e][1]=mt(r,t[e][1],n)}(e,r,t):zt(r),n){const e=new Float64Array(2*r.length);let t=0;for(const n of r)e[t++]=n[0],e[t++]=n[1];return e}return r}const Vt={...i.a.defaultProps,highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:e=>e.hexagon},extruded:!0};delete Vt.getLineDashArray;class Gt extends o.a{shouldUpdateState({changeFlags:e}){return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(!0!==e.highPrecision&&(n.dataChanged||n.updateTriggers&&n.updateTriggers.getHexagon)){const t=this._calculateH3DataProps(e);this.setState(t)}this._updateVertices(this.context.viewport)}_calculateH3DataProps(e){let t=-1,n=!1,r=!1;const{iterable:a,objectInfo:o}=Object(Ft.a)(e.data);for(const i of a){o.index++;const a=e.getHexagon(i,o),s=Object(It.h3GetResolution)(a);if(t<0){if(t=s,!e.highPrecision)break}else if(t!==s){r=!0;break}if(Object(It.h3IsPentagon)(a)){n=!0;break}}return{resolution:t,edgeLengthKM:t>=0?Object(It.edgeLength)(t,It.UNITS.km):0,hasMultipleRes:r,hasPentagon:n}}_shouldUseHighPrecision(){if("auto"===this.props.highPrecision){const{resolution:e,hasPentagon:t,hasMultipleRes:n}=this.state,{viewport:r}=this.context;return r.resolution||n||t||e>=0&&e<=5}return this.props.highPrecision}_updateVertices(e){if(this._shouldUseHighPrecision())return;const{resolution:t,edgeLengthKM:n,centerHex:r}=this.state;if(t<0)return;const a=this.props.centerHexagon||Object(It.geoToH3)(e.latitude,e.longitude,t);if(r===a)return;if(r){const e=Object(It.h3Distance)(r,a);if(e>=0&&e*n<10)return}const{unitsPerMeter:o}=e.distanceScales;let i=Ht(a);const[s,l]=Object(It.h3ToGeo)(a),[u,c]=e.projectFlat([l,s]);i=i.map(t=>{const n=e.projectFlat(t);return[(n[0]-u)/o[0],(n[1]-c)/o[1]]}),this.setState({centerHex:a,vertices:i})}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){const{elevationScale:e,material:t,coverage:n,extruded:r,wireframe:a,stroked:o,filled:i,lineWidthUnits:s,lineWidthScale:l,lineWidthMinPixels:u,lineWidthMaxPixels:c,getFillColor:d,getElevation:f,getLineColor:p,getLineWidth:h,transitions:m,updateTriggers:g}=this.props;return{elevationScale:e,extruded:r,coverage:n,wireframe:a,stroked:o,filled:i,lineWidthUnits:s,lineWidthScale:l,lineWidthMinPixels:u,lineWidthMaxPixels:c,material:t,getElevation:f,getFillColor:d,getLineColor:p,getLineWidth:h,transitions:m,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}_renderPolygonLayer(){const{data:e,getHexagon:t,updateTriggers:n,coverage:r}=this.props,a=this.getSubLayerClass("hexagon-cell-hifi",i.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){let n;return n=null==e?t:"object"==typeof e?{...e,coverage:t}:{getHexagon:e,coverage:t},n}(n.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:(e,n)=>Ht(t(e,n),r,!0)})}_renderColumnLayer(){const{data:e,getHexagon:t,updateTriggers:n}=this.props,r=this.getSubLayerClass("hexagon-cell",Nt.a),a=this._getForwardProps();return a.updateTriggers.getPosition=n.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:a.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Ut.bind(null,t)})}}Gt.defaultProps=Vt,Gt.layerName="H3HexagonLayer";var Yt=n(144),Wt=n(34),qt=n(1175),Xt=n(1161),Kt=n(1196),Zt=n(1915),Jt=n(461),Qt=n(1176);class $t extends Qt.a{getShaders(){const e=super.getShaders();return e.modules.push(Zt.a),{...e,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool u_pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (u_pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){const{featureIds:e}=this.props;super.initializeState(),e&&this.state.attributeManager.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),e.pbrMaterial!==t.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(e){const{featureIds:t}=this.props;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,u_pickFeatureIds:Boolean(t)}),super.draw(e))}getModel(e){const{id:t,pbrMaterial:n}=this.props,r=this.parseMaterial(n,e),a=this.getShaders();var o;(o=e.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])});return new Jt.a(this.context.gl,{...this.getShaders(),id:t,geometry:e,defines:{...a.defines,...null==r?void 0:r.defines,HAS_UV_REGIONS:e.attributes.uvRegions},parameters:null==r?void 0:r.parameters,isInstanced:!0})}updatePbrMaterialUniforms(e){const{model:t}=this.state;if(t){const{mesh:n}=this.props,r=this.parseMaterial(e,n);t.setUniforms(r.uniforms)}}parseMaterial(e,t){const n=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return new Kt.a(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:{unlit:n,...e},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(e){const{featureIds:t}=this.props,n=new Uint8ClampedArray(t.length*e.size),r=[];for(let e=0;e<t.length;e++)this.encodePickingColor(t[e],r),n[3*e]=r[0],n[3*e+1]=r[1],n[3*e+2]=r[2];e.value=n}}$t.layerName="_MeshLayer",$t.defaultProps={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};var en=n(805);function tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nn=n(99);function rn(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function an(e,t,n=""){if(nn.b.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}const on={};function sn(e,t){on[e]||(on[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}var ln=n(110);class un extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return Object(ln.a)(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}to(e){return e===this?this:Object(nn.f)(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(nn.b)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+Object(nn.e)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Object(nn.d)(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){void 0===n&&(n=t,t=e,e=this);for(let r=0;r<this.ELEMENTS;++r){const a=e[r];this[r]=a+n*(t[r]-a)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(nn.b.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}class cn extends un{get ELEMENTS(){return Object(ln.a)(!1),0}get RANK(){return Object(ln.a)(!1),0}toString(){let e="[";if(nn.b.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=rn(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}function dn(e,t,n){const r=t[0],a=t[1],o=n[3]*r+n[7]*a||1;return e[0]=(n[0]*r+n[4]*a)/o,e[1]=(n[1]*r+n[5]*a)/o,e}function fn(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}const pn=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),hn=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),mn=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),gn={};class yn extends cn{static get IDENTITY(){return gn.IDENTITY=gn.IDENTITY||Object.freeze(new yn(pn)),gn.IDENTITY}static get ZERO(){return gn.ZERO=gn.ZERO||Object.freeze(new yn(hn)),gn.ZERO}get INDICES(){return mn}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this[9]=u,this[10]=c,this[11]=d,this[12]=f,this[13]=p,this[14]=h,this[15]=m,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=a,this[2]=l,this[3]=f,this[4]=t,this[5]=o,this[6]=u,this[7]=p,this[8]=n,this[9]=i,this[10]=c,this[11]=h,this[12]=r,this[13]=s,this[14]=d,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(pn)}fromQuaternion(e){return G.c(this,e),this.check()}frustum({left:e,right:t,bottom:n,top:r,near:a,far:o}){return o===1/0?yn._computeInfinitePerspectiveOffCenter(this,e,t,n,r,a):G.d(this,e,t,n,r,a,o),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,n,r,a,o){const i=2*o/(n-t),s=2*o/(a-r),l=(n+t)/(n-t),u=(a+r)/(a-r),c=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=l,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}lookAt(e,t,n){return 1===arguments.length&&({eye:e,center:t,up:n}=e),t=t||[0,0,0],n=n||[0,1,0],G.g(this,e,t,n),this.check()}ortho({left:e,right:t,bottom:n,top:r,near:a=.1,far:o=500}){return G.i(this,e,t,n,r,a,o),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:n=1,near:r=.1,far:a=500}){if(e>2*Math.PI)throw Error("radians");const o=e/2,i=n*Math.tan(o),s=i*t;return(new yn).ortho({left:-s,right:s,bottom:-i,top:i,near:r,far:a})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:a=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return G.j(this,e,n,r,a),this.check()}determinant(){return G.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*a,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*a,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*a,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*a,e[8]=this[10]*o,e}transpose(){return G.q(this,this),this.check()}invert(){return G.f(this,this),this.check()}multiplyLeft(e){return G.h(this,e,this),this.check()}multiplyRight(e){return G.h(this,this,e),this.check()}rotateX(e){return G.l(this,this,e),this.check()}rotateY(e){return G.m(this,this,e),this.check()}rotateZ(e){return G.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return G.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?G.o(this,this,e):G.o(this,this,[e,e,e]),this.check()}translate(e){return G.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(an(t=re.n(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:n}=e;switch(n){case 2:t=Z.j(t||[-0,-0],e,this);break;case 3:t=F.t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return an(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=dn(t||[-0,-0],e,this);break;case 3:t=fn(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return an(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return sn("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return sn("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return sn("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}class vn extends un{get ELEMENTS(){return Object(ln.a)(!1),0}copy(e){return Object(ln.a)(!1),this}get x(){return this[0]}set x(e){this[0]=rn(e)}get y(){return this[1]}set y(e){this[1]=rn(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){const r=this[n]-e[n];t+=r*r}return rn(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return rn(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Object(ln.a)(e>=0&&e<this.ELEMENTS,"index is out of range"),rn(this[e])}setComponent(e,t){return Object(ln.a)(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}const An=[0,0,0],bn={};class _n extends vn{static get ZERO(){return bn.ZERO=bn.ZERO||Object.freeze(new _n(0,0,0,0))}constructor(e=0,t=0,n=0){super(-0,-0,-0),1===arguments.length&&Object(nn.f)(e)?this.copy(e):(nn.b.debug&&(rn(e),rn(t),rn(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return nn.b.debug&&(rn(e.x),rn(e.y),rn(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=rn(e)}angle(e){return F.b(this,e)}cross(e){return F.d(this,this,e),this.check()}rotateX({radians:e,origin:t=An}){return F.n(this,this,t,e),this.check()}rotateY({radians:e,origin:t=An}){return F.o(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=An}){return F.p(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return F.t(this,this,e),this.check()}transformAsVector(e){return fn(this,this,e),this.check()}transformByMatrix3(e){return F.s(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,n){const r=t[0],a=t[1];e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return F.u(this,this,e),this.check()}}var En=.1,xn=1e-12,Mn=1e-15;Math.PI,Math.PI,Math.PI,Math.PI;Math.max(6378137,6378137,6356752.314245179);const wn=e=>e,On=new _n;function Sn(e,t,n=wn){return Object(nn.f)(e)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=n(e.longitude),t[1]=n(e.latitude),t[2]=e.height):(t[0]=n(e.x),t[1]=n(e.y),t[2]=e.z),t}function Tn(e,t,n=wn){return Object(nn.f)(t)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=n(e[0]),t.latitude=n(e[1]),t.height=e[2]):(t.x=n(e[0]),t.y=n(e[1]),t.z=e[2]),t}const Cn=new _n,Ln=new _n,Pn=new _n;const Rn=new _n,Dn={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},kn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},In={east:new _n,north:new _n,up:new _n,west:new _n,south:new _n,down:new _n},Fn=new _n,jn=new _n,Bn=new _n;function Nn(e,t,n,r,a,o){const i=Dn[t]&&Dn[t][n];let s,l,u;Object(ln.a)(i&&(!r||r===i));const c=Rn.copy(a);if(Object(nn.d)(c.x,0,1e-14)&&Object(nn.d)(c.y,0,1e-14)){const e=Math.sign(c.z);s=Fn.fromArray(kn[t]),"east"!==t&&"west"!==t&&s.scale(e),l=jn.fromArray(kn[n]),"east"!==n&&"west"!==n&&l.scale(e),u=Bn.fromArray(kn[r]),"east"!==r&&"west"!==r&&u.scale(e)}else{const{up:a,east:o,north:i}=In;o.set(-c.y,c.x,0).normalize(),e.geodeticSurfaceNormal(c,a),i.copy(a).cross(o);const{down:d,west:f,south:p}=In;d.copy(a).scale(-1),f.copy(o).scale(-1),p.copy(i).scale(-1),s=In[t],l=In[n],u=In[r]}return o[0]=s.x,o[1]=s.y,o[2]=s.z,o[3]=0,o[4]=l.x,o[5]=l.y,o[6]=l.z,o[7]=0,o[8]=u.x,o[9]=u.y,o[10]=u.z,o[11]=0,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=1,o}const zn=new _n,Un=new _n,Hn=new _n,Vn=new _n,Gn=new _n,Yn=new _n;let Wn;class qn{static get WGS84(){return Wn=Wn||new qn(6378137,6378137,6356752.314245179),Wn}constructor(e=0,t=0,n=0){Object(ln.a)(e>=0),Object(ln.a)(t>=0),Object(ln.a)(n>=0),this.radii=new _n(e,t,n),this.radiiSquared=new _n(e*e,t*t,n*n),this.radiiToTheFourth=new _n(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new _n(0===e?0:1/e,0===t?0:1/t,0===n?0:1/n),this.oneOverRadiiSquared=new _n(0===e?0:1/(e*e),0===t?0:1/(t*t),0===n?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.centerToleranceSquared=En,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const n=Un,r=Hn,[,,a]=e;this.geodeticSurfaceNormalCartographic(e,n),r.copy(this.radiiSquared).scale(n);const o=Math.sqrt(n.dot(r));return r.scale(1/o),n.scale(a),r.add(n),r.to(t)}cartesianToCartographic(e,t=[0,0,0]){Yn.from(e);const n=this.scaleToGeodeticSurface(Yn,Vn);if(!n)return;const r=this.geodeticSurfaceNormal(n,Un),a=Gn;a.copy(Yn).subtract(n);const o=Math.atan2(r.y,r.x),i=Math.asin(r.z),s=Math.sign(F.f(a,Yn))*F.i(a);return Tn([o,i,s],t,nn.b._cartographicRadians?wn:nn.g)}eastNorthUpToFixedFrame(e,t=new yn){return Nn(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,n,r,a=new yn){return Nn(this,e,t,n,r,a)}geocentricSurfaceNormal(e,t=[0,0,0]){return zn.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const n=function(e,t=On){return Sn(e,t,nn.b._cartographicRadians?wn:nn.h)}(e),r=n[0],a=n[1],o=Math.cos(a);return zn.set(o*Math.cos(r),o*Math.sin(r),Math.sin(a)).normalize(),zn.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return zn.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function(e,t,n=new _n){const{oneOverRadii:r,oneOverRadiiSquared:a,centerToleranceSquared:o}=t;Cn.from(e);const i=e.x,s=e.y,l=e.z,u=r.x,c=r.y,d=r.z,f=i*i*u*u,p=s*s*c*c,h=l*l*d*d,m=f+p+h,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;const y=Ln;if(y.copy(e).scale(g),m<o)return y.to(n);const v=a.x,A=a.y,b=a.z,_=Pn;_.set(y.x*v*2,y.y*A*2,y.z*b*2);let E,x,M,w,O=(1-g)*e.len()/(.5*_.len()),S=0;do{O-=S,E=1/(1+O*v),x=1/(1+O*A),M=1/(1+O*b);const e=E*E,t=x*x,n=M*M;w=f*e+p*t+h*n-1;S=w/(-2*(f*(e*E)*v+p*(t*x)*A+h*(n*M)*b))}while(Math.abs(w)>xn);return Cn.scale([E,x,M]).to(n)}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){Vn.from(e);const n=Vn.x,r=Vn.y,a=Vn.z,o=this.oneOverRadiiSquared,i=1/Math.sqrt(n*n*o.x+r*r*o.y+a*a*o.z);return Vn.multiplyScalar(i).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return Vn.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return Vn.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){Object(ln.a)(Object(nn.d)(this.radii.x,this.radii.y,Mn)),Object(ln.a)(this.radii.z>0),Vn.from(e);const r=Vn.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(r)>=this.radii.z-t))return Vn.set(0,0,r).to(n)}}var Xn=n(212),Kn=n(172),Zn=n(46);class Jn{constructor(e,t,n){tn(this,"item",void 0),tn(this,"previous",void 0),tn(this,"next",void 0),this.item=e,this.previous=t,this.next=n}}class Qn{constructor(){tn(this,"head",null),tn(this,"tail",null),tn(this,"_length",0)}get length(){return this._length}add(e){const t=new Jn(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,++this._length}}function $n(e){return null!=e}class er{constructor(){tn(this,"_list",void 0),tn(this,"_sentinel",void 0),tn(this,"_trimTiles",void 0),this._list=new Qn,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){const t=e._cacheNode;$n(t)&&this._list.splice(this._sentinel,t)}add(e,t,n){$n(t._cacheNode)||(t._cacheNode=this._list.add(t),n&&n(e,t))}unloadTile(e,t,n){const r=t._cacheNode;$n(r)&&(this._list.remove(r),t._cacheNode=void 0,n&&n(e,t))}unloadTiles(e,t){const n=this._trimTiles;this._trimTiles=!1;const r=this._list,a=1024*e.maximumMemoryUsage*1024,o=this._sentinel;let i=r.head;for(;i!==o&&(e.gpuMemoryUsageInBytes>a||n);){const n=i.item;i=i.next,this.unloadTile(e,n,t)}}trim(){this._trimTiles=!0}}const tr=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});new _n,new _n;const nr=new _n,rr=new _n;class ar{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new _n,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=nr.from(t),this.center=(new _n).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new ar(this.center,this.radius)}union(e){const t=this.center,n=this.radius,r=e.center,a=e.radius,o=nr.copy(r).subtract(t),i=o.magnitude();if(n>=i+a)return this.clone();if(a>=i+n)return e.clone();const s=.5*(n+i+a);return rr.copy(o).scale((-n+s)/i).add(t),this.center.copy(rr),this.radius=s,this}expand(e){const t=(e=nr.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=G.e(nr,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=nr.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const t=this.center,n=this.radius,r=e.normal.dot(t)+e.distance;return r<-n?tr.OUTSIDE:r<n?tr.INTERSECTING:tr.INSIDE}}const or=Object.freeze([1,0,0,0,1,0,0,0,1]),ir=Object.freeze([0,0,0,0,0,0,0,0,0]),sr=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),lr={};class ur extends cn{static get IDENTITY(){return lr.IDENTITY=lr.IDENTITY||Object.freeze(new ur(or)),lr.IDENTITY}static get ZERO(){return lr.ZERO=lr.ZERO||Object.freeze(new ur(ir)),lr.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return sr}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}set(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=r,this[2]=i,this[3]=t,this[4]=a,this[5]=s,this[6]=n,this[7]=o,this[8]=l,this.check()}determinant(){return K.b(this)}identity(){return this.copy(or)}fromQuaternion(e){return K.c(this,e),this.check()}transpose(){return K.i(this,this),this.check()}invert(){return K.d(this,this),this.check()}multiplyLeft(e){return K.e(this,e,this),this.check()}multiplyRight(e){return K.e(this,this,e),this.check()}rotate(e){return K.f(this,this,e),this.check()}scale(e){return Array.isArray(e)?K.g(this,this,e):K.g(this,this,[e,e,e]),this.check()}translate(e){return K.h(this,this,e),this.check()}transform(e,t){switch(e.length){case 2:t=Z.i(t||[-0,-0],e,this);break;case 3:t=F.s(t||[-0,-0,-0],e,this);break;case 4:t=function(e,t,n){const r=t[0],a=t[1],o=t[2];return e[0]=n[0]*r+n[3]*a+n[6]*o,e[1]=n[1]*r+n[4]*a+n[7]*o,e[2]=n[2]*r+n[5]*a+n[8]*o,e[3]=t[3],e}(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return an(t,e.length),t}transformVector(e,t){return sn("Matrix3.transformVector"),this.transform(e,t)}transformVector2(e,t){return sn("Matrix3.transformVector"),this.transform(e,t)}transformVector3(e,t){return sn("Matrix3.transformVector"),this.transform(e,t)}}const cr=[0,0,0,1];class dr extends un{constructor(e=0,t=0,n=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,n,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this.check()}fromMatrix3(e){return ne.e(this,e),this.check()}identity(){return ne.f(this),this.check()}fromAxisRotation(e,t){return ne.p(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=rn(e)}get y(){return this[1]}set y(e){this[1]=rn(e)}get z(){return this[2]}set z(e){this[2]=rn(e)}get w(){return this[3]}set w(e){this[3]=rn(e)}len(){return ne.h(this)}lengthSquared(){return ne.r(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ne.d(this,e)}rotationTo(e,t){return ne.n(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return ne.a(this,this,e),this.check()}calculateW(){return ne.b(this,this),this.check()}conjugate(){return ne.c(this,this),this.check()}invert(){return ne.g(this,this),this.check()}lerp(e,t,n){return ne.i(this,e,t,n),this.check()}multiplyRight(e,t){return Object(ln.a)(!t),ne.j(this,this,e),this.check()}multiplyLeft(e,t){return Object(ln.a)(!t),ne.j(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return ne.k(this,this,e),this.check()}rotateY(e){return ne.l(this,this,e),this.check()}rotateZ(e){return ne.m(this,this,e),this.check()}scale(e){return ne.o(this,this,e),this.check()}slerp(e,t,n){switch(arguments.length){case 1:({start:e=cr,target:t,ratio:n}=arguments[0]);break;case 2:[t,n]=arguments,e=this}return ne.q(this,e,t,n),this.check()}transformVector4(e,t=e){return re.o(t,e,this),an(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}}const fr=new _n,pr=new _n,hr=new _n,mr=new _n,gr=new _n,yr=new _n,vr=new _n,Ar=0,br=1,_r=2,Er=3,xr=4,Mr=5,wr=6,Or=7,Sr=8;class Tr{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new _n).from(e),this.halfAxes=new ur(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new _n(e).len(),new _n(t).len(),new _n(n).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new _n(e).normalize(),a=new _n(t).normalize(),o=new _n(n).normalize();return(new dr).fromMatrix3(new ur([...r,...a,...o]))}fromCenterHalfSizeQuaternion(e,t,n){const r=new dr(n),a=(new ur).fromQuaternion(r);return a[0]=a[0]*t[0],a[1]=a[1]*t[0],a[2]=a[2]*t[0],a[3]=a[3]*t[1],a[4]=a[4]*t[1],a[5]=a[5]*t[1],a[6]=a[6]*t[2],a[7]=a[7]*t[2],a[8]=a[8]*t[2],this.center=(new _n).from(e),this.halfAxes=a,this}clone(){return new Tr(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new ar){const t=this.halfAxes,n=t.getColumn(0,hr),r=t.getColumn(1,mr),a=t.getColumn(2,gr),o=fr.copy(n).add(r).add(a);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,n=e.normal,r=this.halfAxes,a=n.x,o=n.y,i=n.z,s=Math.abs(a*r[Ar]+o*r[br]+i*r[_r])+Math.abs(a*r[Er]+o*r[xr]+i*r[Mr])+Math.abs(a*r[wr]+o*r[Or]+i*r[Sr]),l=n.dot(t)+e.distance;return l<=-s?tr.OUTSIDE:l>=s?tr.INSIDE:tr.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=pr.from(e).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,hr),a=n.getColumn(1,mr),o=n.getColumn(2,gr),i=r.magnitude(),s=a.magnitude(),l=o.magnitude();r.normalize(),a.normalize(),o.normalize();let u,c=0;return u=Math.abs(t.dot(r))-i,u>0&&(c+=u*u),u=Math.abs(t.dot(a))-s,u>0&&(c+=u*u),u=Math.abs(t.dot(o))-l,u>0&&(c+=u*u),c}computePlaneDistances(e,t,n=[-0,-0]){let r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const o=this.center,i=this.halfAxes,s=i.getColumn(0,hr),l=i.getColumn(1,mr),u=i.getColumn(2,gr),c=yr.copy(s).add(l).add(u).add(o),d=vr.copy(c).subtract(e);let f=t.dot(d);return r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),n[0]=r,n[1]=a,n}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,hr);t.transformAsPoint(e);const n=this.halfAxes.getColumn(1,mr);n.transformAsPoint(e);const r=this.halfAxes.getColumn(2,gr);return r.transformAsPoint(e),this.halfAxes=new ur([...t,...n,...r]),this}getTransform(){throw new Error("not implemented")}}const Cr=new _n,Lr=new _n;class Pr{constructor(e=[0,0,1],t=0){this.normal=new _n,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Object(ln.a)(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=Cr.from(e),this.normal.from(t).normalize();const n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,t,n,r){return this.normal.set(e,t,n),Object(ln.a)(Object(nn.d)(this.normal.len(),1)),this.distance=r,this}clone(e){return new Pr(this.normal,this.distance)}equals(e){return Object(nn.d)(this.distance,e.distance)&&Object(nn.d)(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=Lr.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}projectPointOntoPlane(e,t=[0,0,0]){e=Cr.from(e);const n=this.getPointDistance(e),r=Lr.copy(this.normal).scale(n);return e.subtract(r).to(t)}}const Rr=[new _n([1,0,0]),new _n([0,1,0]),new _n([0,0,1])],Dr=new _n,kr=new _n;new Pr(new _n(1,0,0),0);class Ir{static get MASK_OUTSIDE(){return 4294967295}static get MASK_INSIDE(){return 0}static get MASK_INDETERMINATE(){return 2147483647}constructor(e=[]){this.planes=e,Object(ln.a)(this.planes.every(e=>e instanceof Pr))}fromBoundingSphere(e){this.planes.length=2*Rr.length;const t=e.center,n=e.radius;let r=0;for(const e of Rr){let a=this.planes[r],o=this.planes[r+1];a||(a=this.planes[r]=new Pr),o||(o=this.planes[r+1]=new Pr);const i=Dr.copy(e).scale(-n).add(t);e.dot(i);a.fromPointNormal(i,e);const s=Dr.copy(e).scale(n).add(t),l=kr.copy(e).negate();l.dot(s);o.fromPointNormal(s,l),r+=2}return this}computeVisibility(e){Object(ln.a)(e);let t=tr.INSIDE;for(const n of this.planes){switch(e.intersectPlane(n)){case tr.OUTSIDE:return tr.OUTSIDE;case tr.INTERSECTING:t=tr.INTERSECTING}}return t}computeVisibilityWithPlaneMask(e,t){if(Object(ln.a)(e,"boundingVolume is required."),Object(ln.a)(Number.isFinite(t),"parentPlaneMask is required."),t===Ir.MASK_OUTSIDE||t===Ir.MASK_INSIDE)return t;let n=Ir.MASK_INSIDE;const r=this.planes;for(let a=0;a<this.planes.length;++a){const o=a<31?1<<a:0;if(a<31&&0==(t&o))continue;const i=r[a],s=e.intersectPlane(i);if(s===tr.OUTSIDE)return Ir.MASK_OUTSIDE;s===tr.INTERSECTING&&(n|=o)}return n}}new _n,new _n,new _n,new _n,new _n;new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,Math.PI;new ur,new ur,new ur,new ur,new ur;new _n,new _n,new _n,new _n,new _n,new ur,new ur,new ur;const Fr=new _n,jr=new _n,Br=new Ir([new Pr,new Pr,new Pr,new Pr,new Pr,new Pr]);function Nr(e,t){const{cameraDirection:n,cameraUp:r,height:a}=e,{metersPerUnit:o}=e.distanceScales,i=e.unprojectPosition(e.center),s=qn.WGS84.cartographicToCartesian(i,new _n),l=qn.WGS84.eastNorthUpToFixedFrame(s),u=e.unprojectPosition(e.cameraPosition),c=qn.WGS84.cartographicToCartesian(u,new _n),d=new _n(l.transformAsVector(new _n(n).scale(o))).normalize(),f=new _n(l.transformAsVector(new _n(r).scale(o))).normalize();return function(e,t){const n=e.getFrustumPlanes();let r=0;for(const a in n){const o=n[a],i=o.normal.dot(e.center);jr.copy(o.normal).scale(o.distance-i).add(e.center);const s=e.unprojectPosition(jr),l=qn.WGS84.cartographicToCartesian(s,new _n);Br.planes[r++].fromPointNormal(l,Fr.copy(t).subtract(l))}}(e,s),{camera:{position:c,direction:d,up:f},viewport:e,height:a,cullingVolume:Br,frameNumber:t,sseDenominator:1.15}}const zr=new _n;function Ur(e,t){if(e instanceof Tr){const{halfAxes:n}=e,r=function(e){e.getColumn(0,zr);const t=e.getColumn(1),n=e.getColumn(2),r=zr.add(t).add(n);return r.len()}(n);return Math.log2(6356752.314245179/(r+t[2]))}if(e instanceof ar){const{radius:n}=e;return Math.log2(6356752.314245179/(n+t[2]))}if(e.width&&e.height){const{width:t,height:n}=e;return(Math.log2(6378137/t)+Math.log2(6378137/n))/2}return 1}const Hr=0,Vr=1,Gr=3,Yr=4,Wr=5,qr=1,Xr=2,Kr="empty",Zr="scenegraph",Jr="pointcloud",Qr="mesh",$r="I3S",ea="TILES3D",ta="geometricError",na=1;function ra(e){return null!=e}const aa=new _n,oa=new _n,ia=new _n;function sa(e,t,n){if(Object(Kn.a)(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,n){const r=new _n(e[0],e[1],e[2]);t.transform(r,r);let a=[];if(10===e.length){const t=e.slice(3,6),n=new dr;n.fromArray(e,6);const r=new _n([1,0,0]),o=new _n([0,1,0]),i=new _n([0,0,1]);r.transformByQuaternion(n),r.scale(t[0]),o.transformByQuaternion(n),o.scale(t[1]),i.transformByQuaternion(n),i.scale(t[2]),a=[...r.toArray(),...o.toArray(),...i.toArray()]}else a=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];const o=t.transformAsVector(a.slice(0,3)),i=t.transformAsVector(a.slice(3,6)),s=t.transformAsVector(a.slice(6,9)),l=new ur([o[0],o[1],o[2],i[0],i[1],i[2],s[0],s[1],s[2]]);if(ra(n))return n.center=r,n.halfAxes=l,n;return new Tr(r,l)}(e.box,t,n);if(e.region){const[t,n,r,a,o,i]=e.region,s=qn.WGS84.cartographicToCartesian([Object(nn.c)(t),Object(nn.c)(a),o],oa),l=qn.WGS84.cartographicToCartesian([Object(nn.c)(r),Object(nn.c)(n),i],ia),u=(new _n).addVectors(s,l).multiplyScalar(.5),c=(new _n).subVectors(s,l).len()/2;return la([u[0],u[1],u[2],c],new yn)}if(e.sphere)return la(e.sphere,t,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function la(e,t,n){const r=new _n(e[0],e[1],e[2]);t.transform(r,r);const a=t.getScale(aa),o=Math.max(Math.max(a[0],a[1]),a[2]),i=e[3]*o;return ra(n)?(n.center=r,n.radius=i,n):new ar(r,i)}new _n,new _n,new yn,new _n,new _n,new _n;function ua(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){const n=e.dynamicScreenSpaceErrorComputedDensity,r=e.dynamicScreenSpaceErrorFactor;return function(e,t){const n=e*t;return 1-Math.exp(-n*n)}(t,n)*r}return 0}function ca(e,t){const n=t.viewport,r=n.constructor,{longitude:a,latitude:o,height:i,width:s,bearing:l,zoom:u}=n,c=new r({longitude:a,latitude:o,height:i,width:s,bearing:l,zoom:u,pitch:0}),d=e.header.mbs[1],f=e.header.mbs[0],p=e.header.mbs[2],h=e.header.mbs[3],m=[...e.boundingVolume.center],g=c.unprojectPosition(c.cameraPosition),y=qn.WGS84.cartographicToCartesian(g,new _n),v=new _n(y).subtract(m).normalize(),A=new yn;qn.WGS84.eastNorthUpToFixedFrame(m,A);const b=new yn(A).invert(),_=new _n(y).transform(b),E=Math.sqrt(_[0]*_[0]+_[1]*_[1]),x=E*E/_[2],M=new _n([_[0],_[1],x]).transform(A),w=new _n(M).subtract(m).normalize(),O=v.cross(w).normalize().scale(h),S=new _n(m).add(O),T=qn.WGS84.cartesianToCartographic(S),C=c.project([f,d,p]),L=c.project(T);return new _n(C).subtract(L).magnitude()}class da{constructor(e=0){tn(this,"_map",new Map),tn(this,"_array",void 0),tn(this,"_length",void 0),this._array=new Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return Object(Kn.a)(e<this._array.length),this._array[e]}set(e,t){Object(Kn.a)(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){const t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){const t=this.length++;this._array[t]=e,this._map.set(e,t)}}pop(){const e=this._array[--this.length];return this._map.delete(e),e}reserve(e){Object(Kn.a)(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){Object(Kn.a)(e>=0),this.length=e}trim(e){null==e&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const fa={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class pa{constructor(e){tn(this,"options",void 0),tn(this,"root",void 0),tn(this,"requestedTiles",void 0),tn(this,"selectedTiles",void 0),tn(this,"emptyTiles",void 0),tn(this,"_traversalStack",void 0),tn(this,"_emptyTraversalStack",void 0),tn(this,"_frameNumber",void 0),this.options={...fa,...e},this._traversalStack=new da,this._emptyTraversalStack=new da,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(e,t,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const n=this._traversalStack;for(e._selectionDepth=1,n.push(e);n.length>0;){const e=n.pop();let r=!1;this.canTraverse(e,t)&&(this.updateChildTiles(e,t),r=this.updateAndPushChildren(e,t,n,e.hasRenderContent?e._selectionDepth+1:e._selectionDepth));const a=e.parent,o=Boolean(!a||a._shouldRefine),i=!r;e.hasRenderContent?e.refine===qr?(this.loadTile(e,t),this.selectTile(e,t)):e.refine===Xr&&(this.loadTile(e,t),i&&this.selectTile(e,t)):(this.emptyTiles[e.id]=e,this.loadTile(e,t),i&&this.selectTile(e,t)),this.touchTile(e,t),e._shouldRefine=r&&o}this.options.onTraversalEnd(t)}updateChildTiles(e,t){const n=e.children;for(const e of n)this.updateTile(e,t);return!0}updateAndPushChildren(e,t,n,r){const{loadSiblings:a,skipLevelOfDetail:o}=this.options,i=e.children;i.sort(this.compareDistanceToCamera.bind(this));const s=e.refine===Xr&&e.hasRenderContent&&!o;let l=!1,u=!0;for(const e of i)if(e._selectionDepth=r,e.isVisibleAndInRequestVolume?(n.find(e)&&n.delete(e),n.push(e),l=!0):(s||a)&&(this.loadTile(e,t),this.touchTile(e,t)),s){let n;if(n=!!e._inRequestVolume&&(e.hasRenderContent?e.contentAvailable:this.executeEmptyTraversal(e,t)),u=u&&n,!u)return!1}return l||(u=!1),u}updateTile(e,t){this.updateTileVisibility(e,t)}selectTile(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}canTraverse(e,t,n=!1,r=!1){return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!r&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,n))}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,t,n){let r=e._screenSpaceError;return n&&(r=e.getScreenSpaceError(t,!0)),r>this.options.maximumScreenSpaceError}updateTileVisibility(e,t){const n=[];if(this.options.viewportTraversersMap)for(const e in this.options.viewportTraversersMap){this.options.viewportTraversersMap[e]===t.viewport.id&&n.push(e)}else n.push(t.viewport.id);e.updateVisibility(t,n)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let n=!1;for(const r of e.children)r.updateVisibility(t),n=n||r.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,t){let n=!0;const r=this._emptyTraversalStack;for(r.push(e);r.length>0&&n;){const e=r.pop();this.updateTile(e,t),e.isVisibleAndInRequestVolume||this.loadTile(e,t),this.touchTile(e,t);if(!e.hasRenderContent&&this.canTraverse(e,t,!1,!0)){const t=e.children;for(const e of t)r.find(e)&&r.delete(e),r.push(e)}else e.contentAvailable||(n=!1)}return n}}const ha=new _n;class ma{constructor(e,t,n,r=""){tn(this,"tileset",void 0),tn(this,"header",void 0),tn(this,"id",void 0),tn(this,"url",void 0),tn(this,"parent",void 0),tn(this,"refine",void 0),tn(this,"type",void 0),tn(this,"contentUrl",void 0),tn(this,"lodMetricType",void 0),tn(this,"lodMetricValue",void 0),tn(this,"boundingVolume",void 0),tn(this,"content",void 0),tn(this,"contentState",void 0),tn(this,"gpuMemoryUsageInBytes",void 0),tn(this,"children",void 0),tn(this,"depth",void 0),tn(this,"viewportIds",void 0),tn(this,"transform",void 0),tn(this,"extensions",void 0),tn(this,"userData",void 0),tn(this,"computedTransform",void 0),tn(this,"hasEmptyContent",void 0),tn(this,"hasTilesetContent",void 0),tn(this,"traverser",void 0),tn(this,"_cacheNode",void 0),tn(this,"_frameNumber",void 0),tn(this,"_lodJudge",void 0),tn(this,"_expireDate",void 0),tn(this,"_expiredContent",void 0),tn(this,"_shouldRefine",void 0),tn(this,"_distanceToCamera",void 0),tn(this,"_centerZDepth",void 0),tn(this,"_screenSpaceError",void 0),tn(this,"_visibilityPlaneMask",void 0),tn(this,"_visible",void 0),tn(this,"_inRequestVolume",void 0),tn(this,"_stackLength",void 0),tn(this,"_selectionDepth",void 0),tn(this,"_touchedFrame",void 0),tn(this,"_visitedFrame",void 0),tn(this,"_selectedFrame",void 0),tn(this,"_requestedFrame",void 0),tn(this,"_priority",void 0),tn(this,"_contentBoundingVolume",void 0),tn(this,"_viewerRequestVolume",void 0),tn(this,"_initialTransform",void 0),this.header=t,this.tileset=e,this.id=r||t.id,this.url=t.url,this.parent=n,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Hr,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new pa({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new yn,this.transform=new yn,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===Gr||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Hr}get contentExpired(){return this.contentState===Yr}get contentFailed(){return this.contentState===Wr}getScreenSpaceError(e,t){switch(this.tileset.type){case $r:return ca(this,e);case ea:return function(e,t,n){const r=e.tileset,a=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,o=n?a:e.lodMetricValue;if(0===o)return 0;const i=Math.max(e._distanceToCamera,1e-7),{height:s,sseDenominator:l}=t,{viewDistanceScale:u}=r.options;let c=o*s*(u||1)/(i*l);return c-=ua(r,i),c}(this,e,t);default:throw new Error("Unsupported tileset type")}}_getPriority(){const e=this.tileset._traverser,{skipLevelOfDetail:t}=e.options,n=this.refine===qr||t;if(n&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Hr)return-1;const r=this.parent,a=r&&(!n||0===this._screenSpaceError||r.hasTilesetContent)?r._screenSpaceError:this._screenSpaceError,o=e.root?e.root._screenSpaceError:0;return Math.max(o-a,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Vr;const e=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!e)return this.contentState=Hr,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,r={...this.tileset.loadOptions,[n.id]:{...this.tileset.loadOptions[n.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(n.id)}};return this.content=await Object(en.a)(t,n,r),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Gr,this._onContentLoaded(),!0}catch(e){throw this.contentState=Wr,e}finally{e.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Hr,!0}updateVisibility(e,t){if(this._frameNumber===e.frameNumber)return;const n=this.parent,r=n?n._visibilityPlaneMask:Ir.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const e=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(e)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==Ir.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}visibility(e,t){const{cullingVolume:n}=e,{boundingVolume:r}=this;return n.computeVisibilityWithPlaneMask(r,t)}contentVisibility(){return!0}distanceToTile(e){const t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth({camera:e}){const t=this.boundingVolume;return ha.subVectors(t.center,e.position),e.direction.dot(ha)}insideViewerRequestVolume(e){const t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){const e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=Yr,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(e){this.transform=e.transform?new yn(e.transform):new yn;const t=this.parent,n=this.tileset,r=t&&t.computedTransform?t.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new yn(r).multiplyRight(this.transform);const a=t&&t._initialTransform?t._initialTransform.clone():new yn;this._initialTransform=new yn(a).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Hr,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Ir.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||Xr}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}_updateBoundingVolume(e){this.boundingVolume=sa(e.boundingVolume,this.computedTransform,this.boundingVolume);const t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=sa(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=sa(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(e=new yn){const t=e.clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case"i3s":return{...this.tileset.options.i3s,tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}class ga extends pa{compareDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,t){if(super.updateTileVisibility(e,t),!e.isVisibleAndInRequestVolume)return;const n=e.children.length>0;if(e.hasTilesetContent&&n){const n=e.children[0];return this.updateTileVisibility(n,t),void(e._visible=n._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))return void(e._visible=!1);const r=e.refine===Xr,a=e._optimChildrenWithinParent===na;r&&a&&n&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}meetsScreenSpaceErrorEarly(e,t){const{parent:n}=e;return!(!n||n.hasTilesetContent||n.refine!==qr)&&!this.shouldRefine(e,t,!0)}}const ya="REQUESTED",va="COMPLETED",Aa="ERROR";class ba{constructor(){tn(this,"_statusMap",void 0),this._statusMap={}}add(e,t,n,r){this._statusMap[t]||(this._statusMap[t]={request:e,callback:n,key:t,frameState:r,status:ya},e().then(e=>{this._statusMap[t].status=va,this._statusMap[t].callback(e,r)}).catch(e=>{this._statusMap[t].status=Aa,n(e)}))}update(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}find(e){return this._statusMap[e]}}class _a extends pa{constructor(e){super(e),tn(this,"_tileManager",void 0),this._tileManager=new ba}shouldRefine(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";const n=2*ca(e,t);return n<2?"OUT":!e.header.children||n<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}updateChildTiles(e,t){const n=e.header.children||[],r=e.children,a=e.tileset;for(const o of n){const n="".concat(o.id,"-").concat(t.viewport.id),i=r&&r.find(e=>e.id===n);if(i)i&&this.updateTile(i,t);else{let r=()=>this._loadTile(o.id,a);this._tileManager.find(n)?this._tileManager.update(n,t):(a.tileset.nodePages&&(r=()=>a.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(r,n,t=>this._onTileLoad(t,e,n),t))}}return!1}async _loadTile(e,t){const{loader:n}=t,r=t.getTileUrl("".concat(t.url,"/nodes/").concat(e)),a={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return await Object(en.a)(r,n,a)}_onTileLoad(e,t,n){const r=new ma(t.tileset,e,t,n);t.children.push(r);const a=this._tileManager.find(r.id).frameState;this.updateTile(r,a),this._frameNumber===a.frameNumber&&this.executeTraversal(r,a)}}const Ea={description:"",ellipsoid:qn.WGS84,modelMatrix:new yn,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}};class xa{constructor(e,t){tn(this,"options",void 0),tn(this,"loadOptions",void 0),tn(this,"type",void 0),tn(this,"tileset",void 0),tn(this,"loader",void 0),tn(this,"url",void 0),tn(this,"basePath",void 0),tn(this,"modelMatrix",void 0),tn(this,"ellipsoid",void 0),tn(this,"lodMetricType",void 0),tn(this,"lodMetricValue",void 0),tn(this,"refine",void 0),tn(this,"root",void 0),tn(this,"roots",void 0),tn(this,"asset",void 0),tn(this,"description",void 0),tn(this,"properties",void 0),tn(this,"extras",void 0),tn(this,"attributions",void 0),tn(this,"credits",void 0),tn(this,"stats",void 0),tn(this,"traverseCounter",void 0),tn(this,"geometricError",void 0),tn(this,"selectedTiles",void 0),tn(this,"cartographicCenter",void 0),tn(this,"cartesianCenter",void 0),tn(this,"zoom",void 0),tn(this,"boundingVolume",void 0),tn(this,"gpuMemoryUsageInBytes",void 0),tn(this,"dynamicScreenSpaceErrorComputedDensity",void 0),tn(this,"_traverser",void 0),tn(this,"_cache",void 0),tn(this,"_requestScheduler",void 0),tn(this,"_frameNumber",void 0),tn(this,"_queryParamsString",void 0),tn(this,"_queryParams",void 0),tn(this,"_extensionsUsed",void 0),tn(this,"_tiles",void 0),tn(this,"_pendingCount",void 0),tn(this,"lastUpdatedVieports",void 0),tn(this,"_requestedTiles",void 0),tn(this,"_emptyTiles",void 0),tn(this,"frameStateData",void 0),tn(this,"maximumMemoryUsage",void 0),Object(Kn.a)(e),this.options={...Ea,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||Zn.b.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new er,this._requestScheduler=new ct.a({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new Xn.a({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function(e){const t=[];for(const n of Object.keys(e))t.push("".concat(n,"=").concat(e[n]));switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(e){this.options={...this.options,...e}}setOptions(e){this.options={...this.options,...e}}getTileUrl(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}hasExtension(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}update(e){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const t=[];for(const n of e){const e=n.id;this._needTraverse(e)?t.push(e):this.traverseCounter--}for(const n of e){const e=n.id;if(this.roots[e]||(this.roots[e]=this._initializeTileHeaders(this.tileset,null)),!t.includes(e))continue;const r=Nr(n,this._frameNumber);this._traverser.traverse(this.roots[e],r,this.options)}}_needTraverse(e){let t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}_onTraversalEnd(e){const t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const n=this.frameStateData[t],r=Object.values(this._traverser.selectedTiles);n.selectedTiles=r,n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const e in this.frameStateData){const t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(e,t){if(e.length!==t.length)return!0;const n=new Set(e.map(e=>e.id)),r=new Set(t.map(e=>e.id));let a=e.filter(e=>!r.has(e.id)).length>0;return a=a||t.filter(e=>!n.has(e.id)).length>0,a}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount&&(t+=n.content.pointCount));this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=e,this.stats.get("Points").count=t}_initializeTileSet(e){this.root=this._initializeTileHeaders(e,null),this.type===ea&&this._initializeCesiumTileset(e),this.type===$r&&this._initializeI3STileset(),this._calculateViewProps()}_calculateViewProps(){const e=this.root;Object(Kn.a)(e);const{center:t}=e.boundingVolume;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new _n,void(this.zoom=1);this.cartographicCenter=qn.WGS84.cartesianToCartographic(t,new _n),this.cartesianCenter=t,this.zoom=Ur(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get("Tiles In Tileset(s)"),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points","memory"),this.stats.get("Tile Memory Use","memory")}_initializeTileHeaders(e,t){const n=new ma(this,e.root,t);if(t&&(t.children.push(n),n.depth=t.depth+1),this.type===ea){const e=[];for(e.push(n);e.length>0;){const t=e.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();const n=t.header.children||[];for(const r of n){const n=new ma(this,r,t);t.children.push(n),n.depth=t.depth+1,e.push(n)}}}return n}_initializeTraverser(){let e;switch(this.type){case ea:e=ga;break;case $r:e=_a;break;default:e=pa}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let t;try{this._onStartTileLoading(),t=await e.loadContent()}catch(t){this._onTileLoadError(e,t)}finally{this._onEndTileLoading(),this._onTileLoad(e,t)}}_onTileLoadError(e,t){this.stats.get("Failed Tile Loads").incrementCount();const n=t.message||t.toString(),r=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(n)),this.options.onTileError(e,n,r)}_onTileLoad(e,t){t&&(e&&e.content&&function(e,t){Object(Kn.a)(e),Object(Kn.a)(t);const{rtcCenter:n,gltfUpAxis:r}=t,{computedTransform:a,boundingVolume:{center:o}}=e;let i=new yn(a);switch(n&&i.translate(n),r){case"Z":break;case"Y":const e=(new yn).rotateX(Math.PI/2);i=i.multiplyRight(e);break;case"X":const t=(new yn).rotateY(-Math.PI/2);i=i.multiplyRight(t)}t.isQuantized&&i.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);const s=new _n(o);t.cartesianModelMatrix=i,t.cartesianOrigin=s;const l=qn.WGS84.cartesianToCartographic(s,new _n),u=qn.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=u.multiplyRight(i),t.cartographicOrigin=l,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e))}_onStartTileLoading(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}_addTileToCache(e){this._cache.add(this,e,t=>t._updateCacheStats(e))}_updateCacheStats(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);e.length>0;){const t=e.pop();for(const n of t.children)e.push(n);this._destroyTile(t)}this.root=null}_destroySubtree(e){const t=e,n=[];for(n.push(t);n.length>0;){e=n.pop();for(const t of e.children)n.push(t);e!==t&&this._destroyTile(e)}t.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeCesiumTileset(e){if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const Ma={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(Ma);function wa(e,t,n){Object(Kn.a)(e instanceof ArrayBuffer);const r=new TextDecoder("utf8"),a=new Uint8Array(e,t,n);return r.decode(a)}var Oa=n(460);const Sa={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ta={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...Sa};var Ca=n(4);const La={[Sa.DOUBLE]:Float64Array,[Sa.FLOAT]:Float32Array,[Sa.UNSIGNED_SHORT]:Uint16Array,[Sa.UNSIGNED_INT]:Uint32Array,[Sa.UNSIGNED_BYTE]:Uint8Array,[Sa.BYTE]:Int8Array,[Sa.SHORT]:Int16Array,[Sa.INT]:Int32Array},Pa={DOUBLE:Sa.DOUBLE,FLOAT:Sa.FLOAT,UNSIGNED_SHORT:Sa.UNSIGNED_SHORT,UNSIGNED_INT:Sa.UNSIGNED_INT,UNSIGNED_BYTE:Sa.UNSIGNED_BYTE,BYTE:Sa.BYTE,SHORT:Sa.SHORT,INT:Sa.INT};class Ra{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in La){if(La[t]===e)return t}throw new Error("Failed to convert GL type")}static fromName(e){const t=Pa[e];if(!t)throw new Error("Failed to convert GL type");return t}static getArrayType(e){switch(e){case Sa.UNSIGNED_SHORT_5_6_5:case Sa.UNSIGNED_SHORT_4_4_4_4:case Sa.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=La[e];if(!t)throw new Error("Failed to convert GL type");return t}}static getByteSize(e){return Ra.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(Ra.getArrayType(e))}static createTypedArray(e,t,n=0,r){void 0===r&&(r=(t.byteLength-n)/Ra.getByteSize(e));return new(Ra.getArrayType(e))(t,n,r)}}class Da{constructor(e,t){Object(Ca.a)(this,"json",void 0),Object(Ca.a)(this,"buffer",void 0),Object(Ca.a)(this,"featuresLength",0),Object(Ca.a)(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,t=Ta.UNSIGNED_INT,n=1){const r=this.json[e];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(e,t,n,1,r.byteOffset):r}getPropertyArray(e,t,n){const r=this.json[e];return r&&Number.isFinite(r.byteOffset)?("componentType"in r&&(t=Ra.fromName(r.componentType)),this._getTypedArrayFromBinary(e,t,n,this.featuresLength,r.byteOffset)):this._getTypedArrayFromArray(e,t,r)}getProperty(e,t,n,r,a){const o=this.json[e];if(!o)return o;const i=this.getPropertyArray(e,t,n);if(1===n)return i[r];for(let e=0;e<n;++e)a[e]=i[n*r+e];return a}_getTypedArrayFromBinary(e,t,n,r,a){const o=this._cachedTypedArrays;let i=o[e];return i||(i=Ra.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+a,r*n),o[e]=i),i}_getTypedArrayFromArray(e,t,n){const r=this._cachedTypedArrays;let a=r[e];return a||(a=Ra.createTypedArray(t,n),r[e]=a),a}}const ka={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ia={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Fa={SCALAR:(e,t,n)=>{t[n]=e},VEC2:(e,t,n)=>{t[2*n+0]=e[0],t[2*n+1]=e[1]},VEC3:(e,t,n)=>{t[3*n+0]=e[0],t[3*n+1]=e[1],t[3*n+2]=e[2]},VEC4:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT2:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT3:(e,t,n)=>{t[9*n+0]=e[0],t[9*n+1]=e[1],t[9*n+2]=e[2],t[9*n+3]=e[3],t[9*n+4]=e[4],t[9*n+5]=e[5],t[9*n+6]=e[6],t[9*n+7]=e[7],t[9*n+8]=e[8],t[9*n+9]=e[9]},MAT4:(e,t,n)=>{t[16*n+0]=e[0],t[16*n+1]=e[1],t[16*n+2]=e[2],t[16*n+3]=e[3],t[16*n+4]=e[4],t[16*n+5]=e[5],t[16*n+6]=e[6],t[16*n+7]=e[7],t[16*n+8]=e[8],t[16*n+9]=e[9],t[16*n+10]=e[10],t[16*n+11]=e[11],t[16*n+12]=e[12],t[16*n+13]=e[13],t[16*n+14]=e[14],t[16*n+15]=e[15]}};const ja=e=>void 0!==e;function Ba(e,t,n){if(!t)return null;let r=e.getExtension("3DTILES_batch_table_hierarchy");const a=t.HIERARCHY;return a&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=a,r=a),r?function(e,t){let n,r,a;const o=e.instancesLength,i=e.classes;let s,l=e.classIds,u=e.parentCounts,c=e.parentIds,d=o;ja(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,a=getBinaryAccessor(l),l=a.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,o));if(ja(u))for(ja(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,a=getBinaryAccessor(u),u=a.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,o)),s=new Uint16Array(o),d=0,n=0;n<o;++n)s[n]=d,d+=u[n];ja(c)&&ja(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,a=getBinaryAccessor(c),c=a.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,d));const f=i.length;for(n=0;n<f;++n){const e=i[n].length,r=i[n].instances,a=getBinaryProperties(e,r,t);i[n].instances=combine(a,r)}const p=new Array(f).fill(0),h=new Uint16Array(o);for(n=0;n<o;++n)r=l[n],h[n]=p[r],++p[r];const m={classes:i,classIds:l,classIndexes:h,parentCounts:u,parentIndexes:s,parentIds:c};return function(e){const t=e.classIds.length;for(let n=0;n<t;++n)za(e,n,stack)}(m),m}(r,n):null}function Na(e,t,n){if(!e)return;const r=e.parentCounts;return e.parentIds?n(e,t):r>0?function(e,t,n){const r=e.classIds,a=e.parentCounts,o=e.parentIds,i=e.parentIndexes,s=r.length,l=scratchVisited;l.length=Math.max(l.length,s);const u=++marker,c=scratchStack;c.length=0,c.push(t);for(;c.length>0;){if(t=c.pop(),l[t]===u)continue;l[t]=u;const r=n(e,t);if(ja(r))return r;const s=a[t],d=i[t];for(let e=0;e<s;++e){const n=o[d+e];n!==t&&c.push(n)}}return null}(e,t,n):function(e,t,n){let r=!0;for(;r;){const a=n(e,t);if(ja(a))return a;const o=e.parentIds[t];r=o!==t,t=o}throw new Error("traverseHierarchySingleParent")}(e,t,n)}function za(e,t,n){const r=e.parentCounts,a=e.parentIds,o=e.parentIndexes,i=e.classIds.length;if(!ja(a))return;assert(t<i,"Parent index ".concat(t," exceeds the total number of instances: ").concat(i)),assert(-1===n.indexOf(t),"Circular dependency detected in the batch table hierarchy."),n.push(t);const s=ja(r)?r[t]:1,l=ja(r)?o[t]:t;for(let r=0;r<s;++r){const o=a[l+r];o!==t&&za(e,o,n)}n.pop(t)}function Ua(e){return null!=e}const Ha=(e,t)=>e,Va={HIERARCHY:!0,extensions:!0,extras:!0};class Ga{constructor(e,t,n,r={}){var a;Object(Ca.a)(this,"json",void 0),Object(Ca.a)(this,"binary",void 0),Object(Ca.a)(this,"featureCount",void 0),Object(Ca.a)(this,"_extensions",void 0),Object(Ca.a)(this,"_properties",void 0),Object(Ca.a)(this,"_binaryProperties",void 0),Object(Ca.a)(this,"_hierarchy",void 0),Object(Kn.a)(n>=0),this.json=e||{},this.binary=t,this.featureCount=n,this._extensions=(null===(a=this.json)||void 0===a?void 0:a.extensions)||{},this._properties={};for(const e in this.json)Va[e]||(this._properties[e]=this.json[e]);this._binaryProperties=this._initializeBinaryProperties(),r["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Ba(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),this._hierarchy){return Ua(Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n];return e.classes[r].name===t}))}return!1}isExactClass(e,t){return Object(Kn.a)("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),Ua(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=Ua(t)?t:[]).length=0;const n=Object.keys(this._properties);return t.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),this._binaryProperties){const n=this._binaryProperties[t];if(Ua(n))return this._getBinaryProperty(n,e)}const n=this._properties[t];if(Ua(n))return Ha(n[e]);if(this._hierarchy){const n=this._getHierarchyProperty(e,t);if(Ua(n))return n}}setProperty(e,t,n){const r=this.featureCount;if(this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),this._binaryProperties){const r=this._binaryProperties[t];if(r)return void this._setBinaryProperty(r,e,n)}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,n))return;let a=this._properties[t];Ua(a)||(this._properties[t]=new Array(r),a=this._properties[t]),a[e]=Ha(n)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,n){e.pack(n,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const n=this._properties[t],r=this._initializeBinaryProperty(t,n);r&&(e=e||{},e[t]=r)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const n=t;Object(Kn.a)(this.binary,"Property ".concat(e," requires a batch table binary.")),Object(Kn.a)(n.type,"Property ".concat(e," requires a type."));const r=function(e,t,n,r){const{componentType:a}=e;Object(Kn.a)(e.componentType);const o="string"==typeof a?Ra.fromName(a):a,i=ka[e.type],s=Ia[e.type],l=Fa[e.type];return n+=e.byteOffset,{values:Ra.createTypedArray(o,t,n,i*r),type:o,size:i,unpacker:s,packer:l}}(n,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:r.values,componentCount:r.size,unpack:r.unpacker,pack:r.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const n=Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n];return Ua(e.classes[r].instances[t])});return Ua(n)}_getPropertyNamesInHierarchy(e,t){Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n],a=e.classes[r].instances;for(const e in a)a.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)})}_getHierarchyProperty(e,t){return Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n],a=e.classes[r],o=e.classIndexes[n],i=a.instances[t];return Ua(i)?Ua(i.typedArray)?this._getBinaryProperty(i,o):Ha(i[o]):null})}_setHierarchyProperty(e,t,n,r){const a=Na(this._hierarchy,t,(e,a)=>{const o=e.classIds[a],i=e.classes[o],s=e.classIndexes[a],l=i.instances[n];return!!Ua(l)&&(Object(Kn.a)(a===t,'Inherited property "'.concat(n,'" is read-only.')),Ua(l.typedArray)?this._setBinaryProperty(l,s,r):l[s]=Ha(r),!0)});return Ua(a)}}function Ya(e,t,n=0){const r=new DataView(t);if(e.magic=r.getUint32(n,!0),n+=4,e.version=r.getUint32(n,!0),n+=4,e.byteLength=r.getUint32(n,!0),n+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return n}function Wa(e,t,n){const r=new DataView(t);let a;e.header=e.header||{};let o=r.getUint32(n,!0);n+=4;let i=r.getUint32(n,!0);n+=4;let s=r.getUint32(n,!0);n+=4;let l=r.getUint32(n,!0);return n+=4,s>=570425344?(n-=8,a=o,s=i,l=0,o=0,i=0,console.warn("b3dm tile in legacy format.")):l>=570425344&&(n-=4,a=s,s=o,l=i,o=0,i=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=l,e.header.batchLength=a,n}function qa(e,t,n,r){return n=function(e,t,n,r){const{featureTableJsonByteLength:a,featureTableBinaryByteLength:o,batchLength:i}=e.header;if(e.featureTableJson={BATCH_LENGTH:i||0},a>0){const r=wa(t,n,a);e.featureTableJson=JSON.parse(r)}return n+=a,e.featureTableBinary=new Uint8Array(t,n,o),n+=o}(e,t,n),n=function(e,t,n,r){const{batchTableJsonByteLength:a,batchTableBinaryByteLength:o}=e.header;if(a>0){const r=wa(t,n,a);e.batchTableJson=JSON.parse(r),n+=a,o>0&&(e.batchTableBinary=new Uint8Array(t,n,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),n+=o)}return n}(e,t,n)}function Xa(e,t=[0,0,0]){const n=e>>11&31,r=e>>5&63,a=31&e;return t[0]=n<<3,t[1]=r<<2,t[2]=a<<3,t}function Ka(e,t,n){if(!(t||e&&e.batchIds&&n))return null;const{batchIds:r,isRGB565:a,pointCount:o}=e;if(r&&n){const e=new Uint8ClampedArray(3*o);for(let t=0;t<o;t++){const a=r[t],o=n.getProperty(a,"dimensions").map(e=>255*e);e[3*t]=o[0],e[3*t+1]=o[1],e[3*t+2]=o[2]}return{type:Ta.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}if(a){const e=new Uint8ClampedArray(3*o);for(let n=0;n<o;n++){const r=Xa(t[n]);e[3*n]=r[0],e[3*n+1]=r[1],e[3*n+2]=r[2]}return{type:Ta.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}return t&&t.length===3*o?{type:Ta.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ta.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}class Za extends vn{constructor(e=0,t=0){super(2),Object(nn.f)(e)&&1===arguments.length?this.copy(e):(nn.b.debug&&(rn(e),rn(t)),this[0]=e,this[1]=t)}set(e,t){return this[0]=e,this[1]=t,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return nn.b.debug&&(rn(e.x),rn(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Z.j(this,this,e),this.check()}transformAsVector(e){return dn(this,this,e),this.check()}transformByMatrix3(e){return Z.i(this,this,e),this.check()}transformByMatrix2x3(e){return Z.h(this,this,e),this.check()}transformByMatrix2(e){return Z.g(this,this,e),this.check()}}function Ja(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new Za,new _n,new Za,new Za,new Uint8Array(1);function Qa(e,t=255){return Object(nn.a)(e,0,t)/t*2-1}function $a(e){return e<0?-1:1}function eo(e,t,n,r){if(Ja(r),e<0||e>n||t<0||t>n)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(n));if(r.x=Qa(e,n),r.y=Qa(t,n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){const e=r.x;r.x=(1-Math.abs(r.y))*$a(e),r.y=(1-Math.abs(e))*$a(r.y)}return r.normalize()}function to(e,t,n){return eo(e,t,255,n)}const no=new _n;function ro(e,t,n){return e.isQuantized?n["3d-tiles"]&&n["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){const n=new _n,r=new Float32Array(3*e.pointCount);for(let a=0;a<e.pointCount;a++)n.set(t[3*a],t[3*a+1],t[3*a+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(r,3*a);return r}(e,t)):{type:Ta.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}async function ao(e,t,n,r,a){n=qa(e,t,n=Wa(e,t,n=Ya(e,t,n))),function(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}(e);const{featureTable:o,batchTable:i}=function(e){const t=new Da(e.featureTableJson,e.featureTableBinary),n=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(n))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=n,e.featuresLength=n,e.pointsLength=n,e.pointCount=n,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ta.FLOAT,3);const r=function(e,t){let n=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ta.UNSIGNED_SHORT,1),e.batchIds)){const r=t.getGlobalProperty("BATCH_LENGTH");if(!r)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:a,batchTableBinary:o}=e;n=new Ga(a,o,r)}return n}(e,t);return{featureTable:t,batchTable:r}}(e);return await async function(e,t,n,r,a){let o,i,s;const l=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];l&&(s=l.properties);const u=t.getExtension("3DTILES_draco_point_compression");if(u){i=u.properties;const t=u.byteOffset,n=u.byteLength;if(!i||!Number.isFinite(t)||!n)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=e.featureTableBinary.slice(t,t+n),e.hasPositions=Number.isFinite(i.POSITION),e.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),e.hasNormals=Number.isFinite(i.NORMAL),e.hasBatchIds=Number.isFinite(i.BATCH_ID),e.isTranslucent=Number.isFinite(i.RGBA)}if(!o)return!0;const c={buffer:o,properties:{...i,...s},featureTableProperties:i,batchTableProperties:s,dequantizeInShader:!1};return await async function(e,t,n,r){const{parse:a}=r,o={...n,draco:{...n.draco,extraAttributes:t.batchTableProperties||{}}};delete o["3d-tiles"];const i=await a(t.buffer,Oa.a,o),s=i.attributes.POSITION&&i.attributes.POSITION.value,l=i.attributes.COLOR_0&&i.attributes.COLOR_0.value,u=i.attributes.NORMAL&&i.attributes.NORMAL.value,c=i.attributes.BATCH_ID&&i.attributes.BATCH_ID.value,d=s&&i.attributes.POSITION.value.quantization,f=u&&i.attributes.NORMAL.value.quantization;if(d){const t=i.POSITION.data.quantization,n=t.range;e.quantizedVolumeScale=new _n(n,n,n),e.quantizedVolumeOffset=new _n(t.minValues),e.quantizedRange=(1<<t.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<i.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);const p={};if(t.batchTableProperties)for(const e of Object.keys(t.batchTableProperties))i.attributes[e]&&i.attributes[e].value&&(p[e.toLowerCase()]=i.attributes[e].value);e.attributes={positions:s,colors:Ka(e,l,void 0),normals:u,batchIds:c,...p}}(e,c,r,a)}(e,o,0,r,a),function(e,t,n){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ta.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){const r=t.getPropertyArray("POSITION_QUANTIZED",Ta.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ta.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ta.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=ro(e,r,n)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(e,o,r),function(e,t,n){if(!e.attributes.colors){let r=null;t.hasProperty("RGBA")?(r=t.getPropertyArray("RGBA",Ta.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?r=t.getPropertyArray("RGB",Ta.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(r=t.getPropertyArray("RGB565",Ta.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Ka(e,r,n)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ta.UNSIGNED_BYTE,4))}(e,o,i),function(e,t){if(!e.attributes.normals){let n=null;t.hasProperty("NORMAL")?n=t.getPropertyArray("NORMAL",Ta.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(n=t.getPropertyArray("NORMAL_OCT16P",Ta.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){const n=new Float32Array(3*e.pointsLength);for(let r=0;r<e.pointsLength;r++)to(t[2*r],t[2*r+1],no),no.toArray(n,3*r);return{type:Ta.FLOAT,size:2,value:n}}return{type:Ta.FLOAT,size:2,value:t}}(e,n)}}(e,o),n}var oo=n(1159),io=n(182);const so=0,lo=1;function uo(e,t,n,r){e.rotateYtoZ=!0;const a=e.byteOffset+e.byteLength-n;if(0===a)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Object(io.c)(t,n,a),e.gltfByteOffset=0,e.gltfByteLength=a,n%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}async function co(e,t,n,r){const a=n["3d-tiles"]||{};if(function(e,t,n){switch(t){case so:const t=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),n=(new TextDecoder).decode(t);e.gltfUrl=n.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case lo:break;default:throw new Error("b3dm: Illegal glTF format field")}}(e,t),a.loadGLTF){const{parse:t,fetch:a}=r;e.gltfUrl&&(e.gltfArrayBuffer=await a(e.gltfUrl,n),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await t(e.gltfArrayBuffer,oo.a,n,r),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}async function fo(e,t,n,r,a){var o;n=function(e,t,n,r,a){n=Ya(e,t,n),n=Wa(e,t,n),n=qa(e,t,n),n=uo(e,t,n,r);const o=new Da(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ta.FLOAT,3),n}(e,t,n,r),await co(e,lo,r,a);const i=null==e||null===(o=e.gltf)||void 0===o?void 0:o.extensions;return i&&i.CESIUM_RTC&&(e.rtcCenter=i.CESIUM_RTC.center),n}async function po(e,t,n,r,a){return n=function(e,t,n,r,a){if(n=Ya(e,t,n),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));n=Wa(e,t,n);const o=new DataView(t);if(e.gltfFormat=o.getUint32(n,!0),n=qa(e,t,n+=4),n=uo(e,t,n,r),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const i=new Da(e.featureTableJson,e.featureTableBinary),s=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=i.getGlobalProperty("RTC_CENTER",Ta.FLOAT,3);new Ga(e.batchTableJson,e.batchTableBinary,s);return function(e,t,n,r){const a=[new Array(r),e._batchTable][0],o=new _n,i=new _n,s=new _n,l=new _n,u=new ur,c=new dr,d=new _n,f={},p=new yn,h=[],m=[],g=new _n,y=new _n;for(let n=0;n<r;n++){let r;if(t.hasProperty("POSITION"))r=t.getProperty("POSITION",Ta.FLOAT,3,n,o);else if(t.hasProperty("POSITION_QUANTIZED")){r=t.getProperty("POSITION_QUANTIZED",Ta.UNSIGNED_SHORT,3,n,o);const e=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ta.FLOAT,3,g);if(!e)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const a=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ta.FLOAT,3,y);if(!a)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const i=65535;for(let t=0;t<3;t++)r[t]=r[t]/i*a[t]+e[t]}if(!r)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(r),f.translation=o,e.normalUp=t.getProperty("NORMAL_UP",Ta.FLOAT,3,n,h),e.normalRight=t.getProperty("NORMAL_RIGHT",Ta.FLOAT,3,n,m);const v=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ta.UNSIGNED_SHORT,2,h),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ta.UNSIGNED_SHORT,2,m),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(qn.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(u)):u.identity()}v&&(l.copy(i).cross(s).normalize(),u.setColumn(0,i),u.setColumn(1,s),u.setColumn(2,l)),c.fromMatrix3(u),f.rotation=c,d.set(1,1,1);const A=t.getProperty("SCALE",Ta.FLOAT,1,n);Number.isFinite(A)&&d.multiplyByScalar(A);const b=t.getProperty("SCALE_NON_UNIFORM",Ta.FLOAT,3,n,h);b&&d.scale(b),f.scale=d;let _=t.getProperty("BATCH_ID",Ta.UNSIGNED_SHORT,1,n);void 0===_&&(_=n);const E=(new yn).fromQuaternion(f.rotation);p.identity(),p.translate(f.translation),p.multiplyRight(E),p.scale(f.scale);const x=p.clone();a[n]={modelMatrix:x,batchId:_}}e.instances=a}(e,i,0,s),n}(e,t,n,r),await co(e,e.gltfFormat,r,a),n}async function ho(e,t=0,n,r,a={}){switch(a.byteOffset=t,a.type=function(e,t=0){const n=new DataView(e);return"".concat(String.fromCharCode(n.getUint8(t+0))).concat(String.fromCharCode(n.getUint8(t+1))).concat(String.fromCharCode(n.getUint8(t+2))).concat(String.fromCharCode(n.getUint8(t+3)))}(e,t),a.type){case Ma.COMPOSITE:return await async function(e,t,n,r,a,o){n=Ya(e,t,n);const i=new DataView(t);for(e.tilesLength=i.getUint32(n,!0),n+=4,e.tiles=[];e.tiles.length<e.tilesLength&&e.byteLength-n>12;){const i={};e.tiles.push(i),n=await o(t,n,r,a,i)}return n}(a,e,t,n,r,ho);case Ma.BATCHED_3D_MODEL:return await fo(a,e,t,n,r);case Ma.GLTF:return await async function(e,t,n,r){e.rotateYtoZ=!0,e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y";const{parse:a}=r;e.gltf=await a(t,oo.a,n,r)}(a,e,n,r);case Ma.INSTANCED_3D_MODEL:return await po(a,e,t,n,r);case Ma.POINT_CLOUD:return await ao(a,e,t,n,r);default:throw new Error("3DTileLoader: unknown type ".concat(a.type))}}var mo=n(240);async function go(e,t,n){const r=e[t].bufferView,a=e.bufferViews[r],o=e.buffers[a.buffer];if(o.uri){const e=await Object(mo.a)(o.uri),t=await e.arrayBuffer();return new Uint8Array(t,a.byteOffset,a.byteLength)}return new Uint8Array(n,a.byteOffset,a.byteLength)}function yo(e){const t=new DataView(e);return t.getUint32(0,!0)+2**32*t.getUint32(4,!0)}const vo={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.1.6",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(e){if(1952609651!==new Uint32Array(e.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(e.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const t=yo(e.slice(8,16)),n=new Uint8Array(e,24,t),r=new TextDecoder("utf8").decode(n),a=JSON.parse(r),o=yo(e.slice(16,24));let i=new ArrayBuffer(0);return o&&(i=e.slice(24+t)),"bufferView"in a.tileAvailability&&(a.tileAvailability.explicitBitstream=await go(a,"tileAvailability",i)),"bufferView"in a.contentAvailability&&(a.contentAvailability.explicitBitstream=await go(a,"contentAvailability",i)),"bufferView"in a.childSubtreeAvailability&&(a.childSubtreeAvailability.explicitBitstream=await go(a,"childSubtreeAvailability",i)),a},options:{}},Ao={QUADTREE:4,OCTREE:8};function bo(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&function(e,t){const n=Math.floor(e/8),r=e%8;return 1==(t[n]>>r&1)}(t,e.explicitBitstream)}function _o(e,t,n,r){const{basePath:a,refine:o,getRefine:i,lodMetricType:s,getTileType:l,rootLodMetricValue:u,rootBoundingVolume:c}=r,d=e.contentUrl&&e.contentUrl.replace("".concat(a,"/"),""),f=u/2**t,p=function(e,t,n){if(t.region){const{childTileX:r,childTileY:a,childTileZ:o}=n,[i,s,l,u,c,d]=t.region,f=2**e,p=(l-i)/f,h=(u-s)/f,m=(d-c)/f,[g,y]=[i+p*r,i+p*(r+1)],[v,A]=[s+h*a,s+h*(a+1)],[b,_]=[c+m*o,c+m*(o+1)];return{region:[g,v,y,A,b,_]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,c,n);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:i(o),type:l(e),lodMetricType:s,lodMetricValue:f,boundingVolume:p}}function Eo(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function xo(e,t,n,r,a){const o=function(e){const t={};for(const n in e)t["{".concat(n,"}")]=e[n];return t}({level:t,x:n,y:r,z:a});return e.replace(/{level}|{x}|{y}|{z}/gi,e=>o[e])}function Mo(e){if(!e.contentUrl)return Kr;const t=e.contentUrl.split(".").pop();switch(t){case"pnts":return Jr;case"i3dm":case"b3dm":case"glb":case"gltf":return Zr;default:return t}}function wo(e){switch(e){case"REPLACE":case"replace":return Xr;case"ADD":case"add":return qr;default:return e}}function Oo(e,t){if(!e)return null;if(e.content){const n=e.content.uri||e.content.url;e.contentUrl="".concat(t.basePath,"/").concat(n)}return e.id=e.contentUrl,e.lodMetricType=ta,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Mo(e),e.refine=wo(e.refine),e}async function So(e){if(!e.root)return null;const t=e.basePath,n=e.root.extensions["3DTILES_implicit_tiling"],{subdivisionScheme:r,maximumLevel:a,subtreeLevels:o,subtrees:{uri:i}}=n,s=xo(i,0,0,0,0),l="".concat(t,"/").concat(s),u=await Object(en.a)(l,vo),c="".concat(t,"/").concat(e.root.content.uri),d=e.root.refine,f=e.root.geometricError,p=e.root.boundingVolume,h={contentUrlTemplate:c,subtreesUriTemplate:i,subdivisionScheme:r,subtreeLevels:o,maximumLevel:a,refine:d,basePath:t,lodMetricType:ta,rootLodMetricValue:f,rootBoundingVolume:p,getTileType:Mo,getRefine:wo};return await async function(e,t,n){if(!e)return null;e.lodMetricType=ta,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;const{children:r,contentUrl:a}=await async function e(t,n,r={mortonIndex:0,x:0,y:0,z:0},a=0,o=0,i={level:0,mortonIndex:0,x:0,y:0,z:0}){const{subdivisionScheme:s,subtreeLevels:l,maximumLevel:u,contentUrlTemplate:c,subtreesUriTemplate:d,basePath:f}=n,p={children:[],lodMetricValue:0,contentUrl:""},h=Ao[s],m=1&a,g=a>>1&1,y=a>>2&1,v=(h**o-1)/(h-1);let A=Eo(r.mortonIndex,a),b=v+A,_=Eo(r.x,m),E=Eo(r.y,g),x=Eo(r.z,y),M=!1;o+1>l&&(M=bo(t.childSubtreeAvailability,A));const w=Eo(i.x,_),O=Eo(i.y,E),S=Eo(i.z,x),T=o+i.level;if(M){const e=xo("".concat(f,"/").concat(d),T,w,O,S);t=await Object(en.a)(e,vo),i.mortonIndex=A,i.x=_,i.y=E,i.z=x,i.level=o,A=0,b=0,_=0,E=0,x=0,o=0}if(!bo(t.tileAvailability,b)||o>u)return p;bo(t.contentAvailability,b)&&(p.contentUrl=xo(c,T,w,O,S));const C=o+1,L={mortonIndex:A,x:_,y:E,z:x};for(let r=0;r<h;r++){const a=await e(t,n,L,r,C,i);if(a.contentUrl||a.children.length){const e=_o(a,T+1,{childTileX:_,childTileY:E,childTileZ:x},n);p.children.push(e)}}return p}(t,n);a&&(e.contentUrl=a,e.content={uri:a.replace("".concat(n.basePath,"/"),"")});return e.refine=wo(e.refine),e.type=Mo(e),e.children=r,e.id=e.contentUrl,e}(e.root,u,h)}const To={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.1.6",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(e,t,n){const r=t["3d-tiles"]||{};let a;a="auto"===r.isTileset?n.url&&-1!==n.url.indexOf(".json"):r.isTileset;e=a?await async function(e,t,n){var r;const a=JSON.parse((new TextDecoder).decode(e));return a.loader=t.loader||To,a.url=n.url,a.basePath=function(e){return Zn.b.dirname(e.url)}(a),a.root=function(e){var t,n;return(null==e||null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e||null===(n=e.extensionsUsed)||void 0===n?void 0:n.includes("3DTILES_implicit_tiling"))}(a)?await So(a):function(e){const t=e.basePath,n=Oo(e.root,e),r=[];for(r.push(n);r.length>0;){const e=(r.pop()||{}).children||[];for(const n of e)Oo(n,{basePath:t}),r.push(n)}return n}(a),a.type=ea,a.lodMetricType=ta,a.lodMetricValue=(null===(r=a.root)||void 0===r?void 0:r.lodMetricValue)||0,a}(e,t,n):await async function(e,t,n){const r={content:{featureIds:null}};return await ho(e,0,t,n,r.content),r.content}(e,t,n);return e},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};const Co=[0],Lo={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:To,onTilesetLoad:{type:"function",value:e=>{},compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:(e,t,n)=>{},compare:!1},_getMeshColor:{type:"function",value:e=>[255,255,255],compare:!1}};class Po extends o.a{initializeState(){"onTileLoadFail"in this.props&&E.a.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){const{tileset3d:e}=this.state;return e&&e.isLoaded()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(e.data&&e.data!==t.data&&this._loadTileset(e.data),n.viewportChanged){const{activeViewports:e}=this.state;Object.keys(e).length&&(this._updateTileset(e),this.state.lastUpdatedViewports=e,this.state.activeViewports={})}if(n.propsChanged){const{layerMap:e}=this.state;for(const t in e)e[t].needsUpdate=!0}}activateViewport(e){const{activeViewports:t,lastUpdatedViewports:n}=this.state;this.internalState.viewport=e,t[e.id]=e;const r=null==n?void 0:n[e.id];r&&e.equals(r)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:e,sourceLayer:t}){const{layerMap:n}=this.state,r=t&&t.id;if(r){const t=r.substring(this.id.length+1),a=t.substring(t.indexOf("-")+1);e.object=n[a]&&n[a].tile}return e}filterSubLayer({layer:e,viewport:t}){const{tile:n}=e.props,{id:r}=t;return n.selected&&n.viewportIds.includes(r)}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}async _loadTileset(e){const{loadOptions:t={}}=this.props;let n=this.props.loader||this.props.loaders;Array.isArray(n)&&(n=n[0]);const r={loadOptions:{...t}};if(n.preload){const a=await n.preload(e,t);a.headers&&(r.loadOptions.fetch={...r.loadOptions.fetch,headers:a.headers}),Object.assign(r,a)}const a=await Object(en.a)(e,n,r.loadOptions),o=new xa(a,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError,...r});this.setState({tileset3d:o,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(o)}_onTileLoad(e){const{lastUpdatedViewports:t}=this.state;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}_onTileUnload(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}_updateTileset(e){const{tileset3d:t}=this.state,{timeline:n}=this.context,r=Object.keys(e).length;if(!n||!r||!t)return;const a=t.update(Object.values(e));this.state.frameNumber!==a&&this.setState({frameNumber:a})}_getSubLayer(e,t){if(!e.content)return null;switch(e.type){case Jr:return this._makePointCloudLayer(e,t);case Zr:return this._make3DModelLayer(e,t);case Qr:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}_makePointCloudLayer(e,t){const{attributes:n,pointCount:r,constantRGBA:a,cartographicOrigin:o,modelMatrix:i}=e.content,{positions:s,normals:l,colors:u}=n;if(!s)return null;const c=t&&t.props.data||{header:{vertexCount:r},attributes:{POSITION:s,NORMAL:l,COLOR_0:u}},{pointSize:d,getPointColor:f}=this.props;return new(this.getSubLayerClass("pointcloud",qt.a))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:c,coordinateSystem:Wt.a.METER_OFFSETS,coordinateOrigin:o,modelMatrix:i,getColor:a||f,_offset:0})}_make3DModelLayer(e){const{gltf:t,instances:n,cartographicOrigin:r,modelMatrix:a}=e.content;return new(this.getSubLayerClass("scenegraph",Xt.a))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||Co,scenegraph:t,coordinateSystem:Wt.a.METER_OFFSETS,coordinateOrigin:r,modelMatrix:a,getTransformMatrix:e=>e.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(e,t){const n=e.content,{attributes:r,indices:a,modelMatrix:o,cartographicOrigin:i,coordinateSystem:s=Wt.a.METER_OFFSETS,material:l,featureIds:u}=n,{_getMeshColor:c}=this.props,d=t&&t.props.mesh||new Yt.a({drawMode:4,attributes:Ro(r),indices:a});return new(this.getSubLayerClass("mesh",$t))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:d,data:Co,getColor:c(e),pbrMaterial:l,modelMatrix:o,coordinateOrigin:i,coordinateSystem:s,featureIds:u,_offset:0})}renderLayers(){const{tileset3d:e,layerMap:t}=this.state;return e?e.tiles.map(e=>{const n=t[e.id]=t[e.id]||{tile:e};let{layer:r}=n;return e.selected&&(r?n.needsUpdate&&(r=this._getSubLayer(e,r),n.needsUpdate=!1):r=this._getSubLayer(e)),n.layer=r,r}).filter(Boolean):null}}function Ro(e){const t={};return t.positions={...e.positions,value:new Float32Array(e.positions.value)},e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}Po.layerName="Tile3DLayer",Po.defaultProps=Lo;const Do={name:"Terrain",id:"terrain",module:"terrain",version:"3.1.6",worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}},ko=[1],Io={...Rt.defaultProps,elevationData:tt,texture:{...tt,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0,loaders:[Do]};function Fo(e){return Array.isArray(e)?e.join(";"):e}class jo extends o.a{updateState({props:e,oldProps:t}){const n=e.elevationData!==t.elevationData;if(n){const{elevationData:t}=e,n=t&&(Array.isArray(t)||t.includes("{x}")&&t.includes("{y}"));this.setState({isTiled:n})}const r=n||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;if(!this.state.isTiled&&r){const t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&E.a.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:n,meshMaxError:r,signal:a}){var o;if(!e)return null;let i=this.getLoadOptions();i={...i,terrain:{skirtHeight:this.state.isTiled?2*r:0,...null===(o=i)||void 0===o?void 0:o.terrain,bounds:t,meshMaxError:r,elevationDecoder:n}};const{fetch:s}=this.props;return s(e,{propName:"elevationData",layer:this,loadOptions:i,signal:a})}getTiledTerrainData(e){const{elevationData:t,fetch:n,texture:r,elevationDecoder:a,meshMaxError:o}=this.props,{viewport:i}=this.context,s=rt(t,e),l=rt(r,e),{bbox:u,signal:c}=e,d=i.isGeospatial?i.projectFlat([u.west,u.south]):[u.left,u.bottom],f=i.isGeospatial?i.projectFlat([u.east,u.north]):[u.right,u.top],p=[d[0],d[1],f[0],f[1]],h=this.loadTerrain({elevationData:s,bounds:p,elevationDecoder:a,meshMaxError:o,signal:c}),m=l?n(l,{propName:"texture",layer:this,loaders:[],signal:c}).catch(e=>null):Promise.resolve(null);return Promise.all([h,m])}renderSubLayers(e){const t=this.getSubLayerClass("mesh",Qt.a),{data:n,color:r}=e;if(!n)return null;const[a,o]=n;return new t(e,{data:ko,mesh:a,texture:o,_instanced:!1,coordinateSystem:Wt.a.CARTESIAN,getPosition:e=>[0,0,0],getColor:r})}onViewportLoad(e){if(!e)return;const{zRange:t}=this.state,n=e.map(e=>e.content).filter(Boolean).map(e=>e[0].header.boundingBox.map(e=>e[2]));if(0===n.length)return;const r=Math.min(...n.map(e=>e[0])),a=Math.max(...n.map(e=>e[1]));(!t||r<t[0]||a>t[1])&&this.setState({zRange:[r,a]})}renderLayers(){const{color:e,material:t,elevationData:n,texture:r,wireframe:a,meshMaxError:o,elevationDecoder:i,tileSize:s,maxZoom:l,minZoom:u,extent:c,maxRequests:d,onTileLoad:f,onTileUnload:p,onTileError:h,maxCacheSize:m,maxCacheByteSize:g,refinementStrategy:y}=this.props;if(this.state.isTiled)return new Rt(this.getSubLayerProps({id:"tiles"}),{wireframe:a,color:e,material:t,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Fo(n),texture:Fo(r),meshMaxError:o,elevationDecoder:i}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:s,maxZoom:l,minZoom:u,extent:c,maxRequests:d,onTileLoad:f,onTileUnload:p,onTileError:h,maxCacheSize:m,maxCacheByteSize:g,refinementStrategy:y});return new(this.getSubLayerClass("mesh",Qt.a))(this.getSubLayerProps({id:"mesh"}),{data:ko,mesh:this.state.terrain,texture:r,_instanced:!1,getPosition:e=>[0,0,0],getColor:e,material:t,wireframe:a})}}function Bo(e){let t=0;for(let t,n,r=0,a=e.length-1;r<e.length;r++)e[r],e[a],(n[0]-t[0])*(t[1]+n[1]);return t}function No(e,t,n){t&&n&&(1===e?t.id=n.readVarint():2===e?function(e,t){const n=e.readVarint()+e.pos;for(;e.pos<n;){const n=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[n]=r}}(n,t):3===e?t.type=n.readVarint():4===e&&(t._geometry=n.pos))}jo.layerName="TerrainLayer",jo.defaultProps=Io;class zo{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,t,n,r,a){Object(Ca.a)(this,"properties",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"type",void 0),Object(Ca.a)(this,"id",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_geometry",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=a,e.readFields(No,this,t)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let n=1,r=0,a=0,o=0;const i=[];let s;for(;e.pos<t;){if(r<=0){const t=e.readVarint();7&t,t>>3}if(1===n||2===n)e.readSVarint(),e.readSVarint(),1===n&&(s&&i.push(s),[]),s&&s.push([a,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));s&&s.push(s[0].slice())}}return s&&i.push(s),i}bbox(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let n=1,r=0,a=0,o=0,i=1/0,s=-1/0,l=1/0,u=-1/0;for(;e.pos<t;){if(r<=0){const t=e.readVarint();7&t,t>>3}if(1===n||2===n)e.readSVarint(),e.readSVarint(),a<i&&a,a>s&&a,o<l&&o,o>u&&o;else if(7!==n)throw new Error("unknown command ".concat(n))}return[i,l,s,u]}_toGeoJSON(e){let t,n,r=this.loadGeometry(),a=zo.types[this.type];switch(this.type){case 1:const a=[];for(0;t<r.length;t++)a[t]=r[t][0];a,e(r,this);break;case 2:for(0;t<r.length;t++)e(r[t],this);break;case 3:for(function(e){const t=e.length;if(t<=1)return[e];const n=[];let r,a;for(let o=0;o<t;o++){const t=Bo(e[o]);0!==t&&(void 0===a&&t<0,a===t<0?(r&&n.push(r),[e[o]]):r&&r.push(e[o]))}return r&&n.push(r),n}(r),0;t<r.length;t++)for(0;n<r[t].length;n++)e(r[t][n],this)}1===r.length?r[0]:"Multi".concat(a);const o={type:"Feature",geometry:{type:a,coordinates:r},properties:this.properties};return null!==this.id&&(o.id=this.id),o}toGeoJSON(e){if("function"==typeof e)return this._toGeoJSON(e);const{x:t,y:n,z:r}=e,a=this.extent*Math.pow(2,r),o=this.extent*t,i=this.extent*n;return this._toGeoJSON((function(e){for(let t=0;t<e.length;t++){const n=e[t];n[0]=360*(n[0]+o)/a-180;const r=180-360*(n[1]+i)/a;n[1]=360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90}}))}}class Uo{constructor(e,t){Object(Ca.a)(this,"version",void 0),Object(Ca.a)(this,"name",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"length",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),Object(Ca.a)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Ho,this,t),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new zo(this._pbf,t,this.extent,this._keys,this._values)}}function Ho(e,t,n){t&&n&&(15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){let t=null;const n=e.readVarint()+e.pos;for(;e.pos<n;){const t=e.readVarint()>>3;1===t?e.readString():2===t?e.readFloat():3===t?e.readDouble():4===t?e.readVarint64():5===t?e.readVarint():6===t?e.readSVarint():7===t?e.readBoolean():null}return t}(n)))}class Vo{constructor(e,t){Object(Ca.a)(this,"layers",void 0),this.layers=e.readFields(Go,{},t)}}function Go(e,t,n){if(3===e&&n){const e=new Uo(n,n.readVarint()+n.pos);e.length&&t&&(t[e.name]=e)}}var Yo=n(248);function Wo(e){const t=e.indices.length;if(t<=1)return{type:"Polygon",data:e.data,areas:[[Object(Yo.b)(e.data)]],indices:[e.indices]};const n=[],r=[];let a,o=[],i=[],s=0;for(let l,u,c=0;c<t;c++){e.indices[c]-s,e.indices[c+1]-s||e.data.length;const t=e.data.slice(u,l),d=Object(Yo.b)(t);if(0!==d)void 0===a&&d<0,a===d<0?(i.length&&(n.push(o),r.push(i)),[u],[d]):(o.push(d),i.push(u));else{const t=e.data.slice(0,u),n=e.data.slice(l);e.data=t.concat(n),l-u}}return o&&n.push(o),i.length&&r.push(i),{type:"Polygon",areas:n,indices:r,data:e.data}}function qo(e,t,n){t&&n&&(1===e?t.id=n.readVarint():2===e?function(e,t){const n=e.readVarint()+e.pos;for(;e.pos<n;){const n=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[n]=r}}(n,t):3===e?t.type=n.readVarint():4===e&&(t._geometry=n.pos))}let Xo,Ko,Zo,Jo,Qo,$o,ei;class ti{constructor(e,t,n,r,a,o){Object(Ca.a)(this,"properties",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"type",void 0),Object(Ca.a)(this,"id",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_geometry",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),Object(Ca.a)(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=a,this._geometryInfo=o,e.readFields(qo,this,t)}loadGeometry(){const e=this._pbf;e.pos=this._geometry,e.readVarint()+e.pos,1,0,0,0,0;const t=[],n=[];for(;e.pos<Xo;)if(Jo<=0&&(e.readVarint(),7&Zo,Zo>>3),1===Ko||2===Ko)e.readSVarint(),e.readSVarint(),1===Ko&&t.push(ei),n.push(Qo,$o),2;else{if(7!==Ko)throw new Error("unknown command ".concat(Ko));if(ei>0){const e=t[t.length-1];n.push(n[e],n[e+1]),2}}return{data:n,indices:t}}_toBinaryCoordinates(e){const t=this.loadGeometry();let n;e(t.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=t.indices.length,{type:"Point",...t};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=t.indices.length,this._geometryInfo.linePositionsCount+=t.data.length/2,{type:"LineString",...t};break;case 3:Wo(t),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(const e of n.indices)this._geometryInfo.polygonRingsCount+=e.length;this._geometryInfo.polygonPositionsCount+=n.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}const r={type:"Feature",geometry:n,properties:this.properties};return null!==this.id&&(r.id=this.id),r}toBinaryCoordinates(e){if("function"==typeof e)return this._toBinaryCoordinates(e);const{x:t,y:n,z:r}=e,a=this.extent*Math.pow(2,r),o=this.extent*t,i=this.extent*n;return this._toBinaryCoordinates(e=>function(e,t,n,r){for(let a=0,o=e.length;a<o;a+=2){e[a]=360*(e[a]+t)/r-180;const o=180-360*(e[a+1]+n)/r;e[a+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(e,o,i,a))}}class ni{constructor(e,t){Object(Ca.a)(this,"version",void 0),Object(Ca.a)(this,"name",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"length",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),Object(Ca.a)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ri,this,t),this.length=this._features.length}feature(e,t){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const n=this._pbf.readVarint()+this._pbf.pos;return new ti(this._pbf,n,this.extent,this._keys,this._values,t)}}function ri(e,t,n){t&&n&&(15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){let t=null;const n=e.readVarint()+e.pos;for(;e.pos<n;){const t=e.readVarint()>>3;1===t?e.readString():2===t?e.readFloat():3===t?e.readDouble():4===t?e.readVarint64():5===t?e.readVarint():6===t?e.readSVarint():7===t?e.readBoolean():null}return t}(n)))}class ai{constructor(e,t){Object(Ca.a)(this,"layers",void 0),this.layers=e.readFields(oi,{},t)}}function oi(e,t,n){if(3===e&&n){const e=new ni(n,n.readVarint()+n.pos);e.length&&t&&(t[e.name]=e)}}var ii=n(1188),si=n(338),li=n.n(si);function ui(e,t){(function(e){if(e){const t="wgs84"==={...e,mvt:e.mvt||{},gis:e.gis||{}}.coordinates,{tileIndex:n}=e,r=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(t&&!r)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property. Check documentation.")}return e})(t);const n=[];if(t){const r="binary"===t.gis.format,a={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength>0){const o=r?new ai(new li.a(e)):new Vo(new li.a(e)),i=t.mvt;(Array.isArray(i.layers)?i.layers:Object.keys(o.layers)).forEach(e=>{const t=o.layers[e],s={...i,layerName:e};if(t)for(let e=0;e<t.length;e++){const o=t.feature(e,a),i=r?di(o,s):ci(o,s);n.push(i)}})}if(r){const t=Object(ii.a)(n,a);return t.byteLength=e.byteLength,t}}return n}function ci(e,t){const n=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:fi);return t.layerProperty&&(n.properties[t.layerProperty]=t.layerName),n}function di(e,t){const n=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:pi);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=t.layerName),n}function fi(e,t){const{extent:n}=t;for(let t=0;t<e.length;t++){const r=e[t];r[0]/=n,r[1]/=n}}function pi(e,t){const{extent:n}=t;for(let t=0,r=e.length;t<r;++t)e[t]/=n}const hi={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.1.6",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{coordinates:"local",layerProperty:"layerName",layers:null,tileIndex:null}}};function mi(e,t){const n=null==t?void 0:t.globalFeatureId;return void 0!==n?function(e,t){const n=vi(e);for(const e of n){let n=0,r=e.featureIds.value[0];for(let a=0;a<e.featureIds.value.length;a++){const o=e.featureIds.value[a];if(o!==r){if(t===e.globalFeatureIds.value[n])return Ai(e,n,a);n=a,r=o}}if(t===e.globalFeatureIds.value[n])return Ai(e,n,e.featureIds.value.length)}throw new Error("featureId:".concat(t," not found"))}(e,n):gi(e,null==t?void 0:t.type)}function gi(e,t){return function(e){const t=[];for(const n of e){if(0===n.featureIds.value.length)continue;let e=0,r=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){const o=n.featureIds.value[a];o!==r&&(t.push(Ai(n,e,a)),e=a,r=o)}t.push(Ai(n,e,n.featureIds.value.length))}return t}(vi(e,t))}function yi(e,t,n){switch(e.type){case"Point":return function(e,t,n){const{positions:r}=e,a=bi(r,t,n);if(a.length>1)return{type:"MultiPoint",coordinates:a};return{type:"Point",coordinates:a[0]}}(e,t,n);case"LineString":return function(e,t=-1/0,n=1/0){const{positions:r}=e,a=e.pathIndices.value.filter(e=>e>=t&&e<=n);if(!(a.length>2)){return{type:"LineString",coordinates:bi(r,a[0],a[1])}}const o=[];for(let e=0;e<a.length-1;e++){const t=bi(r,a[e],a[e+1]);o.push(t)}return{type:"MultiLineString",coordinates:o}}(e,t,n);case"Polygon":return function e(t,n=-1/0,r=1/0){const{positions:a}=t,o=t.polygonIndices.value.filter(e=>e>=n&&e<=r),i=t.primitivePolygonIndices.value.filter(e=>e>=n&&e<=r);if(!(o.length>2)){const e=[];for(let t=0;t<i.length-1;t++){const n=i[t],r=i[t+1],o=bi(a,n,r);e.push(o)}return{type:"Polygon",coordinates:e}}const s=[];for(let n=0;n<o.length-1;n++){const r=o[n],a=o[n+1],i=e(t,r,a).coordinates;s.push(i)}return{type:"MultiPolygon",coordinates:s}}(e,t,n);default:const r=e;throw new Error("Unsupported geometry type: ".concat(null==r?void 0:r.type))}}function vi(e,t){if(!Boolean(e.points||e.lines||e.polygons))return e.type=t||function(e){if(e.pathIndices)return"LineString";if(e.polygonIndices)return"Polygon";return"Point"}(e),[e];const n=[];return e.points&&(e.points.type="Point",n.push(e.points)),e.lines&&(e.lines.type="LineString",n.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",n.push(e.polygons)),n}function Ai(e,t,n){return{type:"Feature",geometry:yi(e,t,n),properties:function(e,t=0,n){const r=Object.assign({},e.properties[e.featureIds.value[t]]);for(const n in e.numericProps)r[n]=e.numericProps[n].value[t];return r}(e,t),...function(e,t=0,n){return e.fields&&e.fields[e.featureIds.value[t]]}(e,t)}}function bi(e,t,n){t=t||0,n=n||e.value.length/e.size;const r=[];for(let a=t;a<n;a++){const t=Array();for(let n=a*e.size;n<(a+1)*e.size;n++)t.push(Number(e.value[n]));r.push(t)}return r}var _i=n(823);const Ei={Point:xi,MultiPoint:function(e,t,n){return Mi(e,t,n)},LineString:wi,MultiLineString:function(e,t,n){return e.map(e=>wi(e,t,n))},Polygon:Oi,MultiPolygon:function(e,t,n){return e.map(e=>Oi(e,t,n))}};function xi([e,t],[n,r],a){const o=mt(n[0],r[0],e),i=mt(n[1],r[1],t);return a.unprojectFlat([o,i])}function Mi(e,t,n){return e.map(e=>xi(e,t,n))}function wi(e,t,n){return Mi(e,t,n)}function Oi(e,t,n){return e.map(e=>Mi(e,t,n))}const Si=["points","lines","polygons"];function Ti(e,t,n,r){const a=e.featureIds.value;if(!a.length)return-1;let o=0,i=a[a.length-1]+1;if(r){const t=function(e,t){if(!e.__layers){const t={},{properties:n}=e;for(let e=0;e<n.length;e++){const{layerName:r}=n[e];r&&(t[r]?t[r][1]=e:t[r]=[e,e])}e.__layers=t}return e.__layers[t]}(e,r);if(!t)return-1;o=t[0],i=t[1]+1}let s=-1;if(t in e.numericProps){const r=e.numericProps[t].value.findIndex((e,t)=>e===n&&a[t]>=o&&a[t]<i);return r>=0?e.globalFeatureIds.value[r]:-1}return s=t?Ci(e.properties,e=>e[t]===n,o,i):Ci(e.fields,e=>e.id===n,o,i),s>=0?function(e,t){if(!e.__ids){const t=[],n=e.featureIds.value,r=e.globalFeatureIds.value;for(let e=0;e<n.length;e++)t[n[e]]=r[e];e.__ids=t}return e.__ids[t]}(e,s):-1}function Ci(e,t,n,r){for(let a=n;a<r;a++)if(t(e[a],a))return a;return-1}const Li={uniqueIdProperty:{type:"string",value:""},highlightedFeatureId:null,loaders:[hi],binary:!0};class Pi extends Rt{initializeState(){super.initializeState(),this.setState({data:null,tileJSON:null})}get isLoaded(){return this.state.data&&this.state.tileset&&super.isLoaded}updateState({props:e,oldProps:t,context:n,changeFlags:r}){r.dataChanged&&this._updateTileData(),this.state.data&&(super.updateState({props:e,oldProps:t,context:n,changeFlags:r}),this._setWGS84PropertyForTiles());const{highlightColor:a}=e;a!==t.highlightColor&&Array.isArray(a)&&this.setState({highlightColor:a})}async _updateTileData(){let{data:e}=this.props,t=null;if("string"!=typeof e||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e))e.tilejson&&(t=e);else{const{onDataLoad:n,fetch:r}=this.props;this.setState({data:null,tileJSON:null});try{t=await r(e,{propName:"data",layer:this,loaders:[]})}catch(t){this.raiseError(t,"loading TileJSON"),e=null}n&&n(t)}t&&(e=t.tiles),this.setState({data:e,tileJSON:t})}_getTilesetOptions(e){const t=super._getTilesetOptions(e),{tileJSON:n}=this.state;return n&&(Number.isFinite(n.minzoom)&&n.minzoom>e.minZoom&&(t.minZoom=n.minzoom),Number.isFinite(n.maxzoom)&&(!Number.isFinite(e.maxZoom)||n.maxzoom<e.maxZoom)&&(t.maxZoom=n.maxzoom)),t}renderLayers(){return this.state.data?super.renderLayers():null}getTileData(e){var t;const n=rt(this.state.data,e);if(!n)return Promise.reject("Invalid URL");let r=this.getLoadOptions();const{binary:a,fetch:o}=this.props,{signal:i,x:s,y:l,z:u}=e;return r={...r,mimeType:"application/x-protobuf",mvt:{...null===(t=r)||void 0===t?void 0:t.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:{x:s,y:l,z:u}},gis:a?{format:"binary"}:{}},o(n,{propName:"data",layer:this,loadOptions:r,signal:i})}renderSubLayers(e){const{tile:t}=e,n=Math.pow(2,t.z),r=512/n,a=-r,o=512*t.x/n,i=512*(1-t.y/n),s=(new Ot).scale([r,a,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=s,e.coordinateOrigin=[o,i,0],e.coordinateSystem=Wt.a.CARTESIAN,e.extensions=[...e.extensions||[],new _i.a]);const l=super.renderSubLayers(e);return!this.props.binary||l instanceof _.a||E.a.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),l}_updateAutoHighlight(e){const{uniqueIdProperty:t}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:r}=this.state,a=e.object;let o,i;a&&(o=Ri(a,t),i=Di(a));let{highlightColor:s}=this.props;"function"==typeof s&&(s=s(e)),n===o&&r===i||this.setState({highlightColor:s,hoveredFeatureId:o,hoveredFeatureLayerName:i})}getPickingInfo(e){const t=super.getPickingInfo(e),n=this.context.viewport.resolution;if(this.props.binary&&-1!==t.index){const{data:n}=e.sourceLayer.props;t.object=mi(n,{globalFeatureId:t.index})}return t.object&&!n&&(t.object=Ii(t.object,t.tile.bbox,this.context.viewport)),t}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t,hoveredFeatureLayerName:n}=this.state,{uniqueIdProperty:r,highlightedFeatureId:a,binary:o}=this.props,i=e.content,s=ki(a);if(!(ki(t)||s))return-1;const l=s?a:t;return Array.isArray(i)?i.findIndex(e=>{const t=Ri(e,r)===l,a=s||Di(e)===n;return t&&a}):i&&o?function(e,t,n,r){for(const a of Si){const o=e[a]&&Ti(e[a],t,n,r);if(o>=0)return o}return-1}(i,r,l,s?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context,r=n.width,a=n.height,o=n.x,i=n.y,s=[this.id];return t.pickObjects({x:o,y:i,width:r,height:a,layerIds:s,maxObjects:e})}getRenderedFeatures(e=null){const t=this._pickObjects(e),n=new Set,r=[];for(const e of t){const t=Ri(e.object,this.props.uniqueIdProperty);void 0===t?r.push(e.object):n.has(t)||(n.add(t),r.push(e.object))}return r}_setWGS84PropertyForTiles(){const{tileset:e}=this.state;e.selectedTiles.forEach(e=>{e.hasOwnProperty("dataInWGS84")||Object.defineProperty(e,"dataInWGS84",{get:()=>{if(!e.content)return null;if(this.props.binary&&Array.isArray(e.content)&&!e.content.length)return[];if(void 0===e._contentWGS84){const t=this.props.binary?mi(e.content):e.content;e._contentWGS84=t.map(t=>Ii(t,e.bbox,this.context.viewport))}return e._contentWGS84}})})}}function Ri(e,t){return t?e.properties[t]:"id"in e?e.id:void 0}function Di(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function ki(e){return null!=e&&""!==e}function Ii(e,t,n){const r={...e,geometry:{type:e.geometry.type}};return Object.defineProperty(r.geometry,"coordinates",{get:()=>function(e,t,n){const r=[n.projectFlat([t.west,t.north]),n.projectFlat([t.east,t.south])];return{...e,coordinates:Ei[e.type](e.coordinates,r,n)}}(e.geometry,t,n).coordinates}),r}Pi.layerName="MVTLayer",Pi.defaultProps=Li},function(e,t,n){"use strict";n.r(t),n.d(t,"ScreenGridLayer",(function(){return we})),n.d(t,"CPUGridLayer",(function(){return ke})),n.d(t,"HexagonLayer",(function(){return Ne})),n.d(t,"ContourLayer",(function(){return Bt})),n.d(t,"GridLayer",(function(){return Xt})),n.d(t,"GPUGridLayer",(function(){return Wt})),n.d(t,"AGGREGATION_OPERATION",(function(){return p})),n.d(t,"HeatmapLayer",(function(){return an})),n.d(t,"_GPUGridAggregator",(function(){return k})),n.d(t,"_CPUAggregator",(function(){return Pe})),n.d(t,"_AggregationLayer",(function(){return K})),n.d(t,"_BinSorter",(function(){return pe}));var r=n(50),a=n(465),o=n(1203),i=n(16),s=n(639),l=n(461),u=n(1911),c=n(1913),d=n(422),f=n(826);const p={SUM:1,MEAN:2,MIN:3,MAX:4};function h(e,t){return e+t}function m(e,t){return t>e?t:e}function g(e,t){return t<e?t:e}function y(e,t,n){const r=p[e]||p.SUM;switch(t=function(e,t={}){if(Number.isFinite(e))return e;return n=>(t.index=n.index,e(n.source,t))}(t,n),r){case p.MIN:return e=>function(e,t){if(Number.isFinite(t))return e.length?t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(g,1/0):null}(e,t);case p.SUM:return e=>function(e,t){if(Number.isFinite(t))return e.length?e.length*t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(h,0):null}(e,t);case p.MEAN:return e=>function(e,t){if(Number.isFinite(t))return e.length?t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(h,0)/n.length:null}(e,t);case p.MAX:return e=>function(e,t){if(Number.isFinite(t))return e.length?t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(m,-1/0):null}(e,t);default:return null}}function v(e,t={}){return n=>(t.indices=n.map(e=>e.index),e(n.map(e=>e.source),t))}const A={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},b=3402823466e29,_=[32775,32774],E=[32776,32774],x=[32776,32775],M={[p.SUM]:32774,[p.MEAN]:32774,[p.MIN]:_,[p.MAX]:E},w={size:1,operation:p.SUM,needMin:!1,needMax:!1,combineMaxMin:!1};var O=n(250),S=n(167);const T={10240:9728,10241:9728};function C(e,t={}){const{width:n=1,height:r=1,data:a=null,unpackFlipY:o=!0,parameters:s=T}=t;return new O.a(e,{data:a,format:Object(i.j)(e)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:s,dataFormat:6408,width:n,height:r,unpackFlipY:o})}function L(e,t){const{id:n,width:r=1,height:a=1,texture:o}=t;return new S.a(e,{id:n,width:r,height:a,attachments:{36064:o}})}const P=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],R={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},D=[a.a.WEBGL2,a.a.COLOR_ATTACHMENT_RGBA32F,a.a.BLEND_EQUATION_MINMAX,a.a.FLOAT_BLEND,a.a.TEXTURE_FLOAT];class k{static getAggregationData({aggregationData:e,maxData:t,minData:n,maxMinData:r,pixelIndex:a}){const o=4*a,i={};return e&&(i.cellCount=e[o+3],i.cellWeight=e[o]),r?(i.maxCellWieght=r[0],i.minCellWeight=r[3]):(t&&(i.maxCellWieght=t[0],i.totalCount=t[3]),n&&(i.minCellWeight=n[0],i.totalCount=t[3])),i}static getCellData({countsData:e,size:t=1}){const n=e.length/4,r=new Float32Array(n*t),a=new Uint32Array(n);for(let o=0;o<n;o++){for(let n=0;n<t;n++)r[o*t+n]=e[4*o+n];a[o]=e[4*o+3]}return{cellCounts:a,cellWeights:r}}static isSupported(e){return Object(o.c)(e,D)}constructor(e,t={}){this.id=t.id||"gpu-grid-aggregator",this.gl=e,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(i.j)(e)&&Object(o.c)(this.gl,a.a.BLEND_EQUATION_MINMAX,a.a.COLOR_ATTACHMENT_RGBA32F,a.a.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}delete(){const{gridAggregationModel:e,allAggregationModel:t,meanTransform:n}=this,{textures:r,framebuffers:a,maxMinFramebuffers:o,minFramebuffers:i,maxFramebuffers:s,meanTextures:l,resources:u}=this.state;null==e||e.delete(),null==t||t.delete(),null==n||n.delete(),function(e){(e=Array.isArray(e)?e:[e]).forEach(e=>{for(const t in e)e[t].delete()})}([a,r,o,i,s,l,u])}run(e={}){this.setState({results:{}});const t=this._normalizeAggregationParams(e);return this._hasGPUSupport||r.a.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(t)}getData(e){const t={},n=this.state.results;n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData;for(const r in R){const a=R[r];(n[e][r]||n[e][a])&&(n[e][r]=n[e][r]||n[e][a].getData(),t[r]=n[e][r])}return t}updateShaders(e={}){this.setState({shaderOptions:e,modelDirty:!0})}_normalizeAggregationParams(e){const t={...A,...e},{weights:n}=t;return n&&(t.weights=function(e){const t={};for(const n in e)t[n]={...w,...e[n]};return t}(n)),t}setState(e){Object.assign(this.state,e)}_getAggregateData(e){const t={},{textures:n,framebuffers:r,maxMinFramebuffers:a,minFramebuffers:o,maxFramebuffers:i,resources:l}=this.state,{weights:u}=e;for(const e in u){t[e]={};const{needMin:c,needMax:d,combineMaxMin:f}=u[e];t[e].aggregationTexture=n[e],t[e].aggregationBuffer=Object(s.d)(r[e],{target:u[e].aggregationBuffer,sourceType:5126}),c&&d&&f?(t[e].maxMinBuffer=Object(s.d)(a[e],{target:u[e].maxMinBuffer,sourceType:5126}),t[e].maxMinTexture=l["".concat(e,"-maxMinTexture")]):(c&&(t[e].minBuffer=Object(s.d)(o[e],{target:u[e].minBuffer,sourceType:5126}),t[e].minTexture=l["".concat(e,"-minTexture")]),d&&(t[e].maxBuffer=Object(s.d)(i[e],{target:u[e].maxBuffer,sourceType:5126}),t[e].maxTexture=l["".concat(e,"-maxTexture")]))}return this._trackGPUResultBuffers(t,u),t}_renderAggregateData(e){const{cellSize:t,projectPoints:n,attributes:r,moduleSettings:a,numCol:o,numRow:i,weights:s,translation:l,scaling:u}=e,{maxMinFramebuffers:c,minFramebuffers:d,maxFramebuffers:f}=this.state,p=[o,i],h={blend:!0,depthTest:!1,blendFunc:[1,1]},m={cellSize:t,gridSize:p,projectPoints:n,translation:l,scaling:u};for(const e in s){const{needMin:t,needMax:n}=s[e],o=t&&n&&s[e].combineMaxMin;this._renderToWeightsTexture({id:e,parameters:h,moduleSettings:a,uniforms:m,gridSize:p,attributes:r,weights:s}),o?this._renderToMaxMinTexture({id:e,parameters:{...h,blendEquation:x},gridSize:p,minOrMaxFb:c[e],clearParams:{clearColor:[0,0,0,b]},combineMaxMin:o}):(t&&this._renderToMaxMinTexture({id:e,parameters:{...h,blendEquation:_},gridSize:p,minOrMaxFb:d[e],clearParams:{clearColor:[b,b,b,0]},combineMaxMin:o}),n&&this._renderToMaxMinTexture({id:e,parameters:{...h,blendEquation:E},gridSize:p,minOrMaxFb:f[e],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:o}))}}_renderToMaxMinTexture(e){const{id:t,parameters:n,gridSize:r,minOrMaxFb:a,combineMaxMin:o,clearParams:s={}}=e,{framebuffers:l}=this.state,{gl:u,allAggregationModel:c}=this;Object(i.o)(u,{...s,framebuffer:a,viewport:[0,0,r[0],r[1]]},()=>{u.clear(16384),c.draw({parameters:n,uniforms:{uSampler:l[t].texture,gridSize:r,combineMaxMin:o}})})}_renderToWeightsTexture(e){const{id:t,parameters:n,moduleSettings:r,uniforms:a,gridSize:o,weights:s}=e,{framebuffers:l,equations:c,weightAttributes:d}=this.state,{gl:f,gridAggregationModel:h}=this,{operation:m}=s[t],g=m===p.MIN?[b,b,b,0]:[0,0,0,0];if(Object(i.o)(f,{framebuffer:l[t],viewport:[0,0,o[0],o[1]],clearColor:g},()=>{f.clear(16384);const e={weights:d[t]};h.draw({parameters:{...n,blendEquation:c[t]},moduleSettings:r,uniforms:a,attributes:e})}),m===p.MEAN){const{meanTextures:e,textures:n}=this.state,r={_sourceTextures:{aggregationValues:e[t]},_targetTexture:n[t],elementCount:n[t].width*n[t].height};this.meanTransform?this.meanTransform.update(r):this.meanTransform=function(e,t){return new u.a(e,{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n gl_PointSize = 1.0;\n}\n",_targetTextureVarying:"meanValues",...t})}(f,r),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),l[t].attach({36064:n[t]})}}_runAggregation(e){this._updateModels(e),this._setupFramebuffers(e),this._renderAggregateData(e);const t=this._getAggregateData(e);return this.setState({results:t}),t}_setupFramebuffers(e){const{textures:t,framebuffers:n,maxMinFramebuffers:r,minFramebuffers:a,maxFramebuffers:o,meanTextures:i,equations:s}=this.state,{weights:l}=e,{numCol:u,numRow:c}=e,d={width:u,height:c};for(const e in l){const{needMin:f,needMax:h,combineMaxMin:m,operation:g}=l[e];t[e]=l[e].aggregationTexture||t[e]||C(this.gl,{id:"".concat(e,"-texture"),width:u,height:c}),t[e].resize(d);let y=t[e];g===p.MEAN&&(i[e]=i[e]||C(this.gl,{id:"".concat(e,"-mean-texture"),width:u,height:c}),i[e].resize(d),y=i[e]),n[e]?n[e].attach({36064:y}):n[e]=L(this.gl,{id:"".concat(e,"-fb"),width:u,height:c,texture:y}),n[e].resize(d),s[e]=M[g]||M.SUM,(f||h)&&(f&&h&&m?r[e]||(y=l[e].maxMinTexture||this._getMinMaxTexture("".concat(e,"-maxMinTexture")),r[e]=L(this.gl,{id:"".concat(e,"-maxMinFb"),texture:y})):(f&&(a[e]||(y=l[e].minTexture||this._getMinMaxTexture("".concat(e,"-minTexture")),a[e]=L(this.gl,{id:"".concat(e,"-minFb"),texture:y}))),h&&(o[e]||(y=l[e].maxTexture||this._getMinMaxTexture("".concat(e,"-maxTexture")),o[e]=L(this.gl,{id:"".concat(e,"-maxFb"),texture:y})))))}}_getMinMaxTexture(e){const{resources:t}=this.state;return t[e]||(t[e]=C(this.gl,{id:"resourceName"})),t[e]}_setupModels({numCol:e=0,numRow:t=0}={}){var n;const{gl:r}=this,{shaderOptions:a}=this.state;if(null===(n=this.gridAggregationModel)||void 0===n||n.delete(),this.gridAggregationModel=function(e,t){const n=Object(d.a)({vs:"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute vec3 weights;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform bool projectPoints;\nuniform vec2 translation;\nuniform vec3 scaling;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result;\n pos.xy = pos.xy/pos.w;\n result = pos + vec4(translation, 0., 0.);\n result.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;\n return result.xy;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n\n vec2 pixelXY64[2];\n pixelXY64[0] = vec2(pos.x, 0.);\n pixelXY64[1] = vec2(pos.y, 0.);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.b,f.a]},t);return new l.a(e,{id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0,...n})}(r,a),!this.allAggregationModel){const n=e*t;this.allAggregationModel=function(e,t){return new l.a(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n gl_PointSize = 1.0;\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[c.b],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:t,attributes:{position:[0,0]}})}(r,n)}}_setupWeightAttributes(e){const{weightAttributes:t}=this.state,{weights:n}=e;for(const r in n)t[r]=e.attributes[r]}_trackGPUResultBuffers(e,t){const{resources:n}=this.state;for(const r in e)if(e[r])for(const a of P)if(e[r][a]&&t[r][a]!==e[r][a]){const t="gpu-result-".concat(r,"-").concat(a);n[t]&&n[t].delete(),n[t]=e[r][a]}}_updateModels(e){const{vertexCount:t,attributes:n,numCol:r,numRow:a}=e,{modelDirty:o}=this.state;o&&(this._setupModels(e),this.setState({modelDirty:!1})),this._setupWeightAttributes(e),this.gridAggregationModel.setVertexCount(t),this.gridAggregationModel.setAttributes(n),this.allAggregationModel.setInstanceCount(r*a)}}var I=n(144),F=n(435),j=n(825);const B=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function N(e,t=!1,n=Float32Array){let r;if(Number.isFinite(e[0]))r=new n(e);else{r=new n(4*e.length);let t=0;for(let n=0;n<e.length;n++){const a=e[n];r[t++]=a[0],r[t++]=a[1],r[t++]=a[2],r[t++]=Number.isFinite(a[3])?a[3]:255}}if(t)for(let e=0;e<r.length;e++)r[e]/=255;return r}const z=[0,0,0,0],U=[0,255,0,255],H=["minColor","maxColor","colorRange","colorDomain"],V={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:B};class G extends F.a{static isSupported(e){return Object(o.c)(e,[a.a.TEXTURE_FLOAT])}getShaders(){return{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\nuniform sampler2D maxTexture;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float maxWeight = texture2D(maxTexture, vec2(0.5)).r;\n\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[j.a]}}initializeState(){const{gl:e}=this.context;this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(e)})}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({oldProps:e,props:t,changeFlags:n});const r=this.getAttributeManager();t.numInstances!==e.numInstances?r.invalidateAll():e.cellSizePixels!==t.cellSizePixels&&r.invalidate("instancePositions"),this._updateUniforms(e,t,n)}draw({uniforms:e}){const{parameters:t,maxTexture:n}=this.props,r=this.props.minColor||z,a=this.props.maxColor||U,o=this.props.colorDomain||[1,0],{model:i}=this.state;i.setUniforms(e).setUniforms({minColor:r,maxColor:a,maxTexture:n,colorDomain:o}).draw({parameters:{depthTest:!1,depthMask:!1,...t}})}calculateInstancePositions(e,{numInstances:t}){const{width:n,height:r}=this.context.viewport,{cellSizePixels:a}=this.props,o=Math.ceil(n/a),{value:i,size:s}=e;for(let e=0;e<t;e++){const t=e%o,l=Math.floor(e/o);i[e*s+0]=t*a/n*2-1,i[e*s+1]=1-l*a/r*2,i[e*s+2]=0}}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new I.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0})}_shouldUseMinMax(){const{minColor:e,maxColor:t,colorDomain:n,colorRange:a}=this.props;return e||t?(r.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!n&&!a}_updateUniforms(e,t,n){const{model:r}=this.state;if(H.some(n=>e[n]!==t[n])&&r.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),e.colorRange!==t.colorRange&&r.setUniforms({colorRange:N(t.colorRange)}),e.cellMarginPixels!==t.cellMarginPixels||e.cellSizePixels!==t.cellSizePixels||n.viewportChanged){const{width:e,height:t}=this.context.viewport,{cellSizePixels:n,cellMarginPixels:a}=this.props,o=n>a?a:0,i=new Float32Array([(n-o)/e*2,-(n-o)/t*2,1]);r.setUniforms({cellScale:i})}}}G.layerName="ScreenGridCellLayer",G.defaultProps=V;var Y=n(621),W=n(337),q=n(436);function X(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}class K extends Y.a{initializeState(e){super.initializeState(),this.setState({ignoreProps:X(this.constructor._propTypes,e.data.props),dimensions:e})}updateState(e){super.updateState(e);const{changeFlags:t}=e;if(t.extensionsChanged){const e=this.getShaders({});e&&e.defines&&(e.defines.NON_INSTANCED_MODEL=1),this.updateShaders(e)}this._updateAttributes(e.props)}updateAttributes(e){this.setState({changedAttributes:e})}getAttributes(){return this.getAttributeManager().getShaderAttributes()}getModuleSettings(){const{viewport:e,mousePosition:t,gl:n}=this.context;return Object.assign(Object.create(this.props),{viewport:e,mousePosition:t,pickingActive:0,devicePixelRatio:Object(i.e)(n)})}updateShaders(e){}isAggregationDirty(e,t={}){const{props:n,oldProps:r,changeFlags:a}=e,{compareAll:o=!1,dimension:i}=t,{ignoreProps:s}=this.state,{props:l,accessors:u=[]}=i,{updateTriggersChanged:c}=a;if(a.dataChanged)return!0;if(c){if(c.all)return!0;for(const e of u)if(c[e])return!0}if(o)return!!a.extensionsChanged||Object(W.a)({oldProps:r,newProps:n,ignoreProps:s,propTypes:this.constructor._propTypes});for(const e of l)if(n[e]!==r[e])return!0;return!1}isAttributeChanged(e){const{changedAttributes:t}=this.state;return e?t&&void 0!==t[e]:!function(e){let t=!0;for(const n in e){t=!1;break}return t}(t)}_getAttributeManager(){return new q.a(this.context.gl,{id:this.props.id,stats:this.context.stats})}}K.layerName="AggregationLayer";var Z=n(87);function J(e,t,n){const r=n;return r.domain=()=>e,r.range=()=>t,r}function Q(e,t){return J(e,t,n=>function(e,t,n){const a=e[1]-e[0];if(a<=0)return r.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];const o=a/t.length,i=Math.floor((n-e[0])/o),s=Math.max(Math.min(i,t.length-1),0);return t[s]}(e,t,n))}function $(e,t){return J(e,t,n=>function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}(e,t,n))}function ee(e,t){const n=e.sort(te);let r=0;const a=Math.max(1,t.length),o=new Array(a-1);for(;++r<a;)o[r-1]=ne(n,r/a);const i=e=>function(e,t,n){return t[function(e,t){let n=0,r=e.length;for(;n<r;){const a=n+r>>>1;te(e[a],t)>0?r=a:n=a+1}return n}(e,n)]}(o,t,e);return i.thresholds=()=>o,J(e,t,i)}function te(e,t){return e-t}function ne(e,t){const n=e.length;if(t<=0||n<2)return e[0];if(t>=1)return e[n-1];const r=(n-1)*t,a=Math.floor(r),o=e[a];return o+(e[a+1]-o)*(r-a)}function re(e,t){const n=new Map,r=[];for(const t of e){const e="".concat(t);n.has(e)||n.set(e,r.push(t))}return J(e,t,e=>function(e,t,n,r){const a="".concat(r);let o=t.get(a);return void 0===o&&(o=e.push(r),t.set(a,o)),n[(o-1)%n.length]}(r,n,t,e))}function ae(e){return null!=e}function oe(e,t){return("function"==typeof t?e.map(t):e).filter(ae)}function ie(e,t){return oe(e,t)}function se(e,t){return function(e){const t=[];return e.forEach(e=>{!t.includes(e)&&ae(e)&&t.push(e)}),t}(oe(e,t))}const le=e=>e.length,ue=e=>e.points,ce=e=>e.index,de=(e,t)=>e<t?-1:e>t?1:e>=t?0:NaN,fe={getValue:le,getPoints:ue,getIndex:ce,filterData:null};class pe{constructor(e=[],t=fe){this.aggregatedBins=this.getAggregatedBins(e,t),this._updateMinMaxValues(),this.binMap=this.getBinMap()}getAggregatedBins(e,t){const{getValue:n=le,getPoints:r=ue,getIndex:a=ce,filterData:o}=t,i="function"==typeof o,s=e.length,l=[];let u=0;for(let t=0;t<s;t++){const s=e[t],c=r(s),d=a(s),f=i?c.filter(o):c;s.filteredPoints=i?f:null;const p=f.length?n(f):null;null!=p&&(l[u]={i:Number.isFinite(d)?d:t,value:p,counts:f.length},u++)}return l}_percentileToIndex(e){const t=this.sortedBins.length;if(t<2)return[0,0];const[n,r]=e.map(e=>function(e,t,n){return Math.max(t,Math.min(n,e))}(e,0,100));return[Math.ceil(n/100*(t-1)),Math.floor(r/100*(t-1))]}getBinMap(){const e={};for(const t of this.aggregatedBins)e[t.i]=t;return e}_updateMinMaxValues(){let e=0,t=0,n=3402823466e29,r=0;for(const a of this.aggregatedBins)e=e>a.counts?e:a.counts,t=t>a.value?t:a.value,n=n<a.value?n:a.value,r+=a.counts;this.maxCount=e,this.maxValue=t,this.minValue=n,this.totalCount=r}getValueRange(e){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((e,t)=>de(e.value,t.value))),!this.sortedBins.length)return[];let t=0,n=this.sortedBins.length-1;if(Array.isArray(e)){const r=this._percentileToIndex(e);t=r[0],n=r[1]}return[this.sortedBins[t].value,this.sortedBins[n].value]}getValueDomainByScale(e,[t=0,n=100]=[]){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((e,t)=>de(e.value,t.value))),!this.sortedBins.length)return[];const r=this._percentileToIndex([t,n]);return this._getScaleDomain(e,r)}_getScaleDomain(e,[t,n]){const r=this.sortedBins;switch(e){case"quantize":case"linear":return[r[t].value,r[n].value];case"quantile":return ie(r.slice(t,n+1),e=>e.value);case"ordinal":return se(r,e=>e.value);default:return[r[t].value,r[n].value]}}}var he=n(122),me=n(34);function ge(e){return Number.isFinite(e)?e:0}function ye(e,t){const n=e.positions.value;let r,a,o=1/0,i=-1/0,s=1/0,l=-1/0;for(let e=0;e<t;e++)a=n[3*e],r=n[3*e+1],o=r<o?r:o,i=r>i?r:i,s=a<s?a:s,l=a>l?a:l;return{xMin:ge(s),xMax:ge(l),yMin:ge(o),yMax:ge(i)}}function ve(e,t){const n=e<0?-1:1;let r=n<0?Math.abs(e)+t:Math.abs(e);return r=Math.floor(r/t)*t,r*n}function Ae(e,t,n=!0){if(!n)return{xOffset:t,yOffset:t};const{yMin:r,yMax:a}=e;return function(e,t){const n=(i=e,i/6378e3*(180/Math.PI)),r=(a=t,o=e,o/6378e3*(180/Math.PI)/Math.cos(a*Math.PI/180));var a,o;var i;return{yOffset:n,xOffset:r}}(t,(r+a)/2)}function be(e,t,n,a){const o=Ae(e,t,a!==me.a.CARTESIAN),i=function(e,t,n,a){const{width:o,height:i}=a,s=n===me.a.CARTESIAN?[-o/2,-i/2]:[-180,-90];r.a.assert(n===me.a.CARTESIAN||n===me.a.LNGLAT||n===me.a.DEFAULT);const{xMin:l,yMin:u}=e;return[-1*(ve(l-s[0],t.xOffset)+s[0]),-1*(ve(u-s[1],t.yOffset)+s[1])]}(e,o,a,n),{xMin:s,yMin:l,xMax:u,yMax:c}=e,d=u-s+o.xOffset,f=c-l+o.yOffset;return{gridOffset:o,translation:i,width:d,height:f,numCol:Math.ceil(d/o.xOffset),numRow:Math.ceil(f/o.yOffset)}}function _e(e,t){const n=function(e,t){const{data:n=[],cellSize:r}=e,{attributes:a,viewport:o,projectPoints:i,numInstances:s}=t,l=a.positions.value,{size:u}=a.positions.getAccessor(),c=t.boundingBox||function(e,t){const n=e.value,{size:r}=e.getAccessor();let a,o,i=1/0,s=-1/0,l=1/0,u=-1/0;for(let e=0;e<t;e++)o=n[e*r],a=n[e*r+1],Number.isFinite(o)&&Number.isFinite(a)&&(i=a<i?a:i,s=a>s?a:s,l=o<l?o:l,u=o>u?o:u);return{xMin:l,xMax:u,yMin:i,yMax:s}}(a.positions,s),d=t.posOffset||[180,90],f=t.gridOffset||Ae(c,r);if(f.xOffset<=0||f.yOffset<=0)return{gridHash:{},gridOffset:f};const{width:p,height:h}=o,m=Math.ceil(p/f.xOffset),g=Math.ceil(h/f.yOffset),y={},{iterable:v,objectInfo:A}=Object(he.a)(n),b=new Array(3);for(const e of v){A.index++,b[0]=l[A.index*u],b[1]=l[A.index*u+1],b[2]=u>=3?l[A.index*u+2]:0;const[t,n]=i?o.project(b):b;if(Number.isFinite(t)&&Number.isFinite(n)){const r=Math.floor((n+d[1])/f.yOffset),a=Math.floor((t+d[0])/f.xOffset);if(!i||a>=0&&a<m&&r>=0&&r<g){const t="".concat(r,"-").concat(a);y[t]=y[t]||{count:0,points:[],lonIdx:a,latIdx:r},y[t].count+=1,y[t].points.push({source:e,index:A.index})}}}return{gridHash:y,gridOffset:f,offsets:[-1*d[0],-1*d[1]]}}(e,t),r=function({gridHash:e,gridOffset:t,offsets:n}){const r=new Array(Object.keys(e).length);let a=0;for(const o in e){const i=o.split("-"),s=parseInt(i[0],10),l=parseInt(i[1],10),u=a++;r[u]={index:u,position:[n[0]+t.xOffset*l,n[1]+t.yOffset*s],...e[o]}}return r}(n);return{gridHash:n.gridHash,gridOffset:n.gridOffset,data:r}}class Ee extends K{initializeState({dimensions:e}){const{gl:t}=this.context;super.initializeState(e),this.setState({layerData:{},gpuGridAggregator:new k(t,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:_e})}updateState(e){super.updateState(e),this.updateAggregationState(e);const{aggregationDataDirty:t,aggregationWeightsDirty:n,gpuAggregation:r}=this.state;if(this.getNumInstances()<=0)return;let a=!1;(t||r&&n)&&(this._updateAggregation(e),a=!0),r||!t&&!n||(this._updateWeightBins(),this._uploadAggregationResults(),a=!0),this.setState({aggregationDirty:a})}finalizeState(){var e;const{count:t}=this.state.weights;t&&t.aggregationBuffer&&t.aggregationBuffer.delete(),null===(e=this.state.gpuGridAggregator)||void 0===e||e.delete(),super.finalizeState()}updateShaders(e){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(e)}updateAggregationState(e){r.a.assert(!1)}allocateResources(e,t){if(this.state.numRow!==e||this.state.numCol!==t){const n=t*e*4*4,r=this.context.gl,{weights:a}=this.state;for(const e in a){const t=a[e];t.aggregationBuffer&&t.aggregationBuffer.delete(),t.aggregationBuffer=new Z.a(r,{byteLength:n,accessor:{size:4,type:5126,divisor:1}})}}}updateResults({aggregationData:e,maxMinData:t,maxData:n,minData:r}){const{count:a}=this.state.weights;a&&(a.aggregationData=e,a.maxMinData=t,a.maxData=n,a.minData=r)}_updateAggregation(e){const{cpuGridAggregator:t,gpuGridAggregator:n,gridOffset:r,posOffset:a,translation:o=[0,0],scaling:i=[0,0,0],boundingBox:s,projectPoints:l,gpuAggregation:u,numCol:c,numRow:d}=this.state,{props:f}=e,{viewport:p}=this.context,h=this.getAttributes(),m=this.getNumInstances();if(u){const{weights:e}=this.state;n.run({weights:e,cellSize:[r.xOffset,r.yOffset],numCol:c,numRow:d,translation:o,scaling:i,vertexCount:m,projectPoints:l,attributes:h,moduleSettings:this.getModuleSettings()})}else{const e=t(f,{gridOffset:r,projectPoints:l,attributes:h,viewport:p,posOffset:a,boundingBox:s});this.setState({layerData:e})}}_updateWeightBins(){const{getValue:e}=this.state,t=new pe(this.state.layerData.data||[],{getValue:e});this.setState({sortedBins:t})}_uploadAggregationResults(){const{numCol:e,numRow:t}=this.state,{data:n}=this.state.layerData,{aggregatedBins:r,minValue:a,maxValue:o,totalCount:i}=this.state.sortedBins,s=new Float32Array(e*t*4).fill(0);for(const t of r){const{lonIdx:r,latIdx:a}=n[t.i],{value:o,counts:i}=t,l=4*(r+a*e);s[l]=o,s[l+4-1]=i}const l=new Float32Array([o,0,0,a]),u=new Float32Array([o,0,0,i]),c=new Float32Array([a,0,0,i]);this.updateResults({aggregationData:s,maxMinData:l,maxData:u,minData:c})}}Ee.layerName="GridAggregationLayer";const xe={...G.defaultProps,getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"},Me={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class we extends Ee{initializeState(){const{gl:e}=this.context;if(!G.isSupported(e))return this.setState({supported:!1}),void r.a.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();super.initializeState({dimensions:Me,getCellSize:e=>e.cellSizePixels});const t={count:{size:1,operation:p.SUM,needMax:!0,maxTexture:C(e,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:t,subLayerData:{attributes:{}},maxTexture:t.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]});this.getAttributeManager().add({positions:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}shouldUpdateState({changeFlags:e}){return this.state.supported&&e.somethingChanged}updateState(e){super.updateState(e)}renderLayers(){if(!this.state.supported)return[];const{maxTexture:e,numRow:t,numCol:n,weights:r}=this.state,{updateTriggers:a}=this.props,{aggregationBuffer:o}=r.count;return new(this.getSubLayerClass("cells",G))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:a}),{data:{attributes:{instanceCounts:o}},maxTexture:e,numInstances:t*n})}finalizeState(){super.finalizeState();const{aggregationBuffer:e,maxBuffer:t,maxTexture:n}=this.state;null==e||e.delete(),null==t||t.delete(),null==n||n.delete()}getPickingInfo({info:e,mode:t}){const{index:n}=e;if(n>=0){const{gpuGridAggregator:t,gpuAggregation:r,weights:a}=this.state,o=r?t.getData("count"):a.count;e.object=k.getAggregationData({pixelIndex:n,...o})}return e}updateResults({aggregationData:e,maxData:t}){const{count:n}=this.state.weights;n.aggregationData=e,n.aggregationBuffer.setData({data:e}),n.maxData=t,n.maxTexture.setImageData({data:t})}updateAggregationState(e){const t=e.props.cellSizePixels,n=e.oldProps.cellSizePixels!==t,{viewportChanged:a}=e.changeFlags;let o=e.props.gpuAggregation;this.state.gpuAggregation!==e.props.gpuAggregation&&o&&!k.isSupported(this.context.gl)&&(r.a.warn("GPU Grid Aggregation not supported, falling back to CPU")(),o=!1);const i=o!==this.state.gpuAggregation;this.setState({gpuAggregation:o});const s=this.isAttributeChanged("positions"),{dimensions:l}=this.state,{data:u,weights:c}=l,d=s||i||a||this.isAggregationDirty(e,{compareAll:o,dimension:u}),f=this.isAggregationDirty(e,{dimension:c});this.setState({aggregationDataDirty:d,aggregationWeightsDirty:f});const{viewport:p}=this.context;if(a||n){const{width:e,height:n}=p,r=Math.ceil(e/t),a=Math.ceil(n/t);this.allocateResources(a,r),this.setState({scaling:[e/2,-n/2,1],gridOffset:{xOffset:t,yOffset:t},width:e,height:n,numCol:r,numRow:a})}f&&this._updateAccessors(e),(d||f)&&this._resetResults()}_updateAccessors(e){const{getWeight:t,aggregation:n,data:r}=e.props,{count:a}=this.state.weights;a&&(a.getWeight=t,a.operation=p[n]),this.setState({getValue:y(n,t,{data:r})})}_resetResults(){const{count:e}=this.state.weights;e&&(e.aggregationData=null)}}we.layerName="ScreenGridLayer",we.defaultProps=xe;var Oe=n(828);function Se(){}const Te=["getBins","getDomain","getScaleFunc"],Ce=[{key:"fillColor",accessor:"getFillColor",pickingInfo:"colorValue",getBins:{triggers:{value:{prop:"getColorValue",updateTrigger:"getColorValue"},weight:{prop:"getColorWeight",updateTrigger:"getColorWeight"},aggregation:{prop:"colorAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"lowerPercentile"},upperPercentile:{prop:"upperPercentile"},scaleType:{prop:"colorScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"colorDomain"},range:{prop:"colorRange"}},onSet:{props:"onSetColorDomain"}},nullValue:[0,0,0,0]},{key:"elevation",accessor:"getElevation",pickingInfo:"elevationValue",getBins:{triggers:{value:{prop:"getElevationValue",updateTrigger:"getElevationValue"},weight:{prop:"getElevationWeight",updateTrigger:"getElevationWeight"},aggregation:{prop:"elevationAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"elevationLowerPercentile"},upperPercentile:{prop:"elevationUpperPercentile"},scaleType:{prop:"elevationScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"elevationDomain"},range:{prop:"elevationRange"}},onSet:{props:"onSetElevationDomain"}},nullValue:-1}],Le=e=>e.cellSize;class Pe{constructor(e){this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=e.getCellSize||Le,this._getAggregator=e.getAggregator,this._addDimension(e.dimensions||Ce)}static defaultDimensions(){return Ce}updateState(e,t){const{oldProps:n,props:r,changeFlags:a}=e;this.updateGetValueFuncs(n,r,a);const o=this.needsReProjectPoints(n,r,a);let i=!1;if(a.dataChanged||o)this.getAggregatedData(r,t),i=!0;else{(this.getDimensionChanges(n,r,a)||[]).forEach(e=>"function"==typeof e&&e()),i=!0}return this.setState({aggregationDirty:i}),this.state}setState(e){this.state={...this.state,...e}}setDimensionState(e,t){this.setState({dimensions:{...this.state.dimensions,[e]:{...this.state.dimensions[e],...t}}})}normalizeResult(e={}){return e.hexagons?{data:e.hexagons,...e}:e.layerData?{data:e.layerData,...e}:e}getAggregatedData(e,t){const n=this._getAggregator(e)(e,t);this.setState({layerData:this.normalizeResult(n)}),this.changeFlags={layerData:!0},this.getSortedBins(e)}updateGetValueFuncs(e,t,n){for(const r in this.dimensionUpdaters){const{value:a,weight:o,aggregation:i}=this.dimensionUpdaters[r].getBins.triggers;let s=t[a.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[r].getBins,e,t,n)&&(s=s?v(s,{data:t.data}):y(t[i.prop],t[o.prop],{data:t.data})),s&&this.setDimensionState(r,{getValue:s})}}needsReProjectPoints(e,t,n){return this._getCellSize(e)!==this._getCellSize(t)||this._getAggregator(e)!==this._getAggregator(t)||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPosition)}addDimension(e){this._addDimension(e)}_addDimension(e=[]){e.forEach(e=>{const{key:t}=e;this.dimensionUpdaters[t]=this.getDimensionUpdaters(e),this.state.dimensions[t]={getValue:null,domain:null,sortedBins:null,scaleFunc:Se}})}getDimensionUpdaters({key:e,accessor:t,pickingInfo:n,getBins:r,getDomain:a,getScaleFunc:o,nullValue:i}){return{key:e,accessor:t,pickingInfo:n,getBins:{updater:this.getDimensionSortedBins,...r},getDomain:{updater:this.getDimensionValueDomain,...a},getScaleFunc:{updater:this.getDimensionScale,...o},attributeAccessor:this.getSubLayerDimensionAttribute(e,i)}}needUpdateDimensionStep(e,t,n,r){return Object.values(e.triggers).some(e=>e.updateTrigger?r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged[e.updateTrigger]):t[e.prop]!==n[e.prop])}getDimensionChanges(e,t,n){const r=[];for(const a in this.dimensionUpdaters){const o=Te.find(r=>this.needUpdateDimensionStep(this.dimensionUpdaters[a][r],e,t,n));o&&r.push(this.dimensionUpdaters[a][o].updater.bind(this,t,this.dimensionUpdaters[a]))}return r.length?r:null}getUpdateTriggers(e){const t=e.updateTriggers||{},n={};for(const r in this.dimensionUpdaters){const{accessor:a}=this.dimensionUpdaters[r];n[a]={},Te.forEach(o=>{Object.values(this.dimensionUpdaters[r][o].triggers).forEach(({prop:r,updateTrigger:o})=>{if(o){const e=t[o];"object"!=typeof e||Array.isArray(e)?void 0!==e&&(n[a][r]=e):Object.assign(n[a],e)}else n[a][r]=e[r]})})}return n}getSortedBins(e){for(const t in this.dimensionUpdaters)this.getDimensionSortedBins(e,this.dimensionUpdaters[t])}getDimensionSortedBins(e,t){const{key:n}=t,{getValue:r}=this.state.dimensions[n],a=new pe(this.state.layerData.data||[],{getValue:r,filterData:e._filterData});this.setDimensionState(n,{sortedBins:a}),this.getDimensionValueDomain(e,t)}getDimensionValueDomain(e,t){const{getDomain:n,key:r}=t,{triggers:{lowerPercentile:a,upperPercentile:o,scaleType:i}}=n,s=this.state.dimensions[r].sortedBins.getValueDomainByScale(e[i.prop],[e[a.prop],e[o.prop]]);this.setDimensionState(r,{valueDomain:s}),this.getDimensionScale(e,t)}getDimensionScale(e,t){const{key:n,getScaleFunc:r,getDomain:a}=t,{domain:o,range:i}=r.triggers,{scaleType:s}=a.triggers,{onSet:l}=r,u=e[i.prop],c=e[o.prop]||this.state.dimensions[n].valueDomain,d=function(e){switch(e){case"quantize":return Q;case"linear":return $;case"quantile":return ee;case"ordinal":return re;default:return Q}}(s&&e[s.prop])(c,u);"object"==typeof l&&"function"==typeof e[l.props]&&e[l.props](d.domain()),this.setDimensionState(n,{scaleFunc:d})}getSubLayerDimensionAttribute(e,t){return n=>{const{sortedBins:r,scaleFunc:a}=this.state.dimensions[e],o=r.binMap[n.index];if(o&&0===o.counts)return t;const i=o&&o.value,s=a.domain();return i>=s[0]&&i<=s[s.length-1]?a(i):t}}getSubLayerAccessors(e){const t={};for(const n in this.dimensionUpdaters){const{accessor:r}=this.dimensionUpdaters[n];t[r]=this.getSubLayerDimensionAttribute(e,n)}return t}getPickingInfo({info:e}){let t=null;if(e.picked&&e.index>-1){const n=this.state.layerData.data[e.index],r={};for(const e in this.dimensionUpdaters){const{pickingInfo:t}=this.dimensionUpdaters[e],{sortedBins:a}=this.state.dimensions[e],o=a.binMap[n.index]&&a.binMap[n.index].value;r[t]=o}t=Object.assign(r,n,{points:n.filteredPoints||n.points})}return e.picked=Boolean(t),e.object=t,e}getAccessor(e){return this.dimensionUpdaters.hasOwnProperty(e)?this.dimensionUpdaters[e].attributeAccessor:Se}}function Re(){}const De={colorDomain:null,colorRange:B,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},colorScaleType:"quantize",onSetColorDomain:Re,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Re,gridAggregator:_e,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:e=>e.position},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}};class ke extends K{initializeState(){const e=new Pe({getAggregator:e=>e.gridAggregator,getCellSize:e=>e.cellSize});this.state={cpuAggregator:e,aggregatorState:e.state};this.getAttributeManager().add({positions:{size:3,accessor:"getPosition"}})}updateState(e){super.updateState(e),this.setState({aggregatorState:this.state.cpuAggregator.updateState(e,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances(e.props)})})}getPickingInfo({info:e}){return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(e){return this.state.cpuAggregator.getAccessor("fillColor")(e)}_onGetSublayerElevation(e){return this.state.cpuAggregator.getAccessor("elevation")(e)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:e,extruded:t,cellSize:n,coverage:r,material:a,transitions:o}=this.props,{cpuAggregator:i}=this.state,s=this.getSubLayerClass("grid-cell",Oe.a),l=this._getSublayerUpdateTriggers();return new s({cellSize:n,coverage:r,material:a,elevationScale:e,extruded:t,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:l}),{data:i.state.layerData.data})}}ke.layerName="CPUGridLayer",ke.defaultProps=De;var Ie=n(439),Fe=n(462);function je(){}const Be={colorDomain:null,colorRange:B,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",value:0,min:0,max:100},upperPercentile:{type:"number",value:100,min:0,max:100},colorScaleType:"quantize",onSetColorDomain:je,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",value:0,min:0,max:100},elevationUpperPercentile:{type:"number",value:100,min:0,max:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:je,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:function(e,t){const{data:n,radius:a}=e,{viewport:o,attributes:i}=t,s=n.length?function(e,t){const{attributes:n}=t,r=n.positions.value,{size:a}=n.positions.getAccessor();let o,i=1/0,s=1/0,l=-1/0,u=-1/0;for(o=0;o<a*e.length;o+=a){const e=r[o],t=r[o+1];Number.isFinite(e)&&Number.isFinite(t)&&(i=Math.min(e,i),l=Math.max(e,l),s=Math.min(t,s),u=Math.max(t,u))}return[i,s,l,u].every(Number.isFinite)?[(i+l)/2,(s+u)/2]:null}(n,t):null,l=function(e,t,n){const{unitsPerMeter:r}=t.getDistanceScales(n);return e*r[0]}(a,o,s),u=[],{iterable:c,objectInfo:d}=Object(he.a)(n),f=i.positions.value,{size:p}=i.positions.getAccessor();for(const e of c){d.index++;const t=d.index*p,n=[f[t],f[t+1]];Number.isFinite(n[0])&&Number.isFinite(n[1])?u.push({screenCoord:o.projectFlat(n),source:e,index:d.index}):r.a.warn("HexagonLayer: invalid position")()}return{hexagons:Object(Fe.a)().radius(l).x(e=>e.screenCoord[0]).y(e=>e.screenCoord[1])(u).map((e,t)=>({position:o.unprojectFlat([e.x,e.y]),points:e,index:t})),radiusCommon:l}},getPosition:{type:"accessor",value:e=>e.position},material:!0,_filterData:{type:"function",value:null,optional:!0}};class Ne extends K{initializeState(){const e=new Pe({getAggregator:e=>e.hexagonAggregator,getCellSize:e=>e.radius});this.state={cpuAggregator:e,aggregatorState:e.state,vertices:null};this.getAttributeManager().add({positions:{size:3,accessor:"getPosition"}})}updateState(e){if(super.updateState(e),e.changeFlags.propsOrDataChanged){const t=this.state.cpuAggregator.updateState(e,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==t.layerData){const{hexagonVertices:e}=t.layerData||{};this.setState({vertices:e&&this.convertLatLngToMeterOffset(e)})}this.setState({aggregatorState:t})}}convertLatLngToMeterOffset(e){const{viewport:t}=this.context;if(Array.isArray(e)&&6===e.length){const n=e[0],r=e[3],a=[(n[0]+r[0])/2,(n[1]+r[1])/2],o=t.projectFlat(a),{metersPerUnit:i}=t.getDistanceScales(a);return e.map(e=>{const n=t.projectFlat(e);return[(n[0]-o[0])*i[0],(n[1]-o[1])*i[1]]})}return r.a.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}getPickingInfo({info:e}){return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(e){return this.state.cpuAggregator.getAccessor("fillColor")(e)}_onGetSublayerElevation(e){return this.state.cpuAggregator.getAccessor("elevation")(e)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:e,extruded:t,coverage:n,material:r,transitions:a}=this.props,{aggregatorState:o,vertices:i}=this.state,s=this.getSubLayerClass("hexagon-cell",Ie.a),l=this._getSublayerUpdateTriggers();return new s({...i?{vertices:i,radius:1}:{radius:o.layerData.radiusCommon||1,radiusUnits:"common",angle:90},diskResolution:6,elevationScale:e,extruded:t,coverage:n,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:l}),{data:o.layerData.data})}}Ne.layerName="HexagonLayer",Ne.defaultProps=Be;var ze=n(1174),Ue=n(289);const He={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Ve=[He.W,He.SW,He.S],Ge=[He.S,He.SE,He.E],Ye=[He.E,He.NE,He.N],We=[He.NW,He.W,He.N],qe=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Xe=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Ke=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Ze=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],Je=[He.W,He.SW,He.SE,He.E],Qe=[He.S,He.SE,He.NE,He.N],$e=[He.NW,He.W,He.E,He.NE],et=[He.NW,He.SW,He.S,He.N],tt=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],nt=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],rt=[He.NW,He.SW,He.SE,He.NE],at=[He.NW,He.SW,He.SE,He.E,He.N],ot=[He.W,He.SW,He.SE,He.NE,He.N],it=[He.NW,He.W,He.S,He.SE,He.NE],st=[He.NW,He.SW,He.S,He.E,He.NE],lt=[He.NW,He.W,[.5,-1/6],[.5,1/6],He.N],ut=[[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],ct=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E],dt=[He.W,He.SW,He.S,[1/6,.5],[-1/6,.5]],ft=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.N],pt=[[-.5,1/6],[-.5,-1/6],He.E,He.NE,He.N],ht=[He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],mt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6]],gt=[He.W,He.SW,He.SE,He.E,[1/6,.5],[-1/6,.5]],yt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.NE,He.N],vt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.E,He.NE],At=[He.NW,He.SW,He.S,[.5,-1/6],[.5,1/6],He.N],bt=[He.W,He.SW,He.S,He.E,He.NE,He.N],_t=[He.NW,He.W,He.S,He.SE,He.E,He.N],Et=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],xt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Mt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],He.N],wt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],Ot=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],St={0:[],1:[[He.W,He.S]],2:[[He.S,He.E]],3:[[He.W,He.E]],4:[[He.N,He.E]],5:{0:[[He.W,He.S],[He.N,He.E]],1:[[He.W,He.N],[He.S,He.E]]},6:[[He.N,He.S]],7:[[He.W,He.N]],8:[[He.W,He.N]],9:[[He.N,He.S]],10:{0:[[He.W,He.N],[He.S,He.E]],1:[[He.W,He.S],[He.N,He.E]]},11:[[He.N,He.E]],12:[[He.W,He.E]],13:[[He.S,He.E]],14:[[He.W,He.S]],15:[]};function Tt(e){return parseInt(e,4)}const Ct={[Tt("0000")]:[],[Tt("2222")]:[],[Tt("2221")]:[Ve],[Tt("2212")]:[Ge],[Tt("2122")]:[Ye],[Tt("1222")]:[We],[Tt("0001")]:[Ve],[Tt("0010")]:[Ge],[Tt("0100")]:[Ye],[Tt("1000")]:[We],[Tt("2220")]:[qe],[Tt("2202")]:[Xe],[Tt("2022")]:[Ke],[Tt("0222")]:[Ze],[Tt("0002")]:[qe],[Tt("0020")]:[Xe],[Tt("0200")]:[Ke],[Tt("2000")]:[Ze],[Tt("0011")]:[Je],[Tt("0110")]:[Qe],[Tt("1100")]:[$e],[Tt("1001")]:[et],[Tt("2211")]:[Je],[Tt("2112")]:[Qe],[Tt("1122")]:[$e],[Tt("1221")]:[et],[Tt("2200")]:[tt],[Tt("2002")]:[nt],[Tt("0022")]:[tt],[Tt("0220")]:[nt],[Tt("1111")]:[rt],[Tt("1211")]:[at],[Tt("2111")]:[ot],[Tt("1112")]:[it],[Tt("1121")]:[st],[Tt("1011")]:[at],[Tt("0111")]:[ot],[Tt("1110")]:[it],[Tt("1101")]:[st],[Tt("1200")]:[lt],[Tt("0120")]:[ut],[Tt("0012")]:[ct],[Tt("2001")]:[dt],[Tt("1022")]:[lt],[Tt("2102")]:[ut],[Tt("2210")]:[ct],[Tt("0221")]:[dt],[Tt("1002")]:[ft],[Tt("2100")]:[pt],[Tt("0210")]:[ht],[Tt("0021")]:[mt],[Tt("1220")]:[ft],[Tt("0122")]:[pt],[Tt("2012")]:[ht],[Tt("2201")]:[mt],[Tt("0211")]:[gt],[Tt("2110")]:[yt],[Tt("1102")]:[vt],[Tt("1021")]:[At],[Tt("2011")]:[gt],[Tt("0112")]:[yt],[Tt("1120")]:[vt],[Tt("1201")]:[At],[Tt("2101")]:[bt],[Tt("0121")]:[bt],[Tt("1012")]:[_t],[Tt("1210")]:[_t],[Tt("0101")]:{0:[Ve,Ye],1:[bt],2:[bt]},[Tt("1010")]:{0:[We,Ge],1:[_t],2:[_t]},[Tt("2121")]:{0:[bt],1:[bt],2:[Ve,Ye]},[Tt("1212")]:{0:[_t],1:[_t],2:[We,Ge]},[Tt("2120")]:{0:[Et],1:[Et],2:[qe,Ye]},[Tt("2021")]:{0:[xt],1:[xt],2:[Ve,Ke]},[Tt("1202")]:{0:[Mt],1:[Mt],2:[We,Xe]},[Tt("0212")]:{0:[wt],1:[wt],2:[Ge,Ze]},[Tt("0102")]:{0:[qe,Ye],1:[Et],2:[Et]},[Tt("0201")]:{0:[Ve,Ke],1:[xt],2:[xt]},[Tt("1020")]:{0:[We,Xe],1:[Mt],2:[Mt]},[Tt("2010")]:{0:[Ge,Ze],1:[wt],2:[wt]},[Tt("2020")]:{0:[Ze,Xe],1:[Ot],2:[qe,Ke]},[Tt("0202")]:{0:[Ke,qe],1:[Ot],2:[Ze,Xe]}},Lt={ISO_LINES:1,ISO_BANDS:2},Pt={zIndex:0,zOffset:.005};function Rt(e,t){return Array.isArray(t)?e<t[0]?0:e<t[1]?1:2:e>=t?1:0}function Dt(e){const{cellWeights:t,x:n,y:a,width:o,height:i}=e;let s=e.threshold;e.thresholdValue&&(r.a.deprecated("thresholdValue","threshold")(),s=e.thresholdValue);const l=n<0,u=n>=o-1,c=a<0,d=a>=i-1,f=l||u||c||d,p={},h={};l||d?h.top=0:(p.top=t[(a+1)*o+n],h.top=Rt(p.top,s)),u||d?h.topRight=0:(p.topRight=t[(a+1)*o+n+1],h.topRight=Rt(p.topRight,s)),u||c?h.right=0:(p.right=t[a*o+n+1],h.right=Rt(p.right,s)),l||c?h.current=0:(p.current=t[a*o+n],h.current=Rt(p.current,s));const{top:m,topRight:g,right:y,current:v}=h;let A=-1;Number.isFinite(s)&&(A=m<<3|g<<2|y<<1|v),Array.isArray(s)&&(A=m<<6|g<<4|y<<2|v);let b=0;return f||(b=Rt((p.top+p.topRight+p.right+p.current)/4,s)),{code:A,meanCode:b}}function kt(e){const{gridOrigin:t,cellSize:n,x:r,y:a,code:o,meanCode:i,type:s=Lt.ISO_LINES}=e,l={...Pt,...e.thresholdData};let u=s===Lt.ISO_BANDS?Ct[o]:St[o];Array.isArray(u)||(u=u[i]);const c=l.zIndex*l.zOffset,d=(r+1)*n[0],f=(a+1)*n[1],p=t[0]+d,h=t[1]+f;if(s===Lt.ISO_BANDS){const e=[];return u.forEach(t=>{const r=[];t.forEach(e=>{const t=p+e[0]*n[0],a=h+e[1]*n[1];r.push([t,a,c])}),e.push(r)}),e}const m=[];return u.forEach(e=>{e.forEach(e=>{const t=p+e[0]*n[0],r=h+e[1]*n[1];m.push([t,r,c])})}),m}const It=[255,255,255,255],Ft={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM",contours:[{threshold:1}],zOffset:.005},jt={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class Bt extends Ee{initializeState(){super.initializeState({dimensions:jt}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:p.SUM}}});this.getAttributeManager().add({positions:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}updateState(e){super.updateState(e);let t=!1;const{oldProps:n,props:r}=e,{aggregationDirty:a}=this.state;n.contours===r.contours&&n.zOffset===r.zOffset||(t=!0,this._updateThresholdData(e.props)),this.getNumInstances()>0&&(a||t)&&this._generateContours()}renderLayers(){const{contourSegments:e,contourPolygons:t}=this.state.contourData,n=this.getSubLayerClass("lines",ze.a),r=this.getSubLayerClass("bands",Ue.a);return[e&&e.length>0&&new n(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:e=>e.start,getTargetPosition:e=>e.end,getColor:e=>e.contour.color||It,getWidth:e=>e.contour.strokeWidth||1}),t&&t.length>0&&new r(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:e=>e.vertices,getFillColor:e=>e.contour.color||It})]}updateAggregationState(e){const{props:t,oldProps:n}=e,{cellSize:a,coordinateSystem:o}=t,{viewport:i}=this.context,s=n.cellSize!==a;let l=t.gpuAggregation;this.state.gpuAggregation!==t.gpuAggregation&&l&&!k.isSupported(this.context.gl)&&(r.a.warn("GPU Grid Aggregation not supported, falling back to CPU")(),l=!1);const u=l!==this.state.gpuAggregation;this.setState({gpuAggregation:l});const{dimensions:c}=this.state,d=this.isAttributeChanged("positions"),{data:f,weights:p}=c;let{boundingBox:h}=this.state;if(d&&(h=ye(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:h})),d||s){const{gridOffset:e,translation:t,width:n,height:r,numCol:s,numRow:l}=be(h,a,i,o);this.allocateResources(l,s),this.setState({gridOffset:e,boundingBox:h,translation:t,posOffset:t.slice(),gridOrigin:[-1*t[0],-1*t[1]],width:n,height:r,numCol:s,numRow:l})}const m=d||u||this.isAggregationDirty(e,{dimension:f,compareAll:l}),g=this.isAggregationDirty(e,{dimension:p});g&&this._updateAccessors(e),(m||g)&&this._resetResults(),this.setState({aggregationDataDirty:m,aggregationWeightsDirty:g})}_updateAccessors(e){const{getWeight:t,aggregation:n,data:r}=e.props,{count:a}=this.state.weights;a&&(a.getWeight=t,a.operation=p[n]),this.setState({getValue:y(n,t,{data:r})})}_resetResults(){const{count:e}=this.state.weights;e&&(e.aggregationData=null)}_generateContours(){const{numCol:e,numRow:t,gridOrigin:n,gridOffset:r,thresholdData:a}=this.state,{count:o}=this.state.weights;let{aggregationData:i}=o;i||(i=o.aggregationBuffer.getData(),o.aggregationData=i);const{cellWeights:s}=k.getCellData({countsData:i}),l=function({thresholdData:e,colors:t,cellWeights:n,gridSize:r,gridOrigin:a,cellSize:o}){const i=[],s=[],l=r[0],u=r[1];let c=0,d=0;for(const t of e){const{contour:e}=t,{threshold:r}=e;for(let f=-1;f<l;f++)for(let p=-1;p<u;p++){const{code:h,meanCode:m}=Dt({cellWeights:n,threshold:r,x:f,y:p,width:l,height:u}),g={gridOrigin:a,cellSize:o,x:f,y:p,width:l,height:u,code:h,meanCode:m,thresholdData:t};if(Array.isArray(r)){g.type=Lt.ISO_BANDS;const t=kt(g);for(const n of t)s[d++]={vertices:n,contour:e}}else{g.type=Lt.ISO_LINES;const t=kt(g);for(let n=0;n<t.length;n+=2)i[c++]={start:t[n],end:t[n+1],contour:e}}}}return{contourSegments:i,contourPolygons:s}}({thresholdData:a,cellWeights:s,gridSize:[e,t],gridOrigin:n,cellSize:[r.xOffset,r.yOffset]});this.setState({contourData:l})}_updateThresholdData(e){const{contours:t,zOffset:n}=e,r=t.length,a=new Array(r);for(let e=0;e<r;e++){const r=t[e];a[e]={contour:r,zIndex:r.zIndex||e,zOffset:n}}this.setState({thresholdData:a})}}Bt.layerName="ContourLayer",Bt.defaultProps=Ft;var Nt=n(1179),zt=n(89),Ut=n(1873);const Ht={colorDomain:null,colorRange:B,elevationDomain:null,elevationRange:[0,1e3],elevationScale:{type:"number",min:0,value:1},gridSize:{type:"array",min:0,value:[1,1]},gridOrigin:{type:"array",min:0,value:[0,0]},gridOffset:{type:"array",min:0,value:[0,0]},cellSize:{type:"number",min:0,max:1e3,value:1e3},offset:{type:"array",min:0,value:[1,1]},coverage:{type:"number",min:0,max:1,value:1},extruded:!0,material:!0};class Vt extends F.a{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n geometry.worldPosition = centroidPosition;\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:[f.a,Nt.a,j.a,c.b]})}initializeState(){const{gl:e}=this.context;this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});const t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new Ut.a,isInstanced:!0})}draw({uniforms:e}){const{cellSize:t,offset:n,extruded:r,elevationScale:a,coverage:o,gridSize:i,gridOrigin:s,gridOffset:l,elevationRange:u,colorMaxMinBuffer:c,elevationMaxMinBuffer:d}=this.props,f=[Object(zt.b)(s[0]),Object(zt.b)(s[1])],p=[Object(zt.b)(l[0]),Object(zt.b)(l[1])],h=this.getDomainUniforms(),m=N(this.props.colorRange);this.bindUniformBuffers(c,d),this.state.model.setUniforms(e).setUniforms(h).setUniforms({cellSize:t,offset:n,extruded:r,elevationScale:a,coverage:o,gridSize:i,gridOrigin:s,gridOriginLow:f,gridOffset:l,gridOffsetLow:p,colorRange:m,elevationRange:u}).draw(),this.unbindUniformBuffers(c,d)}bindUniformBuffers(e,t){e.bind({target:35345,index:0}),t.bind({target:35345,index:1})}unbindUniformBuffers(e,t){e.unbind({target:35345,index:0}),t.unbind({target:35345,index:1})}getDomainUniforms(){const{colorDomain:e,elevationDomain:t}=this.props,n={};return null!==e?(n.colorDomainValid=!0,n.colorDomain=e):n.colorDomainValid=!1,null!==t?(n.elevationDomainValid=!0,n.elevationDomain=t):n.elevationDomainValid=!1,n}_setupUniformBuffer(e){const t=this.context.gl,n=e.program.handle,r=t.getUniformBlockIndex(n,"ColorData"),a=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,r,0),t.uniformBlockBinding(n,a,1)}}Vt.layerName="GPUGridCellLayer",Vt.defaultProps=Ht;const Gt={colorDomain:null,colorRange:B,getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:1,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:e=>e.position},extruded:!1,material:!0},Yt={data:{props:["cellSize","colorAggregation","elevationAggregation"]}};class Wt extends Ee{initializeState(){const{gl:e}=this.context,t=k.isSupported(e);t||r.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),super.initializeState({dimensions:Yt}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:t,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Z.a(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Z.a(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"});this.getAttributeManager().add({positions:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},color:{size:3,accessor:"getColorWeight"},elevation:{size:3,accessor:"getElevationWeight"}})}updateState(e){if(!1===this.state.isSupported)return;super.updateState(e);const{aggregationDirty:t}=this.state;t&&this.setState({gridHash:null})}getHashKeyForIndex(e){const{numRow:t,numCol:n,boundingBox:r,gridOffset:a}=this.state,o=[n,t],i=[r.xMin,r.yMin],s=[a.xOffset,a.yOffset],l=Math.floor(e/o[0]),u=e-l*o[0],c=Math.floor((l*s[1]+i[1]+90+s[1]/2)/s[1]),d=Math.floor((u*s[0]+i[0]+180+s[0]/2)/s[0]);return"".concat(c,"-").concat(d)}getPositionForIndex(e){const{numRow:t,numCol:n,boundingBox:r,gridOffset:a}=this.state,o=[n,t],i=[r.xMin,r.yMin],s=[a.xOffset,a.yOffset],l=Math.floor(e/o[0]);return[(e-l*o[0])*s[0]+i[0],l*s[1]+i[1]]}getPickingInfo({info:e,mode:t}){const{index:n}=e;let r=null;if(n>=0){const{gpuGridAggregator:e}=this.state,a=this.getPositionForIndex(n),o=k.getAggregationData({pixelIndex:n,...e.getData("color")}),i=k.getAggregationData({pixelIndex:n,...e.getData("elevation")});if(r={colorValue:o.cellWeight,elevationValue:i.cellWeight,count:o.cellCount||i.cellCount,position:a,totalCount:o.totalCount||i.totalCount},"hover"!==t){const{props:e}=this;let{gridHash:t}=this.state;if(!t){const{gridOffset:n,translation:r,boundingBox:a}=this.state,{viewport:o}=this.context;t=_e(e,{gridOffset:n,attributes:this.getAttributes(),viewport:o,translation:r,boundingBox:a}).gridHash,this.setState({gridHash:t})}const a=t[this.getHashKeyForIndex(n)];Object.assign(r,a)}}return e.picked=Boolean(r),e.object=r,e}renderLayers(){if(!this.state.isSupported)return null;const{elevationScale:e,extruded:t,cellSize:n,coverage:r,material:a,elevationRange:o,colorDomain:i,elevationDomain:s}=this.props,{weights:l,numRow:u,numCol:c,gridOrigin:d,gridOffset:f}=this.state,{color:p,elevation:h}=l,m=N(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",Vt))({gridSize:[c,u],gridOrigin:d,gridOffset:[f.xOffset,f.yOffset],colorRange:m,elevationRange:o,colorDomain:i,elevationDomain:s,cellSize:n,coverage:r,material:a,elevationScale:e,extruded:t},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:p.aggregationBuffer,elevations:h.aggregationBuffer}},colorMaxMinBuffer:p.maxMinBuffer,elevationMaxMinBuffer:h.maxMinBuffer,numInstances:c*u})}finalizeState(){const{color:e,elevation:t}=this.state.weights;[e,t].forEach(e=>{const{aggregationBuffer:t,maxMinBuffer:n}=e;n.delete(),null==t||t.delete()}),super.finalizeState()}updateAggregationState(e){const{props:t,oldProps:n}=e,{cellSize:r,coordinateSystem:a}=t,{viewport:o}=this.context,i=n.cellSize!==r,{dimensions:s}=this.state,l=this.isAttributeChanged("positions"),u=l||this.isAttributeChanged();let{boundingBox:c}=this.state;if(l&&(c=ye(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:c})),l||i){const{gridOffset:e,translation:t,width:n,height:i,numCol:s,numRow:l}=be(c,r,o,a);this.allocateResources(l,s),this.setState({gridOffset:e,translation:t,gridOrigin:[-1*t[0],-1*t[1]],width:n,height:i,numCol:s,numRow:l})}const d=u||this.isAggregationDirty(e,{dimension:s.data,compareAll:!0});d&&this._updateAccessors(e),this.setState({aggregationDataDirty:d})}_updateAccessors(e){const{colorAggregation:t,elevationAggregation:n}=e.props,{color:r,elevation:a}=this.state.weights;r.operation=p[t],a.operation=p[n]}}Wt.layerName="GPUGridLayer",Wt.defaultProps=Gt;const qt={...Wt.defaultProps,...ke.defaultProps,gpuAggregation:!1};class Xt extends Y.a{initializeState(){this.state={useGPUAggregation:!0}}updateState({oldProps:e,props:t,changeFlags:n}){const r={};r.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(r)}renderLayers(){const{data:e,updateTriggers:t}=this.props,n=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",Wt):this.getSubLayerClass("CPU",ke))(this.props,this.getSubLayerProps({id:n,updateTriggers:t}),{data:e})}canUseGPUAggregation(e){const{gpuAggregation:t,lowerPercentile:n,upperPercentile:r,getColorValue:a,getElevationValue:o,colorScaleType:i}=e;return!!t&&(!!k.isSupported(this.context.gl)&&(0===n&&100===r&&(null===a&&null===o&&("quantile"!==i&&"ordinal"!==i))))}}Xt.layerName="GridLayer",Xt.defaultProps=qt;const Kt=new Float32Array(12);function Zt(e,t=2){let n=0;for(const r of e)for(let e=0;e<t;e++)Kt[n++]=r[e]||0;return Kt}class Jt extends F.a{getShaders(){return{vs:"#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\n\nattribute vec3 positions;\nattribute vec2 texCoords;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvoid main(void) {\n gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n vTexCoords = texCoords;\n vec4 maxTexture = texture2D(maxTexture, vec2(0.5));\n float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n float minValue = maxValue * threshold;\n if (colorDomain[1] > 0.) {\n maxValue = colorDomain[1];\n minValue = colorDomain[0];\n }\n vIntensityMax = intensity / maxValue;\n vIntensityMin = intensity / minValue;\n}\n",fs:"#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D texture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvec4 getLinearColor(float value) {\n float factor = clamp(value * vIntensityMax, 0., 1.);\n vec4 color = texture2D(colorTexture, vec2(factor, 0.5));\n color.a *= min(value * vIntensityMin, 1.0);\n return color;\n}\n\nvoid main(void) {\n vec4 weights = texture2D(texture, vTexCoords);\n float weight = weights.r;\n\n if (aggregationMode > 0.5) {\n weight /= max(1.0, weights.a);\n }\n if (weight <= 0.) {\n discard;\n }\n\n vec4 linearColor = getLinearColor(weight);\n linearColor.a *= opacity;\n gl_FragColor =linearColor;\n}\n",modules:[f.a]}}initializeState(){const{gl:e}=this.context;this.getAttributeManager().add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(e)})}_getModel(e){const{vertexCount:t}=this.props;return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new I.a({drawMode:6,vertexCount:t})})}draw({uniforms:e}){const{model:t}=this.state,{texture:n,maxTexture:r,colorTexture:a,intensity:o,threshold:i,aggregationMode:s,colorDomain:l}=this.props;t.setUniforms({...e,texture:n,maxTexture:r,colorTexture:a,intensity:o,threshold:i,aggregationMode:s,colorDomain:l}).draw()}}Jt.layerName="TriangleLayer";const Qt={mipmaps:!1,parameters:{10240:9729,10241:9729,10242:33071,10243:33071},dataFormat:6408},$t=[0,0],en={SUM:0,MEAN:1},tn={getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:B,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},nn=[a.a.BLEND_EQUATION_MINMAX,a.a.TEXTURE_FLOAT],rn={data:{props:["radiusPixels"]}};class an extends K{initializeState(){const{gl:e}=this.context;if(!Object(o.c)(e,nn))return this.setState({supported:!1}),void r.a.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();super.initializeState(rn),this.setState({supported:!0,colorDomain:$t}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState(e){this.state.supported&&(super.updateState(e),this._updateHeatmapState(e))}_updateHeatmapState(e){const{props:t,oldProps:n}=e,r=this._getChangeFlags(e);(r.dataChanged||r.viewportChanged)&&(r.boundsChanged=this._updateBounds(r.dataChanged),this._updateTextureRenderingBounds()),r.dataChanged||r.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):r.viewportZoomChanged&&this._debouncedUpdateWeightmap(),t.colorRange!==n.colorRange&&this._updateColorTexture(e),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:e.context.viewport.zoom})}renderLayers(){if(!this.state.supported)return[];const{weightsTexture:e,triPositionBuffer:t,triTexCoordBuffer:n,maxWeightsTexture:r,colorTexture:a,colorDomain:o}=this.state,{updateTriggers:i,intensity:s,threshold:l,aggregation:u}=this.props;return new(this.getSubLayerClass("triangle",Jt))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:i}),{coordinateSystem:me.a.DEFAULT,data:{attributes:{positions:t,texCoords:n}},vertexCount:4,maxTexture:r,colorTexture:a,aggregationMode:en[u]||0,texture:e,intensity:s,threshold:l,colorDomain:o})}finalizeState(){super.finalizeState();const{weightsTransform:e,weightsTexture:t,maxWeightTransform:n,maxWeightsTexture:r,triPositionBuffer:a,triTexCoordBuffer:o,colorTexture:i,updateTimer:s}=this.state;null==e||e.delete(),null==t||t.delete(),null==n||n.delete(),null==r||r.delete(),null==a||a.delete(),null==o||o.delete(),null==i||i.delete(),s&&clearTimeout(s)}_getAttributeManager(){return new q.a(this.context.gl,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(e){const t={},{dimensions:n}=this.state;t.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(e,{compareAll:!0,dimension:n.data}),t.viewportChanged=e.changeFlags.viewportChanged;const{zoom:r}=this.state;return e.context.viewport&&e.context.viewport.zoom===r||(t.viewportZoomChanged=!0),t}_createTextures(){const{gl:e}=this.context,{textureSize:t,format:n,type:r}=this.state;this.setState({weightsTexture:new O.a(e,{width:t,height:t,format:n,type:r,...Qt}),maxWeightsTexture:new O.a(e,{format:n,type:r,...Qt})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{gl:e}=this.context,{weightsTextureSize:t}=this.props,n=Math.min(t,Object(i.f)(e,3379)),s=Object(o.c)(e,a.a.COLOR_ATTACHMENT_RGBA32F),{format:l,type:u}=function({gl:e,floatTargetSupport:t}){return{format:Object(i.j)(e)?34836:6408,type:t?5126:5121}}({gl:e,floatTargetSupport:s}),c=s?1:1/255;this.setState({textureSize:n,format:l,type:u,weightsScale:c}),s||r.a.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}getShaders(e){return super.getShaders("max-weights-transform"===e?{vs:"attribute vec4 inTexture;\nvarying vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\ngl_PointSize = 1.0;\n}\n",_fs:"varying vec4 outTexture;\nvoid main() {\n gl_FragColor = outTexture;\n gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n"}:{vs:"attribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float weights;\nvarying vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n}\n",_fs:"varying vec4 weightsTexture;\nfloat gaussianKDE(float u){\n return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n if (dist > 0.5) {\n discard;\n }\n gl_FragColor = weightsTexture * gaussianKDE(2. * dist);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}_createWeightsTransform(e={}){var t;const{gl:n}=this.context;let{weightsTransform:r}=this.state;const{weightsTexture:a}=this.state;null===(t=r)||void 0===t||t.delete(),r=new u.a(n,{id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:a,_targetTextureVarying:"weightsTexture",...e}),this.setState({weightsTransform:r})}_setupResources(){const{gl:e}=this.context;this._createTextures();const{textureSize:t,weightsTexture:n,maxWeightsTexture:r}=this.state,a=this.getShaders("weights-transform");this._createWeightsTransform(a);const o=this.getShaders("max-weights-transform"),i=new u.a(e,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:r,_targetTextureVarying:"outTexture",...o,elementCount:t*t});this.setState({weightsTexture:n,maxWeightsTexture:r,maxWeightTransform:i,zoom:null,triPositionBuffer:new Z.a(e,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new Z.a(e,{byteLength:48,accessor:{size:2}})})}updateShaders(e){this._createWeightsTransform(e)}_updateMaxWeightValue(){const{maxWeightTransform:e}=this.state;e.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}_updateBounds(e=!1){const{viewport:t}=this.context,n=[t.unproject([0,0]),t.unproject([t.width,0]),t.unproject([t.width,t.height]),t.unproject([0,t.height])].map(e=>e.map(Math.fround)),r=function(e){const t=e.map(e=>e[0]),n=e.map(e=>e[1]),r=Math.min.apply(null,t),a=Math.max.apply(null,t);return[r,Math.min.apply(null,n),a,Math.max.apply(null,n)]}(n),a={visibleWorldBounds:r,viewportCorners:n};let o=!1;if(e||!this.state.worldBounds||(i=this.state.worldBounds,!((s=r)[0]>=i[0]&&s[2]<=i[2]&&s[1]>=i[1]&&s[3]<=i[3]))){const e=this._worldToCommonBounds(r),t=this._commonToWorldBounds(e);this.props.coordinateSystem===me.a.LNGLAT&&(t[1]=Math.max(t[1],-85.051129),t[3]=Math.min(t[3],85.051129),t[0]=Math.max(t[0],-360),t[2]=Math.min(t[2],360));const n=this._worldToCommonBounds(t);a.worldBounds=t,a.normalizedCommonBounds=n,o=!0}var i,s;return this.setState(a),o}_updateTextureRenderingBounds(){const{triPositionBuffer:e,triTexCoordBuffer:t,normalizedCommonBounds:n,viewportCorners:r}=this.state,{viewport:a}=this.context;e.subData(Zt(r,3));const o=r.map(e=>function(e,t){const[n,r,a,o]=t;return[(e[0]-n)/(a-n),(e[1]-r)/(o-r)]}(a.projectPosition(e),n));t.subData(Zt(o,2))}_updateColorTexture(e){const{colorRange:t}=e.props;let{colorTexture:n}=this.state;const r=N(t,!1,Uint8Array);n?n.setImageData({data:r,width:t.length}):n=new O.a(this.context.gl,{data:r,width:t.length,height:1,...Qt}),this.setState({colorTexture:n})}_updateWeightmap(){const{radiusPixels:e,colorDomain:t,aggregation:n}=this.props,{weightsTransform:r,worldBounds:a,textureSize:o,weightsTexture:i,weightsScale:s}=this.state;this.state.isWeightMapDirty=!1;const l=this._worldToCommonBounds(a,{useLayerCoordinateSystem:!0});if(t&&"SUM"===n){const{viewport:e}=this.context,n=e.distanceScales.metersPerUnit[2]*(l[2]-l[0])/o;this.state.colorDomain=t.map(e=>e*n*s)}else this.state.colorDomain=t||$t;const u={radiusPixels:e,commonBounds:l,textureWidth:o,weightsScale:s};r.update({elementCount:this.getNumInstances()}),r.run({uniforms:u,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:this.getAttributes(),moduleSettings:this.getModuleSettings()}),this._updateMaxWeightValue(),i.setParameters({10240:9729,10241:9729})}_debouncedUpdateWeightmap(e=!1){let{updateTimer:t}=this.state;const{debounceTimeout:n}=this.props;e?(t=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(t),t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:t})}_worldToCommonBounds(e,t={}){const{useLayerCoordinateSystem:n=!1}=t,[r,a,o,i]=e,{viewport:s}=this.context,{textureSize:l}=this.state,{coordinateSystem:u}=this.props,c=n&&(u===me.a.LNGLAT_OFFSETS||u===me.a.METER_OFFSETS),d=c?s.projectPosition(this.props.coordinateOrigin):[0,0],f=2*l/s.scale;let p,h;return n&&!c?(p=this.projectPosition([r,a,0]),h=this.projectPosition([o,i,0])):(p=s.projectPosition([r,a,0]),h=s.projectPosition([o,i,0])),function(e,t,n){const[r,a,o,i]=e,s=o-r,l=i-a;let u=s,c=l;s/l<t/n?u=t/n*l:c=n/t*s,u<t&&(u=t,c=n);const d=(o+r)/2,f=(i+a)/2;return[d-u/2,f-c/2,d+u/2,f+c/2]}([p[0]-d[0],p[1]-d[1],h[0]-d[0],h[1]-d[1]],f,f)}_commonToWorldBounds(e){const[t,n,r,a]=e,{viewport:o}=this.context,i=o.unprojectPosition([t,n]),s=o.unprojectPosition([r,a]);return i.slice(0,2).concat(s.slice(0,2))}}an.layerName="HeatmapLayer",an.defaultProps=tn},function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return d}));var r=n(154),a=n(163),o=n(90),i=n(79),s=n(342);function l(e,t){if(Object(o.a)(Object(i.d)(e),"setParameters requires a WebGL context"),Object(s.b)(t))return;const n={};for(const a in t){const o=Number(a),i=r.e[a];i&&("string"==typeof i?n[i]=!0:i(e,t[a],o))}const a=e.state&&e.state.cache;if(a)for(const o in n){(0,r.a[o])(e,t,a)}}function u(e,t){if("number"==typeof(t=t||r.c)){const n=t,a=r.d[n];return a?a(e,n):e.getParameter(n)}const n=Array.isArray(t)?t:Object.keys(t),a={};for(const t of n){const n=r.d[t];a[t]=n?n(e,Number(t)):e.getParameter(Number(t))}return a}function c(e){l(e,r.c)}function d(e,t,n){if(Object(s.b)(t))return n(e);const{nocatch:r=!0}=t;let o;if(Object(a.b)(e),l(e,t),r)o=n(e),Object(a.a)(e);else try{o=n(e)}finally{Object(a.a)(e)}return o}},function(e,t,n){"use strict";function r(e){this._context=e}r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},t.a=function(e){return new r(e)}},function(e,t,n){"use strict";function r(e){return function(t){return t.matches(e)}}n.d(t,"a",(function(){return r})),t.b=function(e){return function(){return this.matches(e)}}},function(e,t,n){"use strict";var r=n(287),a=n(211);function o(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===a.b&&t.documentElement.namespaceURI===a.b?t.createElement(e):t.createElementNS(n,e)}}function i(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}t.a=function(e){var t=Object(r.a)(e);return(t.local?i:o)(t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="3.1.6"},function(e,t,n){"use strict";n.d(t,"b",(function(){return r}));var r="http://www.w3.org/1999/xhtml";t.a={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(4),a=n(333);class o{constructor(e,t){Object(r.a)(this,"name",void 0),Object(r.a)(this,"type",void 0),Object(r.a)(this,"sampleSize",1),Object(r.a)(this,"time",void 0),Object(r.a)(this,"count",void 0),Object(r.a)(this,"samples",void 0),Object(r.a)(this,"lastTiming",void 0),Object(r.a)(this,"lastSampleTime",void 0),Object(r.a)(this,"lastSampleCount",void 0),Object(r.a)(this,"_count",0),Object(r.a)(this,"_time",0),Object(r.a)(this,"_samples",0),Object(r.a)(this,"_startTime",0),Object(r.a)(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Object(a.a)(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class i{constructor(e){Object(r.a)(this,"id",void 0),Object(r.a)(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:n}=e;return this.stats[t]||(this.stats[t]=e instanceof o?e:new o(t,n)),this.stats[t]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var r=n(103);function a(e,t,n=null){if(n)return n;const a={fetch:Object(r.a)(t,e),...e};return Array.isArray(a.loaders)||(a.loaders=null),a}function o(e,t){if(!t&&e&&!Array.isArray(e))return e;let n;if(e&&(n=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];n=n?[...n,...e]:e}return n&&n.length?n:null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e.default:e}t.__esModule=!0;var a=n(1404);t.Motion=r(a);var o=n(1406);t.StaggeredMotion=r(o);var i=n(1407);t.TransitionMotion=r(i);var s=n(1409);t.spring=r(s);var l=n(869);t.presets=r(l);var u=n(376);t.stripStyle=r(u);var c=n(1410);t.reorderKeys=r(c)},function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(85),a=n(453),o=n(47),i=n(146);class s extends a.a{get ELEMENTS(){return Object(i.a)(!1),0}get RANK(){return Object(i.a)(!1),0}toString(){let e="[";if(o.b.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=Object(r.a)(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}var l=n(301),u=n(14),c=n(35),d=n(19),f=n(48);const p=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),h=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),m=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),g={};class y extends s{static get IDENTITY(){return g.IDENTITY=g.IDENTITY||Object.freeze(new y(p)),g.IDENTITY}static get ZERO(){return g.ZERO=g.ZERO||Object.freeze(new y(h)),g.ZERO}get INDICES(){return m}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this[9]=u,this[10]=c,this[11]=d,this[12]=f,this[13]=p,this[14]=h,this[15]=m,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=a,this[2]=l,this[3]=f,this[4]=t,this[5]=o,this[6]=u,this[7]=p,this[8]=n,this[9]=i,this[10]=c,this[11]=h,this[12]=r,this[13]=s,this[14]=d,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(p)}fromQuaternion(e){return u.c(this,e),this.check()}frustum({left:e,right:t,bottom:n,top:r,near:a,far:o}){return o===1/0?y._computeInfinitePerspectiveOffCenter(this,e,t,n,r,a):u.d(this,e,t,n,r,a,o),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,n,r,a,o){const i=2*o/(n-t),s=2*o/(a-r),l=(n+t)/(n-t),u=(a+r)/(a-r),c=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=l,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}lookAt(e,t,n){return 1===arguments.length&&({eye:e,center:t,up:n}=e),t=t||[0,0,0],n=n||[0,1,0],u.g(this,e,t,n),this.check()}ortho({left:e,right:t,bottom:n,top:r,near:a=.1,far:o=500}){return u.i(this,e,t,n,r,a,o),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:n=1,near:r=.1,far:a=500}){if(e>2*Math.PI)throw Error("radians");const o=e/2,i=n*Math.tan(o),s=i*t;return(new y).ortho({left:-s,right:s,bottom:-i,top:i,near:r,far:a})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:a=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return u.j(this,e,n,r,a),this.check()}determinant(){return u.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*a,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*a,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*a,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*a,e[8]=this[10]*o,e}transpose(){return u.q(this,this),this.check()}invert(){return u.f(this,this),this.check()}multiplyLeft(e){return u.h(this,e,this),this.check()}multiplyRight(e){return u.h(this,this,e),this.check()}rotateX(e){return u.l(this,this,e),this.check()}rotateY(e){return u.m(this,this,e),this.check()}rotateZ(e){return u.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return u.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?u.o(this,this,e):u.o(this,this,[e,e,e]),this.check()}translate(e){return u.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(t=f.n(t||[-0,-0,-0,-0],e,this),Object(r.b)(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:n}=e;switch(n){case 2:t=c.j(t||[-0,-0],e,this);break;case 3:t=d.t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=Object(l.a)(t||[-0,-0],e,this);break;case 3:t=Object(l.c)(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return Object(r.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return Object(r.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return Object(r.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}},,function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CURRENT_VERSION=t.VERSIONS=void 0;var a=(0,r(n(137)).default)({v0:null,v1:null});t.VERSIONS=a;var o=a.v1;t.CURRENT_VERSION=o},function(e,t,n){"use strict";(function(e,r){n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));const a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"==typeof r&&r},o=(globalThis,a.window||a.self||a.global),i=a.process||{};console}).call(this,n(55),n(82))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var a,o,i,s=r(n(12)),l=n(11),u={palm:588,desk:768},c={palm:function(){return(0,l.css)(a||(a=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).palm}),l.css.apply(void 0,arguments))},portable:function(){return(0,l.css)(o||(o=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk}),l.css.apply(void 0,arguments))},desk:function(){return(0,l.css)(i||(i=(0,s.default)(["\n @media (min-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk+1}),l.css.apply(void 0,arguments))}};t.media=c},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=R;var o,i,s,l=r(n(5)),u=r(n(7)),c=r(n(13)),d=r(n(9)),f=r(n(10)),p=r(n(8)),h=r(n(3)),m=r(n(12)),g=a(n(0)),y=n(94),v=n(54),A=r(n(1)),b=r(n(11)),_=r(n(865)),E=r(n(513)),x=n(28),M=n(61),w=n(514);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,h.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var a=(0,p.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,f.default)(this,n)}}var C=(0,b.default)(x.Input)(o||(o=(0,m.default)(["\n width: ","px;\n margin-left: ","px;\n font-size: ","; // 10px // 12px;\n padding: ","; // 4px 6px; // 6px 12px;\n"])),(function(e){return e.theme.sliderInputWidth}),(function(e){return e.flush?0:"tiny"===e.size?12:18}),(function(e){return e.theme.sliderInputFontSize}),(function(e){return e.theme.sliderInputPadding})),L=b.default.div(i||(i=(0,m.default)(["\n display: flex;\n position: relative;\n align-items: ",";\n"])),(function(e){return!e.isRanged&&e.showInput?"center":"flex-start"})),P=b.default.div(s||(s=(0,m.default)(["\n margin-top: 12px;\n display: flex;\n justify-content: space-between;\n"])));function R(e){var t=function(t){(0,d.default)(r,t);var n=T(r);function r(){var e;(0,l.default)(this,r);for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return e=n.call.apply(n,[this].concat(a)),(0,h.default)((0,c.default)(e),"state",{value0:0,value1:1,prevValue0:0,prevValue1:1,width:288}),(0,h.default)((0,c.default)(e),"sliderContainer",null),(0,h.default)((0,c.default)(e),"setSliderContainer",(function(t){e.sliderContainer=t,e._resize()})),(0,h.default)((0,c.default)(e),"inputValue0",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"inputValue1",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"value0Selector",(function(e){return e.value0})),(0,h.default)((0,c.default)(e),"value1Selector",(function(e){return e.value1})),(0,h.default)((0,c.default)(e),"filterValueSelector",(0,v.createSelector)(e.value0Selector,e.value1Selector,(function(e,t){return[e,t]}))),(0,h.default)((0,c.default)(e),"_roundValToStep",(function(t){var n=e.props,r=n.range,a=n.step;return(0,M.roundValToStep)(r[0],a,t)})),(0,h.default)((0,c.default)(e),"_setRangeVal1",(function(t){var n=e.props,r=n.value0,a=n.range,o=n.onChange,i=Number(t);return o([r,(0,M.clamp)([r,a[1]],e._roundValToStep(i))]),!0})),(0,h.default)((0,c.default)(e),"_setRangeVal0",(function(t){var n=e.props,r=n.value1,a=n.range,o=n.onChange,i=Number(t);return o([(0,M.clamp)([a[0],r],e._roundValToStep(i)),r]),!0})),(0,h.default)((0,c.default)(e),"_resize",(function(){if(e.sliderContainer){var t=e.sliderContainer.offsetWidth;t!==e.state.width&&e.setState({width:t})}})),(0,h.default)((0,c.default)(e),"_onChangeInput",(function(t,n){e.setState((0,h.default)({},t,n.target.value))})),e}return(0,u.default)(r,[{key:"componentDidMount",value:function(){this.sliderContainer instanceof Element&&(0,w.observeDimensions)(this.sliderContainer,this._resize)}},{key:"componentDidUpdate",value:function(){this._resize()}},{key:"componentWillUnmount",value:function(){this.sliderContainer instanceof Element&&(0,w.unobserveDimensions)(this.sliderContainer)}},{key:"_renderInput",value:function(e){var t=this,n="value0"===e?this._setRangeVal0:this._setRangeVal1,r="value0"===e?this.inputValue0:this.inputValue1,a=function(r){n(r.target.value)||t.setState((0,h.default)({},e,t.state[e]))},o=this._onChangeInput.bind(this,e);return g.default.createElement(C,{className:"kg-range-slider__input",type:"number",ref:r,id:"slider-input-".concat(e),key:e,value:this.state[e],onChange:o,onKeyPress:function(e){"Enter"===e.key&&(a(e),r.current.blur())},onBlur:a,flush:"value0"===e,size:this.props.inputSize,secondary:"secondary"===this.props.inputTheme})}},{key:"render",value:function(){var t=this.props,n=t.isRanged,r=t.showInput,a=t.histogram,o=t.lineChart,i=t.range,s=t.onChange,l=t.sliderHandleWidth,u=t.step,c=t.timezone,d=t.timeFormat,f=t.playbackControlWidth,p=this.state.width,h=Math.max(p-l,0),m=a&&a.length||o;return g.default.createElement("div",{className:"kg-range-slider",style:{width:"100%",padding:"0 ".concat(l/2,"px")},ref:this.setSliderContainer},Array.isArray(i)&&i.every(Number.isFinite)&&g.default.createElement(g.default.Fragment,null,m?g.default.createElement(e,{histogram:a,lineChart:this.props.lineChart,plotType:this.props.plotType,isEnlarged:this.props.isEnlarged,onBrush:function(e,t){return s([e,t])},marks:this.props.marks,range:i,value:this.props.plotValue||this.filterValueSelector(this.props),width:h,isRanged:n,step:u,timezone:c,timeFormat:d,playbackControlWidth:f}):null,g.default.createElement(L,{className:"kg-range-slider__slider",isRanged:n,showInput:r},this.props.xAxis?g.default.createElement("div",{style:{height:"30px"}},g.default.createElement(this.props.xAxis,{width:h,timezone:c,domain:i,isEnlarged:this.props.isEnlarged})):null,g.default.createElement(E.default,{marks:this.props.marks,showValues:!1,isRanged:n,minValue:i[0],maxValue:i[1],value0:this.props.value0,value1:this.props.value1,step:u,handleWidth:l,onSlider0Change:this._setRangeVal0,onSlider1Change:this._setRangeVal1,onSliderBarChange:function(e,t){s([e,t])},enableBarDrag:!0}),!n&&r?this._renderInput("value1"):null),n&&r?g.default.createElement(P,{className:"range-slider__input-group"},this._renderInput("value0"),this._renderInput("value1")):null))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=null,r=e.value0,a=e.value1;return e.value0===t.prevValue0||isNaN(r)||(n=S(S({},n||{}),{},{value0:r,prevValue0:r})),e.value1===t.prevValue1||isNaN(a)||(n=S(S({},n||{}),{},{value1:a,prevValue1:a})),n}}]),r}(g.Component);return(0,h.default)(t,"propTypes",{range:A.default.arrayOf(A.default.number),value0:A.default.number.isRequired,value1:A.default.number.isRequired,onChange:A.default.func.isRequired,histogram:A.default.arrayOf(A.default.any),isRanged:A.default.bool,isEnlarged:A.default.bool,showInput:A.default.bool,inputTheme:A.default.string,inputSize:A.default.string,step:A.default.number,sliderHandleWidth:A.default.number,xAxis:A.default.elementType}),(0,h.default)(t,"defaultProps",{isEnlarged:!1,isRanged:!0,showInput:!0,sliderHandleWidth:12,inputTheme:"",inputSize:"small",onChange:function(){}}),(0,y.polyfill)(t),t}R.deps=[_.default]},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=t.classList=void 0;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11));function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var v={list:"list-selector",listHeader:"list__header",listSection:"list__section",listItem:"list__item",listItemAnchor:"list__item__anchor"};t.classList=v;var A=function(e){return e},b=function(e){var t=e.value,n=e.displayOption,r=void 0===n?A:n;return p.default.createElement("span",{className:v.listItemAnchor},r(t))};t.ListItem=b;var _=g.default.div(o||(o=(0,f.default)(["\n background-color: ",";\n border-top: 1px solid\n ",";\n ",";\n"])),(function(e){return e.light?e.theme.dropdownListBgdLT:e.theme.dropdownListBgd}),(function(e){return e.light?e.theme.dropdownListBorderTopLT:e.theme.dropdownListBorderTop}),(function(e){return e.light?e.theme.dropdownListLT:e.theme.dropdownList})),E=function(e){(0,l.default)(n,e);var t=y(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"_onClick",value:function(e,t){t.preventDefault(),this.props.onOptionSelected(e,t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.fixedOptions,r=t.light,a=this.props.displayOption;if(!this.props.options.length&&this.props.allowCustomValues<=0)return!1;var o=Array.isArray(n)?n.length:0;return p.default.createElement(_,{className:v.list,light:r},this.props.customListHeaderComponent?p.default.createElement("div",{className:v.listHeader},p.default.createElement(this.props.customListHeaderComponent,null)):null,o>0?p.default.createElement("div",{className:v.listSection},n.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n,fixed:!0}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))}))):null,this.props.options.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n+o}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))})))}}]),n}(p.Component);t.default=E,(0,d.default)(E,"propTypes",{options:h.default.arrayOf(h.default.any),allowCustomValues:h.default.number,customClasses:h.default.object,customValues:h.default.arrayOf(h.default.any),customListItemComponent:h.default.oneOfType([h.default.element,h.default.func]),customListHeaderComponent:h.default.oneOfType([h.default.element,h.default.func]),selectionIndex:h.default.number,onOptionSelected:h.default.func,displayOption:h.default.func.isRequired,defaultClassNames:h.default.bool,areResultsTruncated:h.default.bool,resultsTruncatedMessage:h.default.string,listItemComponent:h.default.func}),(0,d.default)(E,"defaultProps",{customClasses:{},customListItemComponent:b,customListHeaderComponent:null,allowCustomValues:0,customValues:[],displayOption:A,onOptionSelected:function(){},defaultClassNames:!0,selectionIndex:null})},function(e,t,n){var r=n(320),a=n(1444),o=n(1445),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?a(e):o(e)}},function(e,t,n){var r=n(1470),a=n(1473);e.exports=function(e,t){var n=a(e,t);return r(n)?n:void 0}},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11)),y=n(39),v=n(28);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var b=g.default.div(o||(o=(0,f.default)(["\n margin-left: ","px;\n display: flex;\n align-items: center;\n color: ",";\n\n :hover {\n cursor: pointer;\n color: ",";\n }\n\n &.disabled {\n pointer-events: none;\n opacity: 0.3;\n }\n"])),(function(e){return e.flush?0:8}),(function(e){return e.active?e.theme.panelHeaderIconActive:e.theme.panelHeaderIcon}),(function(e){return e.hoverColor?e.theme[e.hoverColor]:e.theme.panelHeaderIconHover}));function _(){var e=function(e){(0,l.default)(n,e);var t=A(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.tooltip,r=e.id,a=e.active,o=e.flush,i=e.hoverColor,s=e.tooltipType,l=e.disabled,u=e.className;return p.default.createElement(b,{className:(0,m.default)("panel--header__action",(0,d.default)({disabled:l},u,u)),active:a,hoverColor:i,flush:o},p.default.createElement(this.props.IconComponent,{"data-tip":!0,"data-for":"".concat(n,"_").concat(r),height:"16px",onClick:t}),n?p.default.createElement(v.Tooltip,{id:"".concat(n,"_").concat(r),effect:"solid",delayShow:500,type:s},p.default.createElement("span",null,p.default.createElement(y.FormattedMessage,{id:n}))):null)}}]),n}(p.Component);return(0,d.default)(e,"propTypes",{id:h.default.string,flush:h.default.bool,tooltip:h.default.string,onClick:h.default.func,active:h.default.bool,disabled:h.default.bool,hoverColor:h.default.string,className:h.default.string,tooltipType:h.default.string}),(0,d.default)(e,"defaultProps",{onClick:function(){},hoverColor:null,active:!1}),e}_.deps=[]},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(0)),o=n(1560),i=n(39);var s=function(){var e=a.default.memo((function(e){var t=e.id,n=e.message;return a.default.createElement(o.Tooltip,{id:t,place:"left",effect:"solid"},a.default.createElement("span",null,a.default.createElement(i.FormattedMessage,{id:n})))}));return e.displayName="MapControlTooltip",e};t.default=s},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CURRENT_VERSION=t.VERSIONS=void 0;var a=(0,r(n(137)).default)({v0:null,v1:null});t.VERSIONS=a;var o=a.v1;t.CURRENT_VERSION=o},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var a,o,i,s=r(n(12)),l=n(11),u={palm:588,desk:768},c={palm:function(){return(0,l.css)(a||(a=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).palm}),l.css.apply(void 0,arguments))},portable:function(){return(0,l.css)(o||(o=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk}),l.css.apply(void 0,arguments))},desk:function(){return(0,l.css)(i||(i=(0,s.default)(["\n @media (min-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk+1}),l.css.apply(void 0,arguments))}};t.media=c},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=R;var o,i,s,l=r(n(5)),u=r(n(7)),c=r(n(13)),d=r(n(9)),f=r(n(10)),p=r(n(8)),h=r(n(3)),m=r(n(12)),g=a(n(0)),y=n(94),v=n(54),A=r(n(1)),b=r(n(11)),_=r(n(988)),E=r(n(570)),x=n(29),M=n(62),w=n(571);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,h.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var a=(0,p.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,f.default)(this,n)}}var C=(0,b.default)(x.Input)(o||(o=(0,m.default)(["\n width: ","px;\n margin-left: ","px;\n font-size: ","; // 10px // 12px;\n padding: ","; // 4px 6px; // 6px 12px;\n"])),(function(e){return e.theme.sliderInputWidth}),(function(e){return e.flush?0:"tiny"===e.size?12:18}),(function(e){return e.theme.sliderInputFontSize}),(function(e){return e.theme.sliderInputPadding})),L=b.default.div(i||(i=(0,m.default)(["\n display: flex;\n position: relative;\n align-items: ",";\n"])),(function(e){return!e.isRanged&&e.showInput?"center":"flex-start"})),P=b.default.div(s||(s=(0,m.default)(["\n margin-top: 12px;\n display: flex;\n justify-content: space-between;\n"])));function R(e){var t=function(t){(0,d.default)(r,t);var n=T(r);function r(){var e;(0,l.default)(this,r);for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return e=n.call.apply(n,[this].concat(a)),(0,h.default)((0,c.default)(e),"state",{value0:0,value1:1,prevValue0:0,prevValue1:1,width:288}),(0,h.default)((0,c.default)(e),"sliderContainer",null),(0,h.default)((0,c.default)(e),"setSliderContainer",(function(t){e.sliderContainer=t,e._resize()})),(0,h.default)((0,c.default)(e),"inputValue0",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"inputValue1",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"value0Selector",(function(e){return e.value0})),(0,h.default)((0,c.default)(e),"value1Selector",(function(e){return e.value1})),(0,h.default)((0,c.default)(e),"filterValueSelector",(0,v.createSelector)(e.value0Selector,e.value1Selector,(function(e,t){return[e,t]}))),(0,h.default)((0,c.default)(e),"_roundValToStep",(function(t){var n=e.props,r=n.range,a=n.step;return(0,M.roundValToStep)(r[0],a,t)})),(0,h.default)((0,c.default)(e),"_setRangeVal1",(function(t){var n=e.props,r=n.value0,a=n.range,o=n.onChange,i=Number(t);return o([r,(0,M.clamp)([r,a[1]],e._roundValToStep(i))]),!0})),(0,h.default)((0,c.default)(e),"_setRangeVal0",(function(t){var n=e.props,r=n.value1,a=n.range,o=n.onChange,i=Number(t);return o([(0,M.clamp)([a[0],r],e._roundValToStep(i)),r]),!0})),(0,h.default)((0,c.default)(e),"_resize",(function(){if(e.sliderContainer){var t=e.sliderContainer.offsetWidth;t!==e.state.width&&e.setState({width:t})}})),(0,h.default)((0,c.default)(e),"_onChangeInput",(function(t,n){e.setState((0,h.default)({},t,n.target.value))})),e}return(0,u.default)(r,[{key:"componentDidMount",value:function(){this.sliderContainer instanceof Element&&(0,w.observeDimensions)(this.sliderContainer,this._resize)}},{key:"componentDidUpdate",value:function(){this._resize()}},{key:"componentWillUnmount",value:function(){this.sliderContainer instanceof Element&&(0,w.unobserveDimensions)(this.sliderContainer)}},{key:"_renderInput",value:function(e){var t=this,n="value0"===e?this._setRangeVal0:this._setRangeVal1,r="value0"===e?this.inputValue0:this.inputValue1,a=function(r){n(r.target.value)||t.setState((0,h.default)({},e,t.state[e]))},o=this._onChangeInput.bind(this,e);return g.default.createElement(C,{className:"kg-range-slider__input",type:"number",ref:r,id:"slider-input-".concat(e),key:e,value:this.state[e],onChange:o,onKeyPress:function(e){"Enter"===e.key&&(a(e),r.current.blur())},onBlur:a,flush:"value0"===e,size:this.props.inputSize,secondary:"secondary"===this.props.inputTheme})}},{key:"render",value:function(){var t=this.props,n=t.isRanged,r=t.showInput,a=t.histogram,o=t.lineChart,i=t.range,s=t.onChange,l=t.sliderHandleWidth,u=t.step,c=t.timezone,d=t.timeFormat,f=t.playbackControlWidth,p=this.state.width,h=Math.max(p-l,0),m=a&&a.length||o;return g.default.createElement("div",{className:"kg-range-slider",style:{width:"100%",padding:"0 ".concat(l/2,"px")},ref:this.setSliderContainer},Array.isArray(i)&&i.every(Number.isFinite)&&g.default.createElement(g.default.Fragment,null,m?g.default.createElement(e,{histogram:a,lineChart:this.props.lineChart,plotType:this.props.plotType,isEnlarged:this.props.isEnlarged,onBrush:function(e,t){return s([e,t])},marks:this.props.marks,range:i,value:this.props.plotValue||this.filterValueSelector(this.props),width:h,isRanged:n,step:u,timezone:c,timeFormat:d,playbackControlWidth:f}):null,g.default.createElement(L,{className:"kg-range-slider__slider",isRanged:n,showInput:r},this.props.xAxis?g.default.createElement("div",{style:{height:"30px"}},g.default.createElement(this.props.xAxis,{width:h,timezone:c,domain:i,isEnlarged:this.props.isEnlarged})):null,g.default.createElement(E.default,{marks:this.props.marks,showValues:!1,isRanged:n,minValue:i[0],maxValue:i[1],value0:this.props.value0,value1:this.props.value1,step:u,handleWidth:l,onSlider0Change:this._setRangeVal0,onSlider1Change:this._setRangeVal1,onSliderBarChange:function(e,t){s([e,t])},enableBarDrag:!0}),!n&&r?this._renderInput("value1"):null),n&&r?g.default.createElement(P,{className:"range-slider__input-group"},this._renderInput("value0"),this._renderInput("value1")):null))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=null,r=e.value0,a=e.value1;return e.value0===t.prevValue0||isNaN(r)||(n=S(S({},n||{}),{},{value0:r,prevValue0:r})),e.value1===t.prevValue1||isNaN(a)||(n=S(S({},n||{}),{},{value1:a,prevValue1:a})),n}}]),r}(g.Component);return(0,h.default)(t,"propTypes",{range:A.default.arrayOf(A.default.number),value0:A.default.number.isRequired,value1:A.default.number.isRequired,onChange:A.default.func.isRequired,histogram:A.default.arrayOf(A.default.any),isRanged:A.default.bool,isEnlarged:A.default.bool,showInput:A.default.bool,inputTheme:A.default.string,inputSize:A.default.string,step:A.default.number,sliderHandleWidth:A.default.number,xAxis:A.default.elementType}),(0,h.default)(t,"defaultProps",{isEnlarged:!1,isRanged:!0,showInput:!0,sliderHandleWidth:12,inputTheme:"",inputSize:"small",onChange:function(){}}),(0,y.polyfill)(t),t}R.deps=[_.default]},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=t.classList=void 0;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11));function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var v={list:"list-selector",listHeader:"list__header",listSection:"list__section",listItem:"list__item",listItemAnchor:"list__item__anchor"};t.classList=v;var A=function(e){return e},b=function(e){var t=e.value,n=e.displayOption,r=void 0===n?A:n;return p.default.createElement("span",{className:v.listItemAnchor},r(t))};t.ListItem=b;var _=g.default.div(o||(o=(0,f.default)(["\n background-color: ",";\n border-top: 1px solid\n ",";\n ",";\n"])),(function(e){return e.light?e.theme.dropdownListBgdLT:e.theme.dropdownListBgd}),(function(e){return e.light?e.theme.dropdownListBorderTopLT:e.theme.dropdownListBorderTop}),(function(e){return e.light?e.theme.dropdownListLT:e.theme.dropdownList})),E=function(e){(0,l.default)(n,e);var t=y(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"_onClick",value:function(e,t){t.preventDefault(),this.props.onOptionSelected(e,t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.fixedOptions,r=t.light,a=this.props.displayOption;if(!this.props.options.length&&this.props.allowCustomValues<=0)return!1;var o=Array.isArray(n)?n.length:0;return p.default.createElement(_,{className:v.list,light:r},this.props.customListHeaderComponent?p.default.createElement("div",{className:v.listHeader},p.default.createElement(this.props.customListHeaderComponent,null)):null,o>0?p.default.createElement("div",{className:v.listSection},n.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n,fixed:!0}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))}))):null,this.props.options.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n+o}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))})))}}]),n}(p.Component);t.default=E,(0,d.default)(E,"propTypes",{options:h.default.arrayOf(h.default.any),allowCustomValues:h.default.number,customClasses:h.default.object,customValues:h.default.arrayOf(h.default.any),customListItemComponent:h.default.oneOfType([h.default.element,h.default.func]),customListHeaderComponent:h.default.oneOfType([h.default.element,h.default.func]),selectionIndex:h.default.number,onOptionSelected:h.default.func,displayOption:h.default.func.isRequired,defaultClassNames:h.default.bool,areResultsTruncated:h.default.bool,resultsTruncatedMessage:h.default.string,listItemComponent:h.default.func}),(0,d.default)(E,"defaultProps",{customClasses:{},customListItemComponent:b,customListHeaderComponent:null,allowCustomValues:0,customValues:[],displayOption:A,onOptionSelected:function(){},defaultClassNames:!0,selectionIndex:null})},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11)),y=n(40),v=n(29);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var b=g.default.div(o||(o=(0,f.default)(["\n margin-left: ","px;\n display: flex;\n align-items: center;\n color: ",";\n\n :hover {\n cursor: pointer;\n color: ",";\n }\n\n &.disabled {\n pointer-events: none;\n opacity: 0.3;\n }\n"])),(function(e){return e.flush?0:8}),(function(e){return e.active?e.theme.panelHeaderIconActive:e.theme.panelHeaderIcon}),(function(e){return e.hoverColor?e.theme[e.hoverColor]:e.theme.panelHeaderIconHover}));function _(){var e=function(e){(0,l.default)(n,e);var t=A(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.tooltip,r=e.id,a=e.active,o=e.flush,i=e.hoverColor,s=e.tooltipType,l=e.disabled,u=e.className;return p.default.createElement(b,{className:(0,m.default)("panel--header__action",(0,d.default)({disabled:l},u,u)),active:a,hoverColor:i,flush:o},p.default.createElement(this.props.IconComponent,{"data-tip":!0,"data-for":"".concat(n,"_").concat(r),height:"16px",onClick:t}),n?p.default.createElement(v.Tooltip,{id:"".concat(n,"_").concat(r),effect:"solid",delayShow:500,type:s},p.default.createElement("span",null,p.default.createElement(y.FormattedMessage,{id:n}))):null)}}]),n}(p.Component);return(0,d.default)(e,"propTypes",{id:h.default.string,flush:h.default.bool,tooltip:h.default.string,onClick:h.default.func,active:h.default.bool,disabled:h.default.bool,hoverColor:h.default.string,className:h.default.string,tooltipType:h.default.string}),(0,d.default)(e,"defaultProps",{onClick:function(){},hoverColor:null,active:!1}),e}_.deps=[]},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(0)),o=n(568),i=n(40);var s=function(){var e=a.default.memo((function(e){var t=e.id,n=e.message;return a.default.createElement(o.Tooltip,{id:t,place:"left",effect:"solid"},a.default.createElement("span",null,a.default.createElement(i.FormattedMessage,{id:n})))}));return e.displayName="MapControlTooltip",e};t.default=s},function(e,t){e.exports=function(e,t,n,r){var a,o,i=e.length,s=0;t=t<0?-t>i?0:i+t:t>i?i:t;if(n=n>0?n:0,r.length<1e4)return(o=Array.from(r)).unshift(t,n),[].splice.apply(e,o);a=[].splice.apply(e,[t,n]);for(;s<r.length;)(o=r.slice(s,s+1e4)).unshift(t,0),[].splice.apply(e,o),s+=1e4,t+=1e4;return a}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return lt})),n.d(t,"InteractiveMap",(function(){return lt})),n.d(t,"StaticMap",(function(){return Ue})),n.d(t,"Source",(function(){return ht})),n.d(t,"Layer",(function(){return At})),n.d(t,"BaseControl",(function(){return Et})),n.d(t,"Marker",(function(){return kt})),n.d(t,"Popup",(function(){return zt})),n.d(t,"FullscreenControl",(function(){return Wt})),n.d(t,"GeolocateControl",(function(){return Qt})),n.d(t,"NavigationControl",(function(){return an})),n.d(t,"ScaleControl",(function(){return un})),n.d(t,"CanvasOverlay",(function(){return fn})),n.d(t,"HTMLOverlay",(function(){return mn})),n.d(t,"SVGOverlay",(function(){return vn})),n.d(t,"TRANSITION_EVENTS",(function(){return Ve})),n.d(t,"TransitionInterpolator",(function(){return ce})),n.d(t,"LinearInterpolator",(function(){return Oe})),n.d(t,"FlyToInterpolator",(function(){return _e})),n.d(t,"MapController",(function(){return et})),n.d(t,"WebMercatorViewport",(function(){return q})),n.d(t,"setRTLTextPlugin",(function(){return An})),n.d(t,"_MapContext",(function(){return De}));var r=n(299),a=n(33),o=n(15),i=n(32),s=n(58),l=n(57),u=n(37),c=n(4),d=n(0),f=n(1),p=n.n(f);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var v=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function A(e){if(!e)return null;if("string"==typeof e)return e;e.toJS&&(e=e.toJS());var t,n={},r=g(e.layers);try{for(r.s();!(t=r.n()).done;){var a=t.value;n[a.id]=a}}catch(e){r.e(e)}finally{r.f()}var o=e.layers.map((function(e){var t=n[e.ref],r=null;if("interactive"in e&&delete(r=m({},e)).interactive,t){delete(r=r||m({},e)).ref;var a,o=g(v);try{for(o.s();!(a=o.n()).done;){var i=a.value;i in t&&(r[i]=t[i])}}catch(e){o.e(e)}finally{o.f()}}return r||e}));return m(m({},e),{},{layers:o})}var b=n(252),_=n(42),E=n(48);function x(e,t){var n=E.n([],t,e);return E.k(n,n,1/n[3]),n}function M(e,t){var n=e%t;return n<0?t+n:n}function w(e,t,n){return n*t+(1-n)*e}var O=n(14),S=n(35),T=n(19);function C(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var L=Math.PI,P=L/4,R=L/180,D=180/L;function k(e){return Math.pow(2,e)}function I(e){return Math.log2(e)}function F(e){var t=Object(_.a)(e,2),n=t[0],r=t[1];C(Number.isFinite(n)),C(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");var a=r*R;return[512*(n*R+L)/(2*L),512*(L+Math.log(Math.tan(P+.5*a)))/(2*L)]}function j(e){var t=Object(_.a)(e,2),n=t[0],r=t[1],a=n/512*(2*L)-L,o=2*(Math.atan(Math.exp(r/512*(2*L)-L))-P);return[a*D,o*D]}function B(e){var t=e.latitude,n=e.longitude,r=e.highPrecision,a=void 0!==r&&r;C(Number.isFinite(t)&&Number.isFinite(n));var o={},i=Math.cos(t*R),s=512/360/i,l=512/4003e4/i;if(o.unitsPerMeter=[l,l,l],o.metersPerUnit=[1/l,1/l,1/l],o.unitsPerDegree=[512/360,s,l],o.degreesPerUnit=[.703125,1/s,1/l],a){var u=R*Math.tan(t*R)/i,c=512/360*u/2,d=512/4003e4*u,f=d/s*l;o.unitsPerDegree2=[0,c,d],o.unitsPerMeter2=[f,0,f]}return o}function N(e){var t=e.height,n=e.pitch,r=e.bearing,a=e.altitude,o=e.scale,i=e.center,s=void 0===i?null:i,l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return O.p(l,l,[0,0,-a]),O.l(l,l,-n*R),O.n(l,l,r*R),o/=t,O.o(l,l,[o,o,o]),s&&O.p(l,l,T.l([],s)),l}function z(e){var t=e.width,n=e.height,r=e.pitch,a=function(e){var t=e.width,n=e.height,r=e.altitude,a=void 0===r?1.5:r,o=e.pitch,i=void 0===o?0:o,s=e.nearZMultiplier,l=void 0===s?1:s,u=e.farZMultiplier,c=void 0===u?1:u,d=i*R,f=Math.atan(.5/a),p=Math.sin(f)*a/Math.sin(Math.min(Math.max(Math.PI/2-d-f,.01),Math.PI-.01));return{fov:2*f,aspect:t/n,focalDistance:a,near:l,far:(Math.sin(d)*p+a)*c}}({width:t,height:n,altitude:e.altitude,pitch:r,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=a.fov,i=a.aspect,s=a.near,l=a.far;return O.j([],o,i,s,l)}function U(e,t){var n=Object(_.a)(e,3),r=n[0],a=n[1],o=n[2],i=void 0===o?0:o;return C(Number.isFinite(r)&&Number.isFinite(a)&&Number.isFinite(i)),x(t,[r,a,i,1])}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(_.a)(e,3),a=r[0],o=r[1],i=r[2];if(C(Number.isFinite(a)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(i)){var s=x(t,[a,o,i,1]);return s}var l=x(t,[a,o,0,1]),u=x(t,[a,o,1,1]),c=l[2],d=u[2],f=c===d?0:((n||0)-c)/(d-c);return S.c([],l,u,f)}function V(e){var t=e.width,n=e.height,r=e.bounds,a=e.minExtent,o=void 0===a?0:a,i=e.maxZoom,s=void 0===i?24:i,l=e.padding,u=void 0===l?0:l,c=e.offset,d=void 0===c?[0,0]:c,f=Object(_.a)(r,2),p=Object(_.a)(f[0],2),h=p[0],m=p[1],g=Object(_.a)(f[1],2),y=g[0],v=g[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else C(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var A=new q({width:t,height:n,longitude:0,latitude:0,zoom:0}),b=A.project([h,v]),E=A.project([y,m]),x=[Math.max(Math.abs(E[0]-b[0]),o),Math.max(Math.abs(E[1]-b[1]),o)],M=[t-u.left-u.right-2*Math.abs(d[0]),n-u.top-u.bottom-2*Math.abs(d[1])];C(M[0]>0&&M[1]>0);var w=M[0]/x[0],O=M[1]/x[1],S=(u.right-u.left)/2/w,T=(u.bottom-u.top)/2/O,L=[(E[0]+b[0])/2+S,(E[1]+b[1])/2+T],P=A.unproject(L),R=Math.min(s,A.zoom+Math.log2(Math.abs(Math.min(w,O))));return C(Number.isFinite(R)),{longitude:P[0],latitude:P[1],zoom:R}}var G=Math.PI/180;function Y(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.width,o=e.height,i=e.unproject,s={targetZ:r},l=i([0,o],s),u=i([a,o],s),c=Math.atan(.5/e.altitude),d=(90-e.pitch)*G;return c>d-.01?(t=W(e,0,r),n=W(e,a,r)):(t=i([0,0],s),n=i([a,0],s)),[l,u,n,t]}function W(e,t,n){var r=e.pixelUnprojectionMatrix,a=x(r,[t,0,1,1]),o=x(r,[t,e.height,1,1]),i=(n*e.distanceScales.unitsPerMeter[2]-a[2])/(o[2]-a[2]),s=j(S.c([],a,o,i));return s[2]=n,s}var q=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=t.width,r=t.height,o=t.latitude,i=void 0===o?0:o,s=t.longitude,l=void 0===s?0:s,u=t.zoom,c=void 0===u?0:u,d=t.pitch,f=void 0===d?0:d,p=t.bearing,h=void 0===p?0:p,m=t.altitude,g=void 0===m?1.5:m,y=t.nearZMultiplier,v=void 0===y?.02:y,A=t.farZMultiplier,b=void 0===A?1.01:A;Object(a.a)(this,e),n=n||1,r=r||1;var _=k(c);g=Math.max(.75,g);var E=F([l,i]);E[2]=0,this.projectionMatrix=z({width:n,height:r,pitch:f,altitude:g,nearZMultiplier:v,farZMultiplier:b}),this.viewMatrix=N({height:r,scale:_,center:E,pitch:f,bearing:h,altitude:g}),this.width=n,this.height=r,this.scale=_,this.latitude=i,this.longitude=l,this.zoom=c,this.pitch=f,this.bearing=h,this.altitude=g,this.center=E,this.distanceScales=B(this),this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return Object(i.a)(e,[{key:"_initMatrices",value:function(){var e=this.width,t=this.height,n=this.projectionMatrix,r=this.viewMatrix,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];O.h(a,a,n),O.h(a,a,r),this.viewProjectionMatrix=a;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];O.o(o,o,[e/2,-t/2,1]),O.p(o,o,[1,-1,0]),O.h(o,o,a);var i=O.f([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!i)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=i}},{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&O.b(t.projectionMatrix,this.projectionMatrix)&&O.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,r=void 0===n||n,a=this.projectPosition(e),o=U(a,this.pixelProjectionMatrix),i=Object(_.a)(o,2),s=i[0],l=i[1],u=r?l:this.height-l;return 2===e.length?[s,u]:[s,u,o[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,r=void 0===n||n,a=t.targetZ,o=void 0===a?void 0:a,i=Object(_.a)(e,3),s=i[0],l=i[1],u=i[2],c=r?l:this.height-l,d=o&&o*this.distanceScales.unitsPerMeter[2],f=H([s,c,u],this.pixelUnprojectionMatrix,d),p=this.unprojectPosition(f),h=Object(_.a)(p,3),m=h[0],g=h[1],y=h[2];return Number.isFinite(u)?[m,g,y]:Number.isFinite(o)?[m,g,o]:[m,g]}},{key:"projectPosition",value:function(e){var t=F(e),n=Object(_.a)(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=j(e),n=Object(_.a)(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(e){return F(e)}},{key:"unprojectFlat",value:function(e){return j(e)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=H(e.pos,this.pixelUnprojectionMatrix),r=F(t),a=S.a([],r,S.d([],n));return j(S.a([],this.center,a))}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,a=this.height,o=V(Object.assign({width:r,height:a,bounds:t},n)),i=o.longitude,s=o.latitude,l=o.zoom;return new e({width:r,height:a,longitude:i,latitude:s,zoom:l})}},{key:"getBounds",value:function(e){var t=this.getBoundingRegion(e),n=Math.min.apply(Math,Object(b.a)(t.map((function(e){return e[0]})))),r=Math.max.apply(Math,Object(b.a)(t.map((function(e){return e[0]}))));return[[n,Math.min.apply(Math,Object(b.a)(t.map((function(e){return e[1]}))))],[r,Math.max.apply(Math,Object(b.a)(t.map((function(e){return e[1]}))))]]}},{key:"getBoundingRegion",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Y(this,e.z||0)}}]),e}();function X(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Z=["longitude","latitude","zoom"],J={curve:1.414,speed:1.2};function Q(e,t,n){var r=(n=Object.assign({},J,n)).curve,a=e.zoom,o=[e.longitude,e.latitude],i=k(a),s=t.zoom,l=[t.longitude,t.latitude],u=k(s-a),c=F(o),d=F(l),f=S.f([],d,c),p=Math.max(e.width,e.height),h=p/u,m=S.b(f)*i,g=Math.max(m,.01),y=r*r,v=(h*h-p*p+y*y*g*g)/(2*p*y*g),A=(h*h-p*p-y*y*g*g)/(2*h*y*g),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(A*A+1)-A);return{startZoom:a,startCenterXY:c,uDelta:f,w0:p,u1:m,S:(_-b)/r,rho:r,rho2:y,r0:b,r1:_}}var $=n(1181),ee=n(463),te=n(656),ne=n.n(te);function re(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function ae(e,t){if(e===t)return!0;if(re(e)&&re(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!ae(e[n],t[n]))return!1;return!0}return Math.abs(e-t)<=1e-7}function oe(e,t,n){return Math.max(t,Math.min(n,e))}function ie(e,t,n){return re(e)?e.map((function(e,r){return ie(e,t[r],n)})):n*t+(1-n)*e}function se(e,t){if(!e)throw new Error(t||"react-map-gl: assertion failed.")}function le(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ce=function(){function e(){Object(a.a)(this,e),Object(c.a)(this,"propNames",[])}return Object(i.a)(e,[{key:"arePropsEqual",value:function(e,t){var n,r=le(this.propNames||[]);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(!ae(e[a],t[a]))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}},{key:"initializeProps",value:function(e,t){return{start:e,end:t}}},{key:"interpolateProps",value:function(e,t,n){se(!1,"interpolateProps is not implemented")}},{key:"getDuration",value:function(e,t){return t.transitionDuration}}]),e}(),de={longitude:1,bearing:1};function fe(e){return Number.isFinite(e)||Array.isArray(e)}function pe(e,t,n){return function(e){return e in de}(e)&&Math.abs(n-t)>180&&(n=n<0?n+360:n-360),n}function he(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var ye=["longitude","latitude","zoom","bearing","pitch"],ve=["latitude","longitude","zoom","width","height"],Ae=["bearing","pitch"],be={speed:1.2,curve:1.414},_e=function(e){Object(s.a)(n,e);var t=ge(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,n),e=t.call(this),Object(c.a)(Object(o.a)(e),"speed",void 0),Object(c.a)(Object(o.a)(e),"propNames",ye),Object(c.a)(Object(o.a)(e),"props",void 0),e.props=Object.assign({},be,r),e}return Object(i.a)(n,[{key:"initializeProps",value:function(e,t){var n,r={},a={},o=he(ve);try{for(o.s();!(n=o.n()).done;){var i=n.value,s=e[i],l=t[i];se(fe(s)&&fe(l),"".concat(i," must be supplied for transition")),r[i]=s,a[i]=pe(i,s,l)}}catch(e){o.e(e)}finally{o.f()}var u,c=he(Ae);try{for(c.s();!(u=c.n()).done;){var d=u.value,f=e[d]||0,p=t[d]||0;r[d]=f,a[d]=pe(d,f,p)}}catch(e){c.e(e)}finally{c.f()}return{start:r,end:a}}},{key:"interpolateProps",value:function(e,t,n){var r,a=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a={},o=Q(e,t,r),i=o.startZoom,s=o.startCenterXY,l=o.uDelta,u=o.w0,c=o.u1,d=o.S,f=o.rho,p=o.rho2,h=o.r0;if(c<.01){var m,g=X(Z);try{for(g.s();!(m=g.n()).done;){var y=m.value,v=e[y],A=t[y];a[y]=w(v,A,n)}}catch(e){g.e(e)}finally{g.f()}return a}var b=n*d,_=Math.cosh(h)/Math.cosh(h+f*b),E=u*((Math.cosh(h)*Math.tanh(h+f*b)-Math.sinh(h))/p)/c,x=1/_,M=i+I(x),O=S.e([],l,E);S.a(O,O,s);var T=j(O);return a.longitude=T[0],a.latitude=T[1],a.zoom=M,a}(e,t,n,this.props),o=he(Ae);try{for(o.s();!(r=o.n()).done;){var i=r.value;a[i]=ie(e[i],t[i],n)}}catch(e){o.e(e)}finally{o.f()}return a}},{key:"getDuration",value:function(e,t){var n=t.transitionDuration;return"auto"===n&&(n=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r=Object.assign({},J,r),o=a.screenSpeed,i=a.speed,s=a.maxDuration,l=Q(e,t,r),u=l.S,c=l.rho,d=1e3*u;return n=Number.isFinite(o)?d/(o/c):d/i,Number.isFinite(s)&&n>s?0:n}(e,t,this.props)),n}}]),n}(ce);function Ee(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xe(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Me(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var we=["longitude","latitude","zoom","bearing","pitch"],Oe=function(e){Object(s.a)(n,e);var t=Me(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,n),e=t.call(this),Object(c.a)(Object(o.a)(e),"around",void 0),Array.isArray(r)&&(r={transitionProps:r}),e.propNames=r.transitionProps||we,r.around&&(e.around=r.around),e}return Object(i.a)(n,[{key:"initializeProps",value:function(e,t){var n={},r={};if(this.around){n.around=this.around;var a=new q(e).unproject(this.around);Object.assign(r,t,{around:new q(t).project(a),aroundLngLat:a})}var o,i=Ee(this.propNames);try{for(i.s();!(o=i.n()).done;){var s=o.value,l=e[s],u=t[s];se(fe(l)&&fe(u),"".concat(s," must be supplied for transition")),n[s]=l,r[s]=pe(s,l,u)}}catch(e){i.e(e)}finally{i.f()}return{start:n,end:r}}},{key:"interpolateProps",value:function(e,t,n){var r,a={},o=Ee(this.propNames);try{for(o.s();!(r=o.n()).done;){var i=r.value;a[i]=ie(e[i],t[i],n)}}catch(e){o.e(e)}finally{o.f()}if(t.around){var s=new q(Object.assign({},t,a)).getMapCenterByLngLatPosition({lngLat:t.aroundLngLat,pos:ie(e.around,t.around,n)}),l=Object(_.a)(s,2),u=l[0],c=l[1];a.longitude=u,a.latitude=c}return a}}]),n}(ce),Se={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},Te=0,Ce=0,Le=1.5,Pe=function(){function e(t){var n=t.width,r=t.height,o=t.latitude,i=t.longitude,s=t.zoom,l=t.bearing,u=void 0===l?Ce:l,d=t.pitch,f=void 0===d?Te:d,p=t.altitude,h=void 0===p?Le:p,m=t.maxZoom,g=void 0===m?Se.maxZoom:m,y=t.minZoom,v=void 0===y?Se.minZoom:y,A=t.maxPitch,b=void 0===A?Se.maxPitch:A,_=t.minPitch,E=void 0===_?Se.minPitch:_,x=t.transitionDuration,M=t.transitionEasing,w=t.transitionInterpolator,O=t.transitionInterruption,S=t.startPanLngLat,T=t.startZoomLngLat,C=t.startBearing,L=t.startPitch,P=t.startZoom;Object(a.a)(this,e),Object(c.a)(this,"_viewportProps",void 0),Object(c.a)(this,"_interactiveState",void 0),se(Number.isFinite(n),"`width` must be supplied"),se(Number.isFinite(r),"`height` must be supplied"),se(Number.isFinite(i),"`longitude` must be supplied"),se(Number.isFinite(o),"`latitude` must be supplied"),se(Number.isFinite(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:r,latitude:o,longitude:i,zoom:s,bearing:u,pitch:f,altitude:h,maxZoom:g,minZoom:v,maxPitch:b,minPitch:E,transitionDuration:x,transitionEasing:M,transitionInterpolator:w,transitionInterruption:O}),this._interactiveState={startPanLngLat:S,startZoomLngLat:T,startBearing:C,startPitch:L,startZoom:P}}return Object(i.a)(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,r=this._interactiveState.startPanLngLat||this._unproject(n);if(!r)return this;var a=this._calculateNewLngLat({startPanLngLat:r,pos:t}),o=Object(_.a)(a,2),i=o[0],s=o[1];return this._getUpdatedMapState({longitude:i,latitude:s})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedMapState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,r=e.deltaScaleY,a=void 0===r?0:r,o=this._interactiveState,i=o.startBearing,s=o.startPitch;if(!Number.isFinite(i)||!Number.isFinite(s))return this;var l=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:a,startBearing:i||0,startPitch:s||0}),u=l.pitch,c=l.bearing;return this._getUpdatedMapState({bearing:c,pitch:u})}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,r=e.scale;se(r>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,i=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,i=this._unproject(n)||this._unproject(t)),se(i,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:r,startZoom:o||0}),l=new q(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:i,pos:t}),u=Object(_.a)(l,2),c=u[0],d=u[1];return this._getUpdatedMapState({zoom:s,longitude:c,latitude:d})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(t){return new e(Object.assign({},this._viewportProps,this._interactiveState,t))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,r=e.zoom;e.zoom=oe(r,n,t);var a=e.maxPitch,o=e.minPitch,i=e.pitch;return e.pitch=oe(i,o,a),Object.assign(e,function(e){var t=e.width,n=e.height,r=e.longitude,a=e.latitude,o=e.zoom,i=e.pitch,s=void 0===i?0:i,l=e.bearing,u=void 0===l?0:l;(r<-180||r>180)&&(r=M(r+180,360)-180),(u<-180||u>180)&&(u=M(u+180,360)-180);var c=new q({width:t,height:n,longitude:r,latitude:a,zoom:o}),d=c.project([r,85.05113])[1],f=c.project([r,-85.05113])[1],p=0;return f-d<n&&(o+=Math.log2(n/(f-d)),d=(c=new q({width:t,height:n,longitude:r,latitude:a,zoom:o})).project([r,85.05113])[1],f=c.project([r,-85.05113])[1]),d>0?p=d:f<n&&(p=f-n),p&&(a=c.unproject([t/2,n/2+p])[1]),{width:t,height:n,longitude:r,latitude:a,zoom:o,pitch:s,bearing:u}}(e)),e}},{key:"_unproject",value:function(e){var t=new q(this._viewportProps);return e&&t.unproject(e)}},{key:"_calculateNewLngLat",value:function(e){var t=e.startPanLngLat,n=e.pos;return new q(this._viewportProps).getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,r=this._viewportProps,a=r.maxZoom,o=r.minZoom;return oe(n+Math.log2(t),o,a)}},{key:"_calculateNewPitchAndBearing",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,r=e.startBearing,a=e.startPitch;n=oe(n,-1,1);var o=this._viewportProps,i=o.minPitch,s=o.maxPitch,l=a;return n>0?l=a+n*(s-a):n<0&&(l=a-n*(i-a)),{pitch:l,bearing:r+180*t}}}]),e}();function Re(e){return e[0].toLowerCase()+e.slice(1)}var De=Object(d.createContext)({viewport:null,map:null,mapContainer:null,onViewportChange:null,onViewStateChange:null,eventManager:null,isDragging:!1});function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var je="A valid API access token is required to use Mapbox data";var Be={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},Ne=Object.assign({},ee.a.propTypes,{width:p.a.oneOfType([p.a.number,p.a.string]),height:p.a.oneOfType([p.a.number,p.a.string]),onResize:p.a.func,preventStyleDiffing:p.a.bool,disableTokenWarning:p.a.bool,visible:p.a.bool,className:p.a.string,style:p.a.object,visibilityConstraints:p.a.object}),ze=Object.assign({},ee.a.defaultProps,{preventStyleDiffing:!1,disableTokenWarning:!1,visible:!0,onResize:function(){},className:"",style:null,visibilityConstraints:Se}),Ue=function(e){Object(s.a)(n,e);var t=Fe(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{accessTokenInvalid:!1}),Object(c.a)(Object(o.a)(e),"_mapbox",null),Object(c.a)(Object(o.a)(e),"_map",null),Object(c.a)(Object(o.a)(e),"_mapboxMapRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_mapContainerRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_queryParams",{}),Object(c.a)(Object(o.a)(e),"_width",0),Object(c.a)(Object(o.a)(e),"_height",0),Object(c.a)(Object(o.a)(e),"getMap",(function(){return e._map})),Object(c.a)(Object(o.a)(e),"queryRenderedFeatures",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e._map.queryRenderedFeatures(t,n)})),Object(c.a)(Object(o.a)(e),"_mapboxMapError",(function(t){401!==(t.error&&t.error.status||t.status)||e.state.accessTokenInvalid||(console.error(je),e.setState({accessTokenInvalid:!0})),e.props.onError(t)})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){if(n.supported()){var e=this.props.mapStyle;this._mapbox=new ee.a(Object.assign({},this.props,{mapboxgl:ne.a,width:this._width,height:this._height,container:this._mapboxMapRef.current,onError:this._mapboxMapError,mapStyle:A(e)})),this._map=this._mapbox.getMap()}}},{key:"componentDidUpdate",value:function(e){this._mapbox&&(this._updateMapStyle(e,this.props),this._updateMapProps(this.props))}},{key:"componentWillUnmount",value:function(){this._mapbox&&(this._mapbox.finalize(),this._mapbox=null,this._map=null)}},{key:"_updateMapSize",value:function(e,t){this._width===e&&this._height===t||(this._width=e,this._height=t,this._updateMapProps(this.props))}},{key:"_updateMapStyle",value:function(e,t){var n=t.mapStyle;n!==e.mapStyle&&n&&this._map.setStyle(A(n),{diff:!this.props.preventStyleDiffing})}},{key:"_updateMapProps",value:function(e){this._mapbox&&this._mapbox.setProps(Object.assign({},e,{width:this._width,height:this._height}))}},{key:"_renderNoTokenWarning",value:function(){if(this.state.accessTokenInvalid&&!this.props.disableTokenWarning){return d.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},d.createElement("h3",{key:"header"},"NO_TOKEN_WARNING"),d.createElement("div",{key:"text"},"For information on setting up your basemap, read"),d.createElement("a",{key:"link",href:"https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens"},"Note on Map Tokens"))}return null}},{key:"_renderOverlays",value:function(e){var t=this,n=e.width,r=e.height;return this._updateMapSize(n,r),d.createElement(De.Consumer,null,(function(e){var a=Ie(Ie({},e),{},{viewport:new q(Ie(Ie(Ie({},t.props),t.props.viewState),{},{width:n,height:r})),map:t._map,mapContainer:e.mapContainer||t._mapContainerRef.current});return d.createElement(De.Provider,{value:a},d.createElement("div",{key:"map-overlays",className:"overlays",style:Be},t.props.children))}))}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.width,r=e.height,a=e.style,o=e.visibilityConstraints,i=Object.assign({position:"relative"},a,{width:n,height:r}),s=this.props.visible&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Se;for(var n in t){var r=n.slice(0,3),a=Re(n.slice(3));if("min"===r&&e[a]<t[n])return!1;if("max"===r&&e[a]>t[n])return!1}return!0}(this.props.viewState||this.props,o),l=Object.assign({},Be,{visibility:s?"inherit":"hidden"});return d.createElement("div",{key:"map-container",style:i,ref:this._mapContainerRef},d.createElement("div",{key:"map-mapbox",ref:this._mapboxMapRef,style:l,className:t}),d.createElement($.a,{key:"autosizer",onResize:this.props.onResize},this._renderOverlays.bind(this)),this._renderNoTokenWarning())}}],[{key:"supported",value:function(){return ne.a&&ne.a.supported()}}]),n}(d.PureComponent);Object(c.a)(Ue,"propTypes",Ne),Object(c.a)(Ue,"defaultProps",ze);var He=function(){};var Ve={BREAK:1,SNAP_TO_END:2,IGNORE:3,UPDATE:4},Ge={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new Oe,transitionInterruption:Ve.BREAK,onTransitionStart:He,onTransitionInterrupt:He,onTransitionEnd:He,onViewportChange:He,onStateChange:He},Ye=function(){function e(t,n){var r=this;Object(a.a)(this,e),Object(c.a)(this,"props",void 0),Object(c.a)(this,"state",void 0),Object(c.a)(this,"time",void 0),Object(c.a)(this,"_animationFrame",null),Object(c.a)(this,"_onTransitionFrame",(function(){r._animationFrame=requestAnimationFrame(r._onTransitionFrame),r._updateViewport()})),t&&(this.props=t),this.time=n||Date.now}return Object(i.a)(e,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(e){var t=this.props;if(this.props=e,this._shouldIgnoreViewportChange(t,e))return!1;if(this._isTransitionEnabled(e)){var n=Object.assign({},t),r=Object.assign({},e);if(this._isTransitionInProgress()&&(t.onTransitionInterrupt(),this.state.interruption===Ve.SNAP_TO_END?Object.assign(n,this.state.endProps):Object.assign(n,this.state.propsInTransition),this.state.interruption===Ve.UPDATE)){var a=this.time(),o=(a-this.state.startTime)/this.state.duration;r.transitionDuration=this.state.duration-(a-this.state.startTime),r.transitionEasing=function(e,t){var n=e(t);return function(r){return 1/(1-n)*(e(r*(1-t)+t)-n)}}(this.state.easing,o),r.transitionInterpolator=n.transitionInterpolator}return r.onTransitionStart(),this._triggerTransition(n,r),!0}return this._isTransitionInProgress()&&(t.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return Boolean(this._animationFrame)}},{key:"_isTransitionEnabled",value:function(e){var t=e.transitionDuration,n=e.transitionInterpolator;return(t>0||"auto"===t)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(e,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return!e||(this._isTransitionInProgress()?this.state.interruption===Ve.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t))}},{key:"_triggerTransition",value:function(e,t){se(this._isTransitionEnabled(t)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=t.transitionInterpolator,r=n.getDuration?n.getDuration(e,t):t.transitionDuration;if(0!==r){var a=t.transitionInterpolator.initializeProps(e,t),o={inTransition:!0,isZooming:e.zoom!==t.zoom,isPanning:e.longitude!==t.longitude||e.latitude!==t.latitude,isRotating:e.bearing!==t.bearing||e.pitch!==t.pitch};this.state={duration:r,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startTime:this.time(),startProps:a.start,endProps:a.end,animation:null,propsInTransition:{},interactionState:o},this._onTransitionFrame(),this.props.onStateChange(o)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.props.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var e=this.time(),t=this.state,n=t.startTime,r=t.duration,a=t.easing,o=t.interpolator,i=t.startProps,s=t.endProps,l=!1,u=(e-n)/r;u>=1&&(u=1,l=!0),u=a(u);var c=o.interpolateProps(i,s,u),d=new Pe(Object.assign({},this.props,c));this.state.propsInTransition=d.getViewportProps(),this.props.onViewportChange(this.state.propsInTransition,this.state.interactionState,this.props),l&&(this._endTransition(),this.props.onTransitionEnd())}}]),e}();Object(c.a)(Ye,"defaultProps",Ge);var We=n(622);var qe={transitionDuration:0},Xe={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new Oe,transitionInterruption:Ve.BREAK},Ke=["wheel"],Ze=["panstart","panmove","panend"],Je=["pinchstart","pinchmove","pinchend","pinchcancel"],Qe=["doubletap"],$e=["keydown"],et=function(){function e(){var t=this;Object(a.a)(this,e),Object(c.a)(this,"events",[]),Object(c.a)(this,"mapState",void 0),Object(c.a)(this,"onViewportChange",void 0),Object(c.a)(this,"onStateChange",void 0),Object(c.a)(this,"mapStateProps",void 0),Object(c.a)(this,"eventManager",void 0),Object(c.a)(this,"scrollZoom",!0),Object(c.a)(this,"dragPan",!0),Object(c.a)(this,"dragRotate",!0),Object(c.a)(this,"doubleClickZoom",!0),Object(c.a)(this,"touchZoom",!0),Object(c.a)(this,"touchRotate",!1),Object(c.a)(this,"keyboard",!0),Object(c.a)(this,"_state",{isDragging:!1}),Object(c.a)(this,"_events",{}),Object(c.a)(this,"_transitionManager",new Ye),Object(c.a)(this,"setState",(function(e){Object.assign(t._state,e),t.onStateChange&&t.onStateChange(t._state)})),this.handleEvent=this.handleEvent.bind(this),this._onWheelEnd=function(e,t){var n,r,a,o=function(){return a=null,e.apply(n,r)};return function(){n=this,r=arguments,a&&clearTimeout(a),a=setTimeout(o,t)}}(this._onWheelEnd,100)}return Object(i.a)(e,[{key:"handleEvent",value:function(e){switch(this.mapState=this.getMapState(),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchcancel":case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=e.offsetCenter;return[t.x,t.y]}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.mapState?this.mapState.getViewportProps():{},a=Object.assign({},e.getViewportProps(),t),o=Object.keys(a).some((function(e){return r[e]!==a[e]}));o&&this.onViewportChange(a,n,r),this.setState(Object.assign({},e.getInteractiveState(),n))}},{key:"getMapState",value:function(e){return new Pe(Object.assign({},this.mapStateProps,this._state,e))}},{key:"setOptions",value:function(e){var t=e.onViewportChange,n=e.onStateChange,r=e.eventManager,a=void 0===r?this.eventManager:r,o=e.isInteractive,i=void 0===o||o,s=e.scrollZoom,l=void 0===s?this.scrollZoom:s,u=e.dragPan,c=void 0===u?this.dragPan:u,d=e.dragRotate,f=void 0===d?this.dragRotate:d,p=e.doubleClickZoom,h=void 0===p?this.doubleClickZoom:p,m=e.touchZoom,g=void 0===m?this.touchZoom:m,y=e.touchRotate,v=void 0===y?this.touchRotate:y,A=e.keyboard,b=void 0===A?this.keyboard:A;this.onViewportChange=t,this.onStateChange=n;var _=!this.mapStateProps||this.mapStateProps.height!==e.height;this.mapStateProps=e,_&&this.updateViewport(new Pe(e)),this._transitionManager.processViewportChange(Object.assign({},e,{onStateChange:this.setState})),this.eventManager!==a&&(this.eventManager=a,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(Ke,i&&l),this.toggleEvents(Ze,i&&(c||f)),this.toggleEvents(Je,i&&(g||v)),this.toggleEvents(Qe,i&&h),this.toggleEvents($e,i&&b),this.scrollZoom=l,this.dragPan=c,this.dragRotate=f,this.doubleClickZoom=h,this.touchZoom=g,this.touchRotate=v,this.keyboard=b}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach((function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))}))}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e),n=this.mapState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,qe,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){return this.isFunctionKeyPressed(e)||e.rightButton?this._onPanRotate(e):this._onPanMove(e)}},{key:"_onPanEnd",value:function(e){var t=this.mapState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.mapState.pan({pos:t});return this.updateViewport(n,qe,{isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,r=this.getCenter(e),a=Object(_.a)(r,2)[1],o=a-n,i=this.mapState.getViewportProps(),s=i.width,l=i.height,u=t/s,c=0;n>0?Math.abs(l-o)>5&&(c=n/(o-l)*1.2):n<0&&o>5&&(c=1-a/o),c=Math.min(1,Math.max(-1,c));var d=this.mapState.rotate({deltaScaleX:u,deltaScaleY:c});return this.updateViewport(d,qe,{isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e),n=e.delta,r=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==r&&(r=1/r);var a=this.mapState.zoom({pos:t,scale:r});return this.updateViewport(a,qe,{isZooming:!0}),this._onWheelEnd(),!0}},{key:"_onWheelEnd",value:function(){this.setState({isZooming:!1})}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e),n=this.mapState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,qe,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;var t=this.mapState;if(this.touchZoom){var n=e.scale,r=this.getCenter(e);t=t.zoom({pos:r,scale:n})}if(this.touchRotate){var a=e.rotation,o=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(a-o)/180})}return this.updateViewport(t,qe,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e),n=this.isFunctionKeyPressed(e),r=this.mapState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(r,Object.assign({},Xe,{transitionInterpolator:new Oe({around:t})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),r=this.mapStateProps;switch(e.srcEvent.keyCode){case 189:t=n?this.getMapState({zoom:r.zoom-2}):this.getMapState({zoom:r.zoom-1});break;case 187:t=n?this.getMapState({zoom:r.zoom+2}):this.getMapState({zoom:r.zoom+1});break;case 37:t=n?this.getMapState({bearing:r.bearing-15}):this.mapState.pan({pos:[100,0],startPos:[0,0]});break;case 39:t=n?this.getMapState({bearing:r.bearing+15}):this.mapState.pan({pos:[-100,0],startPos:[0,0]});break;case 38:t=n?this.getMapState({pitch:r.pitch+10}):this.mapState.pan({pos:[0,100],startPos:[0,0]});break;case 40:t=n?this.getMapState({pitch:r.pitch-10}):this.mapState.pan({pos:[0,-100],startPos:[0,0]});break;default:return!1}return this.updateViewport(t,Xe)}}]),e}(),tt=[{old:"onChangeViewport",new:"onViewportChange"},{old:"perspectiveEnabled",new:"dragRotate"},{old:"onHoverFeatures",new:"onHover"},{old:"onClickFeatures",new:"onClick"},{old:"touchZoomRotate",new:"touchZoom, touchRotate"},{old:"mapControls",new:"controller"}];function nt(e){return"react-map-gl: `".concat(e,"` is removed.")}function rt(e){return"Use `".concat(e,"` instead.")}function at(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tt.forEach((function(t){if(e.hasOwnProperty(t.old)){var n=nt(t.old);t.new&&(n="".concat(n," ").concat(rt(t.new))),console.warn(n)}}))}function ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var it=Object.assign({},Ue.propTypes,{maxZoom:p.a.number,minZoom:p.a.number,maxPitch:p.a.number,minPitch:p.a.number,onViewStateChange:p.a.func,onViewportChange:p.a.func,onInteractionStateChange:p.a.func,transitionDuration:p.a.oneOfType([p.a.number,p.a.string]),transitionInterpolator:p.a.object,transitionInterruption:p.a.number,transitionEasing:p.a.func,onTransitionStart:p.a.func,onTransitionInterrupt:p.a.func,onTransitionEnd:p.a.func,scrollZoom:p.a.bool,dragPan:p.a.bool,dragRotate:p.a.bool,doubleClickZoom:p.a.bool,touchZoom:p.a.bool,touchRotate:p.a.bool,keyboard:p.a.bool,onHover:p.a.func,onClick:p.a.func,onDblClick:p.a.func,onContextMenu:p.a.func,onMouseDown:p.a.func,onMouseMove:p.a.func,onMouseUp:p.a.func,onTouchStart:p.a.func,onTouchMove:p.a.func,onTouchEnd:p.a.func,onMouseEnter:p.a.func,onMouseLeave:p.a.func,onMouseOut:p.a.func,onWheel:p.a.func,touchAction:p.a.string,clickRadius:p.a.number,interactiveLayerIds:p.a.array,getCursor:p.a.func,controller:p.a.instanceOf(et)}),st=Object.assign({},Ue.defaultProps,Se,Ye.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(e){return e.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",clickRadius:0,getCursor:function(e){var t=e.isDragging,n=e.isHovering;return t?"grabbing":n?"pointer":"grab"}}),lt=function(e){Object(s.a)(n,e);var t=ot(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"state",{isLoaded:!1,isDragging:!1,isHovering:!1}),Object(c.a)(Object(o.a)(r),"_controller",void 0),Object(c.a)(Object(o.a)(r),"_eventManager",void 0),Object(c.a)(Object(o.a)(r),"_interactiveContext",void 0),Object(c.a)(Object(o.a)(r),"_width",0),Object(c.a)(Object(o.a)(r),"_height",0),Object(c.a)(Object(o.a)(r),"_eventCanvasRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(r),"_staticMapRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(r),"getMap",(function(){return r._staticMapRef.current?r._staticMapRef.current.getMap():null})),Object(c.a)(Object(o.a)(r),"queryRenderedFeatures",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.getMap();return n&&n.queryRenderedFeatures(e,t)})),Object(c.a)(Object(o.a)(r),"_onInteractionStateChange",(function(e){var t=e.isDragging,n=void 0!==t&&t;n!==r.state.isDragging&&(r._updateInteractiveContext({isDragging:n}),r.setState({isDragging:n}));var a=r.props.onInteractionStateChange;a&&a(e)})),Object(c.a)(Object(o.a)(r),"_onResize",(function(e){var t=e.width,n=e.height;r._width=t,r._height=n,r._setControllerProps(r.props),r.props.onResize({width:t,height:n})})),Object(c.a)(Object(o.a)(r),"_onViewportChange",(function(e,t,n){var a=r.props,o=a.onViewStateChange,i=a.onViewportChange;o&&o({viewState:e,interactionState:t,oldViewState:n}),i&&i(e,t,n)})),Object(c.a)(Object(o.a)(r),"_onLoad",(function(e){r.setState({isLoaded:!0}),r.props.onLoad(e)})),Object(c.a)(Object(o.a)(r),"_onEvent",(function(e,t){var n=r.props[e];n&&n(r._normalizeEvent(t))})),Object(c.a)(Object(o.a)(r),"_onPointerDown",(function(e){switch(e.pointerType){case"touch":r._onEvent("onTouchStart",e);break;default:r._onEvent("onMouseDown",e)}})),Object(c.a)(Object(o.a)(r),"_onPointerUp",(function(e){switch(e.pointerType){case"touch":r._onEvent("onTouchEnd",e);break;default:r._onEvent("onMouseUp",e)}})),Object(c.a)(Object(o.a)(r),"_onPointerMove",(function(e){switch(e.pointerType){case"touch":r._onEvent("onTouchMove",e);break;default:r._onEvent("onMouseMove",e)}if(!r.state.isDragging){var t,n=r.props,a=n.onHover,o=n.interactiveLayerIds;e=r._normalizeEvent(e),r.state.isLoaded&&(o||a)&&(t=r._getFeatures({pos:e.point,radius:r.props.clickRadius})),a&&(e.features=t,a(e));var i=Boolean(o&&t&&t.length>0),s=i&&!r.state.isHovering,l=!i&&r.state.isHovering;s&&r._onEvent("onMouseEnter",e),l&&r._onEvent("onMouseLeave",e),(s||l)&&r.setState({isHovering:i})}})),Object(c.a)(Object(o.a)(r),"_onClick",(function(e){var t=r.props,n=t.onClick,a=t.onNativeClick,o=t.onDblClick,i=t.doubleClickZoom,s=[],l=o||i;switch(e.type){case"anyclick":s.push(a),l||s.push(n);break;case"click":l&&s.push(n)}(s=s.filter(Boolean)).length&&((e=r._normalizeEvent(e)).features=r._getFeatures({pos:e.point,radius:r.props.clickRadius}),s.forEach((function(t){return t(e)})))})),at(e),r._controller=e.controller||new et,r._eventManager=new We.EventManager(null,{touchAction:e.touchAction}),r._updateInteractiveContext({isDragging:!1,eventManager:r._eventManager}),r}return Object(i.a)(n,null,[{key:"supported",value:function(){return Ue.supported()}}]),Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this._eventManager,t=this._eventCanvasRef.current;e.setElement(t),e.on({pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerup:this._onPointerUp,pointerleave:this._onEvent.bind(this,"onMouseOut"),click:this._onClick,anyclick:this._onClick,dblclick:this._onEvent.bind(this,"onDblClick"),wheel:this._onEvent.bind(this,"onWheel"),contextmenu:this._onEvent.bind(this,"onContextMenu")}),this._setControllerProps(this.props),this._updateInteractiveContext({mapContainer:t})}},{key:"componentDidUpdate",value:function(){this._setControllerProps(this.props)}},{key:"componentWillUnmount",value:function(){this._eventManager.destroy()}},{key:"_setControllerProps",value:function(e){e=Object.assign({},e,e.viewState,{isInteractive:Boolean(e.onViewStateChange||e.onViewportChange),onViewportChange:this._onViewportChange,onStateChange:this._onInteractionStateChange,eventManager:this._eventManager,width:this._width,height:this._height}),this._controller.setOptions(e);var t=this._interactiveContext;t.onViewportChange=e.onViewportChange,t.onViewStateChange=e.onViewStateChange}},{key:"_getFeatures",value:function(e){var t,n=e.pos,r=e.radius,a={},o=this.getMap();if(this.props.interactiveLayerIds&&(a.layers=this.props.interactiveLayerIds),r){var i=r,s=[[n[0]-i,n[1]+i],[n[0]+i,n[1]-i]];t=o&&o.queryRenderedFeatures(s,a)}else t=o&&o.queryRenderedFeatures(n,a);return t}},{key:"_updateInteractiveContext",value:function(e){this._interactiveContext=Object.assign({},this._interactiveContext,e)}},{key:"_normalizeEvent",value:function(e){if(e.lngLat)return e;var t=e.offsetCenter,n=[t.x,t.y],r=new q(Object.assign({},this.props,{width:this._width,height:this._height}));return e.point=n,e.lngLat=r.unproject(n),e}},{key:"render",value:function(){var e=this.props,t=e.width,n=e.height,a=e.style,o=e.getCursor,i=Object.assign({position:"relative"},a,{width:t,height:n,cursor:o(this.state)});return d.createElement(De.Provider,{value:this._interactiveContext},d.createElement("div",{key:"event-canvas",ref:this._eventCanvasRef,style:i},d.createElement(Ue,Object(r.a)({},this.props,{width:"100%",height:"100%",style:null,onResize:this._onResize,onLoad:this._onLoad,ref:this._staticMapRef}),this.props.children)))}}]),n}(d.PureComponent);Object(c.a)(lt,"propTypes",it),Object(c.a)(lt,"defaultProps",st);var ut=n(244);function ct(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ct(e[n],t[n]))return!1;return!0}if(Array.isArray(t))return!1;if("object"===Object(ut.a)(e)&&"object"===Object(ut.a)(t)){var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var o=0,i=r;o<i.length;o++){var s=i[o];if(!t.hasOwnProperty(s))return!1;if(!ct(e[s],t[s]))return!1}return!0}return!1}function dt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var ft={type:p.a.string.isRequired,id:p.a.string},pt=0,ht=function(e){Object(s.a)(n,e);var t=dt(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"id",void 0),Object(c.a)(Object(o.a)(r),"type",void 0),Object(c.a)(Object(o.a)(r),"_map",null),Object(c.a)(Object(o.a)(r),"_sourceOptions",{}),Object(c.a)(Object(o.a)(r),"_updateSource",(function(){var e=Object(o.a)(r),t=e.type;if(e._map){var n=Object(o.a)(r),a=n._sourceOptions,i=n.props;se(!i.id||i.id===r.id,"source id changed"),se(i.type===t,"source type changed");var s="",l=0;for(var u in i)"children"===u||"id"===u||ct(a[u],i[u])||(a[u]=i[u],s=u,l++);var c=r.getSource();if(c){if(l)if("geojson"===t)c.setData(a.data);else if("image"===t)c.updateImage({url:a.url,coordinates:a.coordinates});else if("canvas"!==t&&"video"!==t||1!==l||"coordinates"!==s)if("vector"===t&&c.setUrl)switch(s){case"url":c.setUrl(a.url);break;case"tiles":c.setTiles(a.tiles)}else console.warn("Unable to update <Source> prop: ".concat(s));else c.setCoordinates(a.coordinates)}else r._createSource(a)}})),r.id=e.id||"jsx-source-".concat(pt++),r.type=e.type,r}return Object(i.a)(n,[{key:"componentWillUnmount",value:function(){var e=this,t=this._map;t&&(t.off("styledata",this._updateSource),requestAnimationFrame((function(){t.style&&t.style._loaded&&t.removeSource(e.id)})))}},{key:"getSource",value:function(){var e=this._map;return e&&e.style&&e.getSource(this.id)}},{key:"_createSource",value:function(e){var t=this._map;t.style&&t.style._loaded&&t.addSource(this.id,e)}},{key:"_render",value:function(e){var t=this;return!this._map&&e.map&&(this._map=e.map,this._map.on("styledata",this._updateSource)),this._updateSource(),d.Children.map(this.props.children,(function(e){return e&&Object(d.cloneElement)(e,{source:t.id})}))}},{key:"render",value:function(){return d.createElement(De.Consumer,null,this._render.bind(this))}}]),n}(d.PureComponent);function mt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function gt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(ht,"propTypes",ft);var yt={type:p.a.oneOf(Object.keys({fill:"fill",line:"line",symbol:"symbol",circle:"circle","fill-extrusion":"fill-extrusion",raster:"raster",background:"background",heatmap:"heatmap",hillshade:"hillshade"})).isRequired,id:p.a.string,source:p.a.string,beforeId:p.a.string};var vt=0,At=function(e){Object(s.a)(n,e);var t=gt(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"id",void 0),Object(c.a)(Object(o.a)(r),"type",void 0),Object(c.a)(Object(o.a)(r),"_map",null),Object(c.a)(Object(o.a)(r),"_layerOptions",{}),Object(c.a)(Object(o.a)(r),"_updateLayer",(function(){var e=r._map;if(e){var t=Object(o.a)(r),n=t.props,a=t._layerOptions;if(se(!n.id||n.id===r.id,"layer id changed"),se(n.type===r.type,"layer type changed"),r.getLayer())try{!function(e,t,n,r){var a=n.layout,o=void 0===a?{}:a,i=n.paint,s=void 0===i?{}:i,l=n.filter,u=n.minzoom,c=n.maxzoom,d=n.beforeId,f=mt(n,["layout","paint","filter","minzoom","maxzoom","beforeId"]);if(d!==r.beforeId&&e.moveLayer(t,d),o!==r.layout){for(var p in o)ct(o[p],r.layout[p])||e.setLayoutProperty(t,p,o[p]);for(var h in r.layout)o.hasOwnProperty(h)||e.setLayoutProperty(t,h,void 0)}if(s!==r.paint){for(var m in s)ct(s[m],r.paint[m])||e.setPaintProperty(t,m,s[m]);for(var g in r.paint)s.hasOwnProperty(g)||e.setPaintProperty(t,g,void 0)}for(var y in ct(l,r.filter)||e.setFilter(t,l),u===r.minzoom&&c===r.maxzoom||e.setLayerZoomRange(t,u,c),f)ct(f[y],r[y])||e.setLayerProperty(t,y,f[y])}(e,r.id,n,a),Object.assign(a,n)}catch(e){console.warn(e)}else r._createLayer()}})),r.id=e.id||"jsx-layer-".concat(vt++),r.type=e.type,r}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this._updateLayer()}},{key:"componentDidUpdate",value:function(){this._updateLayer()}},{key:"componentWillUnmount",value:function(){var e=this._map;e&&(e.off("styledata",this._updateLayer),e.style&&e.style._loaded&&e.removeLayer(this.id))}},{key:"getLayer",value:function(){var e=this._map;return e&&e.style&&e.getLayer(this.id)}},{key:"_createLayer",value:function(){var e=this._map;if(e.style&&e.style._loaded){var t=Object.assign({},this.props);t.id=this.id,delete t.beforeId,e.addLayer(t,this.props.beforeId),this._layerOptions=t}}},{key:"_render",value:function(e){return!this._map&&e.map&&(this._map=e.map,this._map.on("styledata",this._updateLayer)),null}},{key:"render",value:function(){return d.createElement(De.Consumer,null,this._render.bind(this))}}]),n}(d.PureComponent);function bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(At,"propTypes",yt);var _t={captureScroll:p.a.bool,captureDrag:p.a.bool,captureClick:p.a.bool,captureDoubleClick:p.a.bool,capturePointerMove:p.a.bool},Et=function(e){Object(s.a)(n,e);var t=bt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_context",{}),Object(c.a)(Object(o.a)(e),"_events",null),Object(c.a)(Object(o.a)(e),"_containerRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_onScroll",(function(t){e.props.captureScroll&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onDragStart",(function(t){e.props.captureDrag&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onDblClick",(function(t){e.props.captureDoubleClick&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onClick",(function(t){e.props.captureClick&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onPointerMove",(function(t){e.props.capturePointerMove&&t.stopPropagation()})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this._containerRef.current;if(e){var t=this._context.eventManager;t&&(this._events={wheel:this._onScroll,panstart:this._onDragStart,anyclick:this._onClick,click:this._onClick,dblclick:this._onDblClick,pointermove:this._onPointerMove},t.watch(this._events,e))}}},{key:"componentWillUnmount",value:function(){var e=this._context.eventManager;e&&this._events&&e.off(this._events)}},{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){var e=this;return d.createElement(De.Consumer,null,(function(t){return e._context=t,e._render()}))}}]),n}(d.PureComponent);function xt(e,t,n){return(xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(u.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}function Mt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(Et,"propTypes",_t),Object(c.a)(Et,"defaultProps",{captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1});var wt=Object.assign({},Et.propTypes,{draggable:p.a.bool,onDrag:p.a.func,onDragEnd:p.a.func,onDragStart:p.a.func,offsetLeft:p.a.number,offsetTop:p.a.number}),Ot=Object.assign({},Et.defaultProps,{draggable:!1,offsetLeft:0,offsetTop:0}),St=function(e){Object(s.a)(n,e);var t=Mt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{dragPos:null,dragOffset:null}),Object(c.a)(Object(o.a)(e),"_dragEvents",null),Object(c.a)(Object(o.a)(e),"_onDragStart",(function(t){var n=e.props,r=n.draggable,a=n.captureDrag;if((r||a)&&t.stopPropagation(),r){var o=e._getDragEventPosition(t),i=e._getDragEventOffset(t);e.setState({dragPos:o,dragOffset:i}),e._setupDragEvents();var s=e.props.onDragStart;if(s&&i){var l=Object.assign({},t);l.lngLat=e._getDragLngLat(o,i),s(l)}}})),Object(c.a)(Object(o.a)(e),"_onDrag",(function(t){t.stopPropagation();var n=e._getDragEventPosition(t);e.setState({dragPos:n});var r=e.props.onDrag,a=e.state.dragOffset;if(r&&a){var o=Object.assign({},t);o.lngLat=e._getDragLngLat(n,a),r(o)}})),Object(c.a)(Object(o.a)(e),"_onDragEnd",(function(t){var n=e.state,r=n.dragPos,a=n.dragOffset;t.stopPropagation(),e.setState({dragPos:null,dragOffset:null}),e._removeDragEvents();var o=e.props.onDragEnd;if(o&&r&&a){var i=Object.assign({},t);i.lngLat=e._getDragLngLat(r,a),o(i)}})),Object(c.a)(Object(o.a)(e),"_onDragCancel",(function(t){t.stopPropagation(),e.setState({dragPos:null,dragOffset:null}),e._removeDragEvents()})),e}return Object(i.a)(n,[{key:"componentWillUnmount",value:function(){xt(Object(u.a)(n.prototype),"componentWillUnmount",this).call(this),this._removeDragEvents()}},{key:"_setupDragEvents",value:function(){var e=this._context.eventManager;e&&(this._dragEvents={panmove:this._onDrag,panend:this._onDragEnd,pancancel:this._onDragCancel},e.on(this._dragEvents))}},{key:"_removeDragEvents",value:function(){var e=this._context.eventManager;e&&this._dragEvents&&(e.off(this._dragEvents),this._dragEvents=null)}},{key:"_getDragEventPosition",value:function(e){var t=e.offsetCenter;return[t.x,t.y]}},{key:"_getDragEventOffset",value:function(e){var t=e.center,n=t.x,r=t.y,a=this._containerRef.current;if(a){var o=a.getBoundingClientRect();return[o.left-n,o.top-r]}return null}},{key:"_getDraggedPosition",value:function(e,t){return[e[0]+t[0],e[1]+t[1]]}},{key:"_getDragLngLat",value:function(e,t){var n=this.props,r=n.offsetLeft,a=n.offsetTop,o=this._getDraggedPosition(e,t),i=Object(_.a)(o,2),s=i[0],l=i[1];return this._context.viewport.unproject([s-r,l-a])}}]),n}(Et);Object(c.a)(St,"propTypes",wt),Object(c.a)(St,"defaultProps",Ot);var Tt="undefined"!=typeof window&&window.devicePixelRatio||1,Ct=function(e){return Math.round(e*Tt)/Tt},Lt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x";if(null===e)return t;var r="x"===n?e.offsetWidth:e.offsetHeight;return Ct(t/100*r)/r*100};function Pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var Rt=Object.assign({},St.propTypes,{className:p.a.string,longitude:p.a.number.isRequired,latitude:p.a.number.isRequired}),Dt=Object.assign({},St.defaultProps,{className:""}),kt=function(e){Object(s.a)(n,e);var t=Pt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_control",null),e}return Object(i.a)(n,[{key:"_getPosition",value:function(){var e=this.props,t=e.longitude,n=e.latitude,r=e.offsetLeft,a=e.offsetTop,o=this.state,i=o.dragPos,s=o.dragOffset;if(i&&s)return this._getDraggedPosition(i,s);var l=this._context.viewport.project([t,n]),u=Object(_.a)(l,2),c=u[0],d=u[1];return[c+=r,d+=a]}},{key:"_render",value:function(){var e=this._getPosition(),t=Object(_.a)(e,2),n=t[0],r=t[1],a="translate(".concat(Ct(n),"px, ").concat(Ct(r),"px)"),o=this._containerRef.current;if(this._control&&o)o.style.transform=a;else{var i=this.props,s=i.className,l=i.draggable,u=this.state.dragPos,c={position:"absolute",left:0,top:0,transform:a,cursor:l?u?"grabbing":"grab":"auto"};this._control=d.createElement("div",{className:"mapboxgl-marker ".concat(s),ref:this._containerRef,style:c},this.props.children)}return this._control}},{key:"render",value:function(){return this._control=null,xt(Object(u.a)(n.prototype),"render",this).call(this)}}]),n}(St);Object(c.a)(kt,"propTypes",Rt),Object(c.a)(kt,"defaultProps",Dt);var It={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}},Ft=Object.keys(It);function jt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var Bt=Object.assign({},Et.propTypes,{className:p.a.string,longitude:p.a.number.isRequired,latitude:p.a.number.isRequired,altitude:p.a.number,offsetLeft:p.a.number,offsetTop:p.a.number,tipSize:p.a.number,closeButton:p.a.bool,closeOnClick:p.a.bool,anchor:p.a.oneOf(Object.keys(It)),dynamicPosition:p.a.bool,sortByDepth:p.a.bool,onClose:p.a.func}),Nt=Object.assign({},Et.defaultProps,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}}),zt=function(e){Object(s.a)(n,e);var t=jt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_closeOnClick",!1),Object(c.a)(Object(o.a)(e),"_contentRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_onClick",(function(t){if(e.props.captureClick&&t.stopPropagation(),e.props.closeOnClick||"mapboxgl-popup-close-button"===t.target.className){e.props.onClose();var n=e._context.eventManager;n&&n.once("click",(function(e){return e.stopPropagation()}),t.target)}})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){xt(Object(u.a)(n.prototype),"componentDidMount",this).call(this),this.forceUpdate()}},{key:"_getPosition",value:function(e,t){var n=this._context.viewport,r=this.props,a=r.anchor,o=r.dynamicPosition,i=r.tipSize,s=this._contentRef.current;return s&&o?function(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=e.selfWidth,i=e.selfHeight,s=e.anchor,l=e.padding,u=void 0===l?0:l,c=It[s],d=c.x,f=c.y,p=n-f*i,h=p+i;if(p<u)for(;p<u&&f>=.5;)f-=.5,p+=.5*i;else if(h>a-u)for(;h>a-u&&f<=.5;)f+=.5,h-=.5*i;var m=t-d*o,g=m+o,y=.5;if(.5===f&&(d=Math.floor(d),y=1),m<u)for(;m<u&&d>=y;)d-=y,m+=y*o;else if(g>r-u)for(;g>r-u&&d<=1-y;)d+=y,g-=y*o;return Ft.find((function(e){var t=It[e];return t.x===d&&t.y===f}))||s}({x:e,y:t,anchor:a,padding:i,width:n.width,height:n.height,selfWidth:s.clientWidth,selfHeight:s.clientHeight}):a}},{key:"_getContainerStyle",value:function(e,t,n,r){var a=this._context.viewport,o=this.props,i=o.offsetLeft,s=o.offsetTop,l=o.sortByDepth,u=It[r],c=e+i,d=t+s,f=this._containerRef.current,p=Lt(f,100*-u.x),h=Lt(f,100*-u.y,"y"),m={position:"absolute",transform:"\n translate(".concat(p,"%, ").concat(h,"%)\n translate(").concat(Ct(c),"px, ").concat(Ct(d),"px)\n "),display:void 0,zIndex:void 0};return l?(n>1||n<-1||e<0||e>a.width||t<0||t>a.height?m.display="none":m.zIndex=Math.floor((1-n)/2*1e5),m):m}},{key:"_renderTip",value:function(e){var t=this.props.tipSize;return d.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:t}})}},{key:"_renderContent",value:function(){var e=this.props,t=e.closeButton,n=e.children,r=this._context.eventManager?null:this._onClick;return d.createElement("div",{key:"content",ref:this._contentRef,className:"mapboxgl-popup-content",onClick:r},t&&d.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button"},"×"),n)}},{key:"_render",value:function(){var e=this.props,t=e.className,n=e.longitude,r=e.latitude,a=e.altitude,o=this._context.viewport.project([n,r,a]),i=Object(_.a)(o,3),s=i[0],l=i[1],u=i[2],c=this._getPosition(s,l),f=this._getContainerStyle(s,l,u,c);return d.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(c," ").concat(t),style:f,ref:this._containerRef},this._renderTip(c),this._renderContent())}}]),n}(Et);Object(c.a)(zt,"propTypes",Bt),Object(c.a)(zt,"defaultProps",Nt);var Ut=n(136);function Ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var Vt,Gt=Object.assign({},Et.propTypes,{className:p.a.string,container:p.a.object,label:p.a.string}),Yt=Object.assign({},Et.defaultProps,{className:"",container:null,label:"Toggle fullscreen"}),Wt=function(e){Object(s.a)(n,e);var t=Ht(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{isFullscreen:!1,showButton:!1}),Object(c.a)(Object(o.a)(e),"_mapboxFullscreenControl",null),Object(c.a)(Object(o.a)(e),"_onFullscreenChange",(function(){var t=!e._mapboxFullscreenControl._fullscreen;e._mapboxFullscreenControl._fullscreen=t,e.setState({isFullscreen:t})})),Object(c.a)(Object(o.a)(e),"_onClickFullscreen",(function(){e._mapboxFullscreenControl._onClickFullscreen()})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this.props.container||this._context.mapContainer;this._mapboxFullscreenControl=new ne.a.FullscreenControl({container:e}),this.setState({showButton:this._mapboxFullscreenControl._checkFullscreenSupport()}),Ut.a.addEventListener(this._mapboxFullscreenControl._fullscreenchange,this._onFullscreenChange)}},{key:"componentWillUnmount",value:function(){Ut.a.removeEventListener(this._mapboxFullscreenControl._fullscreenchange,this._onFullscreenChange)}},{key:"_renderButton",value:function(e,t,n){return d.createElement("button",{key:e,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(e),type:"button",title:t,onClick:n},d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}},{key:"_render",value:function(){if(!this.state.showButton)return null;var e=this.props,t=e.className,n=e.label,r=this.state.isFullscreen?"shrink":"fullscreen";return d.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group ".concat(t),ref:this._containerRef},this._renderButton(r,n,this._onClickFullscreen))}}]),n}(Et);function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(Wt,"propTypes",Gt),Object(c.a)(Wt,"defaultProps",Yt);var Xt=Object.assign({},Ye.defaultProps,{transitionDuration:500}),Kt=function(){},Zt=Object.assign({},Et.propTypes,{className:p.a.string,style:p.a.object,label:p.a.string,auto:p.a.bool,positionOptions:p.a.object,fitBoundsOptions:p.a.object,trackUserLocation:p.a.bool,showUserLocation:p.a.bool,onViewStateChange:p.a.func,onViewportChange:p.a.func,onGeolocate:p.a.func}),Jt=Object.assign({},Et.defaultProps,{className:"",style:{},label:"Geolocate",auto:!1,positionOptions:null,fitBoundsOptions:null,trackUserLocation:!1,showUserLocation:!0,onGeolocate:function(){}}),Qt=function(e){Object(s.a)(n,e);var t=qt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{supportsGeolocation:!1,markerPosition:null}),Object(c.a)(Object(o.a)(e),"_mapboxGeolocateControl",null),Object(c.a)(Object(o.a)(e),"_geolocateButtonRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_setupMapboxGeolocateControl",(function(t){if(t){var n={showUserLocation:!1};["positionOptions","fitBoundsOptions","trackUserLocation"].forEach((function(t){t in e.props&&null!==e.props[t]&&(n[t]=e.props[t])}));var r=new ne.a.GeolocateControl(n);e._mapboxGeolocateControl=r,r._watchState="OFF",r._geolocateButton=e._geolocateButtonRef.current,r.options.trackUserLocation&&r._geolocateButton&&r._geolocateButton.setAttribute("aria-pressed","false"),r._updateMarker=e._updateMarker,r._updateCamera=e._updateCamera,r._setup=!0;var a=e._context.eventManager;r.options.trackUserLocation&&a&&a.on("panstart",(function(){"ACTIVE_LOCK"===r._watchState&&(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"))})),r.on("geolocate",e.props.onGeolocate)}else console.warn("Geolocation support is not available, the GeolocateControl will not be visible.")})),Object(c.a)(Object(o.a)(e),"_triggerGeolocate",(function(){var t=e._mapboxGeolocateControl;return t._map=e._context.map,e.props.showUserLocation&&(t.on("geolocate",e._updateMarker),t.on("trackuserlocationend",e._updateMarker)),e._mapboxGeolocateControl.trigger()})),Object(c.a)(Object(o.a)(e),"_updateMarker",(function(t){t&&e.setState({markerPosition:t.coords})})),Object(c.a)(Object(o.a)(e),"_getBounds",(function(e){var t=new ne.a.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,r=t.toBounds(n);return[[r._ne.lng,r._ne.lat],[r._sw.lng,r._sw.lat]]})),Object(c.a)(Object(o.a)(e),"_updateCamera",(function(t){var n=e._context.viewport,r=e._getBounds(t),a=new q(n).fitBounds(r),o=a.longitude,i=a.latitude,s=a.zoom,l=Object.assign({},n,{longitude:o,latitude:i,zoom:s}),u=new Pe(l),c=Object.assign({},u.getViewportProps(),Xt),d=e.props.onViewportChange||e._context.onViewportChange||Kt;(e.props.onViewStateChange||e._context.onViewStateChange||Kt)({viewState:c}),d(c)})),Object(c.a)(Object(o.a)(e),"_renderButton",(function(t,n,r){return d.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),ref:e._geolocateButtonRef,type:"button",title:n,onClick:r},d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))})),Object(c.a)(Object(o.a)(e),"_renderMarker",(function(){var t=e.state.markerPosition,n=e.props.showUserLocation;return t&&n?d.createElement(kt,{key:"location-maker",longitude:t.longitude,latitude:t.latitude,captureDrag:!1,captureDoubleClick:!1},d.createElement("div",{className:"mapboxgl-user-location-dot",style:{transform:"translate(-50%, -50%)"}})):null})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this;(void 0!==Vt?Promise.resolve(Vt):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((function(e){return Vt="denied"!==e.state})):(Vt=Boolean(window.navigator.geolocation),Promise.resolve(Vt))).then((function(t){e.setState({supportsGeolocation:t}),e._setupMapboxGeolocateControl(t),t&&e.props.auto&&e._triggerGeolocate()}))}},{key:"componentDidUpdate",value:function(e){this.state.supportsGeolocation&&!e.auto&&this.props.auto&&this._triggerGeolocate()}},{key:"componentWillUnmount",value:function(){if(this._mapboxGeolocateControl){var e=this._mapboxGeolocateControl._geolocationWatchID;void 0!==e&&(window.navigator.geolocation.clearWatch(e),this._mapboxGeolocateControl._geolocationWatchID=void 0)}}},{key:"_render",value:function(){if(!this.state.supportsGeolocation)return null;var e=this.props,t=e.className,n=e.style,r=e.label;return d.createElement("div",null,this._renderMarker(),d.createElement("div",{key:"geolocate-control",className:"mapboxgl-ctrl mapboxgl-ctrl-group ".concat(t),ref:this._containerRef,style:n},this._renderButton("geolocate",r,this._triggerGeolocate)))}}]),n}(Et);function $t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(Qt,"propTypes",Zt),Object(c.a)(Qt,"defaultProps",Jt);var en=function(){},tn=Object.assign({},Et.propTypes,{className:p.a.string,onViewStateChange:p.a.func,onViewportChange:p.a.func,showCompass:p.a.bool,showZoom:p.a.bool,zoomInLabel:p.a.string,zoomOutLabel:p.a.string,compassLabel:p.a.string}),nn=Object.assign({},Et.defaultProps,{className:"",showCompass:!0,showZoom:!0,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",compassLabel:"Reset North"});function rn(e){return function(e,t){for(var n=(e||"").split(".").map(Number),r=(t||"").split(".").map(Number),a=0;a<3;a++){var o=n[a]||0,i=r[a]||0;if(o<i)return-1;if(o>i)return 1}return 0}(e,"1.6.0")>=0?2:1}var an=function(e){Object(s.a)(n,e);var t=$t(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"_uiVersion",void 0),Object(c.a)(Object(o.a)(r),"_onZoomIn",(function(){r._updateViewport({zoom:r._context.viewport.zoom+1})})),Object(c.a)(Object(o.a)(r),"_onZoomOut",(function(){r._updateViewport({zoom:r._context.viewport.zoom-1})})),Object(c.a)(Object(o.a)(r),"_onResetNorth",(function(){r._updateViewport({bearing:0,pitch:0})})),at(e),r}return Object(i.a)(n,[{key:"_updateViewport",value:function(e){var t=this._context.viewport,n=new Pe(Object.assign({},t,e)),r=Object.assign({},n.getViewportProps(),Xe),a=this.props.onViewportChange||this._context.onViewportChange||en;(this.props.onViewStateChange||this._context.onViewStateChange||en)({viewState:r}),a(r)}},{key:"_renderCompass",value:function(){var e=this._context.viewport.bearing,t={transform:"rotate(".concat(-e,"deg)")};return 2===this._uiVersion?d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true",style:t}):d.createElement("span",{className:"mapboxgl-ctrl-compass-arrow",style:t})}},{key:"_renderButton",value:function(e,t,n,r){return d.createElement("button",{key:e,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(e),type:"button",title:t,onClick:n},r||d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}},{key:"_render",value:function(){var e=this.props,t=e.className,n=e.showCompass,r=e.showZoom,a=e.zoomInLabel,o=e.zoomOutLabel,i=e.compassLabel;if(!this._uiVersion){var s=this._context.map;this._uiVersion=s?rn(s.version):2}return d.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group ".concat(t),ref:this._containerRef},r&&this._renderButton("zoom-in",a,this._onZoomIn),r&&this._renderButton("zoom-out",o,this._onZoomOut),n&&this._renderButton("compass",i,this._onResetNorth,this._renderCompass()))}}]),n}(Et);function on(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(an,"propTypes",tn),Object(c.a)(an,"defaultProps",nn);var sn=Object.assign({},Et.propTypes,{maxWidth:p.a.number,unit:p.a.oneOf(["imperial","metric","nautical"])}),ln=Object.assign({},Et.defaultProps,{maxWidth:100,unit:"metric"}),un=function(e){Object(s.a)(n,e);var t=on(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_control",null),Object(c.a)(Object(o.a)(e),"_mapboxScaleControl",null),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=new ne.a.ScaleControl;e._map=this._context.map,e._container=this._containerRef.current,this._mapboxScaleControl=e,this._update()}},{key:"_update",value:function(){var e=this._mapboxScaleControl;e&&(e.options=this.props,e._onMove())}},{key:"_render",value:function(){return this._control=this._control||d.createElement("div",{ref:this._containerRef,className:"mapboxgl-ctrl mapboxgl-ctrl-scale"}),this._update(),this._control}}]),n}(Et);function cn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(un,"propTypes",sn),Object(c.a)(un,"defaultProps",ln);var dn=Object.assign({},Et.propTypes,{redraw:p.a.func.isRequired}),fn=function(e){Object(s.a)(n,e);var t=cn(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_canvas",void 0),Object(c.a)(Object(o.a)(e),"_ctx",void 0),Object(c.a)(Object(o.a)(e),"_redraw",(function(){var t=e._ctx;if(t){var n=Ut.b.devicePixelRatio||1;t.save(),t.scale(n,n);var r=e._context,a=r.viewport,o=r.isDragging;e.props.redraw({width:a.width,height:a.height,ctx:t,isDragging:o,project:a.project.bind(a),unproject:a.unproject.bind(a)}),t.restore()}})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this._containerRef.current;e&&(this._canvas=e,this._ctx=e.getContext("2d")),this._redraw()}},{key:"_render",value:function(){var e=Ut.b.devicePixelRatio||1,t=this._context.viewport,n=t.width,r=t.height;return this._redraw(),d.createElement("canvas",{ref:this._containerRef,width:n*e,height:r*e,style:{width:"".concat(n,"px"),height:"".concat(r,"px"),position:"absolute",left:0,top:0}})}}]),n}(Et);function pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(fn,"propTypes",dn),Object(c.a)(fn,"defaultProps",{captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1});var hn=Object.assign({},Et.propTypes,{redraw:p.a.func.isRequired,style:p.a.object}),mn=function(e){Object(s.a)(n,e);var t=pn(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"_render",value:function(){var e=this._context,t=e.viewport,n=e.isDragging,r=Object.assign({position:"absolute",left:0,top:0,width:t.width,height:t.height},this.props.style);return d.createElement("div",{ref:this._containerRef,style:r},this.props.redraw({width:t.width,height:t.height,isDragging:n,project:t.project.bind(t),unproject:t.unproject.bind(t)}))}}]),n}(Et);function gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(mn,"propTypes",hn),Object(c.a)(mn,"defaultProps",{captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1});var yn=Object.assign({},Et.propTypes,{redraw:p.a.func.isRequired,style:p.a.object}),vn=function(e){Object(s.a)(n,e);var t=gn(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"_render",value:function(){var e=this._context,t=e.viewport,n=e.isDragging,r=Object.assign({position:"absolute",left:0,top:0},this.props.style);return d.createElement("svg",{width:t.width,height:t.height,ref:this._containerRef,style:r},this.props.redraw({width:t.width,height:t.height,isDragging:n,project:t.project.bind(t),unproject:t.unproject.bind(t)}))}}]),n}(Et);Object(c.a)(vn,"propTypes",yn),Object(c.a)(vn,"defaultProps",{captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1});var An=ne.a?ne.a.setRTLTextPlugin:function(){}},function(e,t,n){"use strict";n.r(t),n.d(t,"color",(function(){return r.e})),n.d(t,"rgb",(function(){return r.g})),n.d(t,"hsl",(function(){return r.f})),n.d(t,"lab",(function(){return d})),n.d(t,"hcl",(function(){return A})),n.d(t,"lch",(function(){return v})),n.d(t,"gray",(function(){return c})),n.d(t,"cubehelix",(function(){return P}));var r=n(95),a=n(125);const o=Math.PI/180,i=180/Math.PI,s=6/29,l=3*s*s;function u(e){if(e instanceof f)return new f(e.l,e.a,e.b,e.opacity);if(e instanceof b)return _(e);e instanceof r.b||(e=Object(r.h)(e));var t,n,a=g(e.r),o=g(e.g),i=g(e.b),s=p((.2225045*a+.7168786*o+.0606169*i)/1);return a===o&&o===i?t=n=s:(t=p((.4360747*a+.3850649*o+.1430804*i)/.96422),n=p((.0139322*a+.0971045*o+.7141733*i)/.82521)),new f(116*s-16,500*(t-s),200*(s-n),e.opacity)}function c(e,t){return new f(e,0,0,null==t?1:t)}function d(e,t,n,r){return 1===arguments.length?u(e):new f(e,t,n,null==r?1:r)}function f(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function p(e){return e>.008856451679035631?Math.pow(e,1/3):e/l+4/29}function h(e){return e>s?e*e*e:l*(e-4/29)}function m(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function g(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function y(e){if(e instanceof b)return new b(e.h,e.c,e.l,e.opacity);if(e instanceof f||(e=u(e)),0===e.a&&0===e.b)return new b(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*i;return new b(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function v(e,t,n,r){return 1===arguments.length?y(e):new b(n,t,e,null==r?1:r)}function A(e,t,n,r){return 1===arguments.length?y(e):new b(e,t,n,null==r?1:r)}function b(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function _(e){if(isNaN(e.h))return new f(e.l,0,0,e.opacity);var t=e.h*o;return new f(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Object(a.a)(f,d,Object(a.b)(r.a,{brighter:function(e){return new f(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new f(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=.96422*h(t),e=1*h(e),n=.82521*h(n),new r.b(m(3.1338561*t-1.6168667*e-.4906146*n),m(-.9787684*t+1.9161415*e+.033454*n),m(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Object(a.a)(b,A,Object(a.b)(r.a,{brighter:function(e){return new b(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new b(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return _(this).rgb()}}));var E=-.14861,x=1.78277,M=-.29227,w=-.90649,O=1.97294,S=O*w,T=O*x,C=x*M-w*E;function L(e){if(e instanceof R)return new R(e.h,e.s,e.l,e.opacity);e instanceof r.b||(e=Object(r.h)(e));var t=e.r/255,n=e.g/255,a=e.b/255,o=(C*a+S*t-T*n)/(C+S-T),s=a-o,l=(O*(n-o)-M*s)/w,u=Math.sqrt(l*l+s*s)/(O*o*(1-o)),c=u?Math.atan2(l,s)*i-120:NaN;return new R(c<0?c+360:c,u,o,e.opacity)}function P(e,t,n,r){return 1===arguments.length?L(e):new R(e,t,n,null==r?1:r)}function R(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Object(a.a)(R,P,Object(a.b)(r.a,{brighter:function(e){return e=null==e?r.c:Math.pow(r.c,e),new R(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?r.d:Math.pow(r.d,e),new R(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*o,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),a=Math.cos(e),i=Math.sin(e);return new r.b(255*(t+n*(E*a+x*i)),255*(t+n*(M*a+w*i)),255*(t+n*(O*a)),this.opacity)}}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));let r="";const a={};function o(e){r=e}function i(){return r}function s(e){for(const t in a)if(e.startsWith(t)){const n=a[t];e=e.replace(t,n)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(r).concat(e)),e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return d}));var r=n(104),a=n(71),o=n(64);function i(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function s(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function l(e){return e<0?-e*e:e*e}function u(e){var t=e(a.c,a.c),n=1;function o(){return 1===n?e(a.c,a.c):.5===n?e(s,l):e(i(n),i(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,o()):n},Object(r.b)(t)}function c(){var e=u(Object(a.d)());return e.copy=function(){return Object(a.a)(e,c()).exponent(e.exponent())},o.b.apply(e,arguments),e}function d(){return c.apply(null,arguments).exponent(.5)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i}));var r=n(633);function a(e){return e&&"object"==typeof e&&e.isBuffer}function o(e){return r.toBuffer?r.toBuffer(e):e}function i(e){if(a(e)){return new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer}return e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(e){if(!(t=r.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return s}));var r,a,o,i=n(437);function s(e){return r=Object(i.a)(e),a=r.format,o=r.formatPrefix,r}s({thousands:",",grouping:[3],currency:["$",""]})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(235),a=n(251);async function o(e,t){if("string"==typeof e){e=Object(r.b)(e);let n=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(n=t.fetch),await fetch(e,n)}return await Object(a.b)(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(176);const a=[255,255,255],o=1,i=[0,0,-1];let s=0;class l{constructor(e={}){const{color:t=a}=e,{intensity:n=o}=e,{direction:l=i}=e,{_shadow:u=!1}=e;this.id=e.id||"directional-".concat(s++),this.color=t,this.intensity=n,this.type="directional",this.direction=new r.a(l).normalize().toArray(),this.shadow=u}getProjectedLight(){return this}}},function(e,t,n){"use strict";var r=n(1903);var a={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},o=n(34);const i=Object.keys(o.a).map(e=>"const int COORDINATE_SYSTEM_".concat(e," = ").concat(o.a[e],";")).join(""),s=Object.keys(o.d).map(e=>"const int PROJECTION_MODE_".concat(e," = ").concat(o.d[e],";")).join(""),l=Object.keys(o.e).map(e=>"const int UNIT_".concat(e.toUpperCase()," = ").concat(o.e[e],";")).join("");var u="".concat(i,"\n").concat(s,"\n").concat(l,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size() {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n project_uPseudoMeters == false) {\n \n if (geometry.position.w == 0.0) {\n float y = clamp(geometry.worldPosition.y, -89.9, 89.9);\n return 1.0 / cos(radians(y));\n }\n \n float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n float y2 = y * y;\n float y4 = y2 * y2;\n float y6 = y4 * y2;\n return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n }\n return 1.0;\n}\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z * project_size();\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy * project_size();\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter * project_size();\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n mat3 rotation;\n if (project_needs_rotation(geometry.position.xyz, rotation)) {\n n = rotation * n;\n }\n return n;\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_size_to_pixel(float size, int unit) {\n if (unit == UNIT_METERS) return project_size_to_pixel(size);\n if (unit == UNIT_COMMON) return size * project_uScale;\n return size;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\n"),c=n(294);const d={};t.a={name:"project",dependencies:[r.a,a],vs:u,getUniforms:function(e=d){return e.viewport?Object(c.b)(e):{}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(121),a=n(420);var o=n(615),i=n(109),s=n(103),l=n(293),u=n(213),c=n(145),d=n(183);async function f(e,t,n,p){Object(r.a)(!p||"object"==typeof p),!t||Array.isArray(t)||Object(i.a)(t)||(p=void 0,n=t,t=void 0),e=await e,n=n||{};const{url:h}=Object(c.b)(e),m=t,g=Object(u.b)(m,p),y=await Object(d.a)(e,g,n);return y?(n=Object(s.c)(n,y,g,h),p=Object(u.a)({url:h,parse:f,loaders:g},n,p),await async function(e,t,n,i){if(function(e,t=a.a){Object(r.a)(e,"no worker provided");const n=e.version}(e),t=await Object(l.a)(t,e,n),e.parseTextSync&&"string"==typeof t)return n.dataType="text",e.parseTextSync(t,n,i,e);if(Object(o.a)(e,n))return await Object(o.b)(e,t,n,i,f);if(e.parseText&&"string"==typeof t)return await e.parseText(t,n,i,e);if(e.parse)return await e.parse(t,n,i,e);throw Object(r.a)(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(y,e,n,p)):null}},function(e,t,n){"use strict";function r(e){return(r="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})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return+e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=function(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}},function(e,t,n){"use strict";(function(e){var r=n(86),a=n(1198),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===o?r.a.Buffer:void 0,l=(s?s.isBuffer:void 0)||a.a;t.a=l}).call(this,n(540)(e))},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));n(99);function r(e,t={}){const{start:n=0,end:r=e.length}=t,a=t.size||2;let o=0;for(let t=n,i=r-a;t<r;t+=a)o+=(e[t]-e[i])*(e[t+1]+e[i+1]),i=t;return o/2}function a(e,t,n,r){n=n||2;const a=t&&t.length,l=a?t[0]*n:e.length;let u=o(e,0,l,n,!0,r&&r[0]);const c=[];if(!u||u.next===u.prev)return c;let d,h,m,y,v,A,b;if(a&&(u=function(e,t,n,r,a){const s=[];let l,u,c,d,h;for(l=0,u=t.length;l<u;l++)c=t[l]*r,d=l<u-1?t[l+1]*r:e.length,h=o(e,c,d,r,!1,a&&a[l+1]),h===h.next&&(h.steiner=!0),s.push(g(h));for(s.sort(f),l=0;l<s.length;l++)p(s[l],n),n=i(n,n.next);return n}(e,t,u,n,r)),e.length>80*n){y=h=e[0],v=m=e[1];for(let t=n;t<l;t+=n)A=e[t],b=e[t+1],A<y&&(y=A),b<v&&(v=b),A>h&&(h=A),b>m&&(m=b);d=Math.max(h-y,m-v),d=0!==d?1/d:0}return s(u,c,n,y,v,d),c}function o(e,t,n,a,o,i){let s,l;if(void 0===i&&(i=r(e,{start:t,end:n,size:a})),o===i<0)for(s=t;s<n;s+=a)l=O(s,e[s],e[s+1],l);else for(s=n-a;s>=t;s-=a)l=O(s,e[s],e[s+1],l);return l&&b(l,l.next)&&(S(l),l=l.next),l}function i(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!b(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(S(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function s(e,t,n,r,a,o,f){if(!e)return;!f&&o&&function(e,t,n,r){let a=e;do{null===a.z&&(a.z=m(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){let t,n,r,a,o,i,s,l,u=1;do{for(a=e,e=null,l=null,r=0;a;){for(r++,i=a,o=0,n=0;n<u&&(o++,i=i.nextZ,i);n++);for(s=u;o>0||s>0&&i;)0!==o&&(0===s||!i||a.z<=i.z)?(t=a,a=a.nextZ,o--):(t=i,i=i.nextZ,s--),l?l.nextZ=t:e=t,t.prevZ=l,l=t;a=i}l.nextZ=null,u*=2}while(r>1)}(a)}(e,r,a,o);let p,h,g=e;for(;e.prev!==e.next;)if(p=e.prev,h=e.next,o?u(e,r,a,o):l(e))t.push(p.i/n),t.push(e.i/n),t.push(h.i/n),S(e),e=h.next,g=h.next;else if((e=h)===g){f?1===f?s(e=c(i(e),t,n),t,n,r,a,o,2):2===f&&d(e,t,n,r,a,o):s(i(e),t,n,r,a,o,1);break}}function l(e){const t=e.prev,n=e,r=e.next;if(A(t,n,r)>=0)return!1;let a=e.next.next;for(;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&A(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function u(e,t,n,r){const a=e.prev,o=e,i=e.next;if(A(a,o,i)>=0)return!1;const s=a.x<o.x?a.x<i.x?a.x:i.x:o.x<i.x?o.x:i.x,l=a.y<o.y?a.y<i.y?a.y:i.y:o.y<i.y?o.y:i.y,u=a.x>o.x?a.x>i.x?a.x:i.x:o.x>i.x?o.x:i.x,c=a.y>o.y?a.y>i.y?a.y:i.y:o.y>i.y?o.y:i.y,d=m(s,l,t,n,r),f=m(u,c,t,n,r);let p=e.prevZ,h=e.nextZ;for(;p&&p.z>=d&&h&&h.z<=f;){if(p!==e.prev&&p!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,p.x,p.y)&&A(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==e.prev&&h!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,p.x,p.y)&&A(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=f;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function c(e,t,n){let r=e;do{const a=r.prev,o=r.next.next;!b(a,o)&&_(a,r,r.next,o)&&M(a,o)&&M(o,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(o.i/n),S(r),S(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function d(e,t,n,r,a,o){let l=e;do{let e=l.next.next;for(;e!==l.prev;){if(l.i!==e.i&&v(l,e)){let u=w(l,e);return l=i(l,l.next),u=i(u,u.next),s(l,t,n,r,a,o),void s(u,t,n,r,a,o)}e=e.next}l=l.next}while(l!==e)}function f(e,t){return e.x-t.x}function p(e,t){if(t=function(e,t){let n=t;const r=e.x,a=e.y;let o,i=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){const e=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>i){if(i=e,e===r){if(a===n.y)return n;if(a===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!o)return null;if(r===i)return o;const s=o,l=o.x,u=o.y;let c,d=1/0;n=o;do{r>=n.x&&n.x>=l&&r!==n.x&&y(a<u?r:i,a,l,u,a<u?i:r,a,n.x,n.y)&&(c=Math.abs(a-n.y)/(r-n.x),M(n,e)&&(c<d||c===d&&(n.x>o.x||n.x===o.x&&h(o,n)))&&(o=n,d=c)),n=n.next}while(n!==s);return o}(e,t)){const n=w(t,e);i(t,t.next),i(n,n.next)}}function h(e,t){return A(e.prev,e,t.prev)<0&&A(t.next,e,e.next)<0}function m(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function g(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function y(e,t,n,r,a,o,i,s){return(a-i)*(t-s)-(e-i)*(o-s)>=0&&(e-i)*(r-s)-(n-i)*(t-s)>=0&&(n-i)*(o-s)-(a-i)*(r-s)>=0}function v(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&_(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(M(e,t)&&M(t,e)&&function(e,t){let n=e,r=!1;const a=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&a<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(A(e.prev,e,t.prev)||A(e,t.prev,t))||b(e,t)&&A(e.prev,e,e.next)>0&&A(t.prev,t,t.next)>0)}function A(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function b(e,t){return e.x===t.x&&e.y===t.y}function _(e,t,n,r){const a=x(A(e,t,n)),o=x(A(e,t,r)),i=x(A(n,r,e)),s=x(A(n,r,t));return a!==o&&i!==s||(!(0!==a||!E(e,n,t))||(!(0!==o||!E(e,r,t))||(!(0!==i||!E(n,e,r))||!(0!==s||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function x(e){return e>0?1:e<0?-1:0}function M(e,t){return A(e.prev,e,e.next)<0?A(e,t,e.next)>=0&&A(e,e.prev,t)>=0:A(e,t,e.prev)<0||A(e,e.next,t)<0}function w(e,t){const n=new T(e.i,e.x,e.y),r=new T(t.i,t.x,t.y),a=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function O(e,t,n,r){const a=new T(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function S(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return h})),n.d(t,"a",(function(){return o}));function r(){}function a(e,t){var n=new r;if(e instanceof r)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var a,o=-1,i=e.length;if(null==t)for(;++o<i;)n.set(o,e[o]);else for(;++o<i;)n.set(t(a=e[o],o,e),a)}else if(e)for(var s in e)n.set(s,e[s]);return n}r.prototype=a.prototype={constructor:r,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var o=a,i=function(){var e,t,n,r=[],a=[];function i(n,a,s,l){if(a>=r.length)return null!=e&&n.sort(e),null!=t?t(n):n;for(var u,c,d,f=-1,p=n.length,h=r[a++],m=o(),g=s();++f<p;)(d=m.get(u=h(c=n[f])+""))?d.push(c):m.set(u,[c]);return m.each((function(e,t){l(g,t,i(e,a,s,l))})),g}return n={object:function(e){return i(e,0,s,l)},map:function(e){return i(e,0,u,c)},entries:function(e){return function e(n,o){if(++o>r.length)return n;var i,s=a[o-1];return null!=t&&o>=r.length?i=n.entries():(i=[],n.each((function(t,n){i.push({key:n,values:e(t,o)})}))),null!=s?i.sort((function(e,t){return s(e.key,t.key)})):i}(i(e,0,u,c),0)},key:function(e){return r.push(e),n},sortKeys:function(e){return a[r.length-1]=e,n},sortValues:function(t){return e=t,n},rollup:function(e){return t=e,n}}};function s(){return{}}function l(e,t,n){e[t]=n}function u(){return o()}function c(e,t,n){e.set(t,n)}function d(){}var f=o.prototype;function p(e,t){var n=new d;if(e instanceof d)e.each((function(e){n.add(e)}));else if(e){var r=-1,a=e.length;if(null==t)for(;++r<a;)n.add(e[r]);else for(;++r<a;)n.add(t(e[r],r,e))}return n}d.prototype=p.prototype={constructor:d,has:f.has,add:function(e){return this["$"+(e+="")]=e,this},remove:f.remove,clear:f.clear,values:f.keys,size:f.size,empty:f.empty,each:f.each};var h=p},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(16),a=n(135),o=n(21);let i="";class s extends a.a{static isSupported(e,t){return a.a.isSupported(e,t)}constructor(e,t={}){var n,a;Object(r.b)(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:(n=t.data,Object(o.a)("string"==typeof n),n=i+n,new Promise((e,t)=>{try{const r=new Image;r.onload=()=>e(r),r.onerror=()=>t(new Error(`Could not load image ${n}.`)),r.crossOrigin=a&&a.crossOrigin||"anonymous",r.src=n}catch(e){t(e)}}))})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var r=n(51),a=n(145);async function o(e){if(Object(r.j)(e))return e;const t={},n=Object(a.a)(e);n>=0&&(t["content-length"]=String(n));const{url:o,type:i}=Object(a.b)(e);i&&(t["content-type"]=i);const s=await async function(e){if("string"==typeof e)return"data:,".concat(e.slice(0,5));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(e=>{const n=new FileReader;n.onload=t=>{var n;return e(null==t||null===(n=t.target)||void 0===n?void 0:n.result)},n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=function(e){let t="";const n=new Uint8Array(e);for(let e=0;e<n.byteLength;e++)t+=String.fromCharCode(n[e]);return btoa(t)}(e.slice(0,5));return"data:base64,".concat(t)}return null}(e);s&&(t["x-first-bytes"]=s),"string"==typeof e&&(e=(new TextEncoder).encode(e));const l=new Response(e,{headers:t});return Object.defineProperty(l,"url",{value:o}),l}async function i(e){if(!e.ok){const t=await async function(e){let t="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): ");try{const n=e.headers.get("Content-Type");let r=e.statusText;n.includes("application/json")&&(r+=" ".concat(await e.text())),t+=r,t=t.length>60?"".concat(t.slice(60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(340);var a=n(446);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(98);const a="EXT_color_buffer_float";var o={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:a,bpp:2},33327:{gl2:a,bpp:4},34842:{gl2:a,bpp:8},33326:{gl2:a,bpp:4},33328:{gl2:a,bpp:8},34836:{gl2:a,bpp:16},35898:{gl2:a,bpp:4}},i=n(16),s=n(21);class l extends r.a{static isSupported(e,{format:t}={format:null}){return!t||function(e,t,n){const r=n[t];if(!r)return!1;const a=Object(i.j)(e)&&r.gl2||r.gl1;return"string"==typeof a?e.getExtension(a):a}(e,t,o)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:n=1,samples:r=0}){return Object(s.a)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Object(i.j)(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,n):this.gl.renderbufferStorage(36161,e,t,n),this.format=e,this.width=t,this.height=n,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*o[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){this.gl.bindRenderbuffer(36161,this.handle);return this.gl.getRenderbufferParameter(36161,e)}}},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var r="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",a="undefined"!=typeof window?window:e,o=(void 0!==e||window,"undefined"!=typeof document&&document,!1);try{var i={get passive(){return o=!0,!0}};a.addEventListener("test",i,i),a.removeEventListener("test",i,i)}catch(e){}}).call(this,n(55))},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));const r="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",a="undefined"!=typeof window?window:e;void 0!==e||window,"undefined"!=typeof document&&document;let o=!1;try{const e={get passive(){return o=!0,!0}};a.addEventListener("test",e,e),a.removeEventListener("test",e,e)}catch(e){}}).call(this,n(55))},,,function(e,t){e.exports=r},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.LAYER_TYPES=void 0;var a=(0,r(n(137)).default)({point:null,arc:null,line:null,grid:null,hexagon:null,geojson:null,cluster:null,icon:null,heatmap:null,hexagonId:null,"3D":null,trip:null,s2:null});t.LAYER_TYPES=a},function(e,t){function n(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(a,o){var i=e.apply(t,r);function s(e){n(i,a,o,s,l,"next",e)}function l(e){n(i,a,o,s,l,"throw",e)}s(void 0)}))}}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.processCsvData=S,t.parseRowsByFields=T,t.getSampleForTypeAnalyze=C,t.parseCsvRowsByFieldType=P,t.getFieldsFromData=R,t.renameDuplicateFields=D,t.analyzerTypeToFieldType=k,t.processRowObject=I,t.processGeojson=F,t.formatCsv=j,t.validateInputData=function(e){if(!(0,v.isPlainObject)(e))return(0,d.default)("addDataToMap Error: dataset.data cannot be null"),null;if(!Array.isArray(e.fields))return(0,d.default)("addDataToMap Error: expect dataset.data.fields to be an array"),null;if(!Array.isArray(e.rows))return(0,d.default)("addDataToMap Error: expect dataset.data.rows to be an array"),null;var t=e.fields,n=e.rows;if(t.every((function(e,r){if((0,v.isPlainObject)(e)||((0,d.default)("fields needs to be an array of object, but find ".concat((0,i.default)(e))),t[r]={}),e.name||((0,d.default)("field.name is required but missing in ".concat(JSON.stringify(e))),t[r].name="column_".concat(r)),!h.ALL_FIELD_TYPES[e.type])return(0,d.default)("unknown field type ".concat(e.type)),!1;if(!t.every((function(e){return e.analyzerType})))return(0,d.default)("field missing analyzerType"),!1;if(e.type===h.ALL_FIELD_TYPES.timestamp){var a=function(e,t,n){var r=[],a=0;for(;r.length<n&&a<e.length;)(0,m.notNullorUndefined)(e[a][t])&&r.push(e[a]),a++;return r}(n,r,10).map((function(e){return{ts:e[r]}})),o=f.Analyzer.computeColMeta(a)[0];return o&&"TIME"===o.category&&o.format===e.format}return!0})))return{rows:n,fields:t};var r=C({fields:t.map((function(e){return e.name})),rows:n}),a=t.map((function(e){return e.name})),o=R(r,a);return{fields:t.map((function(e,t){return E(E({},e),{},{type:o[t].type,format:o[t].format,analyzerType:o[t].analyzerType})})),rows:n}},t.processKeplerglJSON=B,t.processKeplerglDataset=N,t.Processors=t.DATASET_HANDLERS=t.PARSE_FIELD_VALUE_FROM_STRING=t.CSV_NULLS=t.ACCEPTED_ANALYZER_TYPES=void 0;var a,o,i=r(n(63)),s=r(n(3)),l=n(1166),u=n(91),c=n(49),d=r(n(359)),f=n(262),p=r(n(365)),h=n(30),m=n(61),g=r(n(312)),y=n(264),v=n(69);function A(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=[f.DATA_TYPES.DATE,f.DATA_TYPES.TIME,f.DATA_TYPES.DATETIME,f.DATA_TYPES.NUMBER,f.DATA_TYPES.INT,f.DATA_TYPES.FLOAT,f.DATA_TYPES.BOOLEAN,f.DATA_TYPES.STRING,f.DATA_TYPES.GEOMETRY,f.DATA_TYPES.GEOMETRY_FROM_STRING,f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,f.DATA_TYPES.ZIPCODE,f.DATA_TYPES.ARRAY,f.DATA_TYPES.OBJECT];t.ACCEPTED_ANALYZER_TYPES=x;var M=/^(null|NULL|Null|NaN|\/N||)$/;t.CSV_NULLS=M;var w=Object.keys(f.DATA_TYPES).filter((function(e){return!x.includes(e)})),O=(a={},(0,s.default)(a,h.ALL_FIELD_TYPES.boolean,{valid:function(e){return"boolean"==typeof e},parse:function(e){return"true"===e||"True"===e||"TRUE"===e||"1"===e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.integer,{valid:function(e){return parseInt(e,10)===e},parse:function(e){return parseInt(e,10)}}),(0,s.default)(a,h.ALL_FIELD_TYPES.timestamp,{valid:function(e,t){return["x","X"].includes(t.format)?"number"==typeof e:"string"==typeof e},parse:function(e,t){return["x","X"].includes(t.format)?Number(e):e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.real,{valid:function(e){return parseFloat(e)===e},parse:parseFloat}),a);function S(e,t){var n,r;if("string"==typeof e){var a=(0,l.csvParseRows)(e);if(!Array.isArray(a)||a.length<2)throw new Error("process Csv Data Failed: CSV is empty");r=a[0],n=a.slice(1)}else Array.isArray(e)&&e.length&&(n=e,r=t,Array.isArray(r)||(r=e[0],n=e.slice(1)));if(!n||!r)throw new Error("invalid input passed to processCsvData");L(n);var o=R(C({fields:r,rows:n}),r);return{fields:o,rows:T(n,o)}}function T(e,t){var n=t.findIndex((function(e){return"_geojson"===e.name}));return t.forEach(P.bind(null,e,n)),e}function C(e){var t=e.fields,n=e.rows,r=e.sampleCount,a=void 0===r?50:r,o=Math.min(a,n.length),i=(0,u.range)(0,o,1).map((function(e){return{}}));return t.forEach((function(e,t){for(var r=0,a=0;a<o;)if(r>=n.length)i[a][e]=null,a++;else if((0,m.notNullorUndefined)(n[r][t])){var s=n[r][t];i[a][e]="string"==typeof s?s.trim():s,a++,r++}else r++})),i}function L(e){for(var t=new RegExp(M,"g"),n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)"string"==typeof e[n][r]&&e[n][r].match(t)&&(e[n][r]=null)}function P(e,t,n,r){var a=O[n.type];if(a){var o=e.find((function(e){return(0,m.notNullorUndefined)(e[r])}));if(!o||a.valid(o[r],n))return;e.forEach((function(e){null!==e[r]&&(e[r]=a.parse(e[r],n),t>-1&&e[t]&&e[t].properties&&(e[t].properties[n.name]=e[r]))}))}}function R(e,t){var n=f.Analyzer.computeColMeta(e,[{regex:/.*geojson|all_points/g,dataType:"GEOMETRY"},{regex:/.*census/g,dataType:"STRING"}],{ignoredDataTypes:w}),r=D(t).fieldByIndex;return t.map((function(e,t){var a=r[t],o=n.find((function(t){return t.key===e}))||{},i=o.type;return{name:a,id:a,displayName:a,format:o.format,fieldIdx:t,type:k(i),analyzerType:i,valueAccessor:function(e){return function(n){return e.valueAt(n.index,t)}}}}))}function D(e){return e.reduce((function(e,t,n){var r=e.allNames,a=t;if(r.includes(t)){for(var o=0;r.includes("".concat(t,"-").concat(o));)o++;a="".concat(t,"-").concat(o)}return e.fieldByIndex[n]=a,e.allNames.push(a),e}),{allNames:[],fieldByIndex:{}})}function k(e){var t=f.DATA_TYPES.DATE,n=f.DATA_TYPES.TIME,r=f.DATA_TYPES.DATETIME,a=f.DATA_TYPES.NUMBER,o=f.DATA_TYPES.INT,i=f.DATA_TYPES.FLOAT,s=f.DATA_TYPES.BOOLEAN,l=f.DATA_TYPES.STRING,u=f.DATA_TYPES.GEOMETRY,d=f.DATA_TYPES.GEOMETRY_FROM_STRING,p=f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,m=f.DATA_TYPES.ZIPCODE,g=f.DATA_TYPES.ARRAY,y=f.DATA_TYPES.OBJECT;switch(e){case t:return h.ALL_FIELD_TYPES.date;case n:case r:return h.ALL_FIELD_TYPES.timestamp;case i:return h.ALL_FIELD_TYPES.real;case o:return h.ALL_FIELD_TYPES.integer;case s:return h.ALL_FIELD_TYPES.boolean;case u:case d:case p:case g:case y:return h.ALL_FIELD_TYPES.geojson;case a:case l:case m:return h.ALL_FIELD_TYPES.string;default:return c.console.warn("Unsupported analyzer type: ".concat(e)),h.ALL_FIELD_TYPES.string}}function I(e){if(!Array.isArray(e)||!e.length)return null;var t=Object.keys(e[0]),n=e.map((function(e){return t.map((function(t){return e[t]}))}));return L(n),S(n,t)}function F(e){var t=(0,p.default)(e);if(!t||!Array.isArray(t.features))throw new Error("Read File Failed: File is not a valid GeoJSON. Read more about [supported file format](".concat(y.GUIDES_FILE_FORMAT_DOC,")"));for(var n=[],r=0;r<t.features.length;r++){var a=t.features[r];a.geometry&&n.push(E({_geojson:a},a.properties||{}))}var o=n.reduce((function(e,t){return Object.keys(t).forEach((function(t){e.includes(t)||e.push(t)})),e}),[]);return n.forEach((function(e){o.forEach((function(t){t in e||(e[t]=null,e._geojson.properties[t]=null)}))})),I(n)}function j(e,t){var n,r=[t.map((function(e){return e.displayName||e.name}))],a=A(e.rows(!0));try{for(a.s();!(n=a.n()).done;){var o=n.value;r.push(o.map((function(e,n){return(0,m.parseFieldValue)(e,t[n].type)})))}}catch(e){a.e(e)}finally{a.f()}return(0,l.csvFormatRows)(r)}function B(e){return e?g.default.load(e.datasets,e.config):null}function N(e){if(!e)return null;var t=g.default.parseSavedData((0,v.toArray)(e));return t?Array.isArray(e)?t:t[0]:null}t.PARSE_FIELD_VALUE_FROM_STRING=O;var z=(o={},(0,s.default)(o,h.DATASET_FORMATS.row,I),(0,s.default)(o,h.DATASET_FORMATS.geojson,F),(0,s.default)(o,h.DATASET_FORMATS.csv,S),(0,s.default)(o,h.DATASET_FORMATS.keplergl,N),o);t.DATASET_HANDLERS=z;var U={processGeojson:F,processCsvData:S,processRowObject:I,processKeplerglJSON:B,processKeplerglDataset:N,analyzerTypeToFieldType:k,getFieldsFromData:R,parseCsvRowsByFieldType:P,formatCsv:j};t.Processors=U},function(e,t,n){"use strict";e.exports={Analyzer:n(1332),DATA_TYPES:n(364).DATA_TYPES,RegexList:n(809)}},function(e,t,n){(function(e,n){var r="[object Arguments]",a="[object Map]",o="[object Object]",i="[object Set]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[r]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[a]=u["[object Number]"]=u[o]=u["[object RegExp]"]=u[i]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),p=t&&!t.nodeType&&t,h=p&&"object"==typeof n&&n&&!n.nodeType&&n,m=h&&h.exports===p,g=m&&c.process,y=function(){try{return g&&g.binding&&g.binding("util")}catch(e){}}(),v=y&&y.isTypedArray;function A(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function b(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function _(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var E,x,M,w=Array.prototype,O=Function.prototype,S=Object.prototype,T=f["__core-js_shared__"],C=O.toString,L=S.hasOwnProperty,P=(E=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",R=S.toString,D=RegExp("^"+C.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=m?f.Buffer:void 0,I=f.Symbol,F=f.Uint8Array,j=S.propertyIsEnumerable,B=w.splice,N=I?I.toStringTag:void 0,z=Object.getOwnPropertySymbols,U=k?k.isBuffer:void 0,H=(x=Object.keys,M=Object,function(e){return x(M(e))}),V=ye(f,"DataView"),G=ye(f,"Map"),Y=ye(f,"Promise"),W=ye(f,"Set"),q=ye(f,"WeakMap"),X=ye(Object,"create"),K=_e(V),Z=_e(G),J=_e(Y),Q=_e(W),$=_e(q),ee=I?I.prototype:void 0,te=ee?ee.valueOf:void 0;function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ae;++t<n;)this.add(e[t])}function ie(e){var t=this.__data__=new re(e);this.size=t.size}function se(e,t){var n=Me(e),r=!n&&xe(e),a=!n&&!r&&we(e),o=!n&&!r&&!a&&Le(e),i=n||r||a||o,s=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var u in e)!t&&!L.call(e,u)||i&&("length"==u||a&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||be(u,l))||s.push(u);return s}function le(e,t){for(var n=e.length;n--;)if(Ee(e[n][0],t))return n;return-1}function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":N&&N in Object(e)?function(e){var t=L.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch(e){}var a=R.call(e);r&&(t?e[N]=n:delete e[N]);return a}(e):function(e){return R.call(e)}(e)}function ce(e){return Ce(e)&&ue(e)==r}function de(e,t,n,s,l){return e===t||(null==e||null==t||!Ce(e)&&!Ce(t)?e!=e&&t!=t:function(e,t,n,s,l,u){var c=Me(e),d=Me(t),f=c?"[object Array]":Ae(e),p=d?"[object Array]":Ae(t),h=(f=f==r?o:f)==o,m=(p=p==r?o:p)==o,g=f==p;if(g&&we(e)){if(!we(t))return!1;c=!0,h=!1}if(g&&!h)return u||(u=new ie),c||Le(e)?he(e,t,n,s,l,u):function(e,t,n,r,o,s,l){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new F(e),new F(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ee(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case a:var u=b;case i:var c=1&r;if(u||(u=_),e.size!=t.size&&!c)return!1;var d=l.get(e);if(d)return d==t;r|=2,l.set(e,t);var f=he(u(e),u(t),r,o,s,l);return l.delete(e),f;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,f,n,s,l,u);if(!(1&n)){var y=h&&L.call(e,"__wrapped__"),v=m&&L.call(t,"__wrapped__");if(y||v){var A=y?e.value():e,E=v?t.value():t;return u||(u=new ie),l(A,E,n,s,u)}}if(!g)return!1;return u||(u=new ie),function(e,t,n,r,a,o){var i=1&n,s=me(e),l=s.length,u=me(t).length;if(l!=u&&!i)return!1;var c=l;for(;c--;){var d=s[c];if(!(i?d in t:L.call(t,d)))return!1}var f=o.get(e);if(f&&o.get(t))return f==t;var p=!0;o.set(e,t),o.set(t,e);var h=i;for(;++c<l;){d=s[c];var m=e[d],g=t[d];if(r)var y=i?r(g,m,d,t,e,o):r(m,g,d,e,t,o);if(!(void 0===y?m===g||a(m,g,n,r,o):y)){p=!1;break}h||(h="constructor"==d)}if(p&&!h){var v=e.constructor,A=t.constructor;v==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof A&&A instanceof A||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,s,l,u)}(e,t,n,s,de,l))}function fe(e){return!(!Te(e)||function(e){return!!P&&P in e}(e))&&(Oe(e)?D:s).test(_e(e))}function pe(e){if(!function(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||S;return e===n}(e))return H(e);var t=[];for(var n in Object(e))L.call(e,n)&&"constructor"!=n&&t.push(n);return t}function he(e,t,n,r,a,o){var i=1&n,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var c=-1,d=!0,f=2&n?new oe:void 0;for(o.set(e,t),o.set(t,e);++c<s;){var p=e[c],h=t[c];if(r)var m=i?r(h,p,c,t,e,o):r(p,h,c,e,t,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!A(t,(function(e,t){if(i=t,!f.has(i)&&(p===e||a(p,e,n,r,o)))return f.push(t);var i}))){d=!1;break}}else if(p!==h&&!a(p,h,n,r,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function me(e){return function(e,t,n){var r=t(e);return Me(e)?r:function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}(r,n(e))}(e,Pe,ve)}function ge(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function ye(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return fe(n)?n:void 0}ne.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(X){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return L.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return X?void 0!==t[e]:L.call(t,e)},ne.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=X&&void 0===t?"__lodash_hash_undefined__":t,this},re.prototype.clear=function(){this.__data__=[],this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=le(t,e);return!(n<0)&&(n==t.length-1?t.pop():B.call(t,n,1),--this.size,!0)},re.prototype.get=function(e){var t=this.__data__,n=le(t,e);return n<0?void 0:t[n][1]},re.prototype.has=function(e){return le(this.__data__,e)>-1},re.prototype.set=function(e,t){var n=this.__data__,r=le(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(G||re),string:new ne}},ae.prototype.delete=function(e){var t=ge(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return ge(this,e).get(e)},ae.prototype.has=function(e){return ge(this,e).has(e)},ae.prototype.set=function(e,t){var n=ge(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},oe.prototype.add=oe.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},oe.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.clear=function(){this.__data__=new re,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(r)}return n.set(e,t),this.size=n.size,this};var ve=z?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[a++]=i)}return o}(z(e),(function(t){return j.call(e,t)})))}:function(){return[]},Ae=ue;function be(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||l.test(e))&&e>-1&&e%1==0&&e<t}function _e(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ee(e,t){return e===t||e!=e&&t!=t}(V&&"[object DataView]"!=Ae(new V(new ArrayBuffer(1)))||G&&Ae(new G)!=a||Y&&"[object Promise]"!=Ae(Y.resolve())||W&&Ae(new W)!=i||q&&"[object WeakMap]"!=Ae(new q))&&(Ae=function(e){var t=ue(e),n=t==o?e.constructor:void 0,r=n?_e(n):"";if(r)switch(r){case K:return"[object DataView]";case Z:return a;case J:return"[object Promise]";case Q:return i;case $:return"[object WeakMap]"}return t});var xe=ce(function(){return arguments}())?ce:function(e){return Ce(e)&&L.call(e,"callee")&&!j.call(e,"callee")},Me=Array.isArray;var we=U||function(){return!1};function Oe(e){if(!Te(e))return!1;var t=ue(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==typeof e}var Le=v?function(e){return function(t){return e(t)}}(v):function(e){return Ce(e)&&Se(e.length)&&!!u[ue(e)]};function Pe(e){return function(e){return null!=e&&Se(e.length)&&!Oe(e)}(e)?se(e):pe(e)}n.exports=function(e,t){return de(e,t)}}).call(this,n(55),n(156)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BUG_REPORT_LINK=t.GUIDES_FILE_FORMAT_DOC=t.EXPORT_HTML_MAP_MODES_DOC=t.MAPBOX_ACCESS_TOKEN=t.ADD_DATA_TO_MAP_DOC=t.EXPORT_HTML_MAP_DOC=t.API_REFERENCE_DOC=t.ACTIONS_DOC=t.USER_GUIDE_DOC=void 0;var r="https://docs.kepler.gl/docs/user-guides";t.USER_GUIDE_DOC=r;var a="https://docs.kepler.gl/docs/api-reference/actions/actions";t.ACTIONS_DOC=a;t.API_REFERENCE_DOC="https://docs.kepler.gl/docs/api-reference";var o="".concat(r,"/k-save-and-export");t.EXPORT_HTML_MAP_DOC=o;var i="".concat(a,"#adddatatomap");t.ADD_DATA_TO_MAP_DOC=i;t.MAPBOX_ACCESS_TOKEN="https://docs.mapbox.com/help/how-mapbox-works/access-tokens/";var s="".concat(r,"/k-save-and-export#export-html-map");t.EXPORT_HTML_MAP_MODES_DOC=s;var l="".concat(r,"/b-kepler-gl-workflow/a-add-data-to-the-map#supported-file-formats");t.GUIDES_FILE_FORMAT_DOC=l;t.BUG_REPORT_LINK="https://github.com/keplergl/kepler.gl/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBug%5D"},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.createDataContainer=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;if((t=l(l({},c),t)).inputDataFormat===u.ROWS_ARRAY)return new o.RowDataContainer({rows:e,fields:t.fields});throw Error("Failed to create a data container: not implemented format")},t.createIndexedDataContainer=d,t.getSampleData=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=e.numRows(),r=Math.max(Math.floor(n/t),1),a=[],o=0;o<n;o+=r)a.push(o);return d(e,a)},t.DataForm=void 0;var a=r(n(3)),o=n(1338),i=n(1339);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u={ROWS_ARRAY:"ROWS_ARRAY"};t.DataForm=u;var c={inputDataFormat:u.ROWS_ARRAY};function d(e,t){return new i.IndexedDataContainer(e,t)}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.findDefaultLayer=function(e,t){if(!e)return[];return Object.keys(t).reduce((function(n,r){var a="function"==typeof t[r].findDefaultLayerProps?t[r].findDefaultLayerProps(e,n):{props:[]},o=Array.isArray(a)?a:a.props||[];return(a.foundLayers||n).concat(o.map((function(t){return l(l({},t),{},{type:r,dataId:e.id})})))}),[]).map((function(n){var r=new t[n.type](n);return"function"==typeof r.setInitialLayerConfig&&e.dataContainer?r.setInitialLayerConfig(e):r}))},t.calculateLayerData=function(e,t,n){if(!e.type||!e.hasAllColumns()||!e.config.dataId)return{layer:e,layerData:{}};return{layerData:e.formatLayerData(t.datasets,n),layer:e}},t.getLayerHoverProp=function(e){var t=e.interactionConfig,n=e.hoverInfo,r=e.layers,a=e.layersToRender,o=e.datasets;if(t.tooltip.enabled&&n&&n.picked){var i=n.object,s=n.layer,l=r[s.props.idx];if(i&&l&&l.getHoverData&&a[l.id]){var u=l.config.dataId;if(!u)return null;var c=o[u],d=c.dataContainer,f=c.fields,p=l.getHoverData(i,d,f),h=t.tooltip.config.fieldsToShow[u];return{data:p,fields:f,fieldsToShow:h,layer:l}}}return null},t.renderDeckGlLayer=function(e,t,n){var r=e.datasets,a=e.layers,o=e.layerData,i=e.hoverInfo,s=e.clicked,l=e.mapState,u=e.interactionConfig,c=e.animationConfig,d=e.mapLayers,f=e.maskPolygon,p=a[n],h=o[n],m=(r[p.config.dataId]||{}).gpuFilter,g=s||i,y=!d||d&&d[p.id];return p.renderLayer({data:h,gpuFilter:m,idx:n,interactionConfig:u,layerCallbacks:t,mapState:l,animationConfig:c,objectHovered:g,visible:y,maskPolygon:f})},t.isLayerRenderable=u,t.isLayerVisible=c,t.prepareLayersForDeck=function(e,t){return e.reduce((function(e,n,r){return l(l({},e),{},(0,a.default)({},n.id,u(n,t[r])&&n.overlayType===o.OVERLAY_TYPE.deckgl))}),{})},t.prepareLayersToRender=function(e,t,n){return e.reduce((function(e,r,o){return l(l({},e),{},(0,a.default)({},r.id,u(r,t[o])&&c(r,n)))}),{})},t.getMaskExtensionProps=function(e){return{maskId:i.MASK_LAYER_ID,maskEnabled:Boolean(e&&e.length),extensions:[d]}};var a=r(n(3)),o=n(126),i=n(30);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t){return e.id!==i.GEOCODER_LAYER_ID&&e.shouldRenderLayer(t)}function c(e,t){return e.config.isVisible&&(!t||t&&t[e.id])}var d=new(n(134).MaskExtension)},function(e,t,n){"use strict";n.r(t),t.default={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,u=s||l||Function("return this")(),c=Object.prototype.toString,d=Math.max,f=Math.min,p=function(){return u.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==c.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=a.test(e);return s||o.test(e)?i(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,a,o,i,s,l,u=0,c=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,o=a;return r=a=void 0,u=t,i=e.apply(o,n)}function A(e){return u=e,s=setTimeout(_,t),c?v(e):i}function b(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-u>=o}function _(){var e=p();if(b(e))return E(e);s=setTimeout(_,function(e){var n=t-(e-l);return g?f(n,o-(e-u)):n}(e))}function E(e){return s=void 0,y&&r?v(e):(r=a=void 0,i)}function x(){var e=p(),n=b(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return A(l);if(g)return s=setTimeout(_,t),v(l)}return void 0===s&&(s=setTimeout(_,t)),i}return t=m(t)||0,h(n)&&(c=!!n.leading,o=(g="maxWait"in n)?d(m(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=a=s=void 0},x.flush=function(){return void 0===s?i:E(p())},x}}).call(this,n(55))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){e.exports=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.LAYER_TYPES=void 0;var a=(0,r(n(137)).default)({point:null,arc:null,line:null,grid:null,hexagon:null,geojson:null,cluster:null,icon:null,heatmap:null,hexagonId:null,"3D":null,trip:null,s2:null});t.LAYER_TYPES=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.processCsvData=S,t.parseRowsByFields=T,t.getSampleForTypeAnalyze=C,t.parseCsvRowsByFieldType=P,t.getFieldsFromData=R,t.renameDuplicateFields=D,t.analyzerTypeToFieldType=k,t.processRowObject=I,t.processGeojson=F,t.formatCsv=j,t.validateInputData=function(e){if(!(0,v.isPlainObject)(e))return(0,d.default)("addDataToMap Error: dataset.data cannot be null"),null;if(!Array.isArray(e.fields))return(0,d.default)("addDataToMap Error: expect dataset.data.fields to be an array"),null;if(!Array.isArray(e.rows))return(0,d.default)("addDataToMap Error: expect dataset.data.rows to be an array"),null;var t=e.fields,n=e.rows;if(t.every((function(e,r){if((0,v.isPlainObject)(e)||((0,d.default)("fields needs to be an array of object, but find ".concat((0,i.default)(e))),t[r]={}),e.name||((0,d.default)("field.name is required but missing in ".concat(JSON.stringify(e))),t[r].name="column_".concat(r)),!h.ALL_FIELD_TYPES[e.type])return(0,d.default)("unknown field type ".concat(e.type)),!1;if(!t.every((function(e){return e.analyzerType})))return(0,d.default)("field missing analyzerType"),!1;if(e.type===h.ALL_FIELD_TYPES.timestamp){var a=function(e,t,n){var r=[],a=0;for(;r.length<n&&a<e.length;)(0,m.notNullorUndefined)(e[a][t])&&r.push(e[a]),a++;return r}(n,r,10).map((function(e){return{ts:e[r]}})),o=f.Analyzer.computeColMeta(a)[0];return o&&"TIME"===o.category&&o.format===e.format}return!0})))return{rows:n,fields:t};var r=C({fields:t.map((function(e){return e.name})),rows:n}),a=t.map((function(e){return e.name})),o=R(r,a);return{fields:t.map((function(e,t){return E(E({},e),{},{type:o[t].type,format:o[t].format,analyzerType:o[t].analyzerType})})),rows:n}},t.processKeplerglJSON=B,t.processKeplerglDataset=N,t.Processors=t.DATASET_HANDLERS=t.PARSE_FIELD_VALUE_FROM_STRING=t.CSV_NULLS=t.ACCEPTED_ANALYZER_TYPES=void 0;var a,o,i=r(n(63)),s=r(n(3)),l=n(1166),u=n(91),c=n(49),d=r(n(359)),f=n(262),p=r(n(365)),h=n(31),m=n(62),g=r(n(324)),y=n(273),v=n(70);function A(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=[f.DATA_TYPES.DATE,f.DATA_TYPES.TIME,f.DATA_TYPES.DATETIME,f.DATA_TYPES.NUMBER,f.DATA_TYPES.INT,f.DATA_TYPES.FLOAT,f.DATA_TYPES.BOOLEAN,f.DATA_TYPES.STRING,f.DATA_TYPES.GEOMETRY,f.DATA_TYPES.GEOMETRY_FROM_STRING,f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,f.DATA_TYPES.ZIPCODE,f.DATA_TYPES.ARRAY,f.DATA_TYPES.OBJECT];t.ACCEPTED_ANALYZER_TYPES=x;var M=/^(null|NULL|Null|NaN|\/N||)$/;t.CSV_NULLS=M;var w=Object.keys(f.DATA_TYPES).filter((function(e){return!x.includes(e)})),O=(a={},(0,s.default)(a,h.ALL_FIELD_TYPES.boolean,{valid:function(e){return"boolean"==typeof e},parse:function(e){return"true"===e||"True"===e||"TRUE"===e||"1"===e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.integer,{valid:function(e){return parseInt(e,10)===e},parse:function(e){return parseInt(e,10)}}),(0,s.default)(a,h.ALL_FIELD_TYPES.timestamp,{valid:function(e,t){return["x","X"].includes(t.format)?"number"==typeof e:"string"==typeof e},parse:function(e,t){return["x","X"].includes(t.format)?Number(e):e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.real,{valid:function(e){return parseFloat(e)===e},parse:parseFloat}),a);function S(e,t){var n,r;if("string"==typeof e){var a=(0,l.csvParseRows)(e);if(!Array.isArray(a)||a.length<2)throw new Error("process Csv Data Failed: CSV is empty");r=a[0],n=a.slice(1)}else Array.isArray(e)&&e.length&&(n=e,r=t,Array.isArray(r)||(r=e[0],n=e.slice(1)));if(!n||!r)throw new Error("invalid input passed to processCsvData");L(n);var o=R(C({fields:r,rows:n}),r);return{fields:o,rows:T(n,o)}}function T(e,t){var n=t.findIndex((function(e){return"_geojson"===e.name}));return t.forEach(P.bind(null,e,n)),e}function C(e){var t=e.fields,n=e.rows,r=e.sampleCount,a=void 0===r?50:r,o=Math.min(a,n.length),i=(0,u.range)(0,o,1).map((function(e){return{}}));return t.forEach((function(e,t){for(var r=0,a=0;a<o;)if(r>=n.length)i[a][e]=null,a++;else if((0,m.notNullorUndefined)(n[r][t])){var s=n[r][t];i[a][e]="string"==typeof s?s.trim():s,a++,r++}else r++})),i}function L(e){for(var t=new RegExp(M,"g"),n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)"string"==typeof e[n][r]&&e[n][r].match(t)&&(e[n][r]=null)}function P(e,t,n,r){var a=O[n.type];if(a){var o=e.find((function(e){return(0,m.notNullorUndefined)(e[r])}));if(!o||a.valid(o[r],n))return;e.forEach((function(e){null!==e[r]&&(e[r]=a.parse(e[r],n),t>-1&&e[t]&&e[t].properties&&(e[t].properties[n.name]=e[r]))}))}}function R(e,t){var n=f.Analyzer.computeColMeta(e,[{regex:/.*geojson|all_points/g,dataType:"GEOMETRY"},{regex:/.*census/g,dataType:"STRING"}],{ignoredDataTypes:w}),r=D(t).fieldByIndex;return t.map((function(e,t){var a=r[t],o=n.find((function(t){return t.key===e}))||{},i=o.type;return{name:a,id:a,displayName:a,format:o.format,fieldIdx:t,type:k(i),analyzerType:i,valueAccessor:function(e){return function(n){return e.valueAt(n.index,t)}}}}))}function D(e){return e.reduce((function(e,t,n){var r=e.allNames,a=t;if(r.includes(t)){for(var o=0;r.includes("".concat(t,"-").concat(o));)o++;a="".concat(t,"-").concat(o)}return e.fieldByIndex[n]=a,e.allNames.push(a),e}),{allNames:[],fieldByIndex:{}})}function k(e){var t=f.DATA_TYPES.DATE,n=f.DATA_TYPES.TIME,r=f.DATA_TYPES.DATETIME,a=f.DATA_TYPES.NUMBER,o=f.DATA_TYPES.INT,i=f.DATA_TYPES.FLOAT,s=f.DATA_TYPES.BOOLEAN,l=f.DATA_TYPES.STRING,u=f.DATA_TYPES.GEOMETRY,d=f.DATA_TYPES.GEOMETRY_FROM_STRING,p=f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,m=f.DATA_TYPES.ZIPCODE,g=f.DATA_TYPES.ARRAY,y=f.DATA_TYPES.OBJECT;switch(e){case t:return h.ALL_FIELD_TYPES.date;case n:case r:return h.ALL_FIELD_TYPES.timestamp;case i:return h.ALL_FIELD_TYPES.real;case o:return h.ALL_FIELD_TYPES.integer;case s:return h.ALL_FIELD_TYPES.boolean;case u:case d:case p:case g:case y:return h.ALL_FIELD_TYPES.geojson;case a:case l:case m:return h.ALL_FIELD_TYPES.string;default:return c.console.warn("Unsupported analyzer type: ".concat(e)),h.ALL_FIELD_TYPES.string}}function I(e){if(!Array.isArray(e)||!e.length)return null;var t=Object.keys(e[0]),n=e.map((function(e){return t.map((function(t){return e[t]}))}));return L(n),S(n,t)}function F(e){var t=(0,p.default)(e);if(!t||!Array.isArray(t.features))throw new Error("Read File Failed: File is not a valid GeoJSON. Read more about [supported file format](".concat(y.GUIDES_FILE_FORMAT_DOC,")"));for(var n=[],r=0;r<t.features.length;r++){var a=t.features[r];a.geometry&&n.push(E({_geojson:a},a.properties||{}))}var o=n.reduce((function(e,t){return Object.keys(t).forEach((function(t){e.includes(t)||e.push(t)})),e}),[]);return n.forEach((function(e){o.forEach((function(t){t in e||(e[t]=null,e._geojson.properties[t]=null)}))})),I(n)}function j(e,t){var n,r=[t.map((function(e){return e.displayName||e.name}))],a=A(e.rows(!0));try{for(a.s();!(n=a.n()).done;){var o=n.value;r.push(o.map((function(e,n){return(0,m.parseFieldValue)(e,t[n].type)})))}}catch(e){a.e(e)}finally{a.f()}return(0,l.csvFormatRows)(r)}function B(e){return e?g.default.load(e.datasets,e.config):null}function N(e){if(!e)return null;var t=g.default.parseSavedData((0,v.toArray)(e));return t?Array.isArray(e)?t:t[0]:null}t.PARSE_FIELD_VALUE_FROM_STRING=O;var z=(o={},(0,s.default)(o,h.DATASET_FORMATS.row,I),(0,s.default)(o,h.DATASET_FORMATS.geojson,F),(0,s.default)(o,h.DATASET_FORMATS.csv,S),(0,s.default)(o,h.DATASET_FORMATS.keplergl,N),o);t.DATASET_HANDLERS=z;var U={processGeojson:F,processCsvData:S,processRowObject:I,processKeplerglJSON:B,processKeplerglDataset:N,analyzerTypeToFieldType:k,getFieldsFromData:R,parseCsvRowsByFieldType:P,formatCsv:j};t.Processors=U},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BUG_REPORT_LINK=t.GUIDES_FILE_FORMAT_DOC=t.EXPORT_HTML_MAP_MODES_DOC=t.MAPBOX_ACCESS_TOKEN=t.ADD_DATA_TO_MAP_DOC=t.EXPORT_HTML_MAP_DOC=t.API_REFERENCE_DOC=t.ACTIONS_DOC=t.USER_GUIDE_DOC=void 0;var r="https://docs.kepler.gl/docs/user-guides";t.USER_GUIDE_DOC=r;var a="https://docs.kepler.gl/docs/api-reference/actions/actions";t.ACTIONS_DOC=a;t.API_REFERENCE_DOC="https://docs.kepler.gl/docs/api-reference";var o="".concat(r,"/k-save-and-export");t.EXPORT_HTML_MAP_DOC=o;var i="".concat(a,"#adddatatomap");t.ADD_DATA_TO_MAP_DOC=i;t.MAPBOX_ACCESS_TOKEN="https://docs.mapbox.com/help/how-mapbox-works/access-tokens/";var s="".concat(r,"/k-save-and-export#export-html-map");t.EXPORT_HTML_MAP_MODES_DOC=s;var l="".concat(r,"/b-kepler-gl-workflow/a-add-data-to-the-map#supported-file-formats");t.GUIDES_FILE_FORMAT_DOC=l;t.BUG_REPORT_LINK="https://github.com/keplergl/kepler.gl/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBug%5D"},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.createDataContainer=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;if((t=l(l({},c),t)).inputDataFormat===u.ROWS_ARRAY)return new o.RowDataContainer({rows:e,fields:t.fields});throw Error("Failed to create a data container: not implemented format")},t.createIndexedDataContainer=d,t.getSampleData=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=e.numRows(),r=Math.max(Math.floor(n/t),1),a=[],o=0;o<n;o+=r)a.push(o);return d(e,a)},t.DataForm=void 0;var a=r(n(3)),o=n(1635),i=n(1636);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u={ROWS_ARRAY:"ROWS_ARRAY"};t.DataForm=u;var c={inputDataFormat:u.ROWS_ARRAY};function d(e,t){return new i.IndexedDataContainer(e,t)}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.findDefaultLayer=function(e,t){if(!e)return[];return Object.keys(t).reduce((function(n,r){var a="function"==typeof t[r].findDefaultLayerProps?t[r].findDefaultLayerProps(e,n):{props:[]},o=Array.isArray(a)?a:a.props||[];return(a.foundLayers||n).concat(o.map((function(t){return l(l({},t),{},{type:r,dataId:e.id})})))}),[]).map((function(n){var r=new t[n.type](n);return"function"==typeof r.setInitialLayerConfig&&e.dataContainer?r.setInitialLayerConfig(e):r}))},t.calculateLayerData=function(e,t,n){if(!e.type||!e.hasAllColumns()||!e.config.dataId)return{layer:e,layerData:{}};return{layerData:e.formatLayerData(t.datasets,n),layer:e}},t.getLayerHoverProp=function(e){var t=e.interactionConfig,n=e.hoverInfo,r=e.layers,a=e.layersToRender,o=e.datasets;if(t.tooltip.enabled&&n&&n.picked){var i=n.object,s=n.layer,l=r[s.props.idx];if(i&&l&&l.getHoverData&&a[l.id]){var u=l.config.dataId;if(!u)return null;var c=o[u],d=c.dataContainer,f=c.fields,p=l.getHoverData(i,d,f),h=t.tooltip.config.fieldsToShow[u];return{data:p,fields:f,fieldsToShow:h,layer:l}}}return null},t.renderDeckGlLayer=function(e,t,n){var r=e.datasets,a=e.layers,o=e.layerData,i=e.hoverInfo,s=e.clicked,l=e.mapState,u=e.interactionConfig,c=e.animationConfig,d=e.mapLayers,f=e.maskPolygon,p=a[n],h=o[n],m=(r[p.config.dataId]||{}).gpuFilter,g=s||i,y=!d||d&&d[p.id];return p.renderLayer({data:h,gpuFilter:m,idx:n,interactionConfig:u,layerCallbacks:t,mapState:l,animationConfig:c,objectHovered:g,visible:y,maskPolygon:f})},t.isLayerRenderable=u,t.isLayerVisible=c,t.prepareLayersForDeck=function(e,t){return e.reduce((function(e,n,r){return l(l({},e),{},(0,a.default)({},n.id,u(n,t[r])&&n.overlayType===o.OVERLAY_TYPE.deckgl))}),{})},t.prepareLayersToRender=function(e,t,n){return e.reduce((function(e,r,o){return l(l({},e),{},(0,a.default)({},r.id,u(r,t[o])&&c(r,n)))}),{})},t.getMaskExtensionProps=function(e){return{maskId:i.MASK_LAYER_ID,maskEnabled:Boolean(e&&e.length),extensions:[d]}};var a=r(n(3)),o=n(129),i=n(31);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t){return e.id!==i.GEOCODER_LAYER_ID&&e.shouldRenderLayer(t)}function c(e,t){return e.config.isVisible&&(!t||t&&t[e.id])}var d=new(n(134).MaskExtension)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,o,i,s=r(n(12)),l=r(n(0)),u=r(n(11)),c=n(40),d=n(29),f=n(45),p=u.default.div(a||(a=(0,s.default)(["\n background-color: ",";\n flex-grow: 1;\n z-index: 1;\n p {\n margin-bottom: 0;\n }\n"])),(function(e){return e.theme.mapPanelBackgroundColor})),h=u.default.div.attrs({className:"map-control__panel-content"})(o||(o=(0,s.default)(["\n ",";\n max-height: 500px;\n min-height: 100px;\n min-width: ","px;\n overflow: auto;\n"])),(function(e){return e.theme.dropdownScrollBar}),(function(e){return e.theme.mapControl.width})),m=u.default.div.attrs({className:"map-control__panel-header"})(i||(i=(0,s.default)(["\n display: flex;\n justify-content: space-between;\n background-color: ",";\n height: 32px;\n padding: 6px 12px;\n font-size: 11px;\n color: ",";\n position: relative;\n\n button {\n width: 18px;\n height: 18px;\n }\n"])),(function(e){return e.theme.mapPanelHeaderBackgroundColor}),(function(e){return e.theme.titleTextColor}));var g=function(){var e=l.default.memo((function(e){var t=e.children,n=e.header,r=e.onClick,a=e.scale,o=void 0===a?1:a,i=e.isExport,s=e.logoComponent;return l.default.createElement(p,{style:{transform:"scale(".concat(o,")"),marginBottom:"8px"}},l.default.createElement(m,null,i&&s?s:n?l.default.createElement("span",{style:{verticalAlign:"middle"}},l.default.createElement(c.FormattedMessage,{id:n})):null,i?null:l.default.createElement(d.IconRoundSmall,{className:"close-map-control-item",onClick:r},l.default.createElement(f.Close,{height:"16px"}))),l.default.createElement(h,null,t))}));return e.displayName="MapControlPanel",e};t.default=g},function(e,t,n){e.exports=function(e){return r({},e)};var r=n(408)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,o,i,s=r(n(12)),l=r(n(0)),u=r(n(11)),c=n(39),d=n(28),f=n(44),p=u.default.div(a||(a=(0,s.default)(["\n background-color: ",";\n flex-grow: 1;\n z-index: 1;\n p {\n margin-bottom: 0;\n }\n"])),(function(e){return e.theme.mapPanelBackgroundColor})),h=u.default.div.attrs({className:"map-control__panel-content"})(o||(o=(0,s.default)(["\n ",";\n max-height: 500px;\n min-height: 100px;\n min-width: ","px;\n overflow: auto;\n"])),(function(e){return e.theme.dropdownScrollBar}),(function(e){return e.theme.mapControl.width})),m=u.default.div.attrs({className:"map-control__panel-header"})(i||(i=(0,s.default)(["\n display: flex;\n justify-content: space-between;\n background-color: ",";\n height: 32px;\n padding: 6px 12px;\n font-size: 11px;\n color: ",";\n position: relative;\n\n button {\n width: 18px;\n height: 18px;\n }\n"])),(function(e){return e.theme.mapPanelHeaderBackgroundColor}),(function(e){return e.theme.titleTextColor}));var g=function(){var e=l.default.memo((function(e){var t=e.children,n=e.header,r=e.onClick,a=e.scale,o=void 0===a?1:a,i=e.isExport,s=e.logoComponent;return l.default.createElement(p,{style:{transform:"scale(".concat(o,")"),marginBottom:"8px"}},l.default.createElement(m,null,i&&s?s:n?l.default.createElement("span",{style:{verticalAlign:"middle"}},l.default.createElement(c.FormattedMessage,{id:n})):null,i?null:l.default.createElement(d.IconRoundSmall,{className:"close-map-control-item",onClick:r},l.default.createElement(f.Close,{height:"16px"}))),l.default.createElement(h,null,t))}));return e.displayName="MapControlPanel",e};t.default=g},function(e,t,n){"use strict";n.r(t),n.d(t,"SortableContainer",(function(){return fe})),n.d(t,"sortableContainer",(function(){return fe})),n.d(t,"SortableElement",(function(){return me})),n.d(t,"sortableElement",(function(){return me})),n.d(t,"SortableHandle",(function(){return re})),n.d(t,"sortableHandle",(function(){return re})),n.d(t,"arrayMove",(function(){return E}));var r=n(299),a=n(42),o=n(4);function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Object(o.a)(e,t,n[t])}))}return e}var s=n(33),l=n(32),u=n(57),c=n(37),d=n(58),f=n(15),p=n(0),h=n(1),m=n.n(h),g=n(102),y=n(93),v=n.n(y),A=n(252),b=function(){function e(){Object(s.a)(this,e),Object(o.a)(this,"refs",{})}return Object(l.a)(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(_)}}]),e}();function _(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function E(e,t,n){return(e=e.slice()).splice(n<0?e.length+n:n,0,e.splice(t,1)[0]),e}function x(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var M={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},w=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function O(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function S(e,t){e.style["".concat(w,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function T(e,t){e.style["".concat(w,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function C(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function L(e,t,n){return Math.max(e,Math.min(n,t))}function P(e){return"px"===e.substr(-2)?parseFloat(e):0}function R(e){var t=window.getComputedStyle(e);return{bottom:P(t.marginBottom),left:P(t.marginLeft),right:P(t.marginRight),top:P(t.marginTop)}}function D(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function k(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function I(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function F(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:j(e.parentNode,t,r)}}function B(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}function N(e){var t=e.lockOffset,n=e.width,r=e.height,a=t,o=t,i="px";if("string"==typeof t){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);v()(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),a=parseFloat(t),o=parseFloat(t),i=s[1]}return v()(isFinite(a)&&isFinite(o),"lockOffset value should be a finite. Given %s",t),"%"===i&&(a=a*n/100,o=o*r/100),{x:a,y:o}}function z(e){var t=e.height,n=e.width,r=e.lockOffset,o=Array.isArray(r)?r:[r,r];v()(2===o.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",r);var i=Object(a.a)(o,2),s=i[0],l=i[1];return[N({height:t,lockOffset:s,width:n}),N({height:t,lockOffset:l,width:n})]}function U(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:U(e.parentNode):null}function H(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:P(t.gridColumnGap),y:P(t.gridRowGap)}:{x:0,y:0}}var V=27,G=32,Y=37,W=38,q=39,X=40,K="A",Z="BUTTON",J="CANVAS",Q="INPUT",$="OPTION",ee="TEXTAREA",te="SELECT";function ne(e){var t="input, textarea, select, canvas, [contenteditable]",n=e.querySelectorAll(t),r=e.cloneNode(!0);return Object(A.a)(r.querySelectorAll(t)).forEach((function(e,t){("file"!==e.type&&(e.value=n[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===J&&n[t].width>0&&n[t].height>0)&&e.getContext("2d").drawImage(n[t],0,0)})),r}function re(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return Object(s.a)(this,n),Object(u.a)(this,Object(c.a)(n).apply(this,arguments))}return Object(d.a)(n,t),Object(l.a)(n,[{key:"componentDidMount",value:function(){Object(g.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return v()(a.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=a.withRef?"wrappedInstance":null;return Object(p.createElement)(e,Object(r.a)({ref:t},this.props))}}]),n}(p.Component),Object(o.a)(t,"displayName",D("sortableHandle",e)),n}function ae(e){return null!=e.sortableHandle}var oe=function(){function e(t,n){Object(s.a)(this,e),this.container=t,this.onScrollCallback=n}return Object(l.a)(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,a=e.maxTranslate,o=e.width,i=e.height,s={x:0,y:0},l={x:1,y:1},u=10,c=10,d=this.container,f=d.scrollTop,p=d.scrollLeft,h=d.scrollHeight,m=d.scrollWidth,g=0===f,y=h-f-d.clientHeight==0,v=0===p,A=m-p-d.clientWidth==0;n.y>=a.y-i/2&&!y?(s.y=1,l.y=c*Math.abs((a.y-i/2-n.y)/i)):n.x>=a.x-o/2&&!A?(s.x=1,l.x=u*Math.abs((a.x-o/2-n.x)/o)):n.y<=r.y+i/2&&!g?(s.y=-1,l.y=c*Math.abs((n.y-i/2-r.y)/i)):n.x<=r.x+o/2&&!v&&(s.x=-1,l.x=u*Math.abs((n.x-o/2-r.x)/o)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===s.x&&0===s.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:l.x*s.x,top:l.y*s.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}();var ie={axis:m.a.oneOf(["x","y","xy"]),contentWindow:m.a.any,disableAutoscroll:m.a.bool,distance:m.a.number,getContainer:m.a.func,getHelperDimensions:m.a.func,helperClass:m.a.string,helperContainer:m.a.oneOfType([m.a.func,"undefined"==typeof HTMLElement?m.a.any:m.a.instanceOf(HTMLElement)]),hideSortableGhost:m.a.bool,keyboardSortingTransitionDuration:m.a.number,lockAxis:m.a.string,lockOffset:m.a.oneOfType([m.a.number,m.a.string,m.a.arrayOf(m.a.oneOfType([m.a.number,m.a.string]))]),lockToContainerEdges:m.a.bool,onSortEnd:m.a.func,onSortMove:m.a.func,onSortOver:m.a.func,onSortStart:m.a.func,pressDelay:m.a.number,pressThreshold:m.a.number,keyCodes:m.a.shape({lift:m.a.arrayOf(m.a.number),drop:m.a.arrayOf(m.a.number),cancel:m.a.arrayOf(m.a.number),up:m.a.arrayOf(m.a.number),down:m.a.arrayOf(m.a.number)}),shouldCancelStart:m.a.func,transitionDuration:m.a.number,updateBeforeSortStart:m.a.func,useDragHandle:m.a.bool,useWindowAsScrollContainer:m.a.bool},se={lift:[G],drop:[G],cancel:[V],up:[W,Y],down:[X,q]},le={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:se,shouldCancelStart:function(e){return-1!==[Q,ee,te,$,Z].indexOf(e.target.tagName)||!!C(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},ue=Object.keys(ie);function ce(e){v()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function de(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}function fe(e){var t,n,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return Object(s.a)(this,n),t=Object(u.a)(this,Object(c.a)(n).call(this,e)),Object(o.a)(Object(f.a)(Object(f.a)(t)),"state",{}),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleStart",(function(e){var n=t.props,r=n.distance,a=n.shouldCancelStart;if(2!==e.button&&!a(e)){t.touched=!0,t.position=I(e);var o=C(e.target,(function(e){return null!=e.sortableInfo}));if(o&&o.sortableInfo&&t.nodeIsChild(o)&&!t.state.sorting){var i=t.props.useDragHandle,s=o.sortableInfo,l=s.index,u=s.collection;if(s.disabled)return;if(i&&!C(e.target,ae))return;t.manager.active={collection:u,index:l},F(e)||e.target.tagName!==K||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleMove",(function(e){var n=t.props,r=n.distance,a=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var o=I(e),i={x:t.position.x-o.x,y:t.position.y-o.y},s=Math.abs(i.x)+Math.abs(i.y);t.delta=i,r||a&&!(s>=a)?r&&s>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n=p.sortableInfo.index,r=R(p),a=H(t.container),c=t.scrollContainer.getBoundingClientRect(),g=s({index:n,node:p,collection:h});if(t.node=p,t.margin=r,t.gridGap=a,t.width=g.width,t.height=g.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=c,t.index=n,t.newIndex=n,t.axis={x:o.indexOf("x")>=0,y:o.indexOf("y")>=0},t.offsetEdge=j(p,t.container),t.initialOffset=I(m?i({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(ne(p)),O(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-r.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-r.top,"px"),width:"".concat(t.width,"px")}),m&&t.helper.focus(),u&&(t.sortableGhost=p,O(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},m){var y=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,v=y.top,A=y.left,b=y.width,_=v+y.height,E=A+b;t.axis.x&&(t.minTranslate.x=A-t.boundingClientRect.left,t.maxTranslate.x=E-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=v-t.boundingClientRect.top,t.maxTranslate.y=_-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:c.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:c.left+c.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:c.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:c.top+c.height)-t.boundingClientRect.top-t.height/2);l&&l.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?p:t.contentWindow,m?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(M.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),M.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),d&&d({node:p,index:n,collection:h,isKeySorting:m,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),m&&t.keyMove(0)},a=t.props,o=a.axis,s=a.getHelperDimensions,l=a.helperClass,u=a.hideSortableGhost,c=a.updateBeforeSortStart,d=a.onSortStart,f=a.useWindowAsScrollContainer,p=n.node,h=n.collection,m=t.manager.isKeySorting,g=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var n=de((function(){var t=p.sortableInfo.index;return Promise.resolve(c({collection:h,index:t,node:p,isKeySorting:m},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return g&&g.then?g.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,a=n.onSortEnd,o=t.manager,i=o.active.collection,s=o.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(s?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(M.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),M.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&O(t.sortableGhost,{opacity:"",visibility:""});for(var u=0,c=l.length;u<c;u++){var d=l[u],f=d.node;d.edgeOffset=null,d.boundingClientRect=null,S(f,null),T(f,null),d.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof a&&a({collection:i,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:s,nodes:l},e),t.touched=!1})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var r=i({},t.translate),a=0,o=0;return t.axis.x&&(r.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),a=t.translate.x-r.x),t.axis.y&&(r.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),o=t.translate.y-r.y),t.translate=r,S(t.helper,t.translate),t.scrollContainer.scrollLeft+=a,void(t.scrollContainer.scrollTop+=o)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleKeyDown",(function(e){var n=e.keyCode,r=t.props,a=r.shouldCancelStart,o=r.keyCodes,s=i({},se,void 0===o?{}:o);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||s.lift.includes(n)&&!a(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),s.lift.includes(n)&&!t.manager.active?t.keyLift(e):s.drop.includes(n)&&t.manager.active?t.keyDrop(e):s.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):s.up.includes(n)?t.keyMove(-1):s.down.includes(n)&&t.keyMove(1))})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"keyLift",(function(e){var n=e.target,r=C(n,(function(e){return null!=e.sortableInfo})).sortableInfo,a=r.index,o=r.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:a,collection:o},t.handlePress(e)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),r=n[n.length-1].node.sortableInfo.index,a=t.newIndex+e,o=t.newIndex;if(!(a<0||a>r)){t.prevIndex=o,t.newIndex=a;var i=B(t.newIndex,t.prevIndex,t.index),s=n.find((function(e){return e.node.sortableInfo.index===i})),l=s.node,u=t.containerScrollDelta,c=s.boundingClientRect||k(l,u),d=s.translate||{x:0,y:0},f=c.top+d.y-u.top,p=c.left+d.x-u.left,h=o<a,m=h&&t.axis.x?l.offsetWidth-t.width:0,g=h&&t.axis.y?l.offsetHeight-t.height:0;t.handleSortMove({pageX:p+m,pageY:f+g,ignoreTransition:0===e})}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,r=e.target,a=C(r,(function(e){return null!=e.sortableInfo}));return a&&a.sortableInfo&&!a.sortableInfo.disabled&&(n?ae(r):r.sortableInfo)})),ce(e),t.manager=new b,t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return Object(d.a)(n,t),Object(l.a)(n,[{key:"getChildContext",value:function(){return{manager:this.manager}}},{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var r=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof r?r():r,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:U(e.container)||e.container,e.autoScroller=new oe(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return M[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return M[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,r=t.lockOffset,o=t.lockToContainerEdges,i=t.transitionDuration,s=t.keyboardSortingTransitionDuration,l=void 0===s?i:s,u=this.manager.isKeySorting,c=e.ignoreTransition,d=I(e),f={x:d.x-this.initialOffset.x,y:d.y-this.initialOffset.y};if(f.y-=window.pageYOffset-this.initialWindowScroll.top,f.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=f,o){var p=z({height:this.height,lockOffset:r,width:this.width}),h=Object(a.a)(p,2),m=h[0],g=h[1],y={x:this.width/2-m.x,y:this.height/2-m.y},v={x:this.width/2-g.x,y:this.height/2-g.y};f.x=L(this.minTranslate.x+y.x,this.maxTranslate.x-v.x,f.x),f.y=L(this.minTranslate.y+y.y,this.maxTranslate.y-v.y,f.y)}"x"===n?f.y=0:"y"===n&&(f.x=0),u&&l&&!c&&T(this.helper,l),S(this.helper,f)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,r=e.onSortOver,a=this.containerScrollDelta,o=this.windowScrollDelta,i=this.manager.getOrderedRefs(),s=this.offsetEdge.left+this.translate.x+a.left,l=this.offsetEdge.top+this.translate.y+a.top,u=this.manager.isKeySorting,c=this.newIndex;this.newIndex=null;for(var d=0,f=i.length;d<f;d++){var p=i[d].node,h=p.sortableInfo.index,m=p.offsetWidth,g=p.offsetHeight,y={height:this.height>g?g/2:this.height/2,width:this.width>m?m/2:this.width/2},v=u&&h>this.index&&h<=c,A=u&&h<this.index&&h>=c,b={x:0,y:0},_=i[d].edgeOffset;_||(_=j(p,this.container),i[d].edgeOffset=_,u&&(i[d].boundingClientRect=k(p,a)));var E=d<i.length-1&&i[d+1],x=d>0&&i[d-1];E&&!E.edgeOffset&&(E.edgeOffset=j(E.node,this.container),u&&(E.boundingClientRect=k(E.node,a))),h!==this.index?(t&&T(p,t),this.axis.x?this.axis.y?A||h<this.index&&(s+o.left-y.width<=_.left&&l+o.top<=_.top+y.height||l+o.top+y.height<=_.top)?(b.x=this.width+this.marginOffset.x,_.left+b.x>this.containerBoundingRect.width-y.width&&E&&(b.x=E.edgeOffset.left-_.left,b.y=E.edgeOffset.top-_.top),null===this.newIndex&&(this.newIndex=h)):(v||h>this.index&&(s+o.left+y.width>=_.left&&l+o.top+y.height>=_.top||l+o.top+y.height>=_.top+g))&&(b.x=-(this.width+this.marginOffset.x),_.left+b.x<this.containerBoundingRect.left+y.width&&x&&(b.x=x.edgeOffset.left-_.left,b.y=x.edgeOffset.top-_.top),this.newIndex=h):v||h>this.index&&s+o.left+y.width>=_.left?(b.x=-(this.width+this.marginOffset.x),this.newIndex=h):(A||h<this.index&&s+o.left<=_.left+y.width)&&(b.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=h)):this.axis.y&&(v||h>this.index&&l+o.top+y.height>=_.top?(b.y=-(this.height+this.marginOffset.y),this.newIndex=h):(A||h<this.index&&l+o.top<=_.top+y.height)&&(b.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=h))),S(p,b),i[d].translate=b):n&&(this.sortableGhost=p,O(p,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),u&&(this.newIndex=c);var M=u?this.prevIndex:c;r&&this.newIndex!==M&&r({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:M,isKeySorting:u,nodes:i,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return v()(h.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.refs.wrappedInstance}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?Object(g.findDOMNode)(this):e(h.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=h.withRef?"wrappedInstance":null;return Object(p.createElement)(e,Object(r.a)({ref:t},x(this.props,ue)))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(p.Component),Object(o.a)(t,"displayName",D("sortableList",e)),Object(o.a)(t,"defaultProps",le),Object(o.a)(t,"propTypes",ie),Object(o.a)(t,"childContextTypes",{manager:m.a.object.isRequired}),n}var pe={index:m.a.number.isRequired,collection:m.a.oneOfType([m.a.number,m.a.string]),disabled:m.a.bool},he=Object.keys(pe);function me(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return Object(s.a)(this,n),Object(u.a)(this,Object(c.a)(n).apply(this,arguments))}return Object(d.a)(n,t),Object(l.a)(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,a=Object(g.findDOMNode)(this);a.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=a,this.ref={node:a},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return v()(a.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=a.withRef?"wrappedInstance":null;return Object(p.createElement)(e,Object(r.a)({ref:t},x(this.props,he)))}}]),n}(p.Component),Object(o.a)(t,"displayName",D("sortableElement",e)),Object(o.a)(t,"contextTypes",{manager:m.a.object.isRequired}),Object(o.a)(t,"propTypes",pe),Object(o.a)(t,"defaultProps",{collection:0}),n}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l}));var r=n(109),a=n(103);const o=()=>{const e=Object(a.b)();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function i(e){const t=o();e=Array.isArray(e)?e:[e];for(const n of e){const e=Object(r.b)(n);t.find(t=>e===t)||t.unshift(e)}}function s(){return o()}function l(){Object(a.b)().loaderRegistry=[]}},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"a",(function(){return m}));var r=n(352),a=n(239),o=n(447),i=n(71),s=n(64);function l(e){return Math.log(e)}function u(e){return Math.exp(e)}function c(e){return-Math.log(-e)}function d(e){return-Math.exp(-e)}function f(e){return isFinite(e)?+("1e"+e):e<0?0:e}function p(e){return function(t){return-e(-t)}}function h(e){var t,n,i=e(l,u),s=i.domain,h=10;function m(){return t=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(h),n=function(e){return 10===e?f:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(h),s()[0]<0?(t=p(t),n=p(n),e(c,d)):e(l,u),i}return i.base=function(e){return arguments.length?(h=+e,m()):h},i.domain=function(e){return arguments.length?(s(e),m()):s()},i.ticks=function(e){var a,o=s(),i=o[0],l=o[o.length-1];(a=l<i)&&(f=i,i=l,l=f);var u,c,d,f=t(i),p=t(l),m=null==e?10:+e,g=[];if(!(h%1)&&p-f<m){if(f=Math.floor(f),p=Math.ceil(p),i>0){for(;f<=p;++f)for(c=1,u=n(f);c<h;++c)if(!((d=u*c)<i)){if(d>l)break;g.push(d)}}else for(;f<=p;++f)for(c=h-1,u=n(f);c>=1;--c)if(!((d=u*c)<i)){if(d>l)break;g.push(d)}2*g.length<m&&(g=Object(r.a)(i,l,m))}else g=Object(r.a)(f,p,Math.min(p-f,m)).map(n);return a?g.reverse():g},i.tickFormat=function(e,r){if(null==r&&(r=10===h?".0e":","),"function"!=typeof r&&(r=Object(a.b)(r)),e===1/0)return r;null==e&&(e=10);var o=Math.max(1,h*e/i.ticks().length);return function(e){var a=e/n(Math.round(t(e)));return a*h<h-.5&&(a*=h),a<=o?r(e):""}},i.nice=function(){return s(Object(o.a)(s(),{floor:function(e){return n(Math.floor(t(e)))},ceil:function(e){return n(Math.ceil(t(e)))}}))},i}function m(){var e=h(Object(i.d)()).domain([1,10]);return e.copy=function(){return Object(i.a)(e,m()).base(e.base())},s.b.apply(e,arguments),e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(47),a=n(142),o=n(296),i=n(53),s=n(92);const l={pitch:0,bearing:0,altitude:1.5,minZoom:0,maxZoom:20,minPitch:0,maxPitch:60,position:[0,0,0]};class u extends o.a{constructor(e){e={...l,...e};const{makeViewport:t,width:n,height:r,latitude:a,longitude:o,zoom:i,bearing:u,pitch:c,altitude:d,position:f,maxZoom:p,minZoom:h,maxPitch:m,minPitch:g,startPanLngLat:y,startZoomLngLat:v,startRotatePos:A,startBearing:b,startPitch:_,startZoom:E,normalize:x}=e||{};Object(s.a)(Number.isFinite(o)),Object(s.a)(Number.isFinite(a)),Object(s.a)(Number.isFinite(i)),super({width:n,height:r,latitude:a,longitude:o,zoom:i,bearing:u,pitch:c,altitude:d,maxZoom:p,minZoom:h,maxPitch:m,minPitch:g,normalize:x,position:f}),this._state={startPanLngLat:y,startZoomLngLat:v,startRotatePos:A,startBearing:b,startPitch:_,startZoom:E},this.makeViewport=t}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const n=this._state.startPanLngLat||this._unproject(t);if(!n)return this;const r=this.makeViewport(this._viewportProps).panByPosition(n,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){const{startRotatePos:r,startBearing:a,startPitch:o}=this._state;if(!r||!Number.isFinite(a)||!Number.isFinite(o))return this;let i;return i=e?this._calculateNewPitchAndBearing({...this._getRotationParams(e,r),startBearing:a,startPitch:o}):{bearing:a+t,pitch:o+n},this._getUpdatedState(i)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:n}){let{startZoom:r,startZoomLngLat:a}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,a=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:n,startZoom:r}),i=this.makeViewport({...this._viewportProps,zoom:o});return this._getUpdatedState({zoom:o,...i.panByPosition(a,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),n={...this._viewportProps},{bearing:r,longitude:a}=n;return Math.abs(r-t.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(a-t.longitude)>180&&(n.longitude=a<0?a+360:a-360),n}_zoomFromCenter(e){const{width:t,height:n}=this._viewportProps;return this.zoom({pos:[t/2,n/2],scale:e})}_panFromCenter(e){const{width:t,height:n}=this._viewportProps;return this.pan({startPos:[t/2,n/2],pos:[t/2+e[0],n/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this._viewportProps,...this._state,...e})}_applyConstraints(e){const{maxZoom:t,minZoom:n,zoom:a}=e;e.zoom=Object(r.a)(a,n,t);const{maxPitch:o,minPitch:s,pitch:l}=e;e.pitch=Object(r.a)(l,s,o);const{normalize:u=!0}=e;return u&&Object.assign(e,Object(i.m)(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:n,minZoom:a}=this._viewportProps,o=t+Math.log2(e);return Object(r.a)(o,a,n)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:n,startPitch:a}){t=Object(r.a)(t,-1,1);const{minPitch:o,maxPitch:i}=this._viewportProps;let s=a;return t>0?s=a+t*(i-a):t<0&&(s=a-t*(o-a)),{pitch:s,bearing:n+180*e}}_getRotationParams(e,t){const n=e[0]-t[0],r=e[1]-t[1],a=e[1],o=t[1],{width:i,height:s}=this._viewportProps,l=n/i;let u=0;return r>0?Math.abs(s-o)>5&&(u=r/(o-s)*1.2):r<0&&o>5&&(u=1-a/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:l,deltaScaleY:u}}}class c extends a.a{constructor(e){e.dragMode=e.dragMode||"pan",super(u,e)}setProps(e){e.position=e.position||[0,0,0];const t=this.controllerStateProps;super.setProps(e);(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...this.controllerStateProps,...this._state}))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch","position"]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(47),a=n(92);class o{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:n,required:r}=e;this._propsToCompare=t,this._propsToExtract=n,this._requiredProps=r}arePropsEqual(e,t){for(const n of this._propsToCompare||Object.keys(t))if(!(n in e)||!(n in t)||!Object(r.d)(e[n],t[n]))return!1;return!0}initializeProps(e,t){let n;if(this._propsToExtract){const r={},a={};for(const n of this._propsToExtract)r[n]=e[n],a[n]=t[n];n={start:r,end:a}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}interpolateProps(e,t,n){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(t=>{const n=e[t];Object(a.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return g}));var r=n(47),a=n(142),o=n(296),i=n(89);const s=0,l=0,u=0,c=[0,0,0],d=-90,f=90,p=-1/0,h=1/0;class m extends o.a{constructor({makeViewport:e,width:t,height:n,rotationX:r=s,rotationOrbit:a=l,target:o=c,zoom:i=u,minRotationX:m=d,maxRotationX:g=f,minZoom:y=p,maxZoom:v=h,startPanPosition:A,startRotatePos:b,startRotationX:_,startRotationOrbit:E,startZoomPosition:x,startZoom:M}){super({width:t,height:n,rotationX:r,rotationOrbit:a,target:o,zoom:i,minRotationX:m,maxRotationX:g,minZoom:y,maxZoom:v}),this._state={startPanPosition:A,startRotatePos:b,startRotationX:_,startRotationOrbit:E,startZoomPosition:x,startZoom:M},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const n=this._state.startPanPosition||t;if(!n)return this;const r=this.makeViewport(this._viewportProps).panByPosition(n,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){const{startRotatePos:r,startRotationX:a,startRotationOrbit:o}=this._state,{width:i,height:s}=this._viewportProps;if(!r||!Number.isFinite(a)||!Number.isFinite(o))return this;let l;if(e){let t=(e[0]-r[0])/i;const n=(e[1]-r[1])/s;(a<-90||a>90)&&(t*=-1),l={rotationX:a+180*n,rotationOrbit:o+180*t}}else l={rotationX:a+n,rotationOrbit:o+t};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),n={...this._viewportProps},{rotationOrbit:r}=n;return Math.abs(r-t.rotationOrbit)>180&&(n.rotationOrbit=r<0?r+360:r-360),n}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:n}){const{zoom:r}=this._viewportProps;let{startZoom:a,startZoomPosition:o}=this._state;Number.isFinite(a)||(a=r,o=this._unproject(t)||this._unproject(e));const i=this._calculateNewZoom({scale:n,startZoom:a}),s=this.makeViewport({...this._viewportProps,zoom:i});return this._getUpdatedState({zoom:i,...s.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:n,minZoom:a}=this._viewportProps;Number.isFinite(t)||(t=this._viewportProps.zoom);const o=t+Math.log2(e);return Object(r.a)(o,a,n)}_panFromCenter(e){const{width:t,height:n,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],n/2+e[1]]})}_getUpdatedState(e){return new this.constructor({...this._viewportProps,...this._state,...e})}_applyConstraints(e){const{maxZoom:t,minZoom:n,zoom:a,maxRotationX:o,minRotationX:s,rotationOrbit:l}=e;return e.zoom=Object(r.a)(a,n,t),e.rotationX=Object(r.a)(e.rotationX,s,o),(l<-180||l>180)&&(e.rotationOrbit=Object(i.e)(l+180,360)-180),e}}class g extends a.a{constructor(e){super(m,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}},function(e,t,n){"use strict";var r=n(468),a=n(52),o=n(207),i=n(188);t.a=function(){var e=i.a,t=i.b,n=Object(a.a)(!0),s=null,l=o.a,u=null;function c(a){var o,i,c,d=a.length,f=!1;for(null==s&&(u=l(c=Object(r.a)())),o=0;o<=d;++o)!(o<d&&n(i=a[o],o,a))===f&&((f=!f)?u.lineStart():u.lineEnd()),f&&u.point(+e(i,o,a),+t(i,o,a));if(c)return u=null,c+""||null}return c.x=function(t){return arguments.length?(e="function"==typeof t?t:Object(a.a)(+t),c):e},c.y=function(e){return arguments.length?(t="function"==typeof e?e:Object(a.a)(+e),c):t},c.defined=function(e){return arguments.length?(n="function"==typeof e?e:Object(a.a)(!!e),c):n},c.curve=function(e){return arguments.length?(l=e,null!=s&&(u=l(s)),c):l},c.context=function(e){return arguments.length?(null==e?s=u=null:u=l(s=e),c):s},c}},function(e,t,n){"use strict";function r(){}t.a=function(e){return null==e?r:function(){return this.querySelector(e)}}},function(e,t,n){"use strict";var r=n(211);t.a=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),r.a.hasOwnProperty(t)?{space:r.a[t],local:e}:e}},function(e,t,n){"use strict";t.a=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}},function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var r=n(435),a=n(826),o=n(1179),i=n(825),s=n(34),l=n(1203),u=n(465),c=n(461),d=n(144),f=n(346),p=n(827),h=n(124);class m extends p.a{constructor(e){const{fp64:t,IndexType:n=Uint32Array}=e;super({...e,attributes:{positions:{size:3,type:t?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:n,size:1}}})}get(e){const{attributes:t}=this;return"indices"===e?t.indices&&t.indices.subarray(0,this.vertexCount):t[e]}updateGeometry(e){super.updateGeometry(e);const t=this.buffers.indices;t&&(this.vertexCount=(t.value||t).length)}normalizeGeometry(e){if(this.normalize){if(e=f.b(e,this.positionSize),this.opts.resolution)return Object(h.b)(e.positions||e,e.holeIndices,{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0});if(this.opts.wrapLongitude)return Object(h.c)(e.positions||e,e.holeIndices,{size:this.positionSize,maxLatitude:86,edgeTypes:!0})}return e}getGeometrySize(e){if(Array.isArray(e)&&!Number.isFinite(e[0])){let t=0;for(const n of e)t+=this.getGeometrySize(n);return t}return(e.positions||e).length/this.positionSize}getGeometryFromBuffer(e){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(e):()=>null}updateGeometryAttributes(e,t){if(Array.isArray(e)&&!Number.isFinite(e[0]))for(const n of e){const e=this.getGeometrySize(n);t.geometrySize=e,this.updateGeometryAttributes(n,t),t.vertexStart+=e,t.indexStart=this.indexStarts[t.geometryIndex+1]}else this._updateIndices(e,t),this._updatePositions(e,t),this._updateVertexValid(e,t)}_updateIndices(e,{geometryIndex:t,vertexStart:n,indexStart:r}){const{attributes:a,indexStarts:o,typedArrayManager:i}=this;let s=a.indices;if(!s)return;let l=r;const u=f.a(e,this.positionSize,this.opts.preproject);s=i.allocate(s,r+u.length,{copy:!0});for(let e=0;e<u.length;e++)s[l++]=u[e]+n;o[t+1]=r+u.length,a.indices=s}_updatePositions(e,{vertexStart:t,geometrySize:n}){const{attributes:{positions:r},positionSize:a}=this;if(!r)return;const o=e.positions||e;for(let e=t,i=0;i<n;e++,i++){const t=o[i*a],n=o[i*a+1],s=a>2?o[i*a+2]:0;r[3*e]=t,r[3*e+1]=n,r[3*e+2]=s}}_updateVertexValid(e,{vertexStart:t,geometrySize:n}){const{attributes:{vertexValid:r},positionSize:a}=this,o=e&&e.holeIndices;if(e&&e.edgeTypes?r.set(e.edgeTypes,t):r.fill(1,t,t+n),o)for(let e=0;e<o.length;e++)r[t+o[e]/a-1]=0;r[t+n-1]=0}}var g="\nattribute vec2 vertexPositions;\nattribute float vertexValid;\n\nuniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nstruct PolygonProps {\n vec4 fillColors;\n vec4 lineColors;\n vec3 positions;\n vec3 nextPositions;\n vec3 pickingColors;\n vec3 positions64Low;\n vec3 nextPositions64Low;\n float elevations;\n};\n\nvec3 project_offset_normal(vec3 vector) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return normalize(vector * project_uCommonUnitsPerWorldUnit);\n }\n return project_normal(vector);\n}\n\nvoid calculatePosition(PolygonProps props) {\n#ifdef IS_SIDE_VERTEX\n if(vertexValid < 0.5){\n gl_Position = vec4(0.);\n return;\n }\n#endif\n\n vec3 pos;\n vec3 pos64Low;\n vec3 normal;\n vec4 colors = isWireframe ? props.lineColors : props.fillColors;\n\n geometry.worldPosition = props.positions;\n geometry.worldPositionAlt = props.nextPositions;\n geometry.pickingColor = props.pickingColors;\n\n#ifdef IS_SIDE_VERTEX\n pos = mix(props.positions, props.nextPositions, vertexPositions.x);\n pos64Low = mix(props.positions64Low, props.nextPositions64Low, vertexPositions.x);\n#else\n pos = props.positions;\n pos64Low = props.positions64Low;\n#endif\n\n if (extruded) {\n pos.z += props.elevations * vertexPositions.y * elevationScale;\n }\n gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n if (extruded) {\n #ifdef IS_SIDE_VERTEX\n normal = vec3(\n props.positions.y - props.nextPositions.y + (props.positions64Low.y - props.nextPositions64Low.y),\n props.nextPositions.x - props.positions.x + (props.nextPositions64Low.x - props.positions64Low.x),\n 0.0);\n normal = project_offset_normal(normal);\n #else\n normal = project_normal(vec3(0.0, 0.0, 1.0));\n #endif\n geometry.normal = normal;\n vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal);\n vColor = vec4(lightColor, colors.a * opacity);\n } else {\n vColor = vec4(colors.rgb, colors.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",y="#define SHADER_NAME solid-polygon-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float elevations;\nattribute vec4 fillColors;\nattribute vec4 lineColors;\nattribute vec3 pickingColors;\n\n".concat(g,"\n\nvoid main(void) {\n PolygonProps props;\n\n props.positions = positions;\n props.positions64Low = positions64Low;\n props.elevations = elevations;\n props.fillColors = fillColors;\n props.lineColors = lineColors;\n props.pickingColors = pickingColors;\n\n calculatePosition(props);\n}\n"),v="#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\n\n\nattribute vec3 instancePositions;\nattribute vec3 nextPositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 nextPositions64Low;\nattribute float instanceElevations;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\n".concat(g,"\n\nvoid main(void) {\n PolygonProps props;\n\n #if RING_WINDING_ORDER_CW == 1\n props.positions = instancePositions;\n props.positions64Low = instancePositions64Low;\n props.nextPositions = nextPositions;\n props.nextPositions64Low = nextPositions64Low;\n #else\n props.positions = nextPositions;\n props.positions64Low = nextPositions64Low;\n props.nextPositions = instancePositions;\n props.nextPositions64Low = instancePositions64Low;\n #endif\n props.elevations = instanceElevations;\n props.fillColors = instanceFillColors;\n props.lineColors = instanceLineColors;\n props.pickingColors = instancePickingColors;\n\n calculatePosition(props);\n}\n");const A=[0,0,0,255],b={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:e=>e.polygon},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:A},getLineColor:{type:"accessor",value:A},material:!0},_={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class E extends r.a{getShaders(e){return super.getShaders({vs:"top"===e?y:v,fs:"#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",defines:{RING_WINDING_ORDER_CW:this.props._normalize||"CCW"!==this.props._windingOrder?1:0},modules:[a.a,o.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const{gl:e,viewport:t}=this.context;let{coordinateSystem:n}=this.props;t.isGeospatial&&n===s.a.DEFAULT&&(n=s.a.LNGLAT),this.setState({numInstances:0,polygonTesselator:new m({preproject:n===s.a.LNGLAT&&t.projectFlat,fp64:this.use64bitPositions(),IndexType:!e||Object(l.c)(e,u.a.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});const r=this.getAttributeManager();r.remove(["instancePickingColors"]),r.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:_,accessor:"getPolygon",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:!0},elevations:{size:1,transition:_,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:_,accessor:"getFillColor",defaultValue:A,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:_,accessor:"getLineColor",defaultValue:A,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n),shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}getPickingInfo(e){const t=super.getPickingInfo(e),{index:n}=t,{data:r}=this.props;return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(e){const{data:t}=this.props;if(t[0]&&t[0].__source)for(let n=0;n<t.length;n++)t[n].__source.index===e&&this._disablePickingIndex(n);else this._disablePickingIndex(e)}draw({uniforms:e}){const{extruded:t,filled:n,wireframe:r,elevationScale:a}=this.props,{topModel:o,sideModel:i,polygonTesselator:s}=this.state,l={...e,extruded:Boolean(t),elevationScale:a};i&&(i.setInstanceCount(s.instanceCount-1),i.setUniforms(l),r&&(i.setDrawMode(3),i.setUniforms({isWireframe:!0}).draw()),n&&(i.setDrawMode(6),i.setUniforms({isWireframe:!1}).draw())),o&&(o.setVertexCount(s.vertexCount),o.setUniforms(l).draw())}updateState(e){super.updateState(e),this.updateGeometry(e);const{props:t,oldProps:n,changeFlags:r}=e,a=this.getAttributeManager();var o;(r.extensionsChanged||t.filled!==n.filled||t.extruded!==n.extruded)&&(null===(o=this.state.models)||void 0===o||o.forEach(e=>e.delete()),this.setState(this._getModels(this.context.gl)),a.invalidateAll())}updateGeometry({props:e,oldProps:t,changeFlags:n}){if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon)){const{polygonTesselator:t}=this.state,r=e.data.attributes||{};t.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:r.getPolygon,buffers:r,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:n.dataChanged}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),n.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(e){const{id:t,filled:n,extruded:r}=this.props;let a,o;if(n){const n=this.getShaders("top");n.defines.NON_INSTANCED_MODEL=1,a=new c.a(e,{...n,id:"".concat(t,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0})}return r&&(o=new c.a(e,{...this.getShaders("side"),id:"".concat(t,"-side"),geometry:new d.a({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1}),o.userData.excludeAttributes={indices:!0}),{models:[o,a].filter(Boolean),topModel:a,sideModel:o}}calculateIndices(e){const{polygonTesselator:t}=this.state;e.startIndices=t.indexStarts,e.value=t.get("indices")}calculatePositions(e){const{polygonTesselator:t}=this.state;e.startIndices=t.vertexStarts,e.value=t.get("positions")}calculateVertexValid(e){e.value=this.state.polygonTesselator.get("vertexValid")}}E.layerName="SolidPolygonLayer",E.defaultProps=b},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(435),a=n(826),o=n(825),i=n(50),s=n(34),l=n(461),u=n(144),c=n(827),d=n(124);class f extends c.a{constructor(e){super({...e,attributes:{positions:{size:3,padding:18,initialize:!0,type:e.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}getGeometryFromBuffer(e){return this.normalize?super.getGeometryFromBuffer(e):()=>null}normalizeGeometry(e){return this.normalize?function(e,t,n,r){let a=e;if(Array.isArray(e[0])){const n=e.length*t;a=new Array(n);for(let n=0;n<e.length;n++)for(let r=0;r<t;r++)a[n*t+r]=e[n][r]||0}return n?Object(d.d)(a,{size:t,gridResolution:n}):r?Object(d.e)(a,{size:t}):a}(e,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):e}get(e){return this.attributes[e]}getGeometrySize(e){if(Array.isArray(e[0])){let t=0;for(const n of e)t+=this.getGeometrySize(n);return t}const t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t<3?0:t+2:t}updateGeometryAttributes(e,t){if(0!==t.geometrySize)if(e&&Array.isArray(e[0]))for(const n of e){const e=this.getGeometrySize(n);t.geometrySize=e,this.updateGeometryAttributes(n,t),t.vertexStart+=e}else this._updateSegmentTypes(e,t),this._updatePositions(e,t)}_updateSegmentTypes(e,t){const{segmentTypes:n}=this.attributes,r=this.isClosed(e),{vertexStart:a,geometrySize:o}=t;n.fill(0,a,a+o),r?(n[a]=4,n[a+o-2]=4):(n[a]+=1,n[a+o-2]+=2),n[a+o-1]=4}_updatePositions(e,t){const{positions:n}=this.attributes;if(!n)return;const{vertexStart:r,geometrySize:a}=t,o=new Array(3);for(let t=r,i=0;i<a;t++,i++)this.getPointOnPath(e,i,o),n[3*t]=o[0],n[3*t+1]=o[1],n[3*t+2]=o[2]}getPathLength(e){return e.length/this.positionSize}getPointOnPath(e,t,n=[]){const{positionSize:r}=this;t*r>=e.length&&(t+=1-e.length/r);const a=t*r;return n[0]=e[a],n[1]=e[a+1],n[2]=3===r&&e[a+2]||0,n}isClosed(e){if(!this.normalize)return this.opts.loop;const{positionSize:t}=this,n=e.length-t;return e[0]===e[n]&&e[1]===e[n+1]&&(2===t||e[2]===e[n+2])}}const p=[0,0,0,255],h={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:e=>e.path},getColor:{type:"accessor",value:p},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},m={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class g extends r.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\nuniform int widthUnits;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n vec2 width\n) {\n bool isEnd = positions.x > 0.0;\n float sideOfPath = positions.y;\n float isJoint = float(sideOfPath == 0.0);\n\n vec3 deltaA3 = (currPoint - prevPoint);\n vec3 deltaB3 = (nextPoint - currPoint);\n\n mat3 rotationMatrix;\n bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n if (needsRotation) {\n deltaA3 = deltaA3 * rotationMatrix;\n deltaB3 = deltaB3 * rotationMatrix;\n }\n vec2 deltaA = deltaA3.xy / width;\n vec2 deltaB = deltaB3.xy / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = dirA + dirB;\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 dir = isEnd ? dirA : dirB;\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n float cornerPosition = sideOfPath * turnDirection;\n\n float miterSize = 1.0 / max(sinHalfA, EPSILON);\n miterSize = mix(\n min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n miterSize,\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n * (sideOfPath + isJoint * turnDirection);\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n if (isCap) {\n offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\n vJointType = capType;\n } else {\n vJointType = jointType;\n }\n vPathLength = L;\n vCornerOffset = offsetVec;\n vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n vMiterLength = isCap ? isJoint : vMiterLength;\n\n vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n vPathPosition = vec2(\n dot(offsetFromStartOfPath, perp),\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n if (needsRotation) {\n offset = rotationMatrix * offset;\n }\n return currPoint + offset;\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.pickingColor = instancePickingColors;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n geometry.worldPosition = currPosition;\n vec2 widthPixels = vec2(clamp(\n project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels) / 2.0);\n vec3 width;\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n width = vec3(widthPixels, 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w,\n project_pixel_size_to_clipspace(width.xy)\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64Low);\n currPosition = project_position(currPosition, currPosition64Low);\n nextPosition = project_position(nextPosition, nextPosition64Low);\n\n width = vec3(project_pixel_size(widthPixels), 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n\n if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\n discard;\n }\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[a.a,o.a]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:m,accessor:"getPath",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:m,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:m,defaultValue:p},instancePickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n)}}),this.setState({pathTesselator:new f({fp64:this.use64bitPositions()})}),this.props.getDashArray&&!this.props.extensions.length&&i.a.removed("getDashArray","PathStyleExtension")()}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager();if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPath)){const{pathTesselator:e}=this.state,a=t.data.attributes||{};e.updateGeometry({data:t.data,geometryBuffer:a.getPath,buffers:a,normalize:!t._pathType,loop:"loop"===t._pathType,getGeometry:t.getPath,positionFormat:t.positionFormat,wrapLongitude:t.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:n.dataChanged}),this.setState({numInstances:e.instanceCount,startIndices:e.vertexStarts}),n.dataChanged||r.invalidateAll()}if(n.extensionsChanged){var a;const{gl:e}=this.context;null===(a=this.state.model)||void 0===a||a.delete(),this.state.model=this._getModel(e),r.invalidateAll()}}getPickingInfo(e){const t=super.getPickingInfo(e),{index:n}=t,{data:r}=this.props;return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(e){const{data:t}=this.props;if(t[0]&&t[0].__source)for(let n=0;n<t.length;n++)t[n].__source.index===e&&this._disablePickingIndex(n);else this._disablePickingIndex(e)}draw({uniforms:e}){const{jointRounded:t,capRounded:n,billboard:r,miterLimit:a,widthUnits:o,widthScale:i,widthMinPixels:l,widthMaxPixels:u}=this.props;this.state.model.setUniforms(e).setUniforms({jointType:Number(t),capType:Number(n),billboard:r,widthUnits:s.e[o],widthScale:i,miterLimit:a,widthMinPixels:l,widthMaxPixels:u}).draw()}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new u.a({drawMode:4,attributes:{indices:new Uint16Array([0,1,2,1,4,2,1,3,4,3,5,4]),positions:{value:new Float32Array([0,0,0,-1,0,1,1,-1,1,1,1,0]),size:2}}}),isInstanced:!0})}calculatePositions(e){const{pathTesselator:t}=this.state;e.startIndices=t.vertexStarts,e.value=t.get("positions")}calculateSegmentTypes(e){const{pathTesselator:t}=this.state;e.startIndices=t.vertexStarts,e.value=t.get("segmentTypes")}}g.layerName="PathLayer",g.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",(function(){return M}));var r=n(435),a=n(826),o=n(825),i=n(34),s=n(50),l=n(461),u=n(144),c=n(1190),d=n(639),f=n(250),p=n(1908),h=n(805),m=n(122);const g=()=>{},y={10241:9987,10240:9729,10242:33071,10243:33071};function v(e,t,n,r){return n===t.width&&r===t.height?t:(e.canvas.height=r,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.canvas)}function A(e){return e&&(e.id||e.url)}function b(e,t,n){for(let r=0;r<t.length;r++){const{icon:a,xOffset:o}=t[r];e[A(a)]={...a,x:o,y:n}}}class _{constructor(e,{onUpdate:t=g,onError:n=g}){this.gl=e,this.onUpdate=t,this.onError=n,this._loadOptions=null,this._getIcon=null,this._texture=null,this._externalTexture=null,this._mapping={},this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=4,this._canvasWidth=1024,this._canvasHeight=0,this._canvas=null}finalize(){var e;null===(e=this._texture)||void 0===e||e.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(e){const t=this._autoPacking?A(e):e;return this._mapping[t]||{}}setProps({loadOptions:e,autoPacking:t,iconAtlas:n,iconMapping:r,data:a,getIcon:o}){e&&(this._loadOptions=e),void 0!==t&&(this._autoPacking=t),o&&(this._getIcon=o),r&&(this._mapping=r),n&&this._updateIconAtlas(n),this._autoPacking&&(a||o)&&"undefined"!=typeof document&&(this._canvas=this._canvas||document.createElement("canvas"),this._updateAutoPacking(a))}get isLoaded(){return 0===this._pendingCount}_updateIconAtlas(e){var t;null===(t=this._texture)||void 0===t||t.delete(),this._texture=null,this._externalTexture=e,this.onUpdate()}_updateAutoPacking(e){const t=Object.values(function(e,t,n){if(!e||!t)return null;n=n||{};const r={},{iterable:a,objectInfo:o}=Object(m.a)(e);for(const e of a){o.index++;const a=t(e,o),i=A(a);if(!a)throw new Error("Icon is missing.");if(!a.url)throw new Error("Icon url is missing.");r[i]||n[i]&&a.url===n[i].url||(r[i]={...a,source:e,sourceIndex:o.index})}return r}(e,this._getIcon,this._mapping)||{});if(t.length>0){const{mapping:e,xOffset:n,yOffset:r,rowHeight:a,canvasHeight:o}=function({icons:e,buffer:t,mapping:n={},xOffset:r=0,yOffset:a=0,rowHeight:o=0,canvasWidth:i}){let s=[];for(let l=0;l<e.length;l++){const u=e[l];if(!n[A(u)]){const{height:e,width:l}=u;r+l+t>i&&(b(n,s,a),r=0,a=o+a+t,o=0,s=[]),s.push({icon:u,xOffset:r}),r=r+l+t,o=Math.max(o,e)}}return s.length>0&&b(n,s,a),{mapping:n,rowHeight:o,xOffset:r,yOffset:a,canvasWidth:i,canvasHeight:(l=o+a+t,Math.pow(2,Math.ceil(Math.log2(l))))};var l}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=a,this._mapping=e,this._xOffset=n,this._yOffset=r,this._canvasHeight=o,this._texture||(this._texture=new f.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:y})),this._texture.height!==this._canvasHeight&&(this._texture=function(e,t,n,r){const a=t.width,o=t.height,i=Object(c.a)(t,{width:n,height:r});return Object(d.b)(t,i,{targetY:0,width:a,height:o}),t.delete(),i}(this.gl,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const n of e)this._pendingCount++,Object(h.a)(n.url,p.a,this._loadOptions).then(e=>{const r=A(n),{x:a,y:o,width:i,height:s}=this._mapping[r],l=v(t,e,i,s);this._texture.setSubImageData({data:l,x:a,y:o,width:i,height:s}),this._texture.generateMipmap(),this.onUpdate()}).catch(e=>{this.onError({url:n.url,source:n.source,sourceIndex:n.sourceIndex,loadOptions:this._loadOptions,error:e})}).finally(()=>{this._pendingCount--})}}const E=[0,0,0,255],x={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:e=>e.position},getIcon:{type:"accessor",value:e=>e.icon},getColor:{type:"accessor",value:E},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};class M extends r.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\nuniform int sizeUnits;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\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 geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale, sizeUnits), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[a.a,o.a]})}initializeState(){this.state={iconManager:new _(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:E},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager(),{iconAtlas:a,iconMapping:o,data:i,getIcon:s}=t,{iconManager:l}=this.state;l.setProps({loadOptions:t.loadOptions});let u=!1;if(a||this.internalState.isAsyncPropLoading("iconAtlas")?(e.iconAtlas!==t.iconAtlas&&l.setProps({iconAtlas:a,autoPacking:!1}),e.iconMapping!==t.iconMapping&&(l.setProps({iconMapping:o}),u=!0)):l.setProps({autoPacking:!0}),(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&l.setProps({data:i,getIcon:s}),u&&(r.invalidate("instanceOffsets"),r.invalidate("instanceIconFrames"),r.invalidate("instanceColorModes")),n.extensionsChanged){var c;const{gl:e}=this.context;null===(c=this.state.model)||void 0===c||c.delete(),this.state.model=this._getModel(e),r.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:e}){const{sizeScale:t,sizeMinPixels:n,sizeMaxPixels:r,sizeUnits:a,billboard:o,alphaCutoff:s}=this.props,{iconManager:l}=this.state,u=l.getTexture();u&&this.state.model.setUniforms(e).setUniforms({iconsTexture:u,iconsTextureDim:[u.width,u.height],sizeUnits:i.e[a],sizeScale:t,sizeMinPixels:n,sizeMaxPixels:r,billboard:o,alphaCutoff:s}).draw()}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new u.a({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(e){const{onIconError:t}=this.getCurrentLayer().props;t?t(e):s.a.error(e.error)()}getInstanceOffset(e){const t=this.state.iconManager.getIconMapping(e);return[t.width/2-t.anchorX||0,t.height/2-t.anchorY||0]}getInstanceColorMode(e){return this.state.iconManager.getIconMapping(e).mask?1:0}getInstanceIconFrame(e){const t=this.state.iconManager.getIconMapping(e);return[t.x||0,t.y||0,t.width||0,t.height||0]}}M.layerName="IconLayer",M.defaultProps=x},function(e,t,n){"use strict";t.a=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return c}));var r=n(421),a=n(51),o=n(298),i=n(251);const s="Cannot convert supplied data type";function l(e,t,n){if(t.text&&"string"==typeof e)return e;if(Object(a.c)(e)&&(e=e.buffer),e instanceof ArrayBuffer){const n=e;if(t.text&&!t.binary){return new TextDecoder("utf8").decode(n)}return n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary){return new TextDecoder("utf8").decode(e)}let n=e.buffer;const r=e.byteLength||e.length;return 0===e.byteOffset&&r===n.byteLength||(n=n.slice(e.byteOffset,e.byteOffset+r)),n}throw new Error(s)}async function u(e,t,n){const u=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||u)return l(e,t);if(Object(a.b)(e)&&(e=await Object(i.b)(e)),Object(a.j)(e)){const n=e;return await Object(i.a)(n),t.binary?await n.arrayBuffer():await n.text()}if(Object(a.i)(e)&&(e=Object(o.a)(e,n)),Object(a.d)(e)||Object(a.a)(e))return Object(r.a)(e);throw new Error(s)}async function c(e,t){if(Object(a.e)(e))return e;if(Object(a.j)(e)){const n=e;await Object(i.a)(n);const r=await n.body;return Object(o.a)(r,t)}return Object(a.b)(e)||Object(a.i)(e)?Object(o.a)(e,t):Object(a.a)(e)?e[Symbol.asyncIterator]():function(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(Object(a.e)(e))return e;if(Object(a.d)(e))return e[Symbol.iterator]();throw new Error(s)}(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return h}));var r=n(14),a=n(48),o=n(34),i=n(184);const s=[0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c=[0,0,0],d=[0,0,0],f=Object(i.a)((function({viewport:e,devicePixelRatio:t,coordinateSystem:n,coordinateOrigin:i}){const{projectionCenter:u,viewProjectionMatrix:d,originCommon:f,cameraPosCommon:h,shaderCoordinateOrigin:m,geospatialOrigin:g}=function(e,t,n){const{viewMatrixUncentered:o,projectionMatrix:i}=e;let{viewMatrix:u,viewProjectionMatrix:c}=e,d=s,f=s,h=e.cameraPosition;const{geospatialOrigin:m,shaderCoordinateOrigin:g,offsetMode:y}=p(e,t,n);y&&(f=e.projectPosition(m||g),h=[h[0]-f[0],h[1]-f[1],h[2]-f[2]],f[3]=1,d=a.n([],f,c),u=o||u,c=r.h([],i,u),c=r.h([],c,l));return{viewMatrix:u,viewProjectionMatrix:c,projectionCenter:d,originCommon:f,cameraPosCommon:h,shaderCoordinateOrigin:g,geospatialOrigin:m}}(e,n,i),y=e.getDistanceScales(),v=[e.width*t,e.height*t],A=a.n([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,b={project_uCoordinateSystem:n,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:m,project_uCommonOrigin:f.slice(0,3),project_uCenter:u,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:v,project_uDevicePixelRatio:t,project_uFocalDistance:A,project_uCommonUnitsPerMeter:y.unitsPerMeter,project_uCommonUnitsPerWorldUnit:y.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:c,project_uScale:e.scale,project_uViewProjectionMatrix:d,project_uCameraPosition:h};if(g){const t=e.getDistanceScales(g);switch(n){case o.a.METER_OFFSETS:b.project_uCommonUnitsPerWorldUnit=t.unitsPerMeter,b.project_uCommonUnitsPerWorldUnit2=t.unitsPerMeter2;break;case o.a.LNGLAT:case o.a.LNGLAT_OFFSETS:e._pseudoMeters||(b.project_uCommonUnitsPerMeter=t.unitsPerMeter),b.project_uCommonUnitsPerWorldUnit=t.unitsPerDegree,b.project_uCommonUnitsPerWorldUnit2=t.unitsPerDegree2;break;case o.a.CARTESIAN:b.project_uCommonUnitsPerWorldUnit=[1,1,t.unitsPerMeter[2]],b.project_uCommonUnitsPerWorldUnit2=[0,0,t.unitsPerMeter2[2]]}}return b}));function p(e,t,n=d){n.length<3&&(n=[n[0],n[1],0]);let r,a=n,i=!0;switch(r=t===o.a.LNGLAT_OFFSETS||t===o.a.METER_OFFSETS?n:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case o.d.WEB_MERCATOR:t!==o.a.LNGLAT&&t!==o.a.CARTESIAN||(r=[0,0,0],i=!1);break;case o.d.WEB_MERCATOR_AUTO_OFFSET:t===o.a.LNGLAT?a=r:t===o.a.CARTESIAN&&(a=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],r=e.unprojectPosition(a),a[0]-=n[0],a[1]-=n[1],a[2]-=n[2]);break;case o.d.IDENTITY:a=e.position.map(Math.fround),a[2]=a[2]||0;break;case o.d.GLOBE:i=!1,r=null;break;default:i=!1}return{geospatialOrigin:r,shaderCoordinateOrigin:a,offsetMode:i}}function h({viewport:e,devicePixelRatio:t=1,modelMatrix:n=null,coordinateSystem:r=o.a.DEFAULT,coordinateOrigin:a,autoWrapLongitude:i=!1}={}){r===o.a.DEFAULT&&(r=e.isGeospatial?o.a.LNGLAT:o.a.CARTESIAN);const s=f({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:a});return s.project_uWrapLongitude=i,s.project_uModelMatrix=n||u,s}},function(e,t,n){"use strict";var r=n(34),a=n(242),o=n(215),i=n(176),s=n(184),l=n(53);const u=Object(s.a)((function({viewport:e,center:t}){return new o.a(e.viewProjectionMatrix).invert().transform(t)})),c=Object(s.a)((function({viewport:e,shadowMatrices:t}){const n=[],r=e.pixelUnprojectionMatrix,a=e.isGeospatial?void 0:1,s=[[0,0,a],[e.width,0,a],[0,e.height,a],[e.width,e.height,a],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map(e=>function(e,t){const[n,r,a]=e,o=Object(l.n)([n,r,a],t);if(Number.isFinite(a))return o;return[o[0],o[1],0]}(e,r));for(const r of t){const t=r.clone().translate(new i.a(e.center).negate()),a=s.map(e=>t.transform(e)),l=(new o.a).ortho({left:Math.min(...a.map(e=>e[0])),right:Math.max(...a.map(e=>e[0])),bottom:Math.min(...a.map(e=>e[1])),top:Math.max(...a.map(e=>e[1])),near:Math.min(...a.map(e=>-e[2])),far:Math.max(...a.map(e=>-e[2]))});n.push(l.multiplyRight(r))}return n})),d=[0,0,0,1],f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:[a.a],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(e={},t={})=>{if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){const{shadowEnabled:n=!0}=e;return n&&e.shadowMatrices&&e.shadowMatrices.length>0?function(e={},t={}){const n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||d,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},a=u({viewport:e.viewport,center:t.project_uCenter}),o=[],s=c({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice();for(let n=0;n<e.shadowMatrices.length;n++){const l=s[n],u=l.clone().translate(new i.a(e.viewport.center).negate());t.project_uCoordinateSystem===r.a.LNGLAT&&t.project_uProjectionMode===r.d.WEB_MERCATOR?(s[n]=u,o[n]=a):(s[n]=l.clone().multiplyRight(f),o[n]=u.transform(a))}for(let t=0;t<s.length;t++)n["shadow_uViewProjectionMatrices[".concat(t,"]")]=s[t],n["shadow_uProjectCenters[".concat(t,"]")]=o[t],e.shadowMaps&&e.shadowMaps.length>0?n["shadow_uShadowMap".concat(t)]=e.shadowMaps[t]:n["shadow_uShadowMap".concat(t)]=e.dummyShadowMap;return n}(e,t):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(4);class a{constructor(e){Object(r.a)(this,"_viewportProps",void 0),Object(r.a)(this,"_state",void 0),this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}},function(e,t,n){"use strict";t.a=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));const r=262144;var a=n(193),o=n(182);function i(e,t){return a.c?async function*(e,t){const n=e.getReader();let r;try{for(;;){const e=r||n.read();null!=t&&t._streamReadAhead&&(r=n.read());const{done:a,value:i}=await e;if(a)return;yield Object(o.d)(i)}}catch(e){n.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield Object(o.d)(t)}(e)}var s=n(51);function l(e,t){if("string"==typeof e)return function*(e,t){const n=(null==t?void 0:t.chunkSize)||262144;let r=0;const a=new TextEncoder;for(;r<e.length;){const t=Math.min(e.length-r,n),o=e.slice(r,r+t);r+=t,yield a.encode(o)}}(e,t);if(e instanceof ArrayBuffer)return function*(e,t={}){const{chunkSize:n=r}=t;let a=0;for(;a<e.byteLength;){const t=Math.min(e.byteLength-a,n),r=new ArrayBuffer(t),o=new Uint8Array(e,a,t);new Uint8Array(r).set(o),a+=t,yield r}}(e,t);if(Object(s.b)(e))return async function*(e,t){const n=(null==t?void 0:t.chunkSize)||1048576;let r=0;for(;r<e.size;){const t=r+n,a=await e.slice(r,t).arrayBuffer();r=t,yield a}}(e,t);if(Object(s.i)(e))return i(e,t);if(Object(s.j)(e)){return i(e.body,t)}throw new Error("makeIterator")}},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=e=>()=>e},function(e,t,n){"use strict";function r(e,t,n){const r=t[0],a=t[1],o=n[3]*r+n[7]*a||1;return e[0]=(n[0]*r+n[4]*a)/o,e[1]=(n[1]*r+n[5]*a)/o,e}function a(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}function o(e,t,n){const r=t[0],a=t[1];return e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e[2]=t[2],e}n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return o}))},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),a=n.length;if(r.length!==a)return!1;for(var o=0;o<a;o++){var i=n[o];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}},function(e,t,n){var r,a,o;
|
|
19
|
+
*/var r,a,o,i;function s(e){return e}function l(e){return e}function u(e){return e}function c(e){if(!(this instanceof c))return new c(e);a(this,e)}function d(e){var t,n,a,d;return t=(e=e||{}).init||s,n=e.request||l,a=e.success||e.response||u,d=e.error||function(){return Promise.resolve((e.response||u).apply(this,arguments)).then(Promise.reject.bind(Promise))},function(s,l){return"object"==typeof s&&(l=s),"function"!=typeof s&&(s=e.client||r),l=t(l||{}),i((function e(t){var r,i;return r={},i={arguments:Array.prototype.slice.call(arguments),client:e},(t="string"==typeof t?{path:t}:t||{}).originator=t.originator||e,o(n.call(r,t,l,i),(function(e){var t,n,o;return o=s,e instanceof c&&(n=e.abort,o=e.client||o,t=e.response,e=e.request),t=t||Promise.resolve(e).then((function(e){return Promise.resolve(o(e)).then((function(e){return a.call(r,e,l,i)}),(function(e){return d.call(r,e,l,i)}))})),n?Promise.race([t,n]):t}),(function(e){return Promise.reject({request:t,error:e})}))}),s)}}r=n(1102),a=n(414),o=n(602),i=n(601),d.ComplexRequest=c,e.exports=d},function(e,t,n){"use strict";n.r(t),n.d(t,"GreatCircleLayer",(function(){return a})),n.d(t,"S2Layer",(function(){return A})),n.d(t,"TileLayer",(function(){return Rt})),n.d(t,"TripsLayer",(function(){return kt})),n.d(t,"H3ClusterLayer",(function(){return Bt})),n.d(t,"H3HexagonLayer",(function(){return Gt})),n.d(t,"Tile3DLayer",(function(){return Po})),n.d(t,"TerrainLayer",(function(){return jo})),n.d(t,"MVTLayer",(function(){return Pi})),n.d(t,"_getURLFromTemplate",(function(){return rt}));var r=n(1173);class a extends r.a{}a.layerName="GreatCircleLayer",a.defaultProps={getHeight:{type:"accessor",value:0},greatCircle:!0};var o=n(621),i=n(829),s=n(303),l=n.n(s);const u=180/Math.PI;function c(e,t,n){const r=1<<t;return[(e[0]+n[0])/r,(e[1]+n[1])/r]}function d(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function f(e){return[d(e[0]),d(e[1])]}function p(e,[t,n]){switch(e){case 0:return[1,t,n];case 1:return[-t,1,n];case 2:return[-t,-n,1];case 3:return[-1,-n,-t];case 4:return[n,-1,-t];case 5:return[n,t,-1];default:throw new Error("Invalid face")}}function h([e,t,n]){const r=Math.atan2(n,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*u,r*u]}function m(e,t,n,r){if(0===r){1===n&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);const r=t[0];t[0]=t[1],t[1]=r}}function g(e){if("string"==typeof e){if(e.indexOf("/")>0)return e;e=function(e){const t=e.padEnd(16,"0");return l.a.fromString(t,16)}(e)}return function(e){let t=l.a.fromString(e,!0,10).toString(2);for(;t.length<64;)t="0"+t;const n=t.lastIndexOf("1"),r=t.substring(0,3),a=t.substring(3,n),o=a.length/2,i=l.a.fromString(r,!0,2).toString(10);let s=l.a.fromString(a,!0,2).toString(4);for(;s.length<o;)s="0"+s;return"".concat(i,"/").concat(s)}(e.toString())}function y(e){return function({face:e,ij:t,level:n}){const r=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(100*Math.pow(2,-n))),o=new Float64Array(4*a*2+2);let i=0,s=0;for(let l=0;l<4;l++){const u=r[l].slice(0),d=r[l+1],m=(d[0]-u[0])/a,g=(d[1]-u[1])/a;for(let r=0;r<a;r++){u[0]+=m,u[1]+=g;const r=h(p(e,f(c(t,n,u))));Math.abs(r[1])>89.999&&(r[0]=s);const a=r[0]-s;r[0]+=a>180?-360:a<-180?360:0,o[i++]=r[0],o[i++]=r[1],s=r[0]}}return o[i++]=o[0],o[i++]=o[1],o}(function(e){const t=e.split("/"),n=parseInt(t[0],10),r=t[1],a=r.length,o=[0,0];let i;for(let e=a-1;e>=0;e--){i=a-e;const t=r[e];let n=0,s=0;"1"===t?s=1:"2"===t?(n=1,s=1):"3"===t&&(n=1);const l=Math.pow(2,i-1);m(l,o,n,s),o[0]+=l*n,o[1]+=l*s}if(n%2==1){const e=o[0];o[0]=o[1],o[1]=e}return{face:n,ij:o,level:i}}(g(e)))}const v={...i.a.defaultProps,getS2Token:{type:"accessor",value:e=>e.token}};class A extends o.a{renderLayers(){const{data:e,getS2Token:t}=this.props,{elevationScale:n,extruded:r,wireframe:a,filled:o,stroked:s,lineWidthUnits:l,lineWidthScale:u,lineWidthMinPixels:c,lineWidthMaxPixels:d,lineJointRounded:f,lineMiterLimit:p,lineDashJustified:h,getElevation:m,getFillColor:g,getLineColor:v,getLineWidth:A,getLineDashArray:b}=this.props,{updateTriggers:_,material:E}=this.props;return new(this.getSubLayerClass("cell",i.a))({filled:o,wireframe:a,extruded:r,elevationScale:n,stroked:s,lineWidthUnits:l,lineWidthScale:u,lineWidthMinPixels:c,lineWidthMaxPixels:d,lineJointRounded:f,lineMiterLimit:p,lineDashJustified:h,material:E,getElevation:m,getFillColor:g,getLineColor:v,getLineWidth:A,getLineDashArray:b},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:_.getElevation,getFillColor:_.getFillColor,getLineColor:_.getLineColor,getLineWidth:_.getLineWidth,getLineDashArray:_.getLineDashArray}}),{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(e,n)=>y(t(e,n))})}}A.layerName="S2Layer",A.defaultProps=v;var b=n(150),_=n(1167),E=n(50);class x{constructor({x:e,y:t,z:n}){this.x=e,this.y=t,this.z=n,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get data(){return this.isLoading?this._loader.then(()=>this.data):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const e=this.content?this.content.byteLength:0;return Number.isFinite(e)||E.a.error("byteLength not defined in tile data")(),e}async _loadData({getData:e,requestScheduler:t,onLoad:n,onError:r}){const{x:a,y:o,z:i,bbox:s}=this,l=this._loaderId;this._abortController=new AbortController;const{signal:u}=this._abortController,c=await t.scheduleRequest(this,e=>e.isSelected?1:-1);if(!c)return void(this._isCancelled=!0);if(this._isCancelled)return void c.done();let d,f=null;try{f=await e({x:a,y:o,z:i,bbox:s,signal:u})}catch(e){d=e||!0}finally{c.done()}l===this._loaderId&&(this._loader=void 0,this.content=f,!this._isCancelled||f?(this._isLoaded=!0,this._isCancelled=!1,d?r(d,this):n(this)):this._isLoaded=!1)}loadData(e){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(e),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}}const M=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function w(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}Math.PI,Math.PI;const O={};function S(e,{precision:t=O.precision||4}={}){return e=function(e){return Math.round(e/O.EPSILON)*O.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function T(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function C(e,t,n){const r=O.EPSILON;n&&(O.EPSILON=n);try{if(e===t)return!0;if(T(e)&&T(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!C(e[n],t[n]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=O.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{O.EPSILON=r}}O.EPSILON=1e-12,O.debug=!1,O.precision=4,O.printTypes=!1,O.printDegrees=!1,O.printRowMajor=!0;class L extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return w(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}to(e){return e===this?this:T(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(O)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+S(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!C(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){void 0===n&&(n=t,t=e,e=this);for(let r=0;r<this.ELEMENTS;++r){const a=e[r];this[r]=a+n*(t[r]-a)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(O.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}function P(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function R(e,t,n=""){if(O.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}const D={};function k(e,t){D[e]||(D[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}class I extends L{get ELEMENTS(){return w(!1),0}copy(e){return w(!1),this}get x(){return this[0]}set x(e){this[0]=P(e)}get y(){return this[1]}set y(e){this[1]=P(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){const r=this[n]-e[n];t+=r*r}return P(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return P(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return w(e>=0&&e<this.ELEMENTS,"index is out of range"),P(this[e])}setComponent(e,t){return w(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}var F=n(19);function j(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}const B=[0,0,0],N={};class z extends I{static get ZERO(){return N.ZERO=N.ZERO||Object.freeze(new z(0,0,0,0))}constructor(e=0,t=0,n=0){super(-0,-0,-0),1===arguments.length&&T(e)?this.copy(e):(O.debug&&(P(e),P(t),P(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return O.debug&&(P(e.x),P(e.y),P(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=P(e)}angle(e){return F.b(this,e)}cross(e){return F.d(this,this,e),this.check()}rotateX({radians:e,origin:t=B}){return F.n(this,this,t,e),this.check()}rotateY({radians:e,origin:t=B}){return F.o(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=B}){return F.p(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return F.t(this,this,e),this.check()}transformAsVector(e){return j(this,this,e),this.check()}transformByMatrix3(e){return F.s(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,n){const r=t[0],a=t[1];e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return F.u(this,this,e),this.check()}}const U=new z,H=new z;class V{constructor(e=[0,0,0],t=[0,0,0],n=null){n=n||U.copy(e).add(t).scale(.5),this.center=new z(n),this.halfDiagonal=new z(t).subtract(this.center),this.minimum=new z(e),this.maximum=new z(t)}clone(){return new V(this.minimum,this.maximum,this.center)}equals(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){const{halfDiagonal:t}=this,n=H.from(e.normal),r=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),a=this.center.dot(n)+e.distance;return a-r>0?M.INSIDE:a+r<0?M.OUTSIDE:M.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=U.from(e).subtract(this.center),{halfDiagonal:n}=this;let r,a=0;return r=Math.abs(t.x)-n.x,r>0&&(a+=r*r),r=Math.abs(t.y)-n.y,r>0&&(a+=r*r),r=Math.abs(t.z)-n.z,r>0&&(a+=r*r),a}}var G=n(14);const Y=new z,W=new z;class q{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new z,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=Y.from(t),this.center=(new z).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new q(this.center,this.radius)}union(e){const t=this.center,n=this.radius,r=e.center,a=e.radius,o=Y.copy(r).subtract(t),i=o.magnitude();if(n>=i+a)return this.clone();if(a>=i+n)return e.clone();const s=.5*(n+i+a);return W.copy(o).scale((-n+s)/i).add(t),this.center.copy(W),this.radius=s,this}expand(e){const t=(e=Y.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=G.e(Y,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=Y.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const t=this.center,n=this.radius,r=e.normal.dot(t)+e.distance;return r<-n?M.OUTSIDE:r<n?M.INTERSECTING:M.INSIDE}}class X extends L{get ELEMENTS(){return w(!1),0}get RANK(){return w(!1),0}toString(){let e="[";if(O.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=P(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}var K=n(81),Z=n(35);const J=Object.freeze([1,0,0,0,1,0,0,0,1]),Q=Object.freeze([0,0,0,0,0,0,0,0,0]),$=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),ee={};class te extends X{static get IDENTITY(){return ee.IDENTITY=ee.IDENTITY||Object.freeze(new te(J)),ee.IDENTITY}static get ZERO(){return ee.ZERO=ee.ZERO||Object.freeze(new te(Q)),ee.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return $}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}set(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=r,this[2]=i,this[3]=t,this[4]=a,this[5]=s,this[6]=n,this[7]=o,this[8]=l,this.check()}determinant(){return K.b(this)}identity(){return this.copy(J)}fromQuaternion(e){return K.c(this,e),this.check()}transpose(){return K.i(this,this),this.check()}invert(){return K.d(this,this),this.check()}multiplyLeft(e){return K.e(this,e,this),this.check()}multiplyRight(e){return K.e(this,this,e),this.check()}rotate(e){return K.f(this,this,e),this.check()}scale(e){return Array.isArray(e)?K.g(this,this,e):K.g(this,this,[e,e,e]),this.check()}translate(e){return K.h(this,this,e),this.check()}transform(e,t){switch(e.length){case 2:t=Z.i(t||[-0,-0],e,this);break;case 3:t=F.s(t||[-0,-0,-0],e,this);break;case 4:t=function(e,t,n){const r=t[0],a=t[1],o=t[2];return e[0]=n[0]*r+n[3]*a+n[6]*o,e[1]=n[1]*r+n[4]*a+n[7]*o,e[2]=n[2]*r+n[5]*a+n[8]*o,e[3]=t[3],e}(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return R(t,e.length),t}transformVector(e,t){return k("Matrix3.transformVector"),this.transform(e,t)}transformVector2(e,t){return k("Matrix3.transformVector"),this.transform(e,t)}transformVector3(e,t){return k("Matrix3.transformVector"),this.transform(e,t)}}var ne=n(38),re=n(48);const ae=[0,0,0,1];class oe extends L{constructor(e=0,t=0,n=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,n,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this.check()}fromMatrix3(e){return ne.e(this,e),this.check()}identity(){return ne.f(this),this.check()}fromAxisRotation(e,t){return ne.p(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=P(e)}get y(){return this[1]}set y(e){this[1]=P(e)}get z(){return this[2]}set z(e){this[2]=P(e)}get w(){return this[3]}set w(e){this[3]=P(e)}len(){return ne.h(this)}lengthSquared(){return ne.r(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ne.d(this,e)}rotationTo(e,t){return ne.n(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return ne.a(this,this,e),this.check()}calculateW(){return ne.b(this,this),this.check()}conjugate(){return ne.c(this,this),this.check()}invert(){return ne.g(this,this),this.check()}lerp(e,t,n){return ne.i(this,e,t,n),this.check()}multiplyRight(e,t){return w(!t),ne.j(this,this,e),this.check()}multiplyLeft(e,t){return w(!t),ne.j(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return ne.k(this,this,e),this.check()}rotateY(e){return ne.l(this,this,e),this.check()}rotateZ(e){return ne.m(this,this,e),this.check()}scale(e){return ne.o(this,this,e),this.check()}slerp(e,t,n){switch(arguments.length){case 1:({start:e=ae,target:t,ratio:n}=arguments[0]);break;case 2:[t,n]=arguments,e=this}return ne.q(this,e,t,n),this.check()}transformVector4(e,t=e){return re.o(t,e,this),R(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}}const ie=new z,se=new z,le=new z,ue=new z,ce=new z,de=new z,fe=new z,pe=0,he=1,me=2,ge=3,ye=4,ve=5,Ae=6,be=7,_e=8;class Ee{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new z).from(e),this.halfAxes=new te(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new z(e).len(),new z(t).len(),new z(n).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new z(e).normalize(),a=new z(t).normalize(),o=new z(n).normalize();return(new oe).fromMatrix3(new te([...r,...a,...o]))}fromCenterHalfSizeQuaternion(e,t,n){const r=new oe(n),a=(new te).fromQuaternion(r);return a[0]=a[0]*t[0],a[1]=a[1]*t[0],a[2]=a[2]*t[0],a[3]=a[3]*t[1],a[4]=a[4]*t[1],a[5]=a[5]*t[1],a[6]=a[6]*t[2],a[7]=a[7]*t[2],a[8]=a[8]*t[2],this.center=(new z).from(e),this.halfAxes=a,this}clone(){return new Ee(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new q){const t=this.halfAxes,n=t.getColumn(0,le),r=t.getColumn(1,ue),a=t.getColumn(2,ce),o=ie.copy(n).add(r).add(a);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,n=e.normal,r=this.halfAxes,a=n.x,o=n.y,i=n.z,s=Math.abs(a*r[pe]+o*r[he]+i*r[me])+Math.abs(a*r[ge]+o*r[ye]+i*r[ve])+Math.abs(a*r[Ae]+o*r[be]+i*r[_e]),l=n.dot(t)+e.distance;return l<=-s?M.OUTSIDE:l>=s?M.INSIDE:M.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=se.from(e).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,le),a=n.getColumn(1,ue),o=n.getColumn(2,ce),i=r.magnitude(),s=a.magnitude(),l=o.magnitude();r.normalize(),a.normalize(),o.normalize();let u,c=0;return u=Math.abs(t.dot(r))-i,u>0&&(c+=u*u),u=Math.abs(t.dot(a))-s,u>0&&(c+=u*u),u=Math.abs(t.dot(o))-l,u>0&&(c+=u*u),c}computePlaneDistances(e,t,n=[-0,-0]){let r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const o=this.center,i=this.halfAxes,s=i.getColumn(0,le),l=i.getColumn(1,ue),u=i.getColumn(2,ce),c=de.copy(s).add(l).add(u).add(o),d=fe.copy(c).subtract(e);let f=t.dot(d);return r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),n[0]=r,n[1]=a,n}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,le);t.transformAsPoint(e);const n=this.halfAxes.getColumn(1,ue);n.transformAsPoint(e);const r=this.halfAxes.getColumn(2,ce);return r.transformAsPoint(e),this.halfAxes=new te([...t,...n,...r]),this}getTransform(){throw new Error("not implemented")}}const xe=new z,Me=new z;class we{constructor(e=[0,0,1],t=0){this.normal=new z,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return w(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=xe.from(e),this.normal.from(t).normalize();const n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,t,n,r){return this.normal.set(e,t,n),w(C(this.normal.len(),1)),this.distance=r,this}clone(e){return new we(this.normal,this.distance)}equals(e){return C(this.distance,e.distance)&&C(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=Me.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}projectPointOntoPlane(e,t=[0,0,0]){e=xe.from(e);const n=this.getPointDistance(e),r=Me.copy(this.normal).scale(n);return e.subtract(r).to(t)}}const Oe=[new z([1,0,0]),new z([0,1,0]),new z([0,0,1])],Se=new z,Te=new z;new we(new z(1,0,0),0);class Ce{static get MASK_OUTSIDE(){return 4294967295}static get MASK_INSIDE(){return 0}static get MASK_INDETERMINATE(){return 2147483647}constructor(e=[]){this.planes=e,w(this.planes.every(e=>e instanceof we))}fromBoundingSphere(e){this.planes.length=2*Oe.length;const t=e.center,n=e.radius;let r=0;for(const e of Oe){let a=this.planes[r],o=this.planes[r+1];a||(a=this.planes[r]=new we),o||(o=this.planes[r+1]=new we);const i=Se.copy(e).scale(-n).add(t);e.dot(i);a.fromPointNormal(i,e);const s=Se.copy(e).scale(n).add(t),l=Te.copy(e).negate();l.dot(s);o.fromPointNormal(s,l),r+=2}return this}computeVisibility(e){w(e);let t=M.INSIDE;for(const n of this.planes){switch(e.intersectPlane(n)){case M.OUTSIDE:return M.OUTSIDE;case M.INTERSECTING:t=M.INTERSECTING}}return t}computeVisibilityWithPlaneMask(e,t){if(w(e,"boundingVolume is required."),w(Number.isFinite(t),"parentPlaneMask is required."),t===Ce.MASK_OUTSIDE||t===Ce.MASK_INSIDE)return t;let n=Ce.MASK_INSIDE;const r=this.planes;for(let a=0;a<this.planes.length;++a){const o=a<31?1<<a:0;if(a<31&&0==(t&o))continue;const i=r[a],s=e.intersectPlane(i);if(s===M.OUTSIDE)return Ce.MASK_OUTSIDE;s===M.INTERSECTING&&(n|=o)}return n}}Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15});new z,new z,new z,new z,new z;new z,new z,new z,new z,new z,new z,new z,new z,new z,new z,new z,new z,Math.PI;var Le=1e-15,Pe=1e-20;Math.PI,Math.PI,Math.PI,Math.PI;const Re=new te,De=new te,ke=new te,Ie=new te,Fe=new te;function je(e,t={}){const n=Pe;let r=0,a=0;const o=De,i=ke;o.identity(),i.copy(e);const s=n*function(e){let t=0;for(let n=0;n<9;++n){const r=e[n];t+=r*r}return Math.sqrt(t)}(i);for(;a<10&&ze(i)>s;)Ue(i,Ie),Fe.copy(Ie).transpose(),i.multiplyRight(Ie),i.multiplyLeft(Fe),o.multiplyRight(Ie),++r>2&&(++a,r=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=i.toTarget(t.diagonal),t}const Be=[1,0,0],Ne=[2,2,1];function ze(e){let t=0;for(let n=0;n<3;++n){const r=e[Re.getElementIndex(Ne[n],Be[n])];t+=2*r*r}return Math.sqrt(t)}function Ue(e,t){const n=Le;let r=0,a=1;for(let t=0;t<3;++t){const n=Math.abs(e[Re.getElementIndex(Ne[t],Be[t])]);n>r&&(a=t,r=n)}const o=Be[a],i=Ne[a];let s=1,l=0;if(Math.abs(e[Re.getElementIndex(i,o)])>n){const t=(e[Re.getElementIndex(i,i)]-e[Re.getElementIndex(o,o)])/2/e[Re.getElementIndex(i,o)];let n;n=t<0?-1/(-t+Math.sqrt(1+t*t)):1/(t+Math.sqrt(1+t*t)),s=1/Math.sqrt(1+n*n),l=n*s}return te.IDENTITY.to(t),t[Re.getElementIndex(o,o)]=t[Re.getElementIndex(i,i)]=s,t[Re.getElementIndex(i,o)]=l,t[Re.getElementIndex(o,i)]=-l,t}const He=new z,Ve=new z,Ge=new z,Ye=new z,We=new z,qe=new te,Xe={diagonal:new te,unitary:new te};var Ke=n(53);const Ze=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Je=Ze.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),Qe=Je.concat([[.25,.5],[.75,.5]]);class $e{constructor(e,t,n){this.x=e,this.y=t,this.z=n}get children(){if(!this._children){const e=2*this.x,t=2*this.y,n=this.z+1;this._children=[new $e(e,t,n),new $e(e,t+1,n),new $e(e+1,t,n),new $e(e+1,t+1,n)]}return this._children}update(e){const{viewport:t,cullingVolume:n,elevationBounds:r,minZ:a,maxZ:o,bounds:i,offset:s,project:l}=e,u=this.getBoundingVolume(r,s,l);if(i&&!this.insideBounds(i))return!1;if(n.computeVisibility(u)<0)return!1;if(!this.childVisible){let{z:e}=this;if(e<o&&e>=a){const n=u.distanceTo(t.cameraPosition)*t.scale/t.height;e+=Math.floor(Math.log2(n))}if(e>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const t of this.children)t.update(e);return!0}getSelected(e=[]){if(this.selected&&e.push(this),this._children)for(const t of this._children)t.getSelected(e);return e}insideBounds([e,t,n,r]){const a=512/Math.pow(2,this.z);return this.x*a<n&&this.y*a<r&&(this.x+1)*a>e&&(this.y+1)*a>t}getBoundingVolume(e,t,n){if(n){const t=this.z<1?Qe:this.z<2?Je:Ze,r=[];for(const a of t){const t=ot(this.x+a[0],this.y+a[1],this.z);t[2]=e[0],r.push(n(t)),e[0]!==e[1]&&(t[2]=e[1],r.push(n(t)))}return function(e,t=new Ee){if(!e||0===e.length)return t.halfAxes=new te([0,0,0,0,0,0,0,0,0]),t.center=new z,t;const n=e.length,r=new z(0,0,0);for(const t of e)r.add(t);const a=1/n;r.multiplyByScalar(a);let o=0,i=0,s=0,l=0,u=0,c=0;for(const t of e){const e=He.copy(t).subtract(r);o+=e.x*e.x,i+=e.x*e.y,s+=e.x*e.z,l+=e.y*e.y,u+=e.y*e.z,c+=e.z*e.z}o*=a,i*=a,s*=a,l*=a,u*=a,c*=a;const d=qe;d[0]=o,d[1]=i,d[2]=s,d[3]=i,d[4]=l,d[5]=u,d[6]=s,d[7]=u,d[8]=c;const{unitary:f}=je(d,Xe),p=t.halfAxes.copy(f);let h=p.getColumn(0,Ge),m=p.getColumn(1,Ye),g=p.getColumn(2,We),y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,A=-Number.MAX_VALUE,b=Number.MAX_VALUE,_=Number.MAX_VALUE,E=Number.MAX_VALUE;for(const t of e)He.copy(t),y=Math.max(He.dot(h),y),v=Math.max(He.dot(m),v),A=Math.max(He.dot(g),A),b=Math.min(He.dot(h),b),_=Math.min(He.dot(m),_),E=Math.min(He.dot(g),E);h=h.multiplyByScalar(.5*(b+y)),m=m.multiplyByScalar(.5*(_+v)),g=g.multiplyByScalar(.5*(E+A)),t.center.copy(h).add(m).add(g);const x=Ve.set(y-b,v-_,A-E).multiplyByScalar(.5),M=new te([x[0],0,0,0,x[1],0,0,0,x[2]]);return t.halfAxes.multiplyRight(M),t}(r)}const r=512/Math.pow(2,this.z),a=this.x*r+512*t,o=512-(this.y+1)*r;return new V([a,o,e[0]],[a+r,o+r,e[1]])}}const et=[-1/0,-1/0,1/0,1/0],tt={type:"url",value:null,validate:(e,t)=>t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every(e=>"string"==typeof e),equals:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}};function nt(e,t){const n=[t.transformPoint([e[0],e[1]]),t.transformPoint([e[2],e[1]]),t.transformPoint([e[0],e[3]]),t.transformPoint([e[2],e[3]])];return[Math.min(...n.map(e=>e[0])),Math.min(...n.map(e=>e[1])),Math.max(...n.map(e=>e[0])),Math.max(...n.map(e=>e[1]))]}function rt(e,t){if(!e||!e.length)return null;if(Array.isArray(e)){e=e[Math.abs(t.x+t.y)%e.length]}const{x:n,y:r,z:a}=t;return e.replace(/\{x\}/g,n).replace(/\{y\}/g,r).replace(/\{z\}/g,a).replace(/\{-y\}/g,Math.pow(2,a)-r-1)}function at(e,t){return 512*Math.pow(2,e)/t}function ot(e,t,n){const r=at(n,512),a=e/r*360-180,o=Math.PI-2*Math.PI*t/r;return[a,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function it(e,t,n,r){const a=at(n,r);return[e/a*512,t/a*512]}function st(e,t,n,r,a=512){if(e.isGeospatial){const[e,a]=ot(t,n,r),[o,i]=ot(t+1,n+1,r);return{west:e,north:a,east:o,south:i}}const[o,i]=it(t,n,r,a),[s,l]=it(t+1,n+1,r,a);return{left:o,top:i,right:s,bottom:l}}function lt(e,t,n,r,a){const o=function(e,t,n){let r;if(t&&2===t.length){const[n,a]=t,o=e.getBounds({z:n}),i=e.getBounds({z:a});r=[Math.min(o[0],i[0]),Math.min(o[1],i[1]),Math.max(o[2],i[2]),Math.max(o[3],i[3])]}else r=e.getBounds();return e.isGeospatial?[Math.max(r[0],n[0]),Math.max(r[1],n[1]),Math.min(r[2],n[2]),Math.min(r[3],n[3])]:[Math.max(Math.min(r[0],n[2]),n[0]),Math.max(Math.min(r[1],n[3]),n[1]),Math.min(Math.max(r[2],n[0]),n[2]),Math.min(Math.max(r[3],n[1]),n[3])]}(e,null,r),i=at(t,n),[s,l,u,c]=function(e,t,n){if(n){return nt(e,n).map(e=>e*t/512)}return e.map(e=>e*t/512)}(o,i,a),d=[];for(let e=Math.floor(s);e<u;e++)for(let n=Math.floor(l);n<c;n++)d.push({x:e,y:n,z:t});return d}function ut({viewport:e,maxZoom:t,minZoom:n,zRange:r,extent:a,tileSize:o=512,modelMatrix:i,modelMatrixInverse:s,zoomOffset:l=0}){let u=e.isGeospatial?Math.round(e.zoom+Math.log2(512/o))+l:Math.ceil(e.zoom)+l;if(Number.isFinite(n)&&u<n){if(!a)return[];u=n}Number.isFinite(t)&&u>t&&(u=t);let c=a;return i&&s&&a&&!e.isGeospatial&&(c=nt(a,i)),e.isGeospatial?function(e,t,n,r){const a=e.resolution?e.projectPosition:null,o=Object.values(e.getFrustumPlanes()).map(({normal:e,distance:t})=>new we(e.clone().negate(),t)),i=new Ce(o),s=e.distanceScales.unitsPerMeter[2],l=n&&n[0]*s||0,u=n&&n[1]*s||0,c=e.pitch<=60?t:0;if(r){const[e,t,n,a]=r,o=Object(Ke.l)([e,a]),i=Object(Ke.l)([n,t]);r=[o[0],512-o[1],i[0],512-i[1]]}const d=new $e(0,0,0),f={viewport:e,project:a,cullingVolume:i,elevationBounds:[l,u],minZ:c,maxZ:t,bounds:r,offset:0};if(d.update(f),e.subViewports&&e.subViewports.length>1){for(f.offset=-1;d.update(f)&&!(--f.offset<-3););for(f.offset=1;d.update(f)&&!(++f.offset>3););}return d.getSelected()}(e,u,r,a):lt(e,u,o,c||et,s)}var ct=n(806);function dt(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}Math.PI,Math.PI;const ft={};function pt(e,{precision:t=ft.precision||4}={}){return e=function(e){return Math.round(e/ft.EPSILON)*ft.EPSILON}(e),"".concat(parseFloat(e.toPrecision(t)))}function ht(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mt(e,t,n){return ht(e)?e.map((e,r)=>mt(e,t[r],n)):n*t+(1-n)*e}function gt(e,t,n){const r=ft.EPSILON;n&&(ft.EPSILON=n);try{if(e===t)return!0;if(ht(e)&&ht(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!gt(e[n],t[n]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):!(!Number.isFinite(e)||!Number.isFinite(t))&&Math.abs(e-t)<=ft.EPSILON*Math.max(1,Math.abs(e),Math.abs(t))}finally{ft.EPSILON=r}}function yt(e,t,n=""){if(ft.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}ft.EPSILON=1e-12,ft.debug=!1,ft.precision=4,ft.printTypes=!1,ft.printDegrees=!1,ft.printRowMajor=!0;const vt={};function At(e,t){vt[e]||(vt[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}class bt extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return dt(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}to(e){return e===this?this:ht(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(ft)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+pt(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!gt(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){void 0===n&&(n=t,t=e,e=this);for(let r=0;r<this.ELEMENTS;++r){const a=e[r];this[r]=a+n*(t[r]-a)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(ft.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}class _t extends bt{get ELEMENTS(){return dt(!1),0}get RANK(){return dt(!1),0}toString(){let e="[";if(ft.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=function(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}const Et=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),xt=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Mt=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),wt={};class Ot extends _t{static get IDENTITY(){return wt.IDENTITY=wt.IDENTITY||Object.freeze(new Ot(Et)),wt.IDENTITY}static get ZERO(){return wt.ZERO=wt.ZERO||Object.freeze(new Ot(xt)),wt.ZERO}get INDICES(){return Mt}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this[9]=u,this[10]=c,this[11]=d,this[12]=f,this[13]=p,this[14]=h,this[15]=m,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=a,this[2]=l,this[3]=f,this[4]=t,this[5]=o,this[6]=u,this[7]=p,this[8]=n,this[9]=i,this[10]=c,this[11]=h,this[12]=r,this[13]=s,this[14]=d,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(Et)}fromQuaternion(e){return G.c(this,e),this.check()}frustum({left:e,right:t,bottom:n,top:r,near:a,far:o}){return o===1/0?Ot._computeInfinitePerspectiveOffCenter(this,e,t,n,r,a):G.d(this,e,t,n,r,a,o),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,n,r,a,o){const i=2*o/(n-t),s=2*o/(a-r),l=(n+t)/(n-t),u=(a+r)/(a-r),c=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=l,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}lookAt(e,t,n){return 1===arguments.length&&({eye:e,center:t,up:n}=e),t=t||[0,0,0],n=n||[0,1,0],G.g(this,e,t,n),this.check()}ortho({left:e,right:t,bottom:n,top:r,near:a=.1,far:o=500}){return G.i(this,e,t,n,r,a,o),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:n=1,near:r=.1,far:a=500}){if(e>2*Math.PI)throw Error("radians");const o=e/2,i=n*Math.tan(o),s=i*t;return(new Ot).ortho({left:-s,right:s,bottom:-i,top:i,near:r,far:a})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:a=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return G.j(this,e,n,r,a),this.check()}determinant(){return G.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*a,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*a,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*a,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*a,e[8]=this[10]*o,e}transpose(){return G.q(this,this),this.check()}invert(){return G.f(this,this),this.check()}multiplyLeft(e){return G.h(this,e,this),this.check()}multiplyRight(e){return G.h(this,this,e),this.check()}rotateX(e){return G.l(this,this,e),this.check()}rotateY(e){return G.m(this,this,e),this.check()}rotateZ(e){return G.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return G.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?G.o(this,this,e):G.o(this,this,[e,e,e]),this.check()}translate(e){return G.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(yt(t=re.n(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:n}=e;switch(n){case 2:t=Z.j(t||[-0,-0],e,this);break;case 3:t=F.t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return yt(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=function(e,t,n){const r=t[0],a=t[1],o=n[3]*r+n[7]*a||1;return e[0]=(n[0]*r+n[4]*a)/o,e[1]=(n[1]*r+n[5]*a)/o,e}(t||[-0,-0],e,this);break;case 3:t=function(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return yt(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return At("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return At("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return At("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}const St={"best-available":function(e){for(const t of e)t.state=0;for(const t of e)t.isSelected&&!Ct(t)&&Lt(t);for(const t of e)t.isVisible=Boolean(2&t.state)},"no-overlap":function(e){for(const t of e)t.state=0;for(const t of e)t.isSelected&&Ct(t);const t=Array.from(e).sort((e,t)=>e.z-t.z);for(const e of t)if(e.isVisible=Boolean(2&e.state),e.isVisible||1&e.state)for(const t of e.children)t.state=1;else e.isSelected&&Lt(e)},never:()=>{}};class Tt{constructor(e){this.opts=e,this.onTileLoad=e=>{this.opts.onTileLoad(e),this.opts.maxCacheByteSize&&(this._cacheByteSize+=e.byteLength,this._resizeCache())},this._requestScheduler=new ct.a({maxRequests:e.maxRequests,throttleRequests:e.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new Ot,this._modelMatrixInverse=new Ot,this.setOptions(e)}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return this._selectedTiles.every(e=>e.isLoaded)}get needsReload(){return this._selectedTiles.some(e=>e.needsReload)}setOptions(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}finalize(){for(const e of this._cache.values())e.isLoading&&e.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const e of this._cache.keys()){const t=this._cache.get(e);this._selectedTiles.includes(t)?t.setNeedsReload():this._cache.delete(e)}}update(e,{zRange:t,modelMatrix:n}={}){const r=new Ot(n),a=!r.equals(this._modelMatrix);if(!e.equals(this._viewport)||a){a&&(this._modelMatrixInverse=r.clone().invert(),this._modelMatrix=r),this._viewport=e;const n=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=n.map(e=>this._getTile(e,!0)),this._dirty&&this._rebuildTree()}else this.needsReload&&(this._selectedTiles=this._selectedTiles.map(e=>this._getTile({x:e.x,y:e.y,z:e.z})));const o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}getTileIndices({viewport:e,maxZoom:t,minZoom:n,zRange:r,modelMatrix:a,modelMatrixInverse:o}){const{tileSize:i,extent:s,zoomOffset:l}=this.opts;return ut({viewport:e,maxZoom:t,minZoom:n,zRange:r,tileSize:i,extent:s,modelMatrix:a,modelMatrixInverse:o,zoomOffset:l})}getTileMetadata({x:e,y:t,z:n}){const{tileSize:r}=this.opts;return{bbox:st(this._viewport,e,t,n,r)}}getParentIndex(e){return e.x=Math.floor(e.x/2),e.y=Math.floor(e.y/2),e.z-=1,e}updateTileStates(){const e=this.opts.refinementStrategy||"best-available",t=new Array(this._cache.size);let n=0;for(const e of this._cache.values())t[n++]=e.isVisible,e.isSelected=!1,e.isVisible=!1;for(const e of this._selectedTiles)e.isSelected=!0,e.isVisible=!0;("function"==typeof e?e:St[e])(Array.from(this._cache.values())),n=0;for(const e of this._cache.values())if(t[n++]!==e.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:e}=this.opts,t=[];let n=0;for(const e of this._cache.values())e.isLoading&&(n++,e.isSelected||e.isVisible||t.push(e));for(;e>0&&n>e&&t.length>0;){t.shift().abort(),n--}}_rebuildTree(){const{_cache:e}=this;for(const t of e.values())t.parent=null,t.children.length=0;for(const t of e.values()){const e=this._getNearestAncestor(t.x,t.y,t.z);t.parent=e,e&&e.children.push(t)}}_resizeCache(){const{_cache:e,opts:t}=this,n=t.maxCacheSize||(t.maxCacheByteSize?1/0:5*this.selectedTiles.length),r=t.maxCacheByteSize||1/0;if(e.size>n||this._cacheByteSize>r){for(const[a,o]of e)if(o.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?o.byteLength:0,e.delete(a),this.opts.onTileUnload(o)),e.size<=n&&this._cacheByteSize<=r)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((e,t)=>e.z-t.z),this._dirty=!1)}_getTile({x:e,y:t,z:n},r){const a="".concat(e,",").concat(t,",").concat(n);let o=this._cache.get(a),i=!1;return!o&&r?(o=new x({x:e,y:t,z:n}),Object.assign(o,this.getTileMetadata(o)),i=!0,this._cache.set(a,o),this._dirty=!0):o&&o.needsReload&&(i=!0),i&&o.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),o}_getNearestAncestor(e,t,n){const{_minZoom:r=0}=this;let a={x:e,y:t,z:n};for(;a.z>r;){a=this.getParentIndex(a);const e=this._getTile(a);if(e)return e}return null}}function Ct(e){for(;e;){if(e.isLoaded||e.content)return e.state|=2,!0;e=e.parent}return!1}function Lt(e){for(const t of e.children)t.isLoaded||t.content?t.state|=2:Lt(t)}const Pt={data:[],dataComparator:tt.equals,renderSubLayers:{type:"function",value:e=>new _.a(e),compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:e=>console.error(e),compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:"best-available",zRange:null,maxRequests:6,zoomOffset:0};class Rt extends o.a{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var e;null===(e=this.state.tileset)||void 0===e||e.finalize()}get isLoaded(){const{tileset:e}=this.state;return e.selectedTiles.every(e=>e.isLoaded&&e.layers&&e.layers.every(e=>e.isLoaded))}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,changeFlags:t}){let{tileset:n}=this.state;const r=t.propsOrDataChanged||t.updateTriggersChanged,a=t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData);n?r&&(n.setOptions(this._getTilesetOptions(e)),a?n.reloadAll():this.state.tileset.tiles.forEach(e=>{e.layers=null})):(n=new Tt(this._getTilesetOptions(e)),this.setState({tileset:n})),this._updateTileset()}_getTilesetOptions(e){const{tileSize:t,maxCacheSize:n,maxCacheByteSize:r,refinementStrategy:a,extent:o,maxZoom:i,minZoom:s,maxRequests:l,zoomOffset:u}=e;return{maxCacheSize:n,maxCacheByteSize:r,maxZoom:i,minZoom:s,tileSize:t,refinementStrategy:a,extent:o,maxRequests:l,zoomOffset:u,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const{tileset:e}=this.state,{zRange:t,modelMatrix:n}=this.props,r=e.update(this.context.viewport,{zRange:t,modelMatrix:n}),{isLoaded:a}=e,o=this.state.isLoaded!==a,i=this.state.frameNumber!==r;a&&(o||i)&&this._onViewportLoad(),i&&this.setState({frameNumber:r}),this.state.isLoaded=a}_onViewportLoad(){const{tileset:e}=this.state,{onViewportLoad:t}=this.props;t&&t(e.selectedTiles)}_onTileLoad(e){this.props.onTileLoad(e),e.layers=null,this.setNeedsUpdate()}_onTileError(e,t){this.props.onTileError(e),t.layers=null,this.setNeedsUpdate()}_onTileUnload(e){this.props.onTileUnload(e)}getTileData(e){const{data:t,getTileData:n,fetch:r}=this.props,{signal:a}=e;return e.url=rt(t,e),n?n(e):e.url?r(e.url,{propName:"data",layer:this,signal:a}):null}renderSubLayers(e){return this.props.renderSubLayers(e)}getSubLayerPropsByTile(e){return null}getPickingInfo({info:e,sourceLayer:t}){return e.tile=t.props.tile,e}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}renderLayers(){return this.state.tileset.tiles.map(e=>{const t=this.getSubLayerPropsByTile(e);if(e.isLoaded||e.content)if(e.layers)t&&e.layers[0]&&Object.keys(t).some(n=>e.layers[0].props[n]!==t[n])&&(e.layers=e.layers.map(e=>e.clone(t)));else{const n=this.renderSubLayers({...this.props,id:"".concat(this.id,"-").concat(e.x,"-").concat(e.y,"-").concat(e.z),data:e.content,_offset:0,tile:e});e.layers=Object(b.b)(n,Boolean).map(n=>n.clone({tile:e,...t}))}else;return e.layers})}filterSubLayer({layer:e}){return e.props.tile.isVisible}}Rt.layerName="TileLayer",Rt.defaultProps=Pt;var Dt=n(290);class kt extends Dt.a{getShaders(){const e=super.getShaders();return e.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},e}initializeState(e){super.initializeState(e);this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(e){const{fadeTrail:t,trailLength:n,currentTime:r}=this.props;e.uniforms={...e.uniforms,fadeTrail:t,trailLength:n,currentTime:r},super.draw(e)}}kt.layerName="TripsLayer",kt.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var It=n(112),Ft=n(122);const jt={...i.a.defaultProps,getHexagons:{type:"accessor",value:e=>e.hexagons}};class Bt extends o.a{updateState({props:e,oldProps:t,changeFlags:n}){if(n.dataChanged||n.updateTriggers&&n.updateTriggers.getHexagons){const{data:t,getHexagons:n}=e,r=[],{iterable:a,objectInfo:o}=Object(Ft.a)(t);for(const e of a){o.index++;const t=n(e,o),a=Object(It.h3SetToMultiPolygon)(t,!0);for(const t of a)r.push(this.getSubLayerRow({polygon:t},e,o.index))}this.setState({polygons:r})}}renderLayers(){const{elevationScale:e,extruded:t,wireframe:n,filled:r,stroked:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:c,lineDashJustified:d,material:f,getFillColor:p,getLineColor:h,getLineWidth:m,getLineDashArray:g,getElevation:y,transitions:v,updateTriggers:A}=this.props;return new(this.getSubLayerClass("cluster-region",i.a))({filled:r,wireframe:n,extruded:t,elevationScale:e,stroked:a,lineWidthScale:o,lineWidthMinPixels:s,lineWidthMaxPixels:l,lineJointRounded:u,lineMiterLimit:c,lineDashJustified:d,material:f,transitions:v,getFillColor:this.getSubLayerAccessor(p),getLineColor:this.getSubLayerAccessor(h),getLineWidth:this.getSubLayerAccessor(m),getLineDashArray:this.getSubLayerAccessor(g),getElevation:this.getSubLayerAccessor(y)},this.getSubLayerProps({id:"cluster-region",updateTriggers:A}),{data:this.state.polygons,getPolygon:e=>e.polygon})}}Bt.defaultProps=jt,Bt.layerName="H3ClusterLayer";var Nt=n(439);function zt(e,t){t=void 0===t?e[0][0]:t;for(const n of e){const e=n[0]-t;e>180?n[0]-=360:e<-180&&(n[0]+=360)}}function Ut(e,t,n){const r=e(t,n),[a,o]=Object(It.h3ToGeo)(r);return[o,a]}function Ht(e,t=1,n){const r=Object(It.h3ToGeoBoundary)(e,!0);if(1!==t?function(e,t,n){const[r,a]=Object(It.h3ToGeo)(e),o=t.length;zt(t,a);const i=t[0]===t[o-1]?o-1:o;for(let e=0;e<i;e++)t[e][0]=mt(a,t[e][0],n),t[e][1]=mt(r,t[e][1],n)}(e,r,t):zt(r),n){const e=new Float64Array(2*r.length);let t=0;for(const n of r)e[t++]=n[0],e[t++]=n[1];return e}return r}const Vt={...i.a.defaultProps,highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:e=>e.hexagon},extruded:!0};delete Vt.getLineDashArray;class Gt extends o.a{shouldUpdateState({changeFlags:e}){return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(!0!==e.highPrecision&&(n.dataChanged||n.updateTriggers&&n.updateTriggers.getHexagon)){const t=this._calculateH3DataProps(e);this.setState(t)}this._updateVertices(this.context.viewport)}_calculateH3DataProps(e){let t=-1,n=!1,r=!1;const{iterable:a,objectInfo:o}=Object(Ft.a)(e.data);for(const i of a){o.index++;const a=e.getHexagon(i,o),s=Object(It.h3GetResolution)(a);if(t<0){if(t=s,!e.highPrecision)break}else if(t!==s){r=!0;break}if(Object(It.h3IsPentagon)(a)){n=!0;break}}return{resolution:t,edgeLengthKM:t>=0?Object(It.edgeLength)(t,It.UNITS.km):0,hasMultipleRes:r,hasPentagon:n}}_shouldUseHighPrecision(){if("auto"===this.props.highPrecision){const{resolution:e,hasPentagon:t,hasMultipleRes:n}=this.state,{viewport:r}=this.context;return r.resolution||n||t||e>=0&&e<=5}return this.props.highPrecision}_updateVertices(e){if(this._shouldUseHighPrecision())return;const{resolution:t,edgeLengthKM:n,centerHex:r}=this.state;if(t<0)return;const a=this.props.centerHexagon||Object(It.geoToH3)(e.latitude,e.longitude,t);if(r===a)return;if(r){const e=Object(It.h3Distance)(r,a);if(e>=0&&e*n<10)return}const{unitsPerMeter:o}=e.distanceScales;let i=Ht(a);const[s,l]=Object(It.h3ToGeo)(a),[u,c]=e.projectFlat([l,s]);i=i.map(t=>{const n=e.projectFlat(t);return[(n[0]-u)/o[0],(n[1]-c)/o[1]]}),this.setState({centerHex:a,vertices:i})}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){const{elevationScale:e,material:t,coverage:n,extruded:r,wireframe:a,stroked:o,filled:i,lineWidthUnits:s,lineWidthScale:l,lineWidthMinPixels:u,lineWidthMaxPixels:c,getFillColor:d,getElevation:f,getLineColor:p,getLineWidth:h,transitions:m,updateTriggers:g}=this.props;return{elevationScale:e,extruded:r,coverage:n,wireframe:a,stroked:o,filled:i,lineWidthUnits:s,lineWidthScale:l,lineWidthMinPixels:u,lineWidthMaxPixels:c,material:t,getElevation:f,getFillColor:d,getLineColor:p,getLineWidth:h,transitions:m,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}_renderPolygonLayer(){const{data:e,getHexagon:t,updateTriggers:n,coverage:r}=this.props,a=this.getSubLayerClass("hexagon-cell-hifi",i.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(e,t){let n;return n=null==e?t:"object"==typeof e?{...e,coverage:t}:{getHexagon:e,coverage:t},n}(n.getHexagon,r),new a(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:(e,n)=>Ht(t(e,n),r,!0)})}_renderColumnLayer(){const{data:e,getHexagon:t,updateTriggers:n}=this.props,r=this.getSubLayerClass("hexagon-cell",Nt.a),a=this._getForwardProps();return a.updateTriggers.getPosition=n.getHexagon,new r(a,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:a.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Ut.bind(null,t)})}}Gt.defaultProps=Vt,Gt.layerName="H3HexagonLayer";var Yt=n(144),Wt=n(34),qt=n(1175),Xt=n(1161),Kt=n(1196),Zt=n(1915),Jt=n(461),Qt=n(1176);class $t extends Qt.a{getShaders(){const e=super.getShaders();return e.modules.push(Zt.a),{...e,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool u_pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n #ifdef HAS_UV_REGIONS\n return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n #else\n return uv;\n #endif\n}\n\nvoid main(void) {\n vec2 uv = applyUVRegion(texCoords);\n geometry.uv = uv;\n\n if (u_pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n geometry.normal = normals_commonspace;\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #ifdef HAS_NORMALS\n pbr_vNormal = geometry.normal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){const{featureIds:e}=this.props;super.initializeState(),e&&this.state.attributeManager.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),e.pbrMaterial!==t.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(e){const{featureIds:t}=this.props;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,u_pickFeatureIds:Boolean(t)}),super.draw(e))}getModel(e){const{id:t,pbrMaterial:n}=this.props,r=this.parseMaterial(n,e),a=this.getShaders();var o;(o=e.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])});return new Jt.a(this.context.gl,{...this.getShaders(),id:t,geometry:e,defines:{...a.defines,...null==r?void 0:r.defines,HAS_UV_REGIONS:e.attributes.uvRegions},parameters:null==r?void 0:r.parameters,isInstanced:!0})}updatePbrMaterialUniforms(e){const{model:t}=this.state;if(t){const{mesh:n}=this.props,r=this.parseMaterial(e,n);t.setUniforms(r.uniforms)}}parseMaterial(e,t){const n=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return new Kt.a(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:{unlit:n,...e},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(e){const{featureIds:t}=this.props,n=new Uint8ClampedArray(t.length*e.size),r=[];for(let e=0;e<t.length;e++)this.encodePickingColor(t[e],r),n[3*e]=r[0],n[3*e+1]=r[1],n[3*e+2]=r[2];e.value=n}}$t.layerName="_MeshLayer",$t.defaultProps={pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}};var en=n(805);function tn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nn=n(99);function rn(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(e));return e}function an(e,t,n=""){if(nn.b.debug&&!function(e,t){if(e.length!==t)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}(e,t))throw new Error("math.gl: ".concat(n," some fields set to invalid numbers'"));return e}const on={};function sn(e,t){on[e]||(on[e]=!0,console.warn("".concat(e," has been removed in version ").concat(t,", see upgrade guide for more information")))}var ln=n(110);class un extends(function(e){function t(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}(Array)){get ELEMENTS(){return Object(ln.a)(!1),0}clone(){return(new this.constructor).copy(this)}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}to(e){return e===this?this:Object(nn.f)(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(nn.b)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+Object(nn.e)(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Object(nn.d)(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){void 0===n&&(n=t,t=e,e=this);for(let r=0;r<this.ELEMENTS;++r){const a=e[r];this[r]=a+n*(t[r]-a)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]+=t[e];return this.check()}subtract(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]-=t[e];return this.check()}scale(e){if(Array.isArray(e))return this.multiply(e);for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}sub(e){return this.subtract(e)}setScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=e;return this.check()}addScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}divideScalar(e){return this.scale(1/e)}clampScalar(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),t);return this.check()}multiplyByScalar(e){return this.scale(e)}get elements(){return this}check(){if(nn.b.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}class cn extends un{get ELEMENTS(){return Object(ln.a)(!1),0}get RANK(){return Object(ln.a)(!1),0}toString(){let e="[";if(nn.b.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=rn(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}function dn(e,t,n){const r=t[0],a=t[1],o=n[3]*r+n[7]*a||1;return e[0]=(n[0]*r+n[4]*a)/o,e[1]=(n[1]*r+n[5]*a)/o,e}function fn(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}const pn=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),hn=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),mn=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),gn={};class yn extends cn{static get IDENTITY(){return gn.IDENTITY=gn.IDENTITY||Object.freeze(new yn(pn)),gn.IDENTITY}static get ZERO(){return gn.ZERO=gn.ZERO||Object.freeze(new yn(hn)),gn.ZERO}get INDICES(){return mn}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this[9]=u,this[10]=c,this[11]=d,this[12]=f,this[13]=p,this[14]=h,this[15]=m,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=a,this[2]=l,this[3]=f,this[4]=t,this[5]=o,this[6]=u,this[7]=p,this[8]=n,this[9]=i,this[10]=c,this[11]=h,this[12]=r,this[13]=s,this[14]=d,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(pn)}fromQuaternion(e){return G.c(this,e),this.check()}frustum({left:e,right:t,bottom:n,top:r,near:a,far:o}){return o===1/0?yn._computeInfinitePerspectiveOffCenter(this,e,t,n,r,a):G.d(this,e,t,n,r,a,o),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,n,r,a,o){const i=2*o/(n-t),s=2*o/(a-r),l=(n+t)/(n-t),u=(a+r)/(a-r),c=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=l,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}lookAt(e,t,n){return 1===arguments.length&&({eye:e,center:t,up:n}=e),t=t||[0,0,0],n=n||[0,1,0],G.g(this,e,t,n),this.check()}ortho({left:e,right:t,bottom:n,top:r,near:a=.1,far:o=500}){return G.i(this,e,t,n,r,a,o),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:n=1,near:r=.1,far:a=500}){if(e>2*Math.PI)throw Error("radians");const o=e/2,i=n*Math.tan(o),s=i*t;return(new yn).ortho({left:-s,right:s,bottom:-i,top:i,near:r,far:a})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:a=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return G.j(this,e,n,r,a),this.check()}determinant(){return G.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*a,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*a,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*a,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*a,e[8]=this[10]*o,e}transpose(){return G.q(this,this),this.check()}invert(){return G.f(this,this),this.check()}multiplyLeft(e){return G.h(this,e,this),this.check()}multiplyRight(e){return G.h(this,this,e),this.check()}rotateX(e){return G.l(this,this,e),this.check()}rotateY(e){return G.m(this,this,e),this.check()}rotateZ(e){return G.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return G.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?G.o(this,this,e):G.o(this,this,[e,e,e]),this.check()}translate(e){return G.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(an(t=re.n(t||[-0,-0,-0,-0],e,this),4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:n}=e;switch(n){case 2:t=Z.j(t||[-0,-0],e,this);break;case 3:t=F.t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return an(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=dn(t||[-0,-0],e,this);break;case 3:t=fn(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return an(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return sn("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return sn("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return sn("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}class vn extends un{get ELEMENTS(){return Object(ln.a)(!1),0}copy(e){return Object(ln.a)(!1),this}get x(){return this[0]}set x(e){this[0]=rn(e)}get y(){return this[1]}set y(e){this[1]=rn(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){const r=this[n]-e[n];t+=r*r}return rn(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return rn(t)}normalize(){const e=this.magnitude();if(0!==e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t[e];return this.check()}divide(...e){for(const t of e)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t[e];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Object(ln.a)(e>=0&&e<this.ELEMENTS,"index is out of range"),rn(this[e])}setComponent(e,t){return Object(ln.a)(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){return this.add(new this.constructor(e).multiplyScalar(t))}}const An=[0,0,0],bn={};class _n extends vn{static get ZERO(){return bn.ZERO=bn.ZERO||Object.freeze(new _n(0,0,0,0))}constructor(e=0,t=0,n=0){super(-0,-0,-0),1===arguments.length&&Object(nn.f)(e)?this.copy(e):(nn.b.debug&&(rn(e),rn(t),rn(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return nn.b.debug&&(rn(e.x),rn(e.y),rn(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=rn(e)}angle(e){return F.b(this,e)}cross(e){return F.d(this,this,e),this.check()}rotateX({radians:e,origin:t=An}){return F.n(this,this,t,e),this.check()}rotateY({radians:e,origin:t=An}){return F.o(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=An}){return F.p(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return F.t(this,this,e),this.check()}transformAsVector(e){return fn(this,this,e),this.check()}transformByMatrix3(e){return F.s(this,this,e),this.check()}transformByMatrix2(e){return function(e,t,n){const r=t[0],a=t[1];e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e[2]=t[2]}(this,this,e),this.check()}transformByQuaternion(e){return F.u(this,this,e),this.check()}}var En=.1,xn=1e-12,Mn=1e-15;Math.PI,Math.PI,Math.PI,Math.PI;Math.max(6378137,6378137,6356752.314245179);const wn=e=>e,On=new _n;function Sn(e,t,n=wn){return Object(nn.f)(e)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=n(e.longitude),t[1]=n(e.latitude),t[2]=e.height):(t[0]=n(e.x),t[1]=n(e.y),t[2]=e.z),t}function Tn(e,t,n=wn){return Object(nn.f)(t)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=n(e[0]),t.latitude=n(e[1]),t.height=e[2]):(t.x=n(e[0]),t.y=n(e[1]),t.z=e[2]),t}const Cn=new _n,Ln=new _n,Pn=new _n;const Rn=new _n,Dn={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},kn={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},In={east:new _n,north:new _n,up:new _n,west:new _n,south:new _n,down:new _n},Fn=new _n,jn=new _n,Bn=new _n;function Nn(e,t,n,r,a,o){const i=Dn[t]&&Dn[t][n];let s,l,u;Object(ln.a)(i&&(!r||r===i));const c=Rn.copy(a);if(Object(nn.d)(c.x,0,1e-14)&&Object(nn.d)(c.y,0,1e-14)){const e=Math.sign(c.z);s=Fn.fromArray(kn[t]),"east"!==t&&"west"!==t&&s.scale(e),l=jn.fromArray(kn[n]),"east"!==n&&"west"!==n&&l.scale(e),u=Bn.fromArray(kn[r]),"east"!==r&&"west"!==r&&u.scale(e)}else{const{up:a,east:o,north:i}=In;o.set(-c.y,c.x,0).normalize(),e.geodeticSurfaceNormal(c,a),i.copy(a).cross(o);const{down:d,west:f,south:p}=In;d.copy(a).scale(-1),f.copy(o).scale(-1),p.copy(i).scale(-1),s=In[t],l=In[n],u=In[r]}return o[0]=s.x,o[1]=s.y,o[2]=s.z,o[3]=0,o[4]=l.x,o[5]=l.y,o[6]=l.z,o[7]=0,o[8]=u.x,o[9]=u.y,o[10]=u.z,o[11]=0,o[12]=c.x,o[13]=c.y,o[14]=c.z,o[15]=1,o}const zn=new _n,Un=new _n,Hn=new _n,Vn=new _n,Gn=new _n,Yn=new _n;let Wn;class qn{static get WGS84(){return Wn=Wn||new qn(6378137,6378137,6356752.314245179),Wn}constructor(e=0,t=0,n=0){Object(ln.a)(e>=0),Object(ln.a)(t>=0),Object(ln.a)(n>=0),this.radii=new _n(e,t,n),this.radiiSquared=new _n(e*e,t*t,n*n),this.radiiToTheFourth=new _n(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new _n(0===e?0:1/e,0===t?0:1/t,0===n?0:1/n),this.oneOverRadiiSquared=new _n(0===e?0:1/(e*e),0===t?0:1/(t*t),0===n?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.centerToleranceSquared=En,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const n=Un,r=Hn,[,,a]=e;this.geodeticSurfaceNormalCartographic(e,n),r.copy(this.radiiSquared).scale(n);const o=Math.sqrt(n.dot(r));return r.scale(1/o),n.scale(a),r.add(n),r.to(t)}cartesianToCartographic(e,t=[0,0,0]){Yn.from(e);const n=this.scaleToGeodeticSurface(Yn,Vn);if(!n)return;const r=this.geodeticSurfaceNormal(n,Un),a=Gn;a.copy(Yn).subtract(n);const o=Math.atan2(r.y,r.x),i=Math.asin(r.z),s=Math.sign(F.f(a,Yn))*F.i(a);return Tn([o,i,s],t,nn.b._cartographicRadians?wn:nn.g)}eastNorthUpToFixedFrame(e,t=new yn){return Nn(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,n,r,a=new yn){return Nn(this,e,t,n,r,a)}geocentricSurfaceNormal(e,t=[0,0,0]){return zn.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){const n=function(e,t=On){return Sn(e,t,nn.b._cartographicRadians?wn:nn.h)}(e),r=n[0],a=n[1],o=Math.cos(a);return zn.set(o*Math.cos(r),o*Math.sin(r),Math.sin(a)).normalize(),zn.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return zn.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function(e,t,n=new _n){const{oneOverRadii:r,oneOverRadiiSquared:a,centerToleranceSquared:o}=t;Cn.from(e);const i=e.x,s=e.y,l=e.z,u=r.x,c=r.y,d=r.z,f=i*i*u*u,p=s*s*c*c,h=l*l*d*d,m=f+p+h,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;const y=Ln;if(y.copy(e).scale(g),m<o)return y.to(n);const v=a.x,A=a.y,b=a.z,_=Pn;_.set(y.x*v*2,y.y*A*2,y.z*b*2);let E,x,M,w,O=(1-g)*e.len()/(.5*_.len()),S=0;do{O-=S,E=1/(1+O*v),x=1/(1+O*A),M=1/(1+O*b);const e=E*E,t=x*x,n=M*M;w=f*e+p*t+h*n-1;S=w/(-2*(f*(e*E)*v+p*(t*x)*A+h*(n*M)*b))}while(Math.abs(w)>xn);return Cn.scale([E,x,M]).to(n)}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){Vn.from(e);const n=Vn.x,r=Vn.y,a=Vn.z,o=this.oneOverRadiiSquared,i=1/Math.sqrt(n*n*o.x+r*r*o.y+a*a*o.z);return Vn.multiplyScalar(i).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return Vn.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return Vn.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){Object(ln.a)(Object(nn.d)(this.radii.x,this.radii.y,Mn)),Object(ln.a)(this.radii.z>0),Vn.from(e);const r=Vn.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(r)>=this.radii.z-t))return Vn.set(0,0,r).to(n)}}var Xn=n(212),Kn=n(172),Zn=n(46);class Jn{constructor(e,t,n){tn(this,"item",void 0),tn(this,"previous",void 0),tn(this,"next",void 0),this.item=e,this.previous=t,this.next=n}}class Qn{constructor(){tn(this,"head",null),tn(this,"tail",null),tn(this,"_length",0)}get length(){return this._length}add(e){const t=new Jn(e,this.tail,null);return this.tail?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,++this._length}}function $n(e){return null!=e}class er{constructor(){tn(this,"_list",void 0),tn(this,"_sentinel",void 0),tn(this,"_trimTiles",void 0),this._list=new Qn,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){const t=e._cacheNode;$n(t)&&this._list.splice(this._sentinel,t)}add(e,t,n){$n(t._cacheNode)||(t._cacheNode=this._list.add(t),n&&n(e,t))}unloadTile(e,t,n){const r=t._cacheNode;$n(r)&&(this._list.remove(r),t._cacheNode=void 0,n&&n(e,t))}unloadTiles(e,t){const n=this._trimTiles;this._trimTiles=!1;const r=this._list,a=1024*e.maximumMemoryUsage*1024,o=this._sentinel;let i=r.head;for(;i!==o&&(e.gpuMemoryUsageInBytes>a||n);){const n=i.item;i=i.next,this.unloadTile(e,n,t)}}trim(){this._trimTiles=!0}}const tr=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});new _n,new _n;const nr=new _n,rr=new _n;class ar{constructor(e=[0,0,0],t=0){this.radius=-0,this.center=new _n,this.fromCenterRadius(e,t)}fromCenterRadius(e,t){return this.center.from(e),this.radius=t,this}fromCornerPoints(e,t){return t=nr.from(t),this.center=(new _n).from(e).add(t).scale(.5),this.radius=this.center.distance(t),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new ar(this.center,this.radius)}union(e){const t=this.center,n=this.radius,r=e.center,a=e.radius,o=nr.copy(r).subtract(t),i=o.magnitude();if(n>=i+a)return this.clone();if(a>=i+n)return e.clone();const s=.5*(n+i+a);return rr.copy(o).scale((-n+s)/i).add(t),this.center.copy(rr),this.radius=s,this}expand(e){const t=(e=nr.from(e)).subtract(this.center).magnitude();return t>this.radius&&(this.radius=t),this}transform(e){this.center.transform(e);const t=G.e(nr,e);return this.radius=Math.max(t[0],Math.max(t[1],t[2]))*this.radius,this}distanceSquaredTo(e){const t=this.distanceTo(e);return t*t}distanceTo(e){const t=(e=nr.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){const t=this.center,n=this.radius,r=e.normal.dot(t)+e.distance;return r<-n?tr.OUTSIDE:r<n?tr.INTERSECTING:tr.INSIDE}}const or=Object.freeze([1,0,0,0,1,0,0,0,1]),ir=Object.freeze([0,0,0,0,0,0,0,0,0]),sr=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL1ROW0:3,COL1ROW1:4,COL1ROW2:5,COL2ROW0:6,COL2ROW1:7,COL2ROW2:8}),lr={};class ur extends cn{static get IDENTITY(){return lr.IDENTITY=lr.IDENTITY||Object.freeze(new ur(or)),lr.IDENTITY}static get ZERO(){return lr.ZERO=lr.ZERO||Object.freeze(new ur(ir)),lr.ZERO}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return sr}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}set(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l){return this[0]=e,this[1]=r,this[2]=i,this[3]=t,this[4]=a,this[5]=s,this[6]=n,this[7]=o,this[8]=l,this.check()}determinant(){return K.b(this)}identity(){return this.copy(or)}fromQuaternion(e){return K.c(this,e),this.check()}transpose(){return K.i(this,this),this.check()}invert(){return K.d(this,this),this.check()}multiplyLeft(e){return K.e(this,e,this),this.check()}multiplyRight(e){return K.e(this,this,e),this.check()}rotate(e){return K.f(this,this,e),this.check()}scale(e){return Array.isArray(e)?K.g(this,this,e):K.g(this,this,[e,e,e]),this.check()}translate(e){return K.h(this,this,e),this.check()}transform(e,t){switch(e.length){case 2:t=Z.i(t||[-0,-0],e,this);break;case 3:t=F.s(t||[-0,-0,-0],e,this);break;case 4:t=function(e,t,n){const r=t[0],a=t[1],o=t[2];return e[0]=n[0]*r+n[3]*a+n[6]*o,e[1]=n[1]*r+n[4]*a+n[7]*o,e[2]=n[2]*r+n[5]*a+n[8]*o,e[3]=t[3],e}(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return an(t,e.length),t}transformVector(e,t){return sn("Matrix3.transformVector"),this.transform(e,t)}transformVector2(e,t){return sn("Matrix3.transformVector"),this.transform(e,t)}transformVector3(e,t){return sn("Matrix3.transformVector"),this.transform(e,t)}}const cr=[0,0,0,1];class dr extends un{constructor(e=0,t=0,n=0,r=1){super(-0,-0,-0,-0),Array.isArray(e)&&1===arguments.length?this.copy(e):this.set(e,t,n,r)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,r){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this.check()}fromMatrix3(e){return ne.e(this,e),this.check()}identity(){return ne.f(this),this.check()}fromAxisRotation(e,t){return ne.p(this,e,t),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=rn(e)}get y(){return this[1]}set y(e){this[1]=rn(e)}get z(){return this[2]}set z(e){this[2]=rn(e)}get w(){return this[3]}set w(e){this[3]=rn(e)}len(){return ne.h(this)}lengthSquared(){return ne.r(this)}dot(e,t){if(void 0!==t)throw new Error("Quaternion.dot only takes one argument");return ne.d(this,e)}rotationTo(e,t){return ne.n(this,e,t),this.check()}add(e,t){if(void 0!==t)throw new Error("Quaternion.add only takes one argument");return ne.a(this,this,e),this.check()}calculateW(){return ne.b(this,this),this.check()}conjugate(){return ne.c(this,this),this.check()}invert(){return ne.g(this,this),this.check()}lerp(e,t,n){return ne.i(this,e,t,n),this.check()}multiplyRight(e,t){return Object(ln.a)(!t),ne.j(this,this,e),this.check()}multiplyLeft(e,t){return Object(ln.a)(!t),ne.j(this,e,this),this.check()}normalize(){const e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,0===e&&(this[3]=1),this.check()}rotateX(e){return ne.k(this,this,e),this.check()}rotateY(e){return ne.l(this,this,e),this.check()}rotateZ(e){return ne.m(this,this,e),this.check()}scale(e){return ne.o(this,this,e),this.check()}slerp(e,t,n){switch(arguments.length){case 1:({start:e=cr,target:t,ratio:n}=arguments[0]);break;case 2:[t,n]=arguments,e=this}return ne.q(this,e,t,n),this.check()}transformVector4(e,t=e){return re.o(t,e,this),an(t,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e,t){return this.multiplyLeft(e,t)}multiply(e,t){return this.multiplyRight(e,t)}}const fr=new _n,pr=new _n,hr=new _n,mr=new _n,gr=new _n,yr=new _n,vr=new _n,Ar=0,br=1,_r=2,Er=3,xr=4,Mr=5,wr=6,Or=7,Sr=8;class Tr{constructor(e=[0,0,0],t=[0,0,0,0,0,0,0,0,0]){this.center=(new _n).from(e),this.halfAxes=new ur(t)}get halfSize(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new _n(e).len(),new _n(t).len(),new _n(n).len()]}get quaternion(){const e=this.halfAxes.getColumn(0),t=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),r=new _n(e).normalize(),a=new _n(t).normalize(),o=new _n(n).normalize();return(new dr).fromMatrix3(new ur([...r,...a,...o]))}fromCenterHalfSizeQuaternion(e,t,n){const r=new dr(n),a=(new ur).fromQuaternion(r);return a[0]=a[0]*t[0],a[1]=a[1]*t[0],a[2]=a[2]*t[0],a[3]=a[3]*t[1],a[4]=a[4]*t[1],a[5]=a[5]*t[1],a[6]=a[6]*t[2],a[7]=a[7]*t[2],a[8]=a[8]*t[2],this.center=(new _n).from(e),this.halfAxes=a,this}clone(){return new Tr(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new ar){const t=this.halfAxes,n=t.getColumn(0,hr),r=t.getColumn(1,mr),a=t.getColumn(2,gr),o=fr.copy(n).add(r).add(a);return e.center.copy(this.center),e.radius=o.magnitude(),e}intersectPlane(e){const t=this.center,n=e.normal,r=this.halfAxes,a=n.x,o=n.y,i=n.z,s=Math.abs(a*r[Ar]+o*r[br]+i*r[_r])+Math.abs(a*r[Er]+o*r[xr]+i*r[Mr])+Math.abs(a*r[wr]+o*r[Or]+i*r[Sr]),l=n.dot(t)+e.distance;return l<=-s?tr.OUTSIDE:l>=s?tr.INSIDE:tr.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){const t=pr.from(e).subtract(this.center),n=this.halfAxes,r=n.getColumn(0,hr),a=n.getColumn(1,mr),o=n.getColumn(2,gr),i=r.magnitude(),s=a.magnitude(),l=o.magnitude();r.normalize(),a.normalize(),o.normalize();let u,c=0;return u=Math.abs(t.dot(r))-i,u>0&&(c+=u*u),u=Math.abs(t.dot(a))-s,u>0&&(c+=u*u),u=Math.abs(t.dot(o))-l,u>0&&(c+=u*u),c}computePlaneDistances(e,t,n=[-0,-0]){let r=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;const o=this.center,i=this.halfAxes,s=i.getColumn(0,hr),l=i.getColumn(1,mr),u=i.getColumn(2,gr),c=yr.copy(s).add(l).add(u).add(o),d=vr.copy(c).subtract(e);let f=t.dot(d);return r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),c.copy(o).add(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).add(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).add(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),o.copy(c).subtract(s).subtract(l).subtract(u),d.copy(c).subtract(e),f=t.dot(d),r=Math.min(f,r),a=Math.max(f,a),n[0]=r,n[1]=a,n}transform(e){this.center.transformAsPoint(e);const t=this.halfAxes.getColumn(0,hr);t.transformAsPoint(e);const n=this.halfAxes.getColumn(1,mr);n.transformAsPoint(e);const r=this.halfAxes.getColumn(2,gr);return r.transformAsPoint(e),this.halfAxes=new ur([...t,...n,...r]),this}getTransform(){throw new Error("not implemented")}}const Cr=new _n,Lr=new _n;class Pr{constructor(e=[0,0,1],t=0){this.normal=new _n,this.distance=-0,this.fromNormalDistance(e,t)}fromNormalDistance(e,t){return Object(ln.a)(Number.isFinite(t)),this.normal.from(e).normalize(),this.distance=t,this}fromPointNormal(e,t){e=Cr.from(e),this.normal.from(t).normalize();const n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,t,n,r){return this.normal.set(e,t,n),Object(ln.a)(Object(nn.d)(this.normal.len(),1)),this.distance=r,this}clone(e){return new Pr(this.normal,this.distance)}equals(e){return Object(nn.d)(this.distance,e.distance)&&Object(nn.d)(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){const t=Lr.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,t)}projectPointOntoPlane(e,t=[0,0,0]){e=Cr.from(e);const n=this.getPointDistance(e),r=Lr.copy(this.normal).scale(n);return e.subtract(r).to(t)}}const Rr=[new _n([1,0,0]),new _n([0,1,0]),new _n([0,0,1])],Dr=new _n,kr=new _n;new Pr(new _n(1,0,0),0);class Ir{static get MASK_OUTSIDE(){return 4294967295}static get MASK_INSIDE(){return 0}static get MASK_INDETERMINATE(){return 2147483647}constructor(e=[]){this.planes=e,Object(ln.a)(this.planes.every(e=>e instanceof Pr))}fromBoundingSphere(e){this.planes.length=2*Rr.length;const t=e.center,n=e.radius;let r=0;for(const e of Rr){let a=this.planes[r],o=this.planes[r+1];a||(a=this.planes[r]=new Pr),o||(o=this.planes[r+1]=new Pr);const i=Dr.copy(e).scale(-n).add(t);e.dot(i);a.fromPointNormal(i,e);const s=Dr.copy(e).scale(n).add(t),l=kr.copy(e).negate();l.dot(s);o.fromPointNormal(s,l),r+=2}return this}computeVisibility(e){Object(ln.a)(e);let t=tr.INSIDE;for(const n of this.planes){switch(e.intersectPlane(n)){case tr.OUTSIDE:return tr.OUTSIDE;case tr.INTERSECTING:t=tr.INTERSECTING}}return t}computeVisibilityWithPlaneMask(e,t){if(Object(ln.a)(e,"boundingVolume is required."),Object(ln.a)(Number.isFinite(t),"parentPlaneMask is required."),t===Ir.MASK_OUTSIDE||t===Ir.MASK_INSIDE)return t;let n=Ir.MASK_INSIDE;const r=this.planes;for(let a=0;a<this.planes.length;++a){const o=a<31?1<<a:0;if(a<31&&0==(t&o))continue;const i=r[a],s=e.intersectPlane(i);if(s===tr.OUTSIDE)return Ir.MASK_OUTSIDE;s===tr.INTERSECTING&&(n|=o)}return n}}new _n,new _n,new _n,new _n,new _n;new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,new _n,Math.PI;new ur,new ur,new ur,new ur,new ur;new _n,new _n,new _n,new _n,new _n,new ur,new ur,new ur;const Fr=new _n,jr=new _n,Br=new Ir([new Pr,new Pr,new Pr,new Pr,new Pr,new Pr]);function Nr(e,t){const{cameraDirection:n,cameraUp:r,height:a}=e,{metersPerUnit:o}=e.distanceScales,i=e.unprojectPosition(e.center),s=qn.WGS84.cartographicToCartesian(i,new _n),l=qn.WGS84.eastNorthUpToFixedFrame(s),u=e.unprojectPosition(e.cameraPosition),c=qn.WGS84.cartographicToCartesian(u,new _n),d=new _n(l.transformAsVector(new _n(n).scale(o))).normalize(),f=new _n(l.transformAsVector(new _n(r).scale(o))).normalize();return function(e,t){const n=e.getFrustumPlanes();let r=0;for(const a in n){const o=n[a],i=o.normal.dot(e.center);jr.copy(o.normal).scale(o.distance-i).add(e.center);const s=e.unprojectPosition(jr),l=qn.WGS84.cartographicToCartesian(s,new _n);Br.planes[r++].fromPointNormal(l,Fr.copy(t).subtract(l))}}(e,s),{camera:{position:c,direction:d,up:f},viewport:e,height:a,cullingVolume:Br,frameNumber:t,sseDenominator:1.15}}const zr=new _n;function Ur(e,t){if(e instanceof Tr){const{halfAxes:n}=e,r=function(e){e.getColumn(0,zr);const t=e.getColumn(1),n=e.getColumn(2),r=zr.add(t).add(n);return r.len()}(n);return Math.log2(6356752.314245179/(r+t[2]))}if(e instanceof ar){const{radius:n}=e;return Math.log2(6356752.314245179/(n+t[2]))}if(e.width&&e.height){const{width:t,height:n}=e;return(Math.log2(6378137/t)+Math.log2(6378137/n))/2}return 1}const Hr=0,Vr=1,Gr=3,Yr=4,Wr=5,qr=1,Xr=2,Kr="empty",Zr="scenegraph",Jr="pointcloud",Qr="mesh",$r="I3S",ea="TILES3D",ta="geometricError",na=1;function ra(e){return null!=e}const aa=new _n,oa=new _n,ia=new _n;function sa(e,t,n){if(Object(Kn.a)(e,"3D Tile: boundingVolume must be defined"),e.box)return function(e,t,n){const r=new _n(e[0],e[1],e[2]);t.transform(r,r);let a=[];if(10===e.length){const t=e.slice(3,6),n=new dr;n.fromArray(e,6);const r=new _n([1,0,0]),o=new _n([0,1,0]),i=new _n([0,0,1]);r.transformByQuaternion(n),r.scale(t[0]),o.transformByQuaternion(n),o.scale(t[1]),i.transformByQuaternion(n),i.scale(t[2]),a=[...r.toArray(),...o.toArray(),...i.toArray()]}else a=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];const o=t.transformAsVector(a.slice(0,3)),i=t.transformAsVector(a.slice(3,6)),s=t.transformAsVector(a.slice(6,9)),l=new ur([o[0],o[1],o[2],i[0],i[1],i[2],s[0],s[1],s[2]]);if(ra(n))return n.center=r,n.halfAxes=l,n;return new Tr(r,l)}(e.box,t,n);if(e.region){const[t,n,r,a,o,i]=e.region,s=qn.WGS84.cartographicToCartesian([Object(nn.c)(t),Object(nn.c)(a),o],oa),l=qn.WGS84.cartographicToCartesian([Object(nn.c)(r),Object(nn.c)(n),i],ia),u=(new _n).addVectors(s,l).multiplyScalar(.5),c=(new _n).subVectors(s,l).len()/2;return la([u[0],u[1],u[2],c],new yn)}if(e.sphere)return la(e.sphere,t,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function la(e,t,n){const r=new _n(e[0],e[1],e[2]);t.transform(r,r);const a=t.getScale(aa),o=Math.max(Math.max(a[0],a[1]),a[2]),i=e[3]*o;return ra(n)?(n.center=r,n.radius=i,n):new ar(r,i)}new _n,new _n,new yn,new _n,new _n,new _n;function ua(e,t){if(e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity){const n=e.dynamicScreenSpaceErrorComputedDensity,r=e.dynamicScreenSpaceErrorFactor;return function(e,t){const n=e*t;return 1-Math.exp(-n*n)}(t,n)*r}return 0}function ca(e,t){const n=t.viewport,r=n.constructor,{longitude:a,latitude:o,height:i,width:s,bearing:l,zoom:u}=n,c=new r({longitude:a,latitude:o,height:i,width:s,bearing:l,zoom:u,pitch:0}),d=e.header.mbs[1],f=e.header.mbs[0],p=e.header.mbs[2],h=e.header.mbs[3],m=[...e.boundingVolume.center],g=c.unprojectPosition(c.cameraPosition),y=qn.WGS84.cartographicToCartesian(g,new _n),v=new _n(y).subtract(m).normalize(),A=new yn;qn.WGS84.eastNorthUpToFixedFrame(m,A);const b=new yn(A).invert(),_=new _n(y).transform(b),E=Math.sqrt(_[0]*_[0]+_[1]*_[1]),x=E*E/_[2],M=new _n([_[0],_[1],x]).transform(A),w=new _n(M).subtract(m).normalize(),O=v.cross(w).normalize().scale(h),S=new _n(m).add(O),T=qn.WGS84.cartesianToCartographic(S),C=c.project([f,d,p]),L=c.project(T);return new _n(C).subtract(L).magnitude()}class da{constructor(e=0){tn(this,"_map",new Map),tn(this,"_array",void 0),tn(this,"_length",void 0),this._array=new Array(e),this._length=e}get length(){return this._length}set length(e){this._length=e,e>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return Object(Kn.a)(e<this._array.length),this._array[e]}set(e,t){Object(Kn.a)(e>=0),e>=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){const t=this._map.get(e);t>=0&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){if(!this._map.has(e)){const t=this.length++;this._array[t]=e,this._map.set(e,t)}}pop(){const e=this._array[--this.length];return this._map.delete(e),e}reserve(e){Object(Kn.a)(e>=0),e>this._array.length&&(this._array.length=e)}resize(e){Object(Kn.a)(e>=0),this.length=e}trim(e){null==e&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const fa={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class pa{constructor(e){tn(this,"options",void 0),tn(this,"root",void 0),tn(this,"requestedTiles",void 0),tn(this,"selectedTiles",void 0),tn(this,"emptyTiles",void 0),tn(this,"_traversalStack",void 0),tn(this,"_emptyTraversalStack",void 0),tn(this,"_frameNumber",void 0),this.options={...fa,...e},this._traversalStack=new da,this._emptyTraversalStack=new da,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(e,t,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const n=this._traversalStack;for(e._selectionDepth=1,n.push(e);n.length>0;){const e=n.pop();let r=!1;this.canTraverse(e,t)&&(this.updateChildTiles(e,t),r=this.updateAndPushChildren(e,t,n,e.hasRenderContent?e._selectionDepth+1:e._selectionDepth));const a=e.parent,o=Boolean(!a||a._shouldRefine),i=!r;e.hasRenderContent?e.refine===qr?(this.loadTile(e,t),this.selectTile(e,t)):e.refine===Xr&&(this.loadTile(e,t),i&&this.selectTile(e,t)):(this.emptyTiles[e.id]=e,this.loadTile(e,t),i&&this.selectTile(e,t)),this.touchTile(e,t),e._shouldRefine=r&&o}this.options.onTraversalEnd(t)}updateChildTiles(e,t){const n=e.children;for(const e of n)this.updateTile(e,t);return!0}updateAndPushChildren(e,t,n,r){const{loadSiblings:a,skipLevelOfDetail:o}=this.options,i=e.children;i.sort(this.compareDistanceToCamera.bind(this));const s=e.refine===Xr&&e.hasRenderContent&&!o;let l=!1,u=!0;for(const e of i)if(e._selectionDepth=r,e.isVisibleAndInRequestVolume?(n.find(e)&&n.delete(e),n.push(e),l=!0):(s||a)&&(this.loadTile(e,t),this.touchTile(e,t)),s){let n;if(n=!!e._inRequestVolume&&(e.hasRenderContent?e.contentAvailable:this.executeEmptyTraversal(e,t)),u=u&&n,!u)return!1}return l||(u=!1),u}updateTile(e,t){this.updateTileVisibility(e,t)}selectTile(e,t){this.shouldSelectTile(e)&&(e._selectedFrame=t.frameNumber,this.selectedTiles[e.id]=e)}loadTile(e,t){this.shouldLoadTile(e)&&(e._requestedFrame=t.frameNumber,e._priority=e._getPriority(),this.requestedTiles[e.id]=e)}touchTile(e,t){e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber}canTraverse(e,t,n=!1,r=!1){return!!e.hasChildren&&(e.hasTilesetContent?!e.contentExpired:!(!r&&!e.isVisibleAndInRequestVolume)&&this.shouldRefine(e,t,n))}shouldLoadTile(e){return e.hasUnloadedContent||e.contentExpired}shouldSelectTile(e){return e.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(e,t,n){let r=e._screenSpaceError;return n&&(r=e.getScreenSpaceError(t,!0)),r>this.options.maximumScreenSpaceError}updateTileVisibility(e,t){const n=[];if(this.options.viewportTraversersMap)for(const e in this.options.viewportTraversersMap){this.options.viewportTraversersMap[e]===t.viewport.id&&n.push(e)}else n.push(t.viewport.id);e.updateVisibility(t,n)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let n=!1;for(const r of e.children)r.updateVisibility(t),n=n||r.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,t){let n=!0;const r=this._emptyTraversalStack;for(r.push(e);r.length>0&&n;){const e=r.pop();this.updateTile(e,t),e.isVisibleAndInRequestVolume||this.loadTile(e,t),this.touchTile(e,t);if(!e.hasRenderContent&&this.canTraverse(e,t,!1,!0)){const t=e.children;for(const e of t)r.find(e)&&r.delete(e),r.push(e)}else e.contentAvailable||(n=!1)}return n}}const ha=new _n;class ma{constructor(e,t,n,r=""){tn(this,"tileset",void 0),tn(this,"header",void 0),tn(this,"id",void 0),tn(this,"url",void 0),tn(this,"parent",void 0),tn(this,"refine",void 0),tn(this,"type",void 0),tn(this,"contentUrl",void 0),tn(this,"lodMetricType",void 0),tn(this,"lodMetricValue",void 0),tn(this,"boundingVolume",void 0),tn(this,"content",void 0),tn(this,"contentState",void 0),tn(this,"gpuMemoryUsageInBytes",void 0),tn(this,"children",void 0),tn(this,"depth",void 0),tn(this,"viewportIds",void 0),tn(this,"transform",void 0),tn(this,"extensions",void 0),tn(this,"userData",void 0),tn(this,"computedTransform",void 0),tn(this,"hasEmptyContent",void 0),tn(this,"hasTilesetContent",void 0),tn(this,"traverser",void 0),tn(this,"_cacheNode",void 0),tn(this,"_frameNumber",void 0),tn(this,"_lodJudge",void 0),tn(this,"_expireDate",void 0),tn(this,"_expiredContent",void 0),tn(this,"_shouldRefine",void 0),tn(this,"_distanceToCamera",void 0),tn(this,"_centerZDepth",void 0),tn(this,"_screenSpaceError",void 0),tn(this,"_visibilityPlaneMask",void 0),tn(this,"_visible",void 0),tn(this,"_inRequestVolume",void 0),tn(this,"_stackLength",void 0),tn(this,"_selectionDepth",void 0),tn(this,"_touchedFrame",void 0),tn(this,"_visitedFrame",void 0),tn(this,"_selectedFrame",void 0),tn(this,"_requestedFrame",void 0),tn(this,"_priority",void 0),tn(this,"_contentBoundingVolume",void 0),tn(this,"_viewerRequestVolume",void 0),tn(this,"_initialTransform",void 0),this.header=t,this.tileset=e,this.id=r||t.id,this.url=t.url,this.parent=n,this.refine=this._getRefine(t.refine),this.type=t.type,this.contentUrl=t.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Hr,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new pa({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new yn,this.transform=new yn,this._initializeLodMetric(t),this._initializeTransforms(t),this._initializeBoundingVolumes(t),this._initializeContent(t),this._initializeRenderingState(t),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===Gr||this.hasEmptyContent}get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Hr}get contentExpired(){return this.contentState===Yr}get contentFailed(){return this.contentState===Wr}getScreenSpaceError(e,t){switch(this.tileset.type){case $r:return ca(this,e);case ea:return function(e,t,n){const r=e.tileset,a=e.parent&&e.parent.lodMetricValue||e.lodMetricValue,o=n?a:e.lodMetricValue;if(0===o)return 0;const i=Math.max(e._distanceToCamera,1e-7),{height:s,sseDenominator:l}=t,{viewDistanceScale:u}=r.options;let c=o*s*(u||1)/(i*l);return c-=ua(r,i),c}(this,e,t);default:throw new Error("Unsupported tileset type")}}_getPriority(){const e=this.tileset._traverser,{skipLevelOfDetail:t}=e.options,n=this.refine===qr||t;if(n&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Hr)return-1;const r=this.parent,a=r&&(!n||0===this._screenSpaceError||r.hasTilesetContent)?r._screenSpaceError:this._screenSpaceError,o=e.root?e.root._screenSpaceError:0;return Math.max(o-a,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Vr;const e=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!e)return this.contentState=Hr,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),n=this.tileset.loader,r={...this.tileset.loadOptions,[n.id]:{...this.tileset.loadOptions[n.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(n.id)}};return this.content=await Object(en.a)(t,n,r),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=Gr,this._onContentLoaded(),!0}catch(e){throw this.contentState=Wr,e}finally{e.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Hr,!0}updateVisibility(e,t){if(this._frameNumber===e.frameNumber)return;const n=this.parent,r=n?n._visibilityPlaneMask:Ir.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const e=n?n.computedTransform:this.tileset.modelMatrix;this._updateTransform(e)}this._distanceToCamera=this.distanceToTile(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==Ir.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._frameNumber=e.frameNumber,this.viewportIds=t}visibility(e,t){const{cullingVolume:n}=e,{boundingVolume:r}=this;return n.computeVisibilityWithPlaneMask(r,t)}contentVisibility(){return!0}distanceToTile(e){const t=this.boundingVolume;return Math.sqrt(Math.max(t.distanceSquaredTo(e.camera.position),0))}cameraSpaceZDepth({camera:e}){const t=this.boundingVolume;return ha.subVectors(t.center,e.position),e.direction.dot(ha)}insideViewerRequestVolume(e){const t=this._viewerRequestVolume;return!t||t.distanceSquaredTo(e.camera.position)<=0}updateExpiration(){if(null!=this._expireDate&&this.contentReady&&!this.hasEmptyContent){const e=Date.now();Date.lessThan(this._expireDate,e)&&(this.contentState=Yr,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(e){"lodMetricType"in e?this.lodMetricType=e.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in e?this.lodMetricValue=e.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(e){this.transform=e.transform?new yn(e.transform):new yn;const t=this.parent,n=this.tileset,r=t&&t.computedTransform?t.computedTransform.clone():n.modelMatrix.clone();this.computedTransform=new yn(r).multiplyRight(this.transform);const a=t&&t._initialTransform?t._initialTransform.clone():new yn;this._initialTransform=new yn(a).multiplyRight(this.transform)}_initializeBoundingVolumes(e){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(e)}_initializeContent(e){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Hr,this.hasTilesetContent=!1,e.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(e){this.depth=e.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Ir.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(e){return e||this.parent&&this.parent.refine||Xr}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}_updateBoundingVolume(e){this.boundingVolume=sa(e.boundingVolume,this.computedTransform,this.boundingVolume);const t=e.content;t&&(t.boundingVolume&&(this._contentBoundingVolume=sa(t.boundingVolume,this.computedTransform,this._contentBoundingVolume)),e.viewerRequestVolume&&(this._viewerRequestVolume=sa(e.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(e=new yn){const t=e.clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(e){switch(e){case"i3s":return{...this.tileset.options.i3s,tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1};case"3d-tiles":case"cesium-ion":default:return{assetGltfUpAxis:(t=this.tileset.tileset).asset&&t.asset.gltfUpAxis||"Y"}}var t}}class ga extends pa{compareDistanceToCamera(e,t){return 0===t._distanceToCamera&&0===e._distanceToCamera?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera}updateTileVisibility(e,t){if(super.updateTileVisibility(e,t),!e.isVisibleAndInRequestVolume)return;const n=e.children.length>0;if(e.hasTilesetContent&&n){const n=e.children[0];return this.updateTileVisibility(n,t),void(e._visible=n._visible)}if(this.meetsScreenSpaceErrorEarly(e,t))return void(e._visible=!1);const r=e.refine===Xr,a=e._optimChildrenWithinParent===na;r&&a&&n&&!this.anyChildrenVisible(e,t)&&(e._visible=!1)}meetsScreenSpaceErrorEarly(e,t){const{parent:n}=e;return!(!n||n.hasTilesetContent||n.refine!==qr)&&!this.shouldRefine(e,t,!0)}}const ya="REQUESTED",va="COMPLETED",Aa="ERROR";class ba{constructor(){tn(this,"_statusMap",void 0),this._statusMap={}}add(e,t,n,r){this._statusMap[t]||(this._statusMap[t]={request:e,callback:n,key:t,frameState:r,status:ya},e().then(e=>{this._statusMap[t].status=va,this._statusMap[t].callback(e,r)}).catch(e=>{this._statusMap[t].status=Aa,n(e)}))}update(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}find(e){return this._statusMap[e]}}class _a extends pa{constructor(e){super(e),tn(this,"_tileManager",void 0),this._tileManager=new ba}shouldRefine(e,t){return e._lodJudge=function(e,t){if(0===e.lodMetricValue||isNaN(e.lodMetricValue))return"DIG";const n=2*ca(e,t);return n<2?"OUT":!e.header.children||n<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT"}(e,t),"DIG"===e._lodJudge}updateChildTiles(e,t){const n=e.header.children||[],r=e.children,a=e.tileset;for(const o of n){const n="".concat(o.id,"-").concat(t.viewport.id),i=r&&r.find(e=>e.id===n);if(i)i&&this.updateTile(i,t);else{let r=()=>this._loadTile(o.id,a);this._tileManager.find(n)?this._tileManager.update(n,t):(a.tileset.nodePages&&(r=()=>a.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(r,n,t=>this._onTileLoad(t,e,n),t))}}return!1}async _loadTile(e,t){const{loader:n}=t,r=t.getTileUrl("".concat(t.url,"/nodes/").concat(e)),a={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return await Object(en.a)(r,n,a)}_onTileLoad(e,t,n){const r=new ma(t.tileset,e,t,n);t.children.push(r);const a=this._tileManager.find(r.id).frameState;this.updateTile(r,a),this._frameNumber===a.frameNumber&&this.executeTraversal(r,a)}}const Ea={description:"",ellipsoid:qn.WGS84,modelMatrix:new yn,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}};class xa{constructor(e,t){tn(this,"options",void 0),tn(this,"loadOptions",void 0),tn(this,"type",void 0),tn(this,"tileset",void 0),tn(this,"loader",void 0),tn(this,"url",void 0),tn(this,"basePath",void 0),tn(this,"modelMatrix",void 0),tn(this,"ellipsoid",void 0),tn(this,"lodMetricType",void 0),tn(this,"lodMetricValue",void 0),tn(this,"refine",void 0),tn(this,"root",void 0),tn(this,"roots",void 0),tn(this,"asset",void 0),tn(this,"description",void 0),tn(this,"properties",void 0),tn(this,"extras",void 0),tn(this,"attributions",void 0),tn(this,"credits",void 0),tn(this,"stats",void 0),tn(this,"traverseCounter",void 0),tn(this,"geometricError",void 0),tn(this,"selectedTiles",void 0),tn(this,"cartographicCenter",void 0),tn(this,"cartesianCenter",void 0),tn(this,"zoom",void 0),tn(this,"boundingVolume",void 0),tn(this,"gpuMemoryUsageInBytes",void 0),tn(this,"dynamicScreenSpaceErrorComputedDensity",void 0),tn(this,"_traverser",void 0),tn(this,"_cache",void 0),tn(this,"_requestScheduler",void 0),tn(this,"_frameNumber",void 0),tn(this,"_queryParamsString",void 0),tn(this,"_queryParams",void 0),tn(this,"_extensionsUsed",void 0),tn(this,"_tiles",void 0),tn(this,"_pendingCount",void 0),tn(this,"lastUpdatedVieports",void 0),tn(this,"_requestedTiles",void 0),tn(this,"_emptyTiles",void 0),tn(this,"frameStateData",void 0),tn(this,"maximumMemoryUsage",void 0),Object(Kn.a)(e),this.options={...Ea,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||Zn.b.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new er,this._requestScheduler=new ct.a({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new Xn.a({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function(e){const t=[];for(const n of Object.keys(e))t.push("".concat(n,"=").concat(e[n]));switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(e){this.options={...this.options,...e}}setOptions(e){this.options={...this.options,...e}}getTileUrl(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}hasExtension(e){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(e)>-1)}update(e){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;!e&&this.lastUpdatedVieports?e=this.lastUpdatedVieports:this.lastUpdatedVieports=e,e instanceof Array||(e=[e]),this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const t=[];for(const n of e){const e=n.id;this._needTraverse(e)?t.push(e):this.traverseCounter--}for(const n of e){const e=n.id;if(this.roots[e]||(this.roots[e]=this._initializeTileHeaders(this.tileset,null)),!t.includes(e))continue;const r=Nr(n,this._frameNumber);this._traverser.traverse(this.roots[e],r,this.options)}}_needTraverse(e){let t=e;return this.options.viewportTraversersMap&&(t=this.options.viewportTraversersMap[e]),t===e}_onTraversalEnd(e){const t=e.viewport.id;this.frameStateData[t]||(this.frameStateData[t]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const n=this.frameStateData[t],r=Object.values(this._traverser.selectedTiles);n.selectedTiles=r,n._requestedTiles=Object.values(this._traverser.requestedTiles),n._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const e in this.frameStateData){const t=this.frameStateData[e];this.selectedTiles=this.selectedTiles.concat(t.selectedTiles),this._requestedTiles=this._requestedTiles.concat(t._requestedTiles),this._emptyTiles=this._emptyTiles.concat(t._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const e of this.selectedTiles)this._tiles[e.id]=e;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(e,t){if(e.length!==t.length)return!0;const n=new Set(e.map(e=>e.id)),r=new Set(t.map(e=>e.id));let a=e.filter(e=>!r.has(e.id)).length>0;return a=a||t.filter(e=>!n.has(e.id)).length>0,a}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount&&(t+=n.content.pointCount));this.stats.get("Tiles In View").count=this.selectedTiles.length,this.stats.get("Tiles To Render").count=e,this.stats.get("Points").count=t}_initializeTileSet(e){this.root=this._initializeTileHeaders(e,null),this.type===ea&&this._initializeCesiumTileset(e),this.type===$r&&this._initializeI3STileset(),this._calculateViewProps()}_calculateViewProps(){const e=this.root;Object(Kn.a)(e);const{center:t}=e.boundingVolume;if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new _n,void(this.zoom=1);this.cartographicCenter=qn.WGS84.cartesianToCartographic(t,new _n),this.cartesianCenter=t,this.zoom=Ur(e.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get("Tiles In Tileset(s)"),this.stats.get("Tiles Loading"),this.stats.get("Tiles In Memory"),this.stats.get("Tiles In View"),this.stats.get("Tiles To Render"),this.stats.get("Tiles Loaded"),this.stats.get("Tiles Unloaded"),this.stats.get("Failed Tile Loads"),this.stats.get("Points","memory"),this.stats.get("Tile Memory Use","memory")}_initializeTileHeaders(e,t){const n=new ma(this,e.root,t);if(t&&(t.children.push(n),n.depth=t.depth+1),this.type===ea){const e=[];for(e.push(n);e.length>0;){const t=e.pop();this.stats.get("Tiles In Tileset(s)").incrementCount();const n=t.header.children||[];for(const r of n){const n=new ma(this,r,t);t.children.push(n),n.depth=t.depth+1,e.push(n)}}}return n}_initializeTraverser(){let e;switch(this.type){case ea:e=ga;break;case $r:e=_a;break;default:e=pa}return new e({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(e){this._destroySubtree(e)}async _loadTile(e){let t;try{this._onStartTileLoading(),t=await e.loadContent()}catch(t){this._onTileLoadError(e,t)}finally{this._onEndTileLoading(),this._onTileLoad(e,t)}}_onTileLoadError(e,t){this.stats.get("Failed Tile Loads").incrementCount();const n=t.message||t.toString(),r=e.url;console.error("A 3D tile failed to load: ".concat(e.url," ").concat(n)),this.options.onTileError(e,n,r)}_onTileLoad(e,t){t&&(e&&e.content&&function(e,t){Object(Kn.a)(e),Object(Kn.a)(t);const{rtcCenter:n,gltfUpAxis:r}=t,{computedTransform:a,boundingVolume:{center:o}}=e;let i=new yn(a);switch(n&&i.translate(n),r){case"Z":break;case"Y":const e=(new yn).rotateX(Math.PI/2);i=i.multiplyRight(e);break;case"X":const t=(new yn).rotateY(-Math.PI/2);i=i.multiplyRight(t)}t.isQuantized&&i.translate(t.quantizedVolumeOffset).scale(t.quantizedVolumeScale);const s=new _n(o);t.cartesianModelMatrix=i,t.cartesianOrigin=s;const l=qn.WGS84.cartesianToCartographic(s,new _n),u=qn.WGS84.eastNorthUpToFixedFrame(s).invert();t.cartographicModelMatrix=u.multiplyRight(i),t.cartographicOrigin=l,t.coordinateSystem||(t.modelMatrix=t.cartographicModelMatrix)}(e,e.content),this._addTileToCache(e),this.options.onTileLoad(e))}_onStartTileLoading(){this._pendingCount++,this.stats.get("Tiles Loading").incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get("Tiles Loading").decrementCount()}_addTileToCache(e){this._cache.add(this,e,t=>t._updateCacheStats(e))}_updateCacheStats(e){this.stats.get("Tiles Loaded").incrementCount(),this.stats.get("Tiles In Memory").incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get("Tiles In Memory").decrementCount(),this.stats.get("Tiles Unloaded").incrementCount(),this.stats.get("Tile Memory Use").count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);e.length>0;){const t=e.pop();for(const n of t.children)e.push(n);this._destroyTile(t)}this.root=null}_destroySubtree(e){const t=e,n=[];for(n.push(t);n.length>0;){e=n.pop();for(const t of e.children)n.push(t);e!==t&&this._destroyTile(e)}t.children=[]}_destroyTile(e){this._cache.unloadTile(this,e),this._unloadTile(e),e.destroy()}_initializeCesiumTileset(e){if(this.asset=e.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=e.properties,this.geometricError=e.geometricError,this._extensionsUsed=e.extensionsUsed,this.extras=e.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const Ma={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(Ma);function wa(e,t,n){Object(Kn.a)(e instanceof ArrayBuffer);const r=new TextDecoder("utf8"),a=new Uint8Array(e,t,n);return r.decode(a)}var Oa=n(460);const Sa={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ta={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...Sa};var Ca=n(4);const La={[Sa.DOUBLE]:Float64Array,[Sa.FLOAT]:Float32Array,[Sa.UNSIGNED_SHORT]:Uint16Array,[Sa.UNSIGNED_INT]:Uint32Array,[Sa.UNSIGNED_BYTE]:Uint8Array,[Sa.BYTE]:Int8Array,[Sa.SHORT]:Int16Array,[Sa.INT]:Int32Array},Pa={DOUBLE:Sa.DOUBLE,FLOAT:Sa.FLOAT,UNSIGNED_SHORT:Sa.UNSIGNED_SHORT,UNSIGNED_INT:Sa.UNSIGNED_INT,UNSIGNED_BYTE:Sa.UNSIGNED_BYTE,BYTE:Sa.BYTE,SHORT:Sa.SHORT,INT:Sa.INT};class Ra{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(const t in La){if(La[t]===e)return t}throw new Error("Failed to convert GL type")}static fromName(e){const t=Pa[e];if(!t)throw new Error("Failed to convert GL type");return t}static getArrayType(e){switch(e){case Sa.UNSIGNED_SHORT_5_6_5:case Sa.UNSIGNED_SHORT_4_4_4_4:case Sa.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const t=La[e];if(!t)throw new Error("Failed to convert GL type");return t}}static getByteSize(e){return Ra.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(Ra.getArrayType(e))}static createTypedArray(e,t,n=0,r){void 0===r&&(r=(t.byteLength-n)/Ra.getByteSize(e));return new(Ra.getArrayType(e))(t,n,r)}}class Da{constructor(e,t){Object(Ca.a)(this,"json",void 0),Object(Ca.a)(this,"buffer",void 0),Object(Ca.a)(this,"featuresLength",0),Object(Ca.a)(this,"_cachedTypedArrays",{}),this.json=e,this.buffer=t}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,t=Ta.UNSIGNED_INT,n=1){const r=this.json[e];return r&&Number.isFinite(r.byteOffset)?this._getTypedArrayFromBinary(e,t,n,1,r.byteOffset):r}getPropertyArray(e,t,n){const r=this.json[e];return r&&Number.isFinite(r.byteOffset)?("componentType"in r&&(t=Ra.fromName(r.componentType)),this._getTypedArrayFromBinary(e,t,n,this.featuresLength,r.byteOffset)):this._getTypedArrayFromArray(e,t,r)}getProperty(e,t,n,r,a){const o=this.json[e];if(!o)return o;const i=this.getPropertyArray(e,t,n);if(1===n)return i[r];for(let e=0;e<n;++e)a[e]=i[n*r+e];return a}_getTypedArrayFromBinary(e,t,n,r,a){const o=this._cachedTypedArrays;let i=o[e];return i||(i=Ra.createTypedArray(t,this.buffer.buffer,this.buffer.byteOffset+a,r*n),o[e]=i),i}_getTypedArrayFromArray(e,t,n){const r=this._cachedTypedArrays;let a=r[e];return a||(a=Ra.createTypedArray(t,n),r[e]=a),a}}const ka={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ia={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Fa={SCALAR:(e,t,n)=>{t[n]=e},VEC2:(e,t,n)=>{t[2*n+0]=e[0],t[2*n+1]=e[1]},VEC3:(e,t,n)=>{t[3*n+0]=e[0],t[3*n+1]=e[1],t[3*n+2]=e[2]},VEC4:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT2:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT3:(e,t,n)=>{t[9*n+0]=e[0],t[9*n+1]=e[1],t[9*n+2]=e[2],t[9*n+3]=e[3],t[9*n+4]=e[4],t[9*n+5]=e[5],t[9*n+6]=e[6],t[9*n+7]=e[7],t[9*n+8]=e[8],t[9*n+9]=e[9]},MAT4:(e,t,n)=>{t[16*n+0]=e[0],t[16*n+1]=e[1],t[16*n+2]=e[2],t[16*n+3]=e[3],t[16*n+4]=e[4],t[16*n+5]=e[5],t[16*n+6]=e[6],t[16*n+7]=e[7],t[16*n+8]=e[8],t[16*n+9]=e[9],t[16*n+10]=e[10],t[16*n+11]=e[11],t[16*n+12]=e[12],t[16*n+13]=e[13],t[16*n+14]=e[14],t[16*n+15]=e[15]}};const ja=e=>void 0!==e;function Ba(e,t,n){if(!t)return null;let r=e.getExtension("3DTILES_batch_table_hierarchy");const a=t.HIERARCHY;return a&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=a,r=a),r?function(e,t){let n,r,a;const o=e.instancesLength,i=e.classes;let s,l=e.classIds,u=e.parentCounts,c=e.parentIds,d=o;ja(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,a=getBinaryAccessor(l),l=a.createArrayBufferView(t.buffer,t.byteOffset+l.byteOffset,o));if(ja(u))for(ja(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,a=getBinaryAccessor(u),u=a.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,o)),s=new Uint16Array(o),d=0,n=0;n<o;++n)s[n]=d,d+=u[n];ja(c)&&ja(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,a=getBinaryAccessor(c),c=a.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,d));const f=i.length;for(n=0;n<f;++n){const e=i[n].length,r=i[n].instances,a=getBinaryProperties(e,r,t);i[n].instances=combine(a,r)}const p=new Array(f).fill(0),h=new Uint16Array(o);for(n=0;n<o;++n)r=l[n],h[n]=p[r],++p[r];const m={classes:i,classIds:l,classIndexes:h,parentCounts:u,parentIndexes:s,parentIds:c};return function(e){const t=e.classIds.length;for(let n=0;n<t;++n)za(e,n,stack)}(m),m}(r,n):null}function Na(e,t,n){if(!e)return;const r=e.parentCounts;return e.parentIds?n(e,t):r>0?function(e,t,n){const r=e.classIds,a=e.parentCounts,o=e.parentIds,i=e.parentIndexes,s=r.length,l=scratchVisited;l.length=Math.max(l.length,s);const u=++marker,c=scratchStack;c.length=0,c.push(t);for(;c.length>0;){if(t=c.pop(),l[t]===u)continue;l[t]=u;const r=n(e,t);if(ja(r))return r;const s=a[t],d=i[t];for(let e=0;e<s;++e){const n=o[d+e];n!==t&&c.push(n)}}return null}(e,t,n):function(e,t,n){let r=!0;for(;r;){const a=n(e,t);if(ja(a))return a;const o=e.parentIds[t];r=o!==t,t=o}throw new Error("traverseHierarchySingleParent")}(e,t,n)}function za(e,t,n){const r=e.parentCounts,a=e.parentIds,o=e.parentIndexes,i=e.classIds.length;if(!ja(a))return;assert(t<i,"Parent index ".concat(t," exceeds the total number of instances: ").concat(i)),assert(-1===n.indexOf(t),"Circular dependency detected in the batch table hierarchy."),n.push(t);const s=ja(r)?r[t]:1,l=ja(r)?o[t]:t;for(let r=0;r<s;++r){const o=a[l+r];o!==t&&za(e,o,n)}n.pop(t)}function Ua(e){return null!=e}const Ha=(e,t)=>e,Va={HIERARCHY:!0,extensions:!0,extras:!0};class Ga{constructor(e,t,n,r={}){var a;Object(Ca.a)(this,"json",void 0),Object(Ca.a)(this,"binary",void 0),Object(Ca.a)(this,"featureCount",void 0),Object(Ca.a)(this,"_extensions",void 0),Object(Ca.a)(this,"_properties",void 0),Object(Ca.a)(this,"_binaryProperties",void 0),Object(Ca.a)(this,"_hierarchy",void 0),Object(Kn.a)(n>=0),this.json=e||{},this.binary=t,this.featureCount=n,this._extensions=(null===(a=this.json)||void 0===a?void 0:a.extensions)||{},this._properties={};for(const e in this.json)Va[e]||(this._properties[e]=this.json[e]);this._binaryProperties=this._initializeBinaryProperties(),r["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Ba(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,t){if(this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),this._hierarchy){return Ua(Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n];return e.classes[r].name===t}))}return!1}isExactClass(e,t){return Object(Kn.a)("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){const t=this._hierarchy.classIds[e];return this._hierarchy.classes[t].name}}hasProperty(e,t){return this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),Ua(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=Ua(t)?t:[]).length=0;const n=Object.keys(this._properties);return t.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),this._binaryProperties){const n=this._binaryProperties[t];if(Ua(n))return this._getBinaryProperty(n,e)}const n=this._properties[t];if(Ua(n))return Ha(n[e]);if(this._hierarchy){const n=this._getHierarchyProperty(e,t);if(Ua(n))return n}}setProperty(e,t,n){const r=this.featureCount;if(this._checkBatchId(e),Object(Kn.a)("string"==typeof t,t),this._binaryProperties){const r=this._binaryProperties[t];if(r)return void this._setBinaryProperty(r,e,n)}if(this._hierarchy&&this._setHierarchyProperty(this,e,t,n))return;let a=this._properties[t];Ua(a)||(this._properties[t]=new Array(r),a=this._properties[t]),a[e]=Ha(n)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,t){return e.unpack(e.typedArray,t)}_setBinaryProperty(e,t,n){e.pack(n,e.typedArray,t)}_initializeBinaryProperties(){let e=null;for(const t in this._properties){const n=this._properties[t],r=this._initializeBinaryProperty(t,n);r&&(e=e||{},e[t]=r)}return e}_initializeBinaryProperty(e,t){if("byteOffset"in t){const n=t;Object(Kn.a)(this.binary,"Property ".concat(e," requires a batch table binary.")),Object(Kn.a)(n.type,"Property ".concat(e," requires a type."));const r=function(e,t,n,r){const{componentType:a}=e;Object(Kn.a)(e.componentType);const o="string"==typeof a?Ra.fromName(a):a,i=ka[e.type],s=Ia[e.type],l=Fa[e.type];return n+=e.byteOffset,{values:Ra.createTypedArray(o,t,n,i*r),type:o,size:i,unpacker:s,packer:l}}(n,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:r.values,componentCount:r.size,unpack:r.unpacker,pack:r.packer}}return null}_hasPropertyInHierarchy(e,t){if(!this._hierarchy)return!1;const n=Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n];return Ua(e.classes[r].instances[t])});return Ua(n)}_getPropertyNamesInHierarchy(e,t){Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n],a=e.classes[r].instances;for(const e in a)a.hasOwnProperty(e)&&-1===t.indexOf(e)&&t.push(e)})}_getHierarchyProperty(e,t){return Na(this._hierarchy,e,(e,n)=>{const r=e.classIds[n],a=e.classes[r],o=e.classIndexes[n],i=a.instances[t];return Ua(i)?Ua(i.typedArray)?this._getBinaryProperty(i,o):Ha(i[o]):null})}_setHierarchyProperty(e,t,n,r){const a=Na(this._hierarchy,t,(e,a)=>{const o=e.classIds[a],i=e.classes[o],s=e.classIndexes[a],l=i.instances[n];return!!Ua(l)&&(Object(Kn.a)(a===t,'Inherited property "'.concat(n,'" is read-only.')),Ua(l.typedArray)?this._setBinaryProperty(l,s,r):l[s]=Ha(r),!0)});return Ua(a)}}function Ya(e,t,n=0){const r=new DataView(t);if(e.magic=r.getUint32(n,!0),n+=4,e.version=r.getUint32(n,!0),n+=4,e.byteLength=r.getUint32(n,!0),n+=4,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return n}function Wa(e,t,n){const r=new DataView(t);let a;e.header=e.header||{};let o=r.getUint32(n,!0);n+=4;let i=r.getUint32(n,!0);n+=4;let s=r.getUint32(n,!0);n+=4;let l=r.getUint32(n,!0);return n+=4,s>=570425344?(n-=8,a=o,s=i,l=0,o=0,i=0,console.warn("b3dm tile in legacy format.")):l>=570425344&&(n-=4,a=s,s=o,l=i,o=0,i=0,console.warn("b3dm tile in legacy format.")),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=l,e.header.batchLength=a,n}function qa(e,t,n,r){return n=function(e,t,n,r){const{featureTableJsonByteLength:a,featureTableBinaryByteLength:o,batchLength:i}=e.header;if(e.featureTableJson={BATCH_LENGTH:i||0},a>0){const r=wa(t,n,a);e.featureTableJson=JSON.parse(r)}return n+=a,e.featureTableBinary=new Uint8Array(t,n,o),n+=o}(e,t,n),n=function(e,t,n,r){const{batchTableJsonByteLength:a,batchTableBinaryByteLength:o}=e.header;if(a>0){const r=wa(t,n,a);e.batchTableJson=JSON.parse(r),n+=a,o>0&&(e.batchTableBinary=new Uint8Array(t,n,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),n+=o)}return n}(e,t,n)}function Xa(e,t=[0,0,0]){const n=e>>11&31,r=e>>5&63,a=31&e;return t[0]=n<<3,t[1]=r<<2,t[2]=a<<3,t}function Ka(e,t,n){if(!(t||e&&e.batchIds&&n))return null;const{batchIds:r,isRGB565:a,pointCount:o}=e;if(r&&n){const e=new Uint8ClampedArray(3*o);for(let t=0;t<o;t++){const a=r[t],o=n.getProperty(a,"dimensions").map(e=>255*e);e[3*t]=o[0],e[3*t+1]=o[1],e[3*t+2]=o[2]}return{type:Ta.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}if(a){const e=new Uint8ClampedArray(3*o);for(let n=0;n<o;n++){const r=Xa(t[n]);e[3*n]=r[0],e[3*n+1]=r[1],e[3*n+2]=r[2]}return{type:Ta.UNSIGNED_BYTE,value:e,size:3,normalized:!0}}return t&&t.length===3*o?{type:Ta.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ta.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}class Za extends vn{constructor(e=0,t=0){super(2),Object(nn.f)(e)&&1===arguments.length?this.copy(e):(nn.b.debug&&(rn(e),rn(t)),this[0]=e,this[1]=t)}set(e,t){return this[0]=e,this[1]=t,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return nn.b.debug&&(rn(e.x),rn(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Z.j(this,this,e),this.check()}transformAsVector(e){return dn(this,this,e),this.check()}transformByMatrix3(e){return Z.i(this,this,e),this.check()}transformByMatrix2x3(e){return Z.h(this,this,e),this.check()}transformByMatrix2(e){return Z.g(this,this,e),this.check()}}function Ja(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new Za,new _n,new Za,new Za,new Uint8Array(1);function Qa(e,t=255){return Object(nn.a)(e,0,t)/t*2-1}function $a(e){return e<0?-1:1}function eo(e,t,n,r){if(Ja(r),e<0||e>n||t<0||t>n)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(n));if(r.x=Qa(e,n),r.y=Qa(t,n),r.z=1-(Math.abs(r.x)+Math.abs(r.y)),r.z<0){const e=r.x;r.x=(1-Math.abs(r.y))*$a(e),r.y=(1-Math.abs(e))*$a(r.y)}return r.normalize()}function to(e,t,n){return eo(e,t,255,n)}const no=new _n;function ro(e,t,n){return e.isQuantized?n["3d-tiles"]&&n["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,function(e,t){const n=new _n,r=new Float32Array(3*e.pointCount);for(let a=0;a<e.pointCount;a++)n.set(t[3*a],t[3*a+1],t[3*a+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(r,3*a);return r}(e,t)):{type:Ta.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}async function ao(e,t,n,r,a){n=qa(e,t,n=Wa(e,t,n=Ya(e,t,n))),function(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}(e);const{featureTable:o,batchTable:i}=function(e){const t=new Da(e.featureTableJson,e.featureTableBinary),n=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(n))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=n,e.featuresLength=n,e.pointsLength=n,e.pointCount=n,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ta.FLOAT,3);const r=function(e,t){let n=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ta.UNSIGNED_SHORT,1),e.batchIds)){const r=t.getGlobalProperty("BATCH_LENGTH");if(!r)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:a,batchTableBinary:o}=e;n=new Ga(a,o,r)}return n}(e,t);return{featureTable:t,batchTable:r}}(e);return await async function(e,t,n,r,a){let o,i,s;const l=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];l&&(s=l.properties);const u=t.getExtension("3DTILES_draco_point_compression");if(u){i=u.properties;const t=u.byteOffset,n=u.byteLength;if(!i||!Number.isFinite(t)||!n)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=e.featureTableBinary.slice(t,t+n),e.hasPositions=Number.isFinite(i.POSITION),e.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),e.hasNormals=Number.isFinite(i.NORMAL),e.hasBatchIds=Number.isFinite(i.BATCH_ID),e.isTranslucent=Number.isFinite(i.RGBA)}if(!o)return!0;const c={buffer:o,properties:{...i,...s},featureTableProperties:i,batchTableProperties:s,dequantizeInShader:!1};return await async function(e,t,n,r){const{parse:a}=r,o={...n,draco:{...n.draco,extraAttributes:t.batchTableProperties||{}}};delete o["3d-tiles"];const i=await a(t.buffer,Oa.a,o),s=i.attributes.POSITION&&i.attributes.POSITION.value,l=i.attributes.COLOR_0&&i.attributes.COLOR_0.value,u=i.attributes.NORMAL&&i.attributes.NORMAL.value,c=i.attributes.BATCH_ID&&i.attributes.BATCH_ID.value,d=s&&i.attributes.POSITION.value.quantization,f=u&&i.attributes.NORMAL.value.quantization;if(d){const t=i.POSITION.data.quantization,n=t.range;e.quantizedVolumeScale=new _n(n,n,n),e.quantizedVolumeOffset=new _n(t.minValues),e.quantizedRange=(1<<t.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<i.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);const p={};if(t.batchTableProperties)for(const e of Object.keys(t.batchTableProperties))i.attributes[e]&&i.attributes[e].value&&(p[e.toLowerCase()]=i.attributes[e].value);e.attributes={positions:s,colors:Ka(e,l,void 0),normals:u,batchIds:c,...p}}(e,c,r,a)}(e,o,0,r,a),function(e,t,n){if(!e.attributes.positions)if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ta.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){const r=t.getPropertyArray("POSITION_QUANTIZED",Ta.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=65535,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ta.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ta.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=ro(e,r,n)}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(e,o,r),function(e,t,n){if(!e.attributes.colors){let r=null;t.hasProperty("RGBA")?(r=t.getPropertyArray("RGBA",Ta.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?r=t.getPropertyArray("RGB",Ta.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(r=t.getPropertyArray("RGB565",Ta.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Ka(e,r,n)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ta.UNSIGNED_BYTE,4))}(e,o,i),function(e,t){if(!e.attributes.normals){let n=null;t.hasProperty("NORMAL")?n=t.getPropertyArray("NORMAL",Ta.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(n=t.getPropertyArray("NORMAL_OCT16P",Ta.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=function(e,t){if(!t)return null;if(e.isOctEncoded16P){const n=new Float32Array(3*e.pointsLength);for(let r=0;r<e.pointsLength;r++)to(t[2*r],t[2*r+1],no),no.toArray(n,3*r);return{type:Ta.FLOAT,size:2,value:n}}return{type:Ta.FLOAT,size:2,value:t}}(e,n)}}(e,o),n}var oo=n(1159),io=n(182);const so=0,lo=1;function uo(e,t,n,r){e.rotateYtoZ=!0;const a=e.byteOffset+e.byteLength-n;if(0===a)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=r["3d-tiles"]&&r["3d-tiles"].assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Object(io.c)(t,n,a),e.gltfByteOffset=0,e.gltfByteLength=a,n%4==0||console.warn("".concat(e.type,": embedded glb is not aligned to a 4-byte boundary.")),e.byteOffset+e.byteLength}async function co(e,t,n,r){const a=n["3d-tiles"]||{};if(function(e,t,n){switch(t){case so:const t=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),n=(new TextDecoder).decode(t);e.gltfUrl=n.replace(/[\s\0]+$/,""),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case lo:break;default:throw new Error("b3dm: Illegal glTF format field")}}(e,t),a.loadGLTF){const{parse:t,fetch:a}=r;e.gltfUrl&&(e.gltfArrayBuffer=await a(e.gltfUrl,n),e.gltfByteOffset=0),e.gltfArrayBuffer&&(e.gltf=await t(e.gltfArrayBuffer,oo.a,n,r),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength)}}async function fo(e,t,n,r,a){var o;n=function(e,t,n,r,a){n=Ya(e,t,n),n=Wa(e,t,n),n=qa(e,t,n),n=uo(e,t,n,r);const o=new Da(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ta.FLOAT,3),n}(e,t,n,r),await co(e,lo,r,a);const i=null==e||null===(o=e.gltf)||void 0===o?void 0:o.extensions;return i&&i.CESIUM_RTC&&(e.rtcCenter=i.CESIUM_RTC.center),n}async function po(e,t,n,r,a){return n=function(e,t,n,r,a){if(n=Ya(e,t,n),1!==e.version)throw new Error("Instanced 3D Model version ".concat(e.version," is not supported"));n=Wa(e,t,n);const o=new DataView(t);if(e.gltfFormat=o.getUint32(n,!0),n=qa(e,t,n+=4),n=uo(e,t,n,r),0===e.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const i=new Da(e.featureTableJson,e.featureTableBinary),s=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=i.getGlobalProperty("RTC_CENTER",Ta.FLOAT,3);new Ga(e.batchTableJson,e.batchTableBinary,s);return function(e,t,n,r){const a=[new Array(r),e._batchTable][0],o=new _n,i=new _n,s=new _n,l=new _n,u=new ur,c=new dr,d=new _n,f={},p=new yn,h=[],m=[],g=new _n,y=new _n;for(let n=0;n<r;n++){let r;if(t.hasProperty("POSITION"))r=t.getProperty("POSITION",Ta.FLOAT,3,n,o);else if(t.hasProperty("POSITION_QUANTIZED")){r=t.getProperty("POSITION_QUANTIZED",Ta.UNSIGNED_SHORT,3,n,o);const e=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ta.FLOAT,3,g);if(!e)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const a=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ta.FLOAT,3,y);if(!a)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const i=65535;for(let t=0;t<3;t++)r[t]=r[t]/i*a[t]+e[t]}if(!r)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(r),f.translation=o,e.normalUp=t.getProperty("NORMAL_UP",Ta.FLOAT,3,n,h),e.normalRight=t.getProperty("NORMAL_RIGHT",Ta.FLOAT,3,n,m);const v=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ta.UNSIGNED_SHORT,2,h),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ta.UNSIGNED_SHORT,2,m),e.octNormalUp){if(!e.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}e.eastNorthUp?(qn.WGS84.eastNorthUpToFixedFrame(o,p),p.getRotationMatrix3(u)):u.identity()}v&&(l.copy(i).cross(s).normalize(),u.setColumn(0,i),u.setColumn(1,s),u.setColumn(2,l)),c.fromMatrix3(u),f.rotation=c,d.set(1,1,1);const A=t.getProperty("SCALE",Ta.FLOAT,1,n);Number.isFinite(A)&&d.multiplyByScalar(A);const b=t.getProperty("SCALE_NON_UNIFORM",Ta.FLOAT,3,n,h);b&&d.scale(b),f.scale=d;let _=t.getProperty("BATCH_ID",Ta.UNSIGNED_SHORT,1,n);void 0===_&&(_=n);const E=(new yn).fromQuaternion(f.rotation);p.identity(),p.translate(f.translation),p.multiplyRight(E),p.scale(f.scale);const x=p.clone();a[n]={modelMatrix:x,batchId:_}}e.instances=a}(e,i,0,s),n}(e,t,n,r),await co(e,e.gltfFormat,r,a),n}async function ho(e,t=0,n,r,a={}){switch(a.byteOffset=t,a.type=function(e,t=0){const n=new DataView(e);return"".concat(String.fromCharCode(n.getUint8(t+0))).concat(String.fromCharCode(n.getUint8(t+1))).concat(String.fromCharCode(n.getUint8(t+2))).concat(String.fromCharCode(n.getUint8(t+3)))}(e,t),a.type){case Ma.COMPOSITE:return await async function(e,t,n,r,a,o){n=Ya(e,t,n);const i=new DataView(t);for(e.tilesLength=i.getUint32(n,!0),n+=4,e.tiles=[];e.tiles.length<e.tilesLength&&e.byteLength-n>12;){const i={};e.tiles.push(i),n=await o(t,n,r,a,i)}return n}(a,e,t,n,r,ho);case Ma.BATCHED_3D_MODEL:return await fo(a,e,t,n,r);case Ma.GLTF:return await async function(e,t,n,r){e.rotateYtoZ=!0,e.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y";const{parse:a}=r;e.gltf=await a(t,oo.a,n,r)}(a,e,n,r);case Ma.INSTANCED_3D_MODEL:return await po(a,e,t,n,r);case Ma.POINT_CLOUD:return await ao(a,e,t,n,r);default:throw new Error("3DTileLoader: unknown type ".concat(a.type))}}var mo=n(240);async function go(e,t,n){const r=e[t].bufferView,a=e.bufferViews[r],o=e.buffers[a.buffer];if(o.uri){const e=await Object(mo.a)(o.uri),t=await e.arrayBuffer();return new Uint8Array(t,a.byteOffset,a.byteLength)}return new Uint8Array(n,a.byteOffset,a.byteLength)}function yo(e){const t=new DataView(e);return t.getUint32(0,!0)+2**32*t.getUint32(4,!0)}const vo={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:"3.1.6",extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(e){if(1952609651!==new Uint32Array(e.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(e.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const t=yo(e.slice(8,16)),n=new Uint8Array(e,24,t),r=new TextDecoder("utf8").decode(n),a=JSON.parse(r),o=yo(e.slice(16,24));let i=new ArrayBuffer(0);return o&&(i=e.slice(24+t)),"bufferView"in a.tileAvailability&&(a.tileAvailability.explicitBitstream=await go(a,"tileAvailability",i)),"bufferView"in a.contentAvailability&&(a.contentAvailability.explicitBitstream=await go(a,"contentAvailability",i)),"bufferView"in a.childSubtreeAvailability&&(a.childSubtreeAvailability.explicitBitstream=await go(a,"childSubtreeAvailability",i)),a},options:{}},Ao={QUADTREE:4,OCTREE:8};function bo(e,t){return"constant"in e?Boolean(e.constant):!!e.explicitBitstream&&function(e,t){const n=Math.floor(e/8),r=e%8;return 1==(t[n]>>r&1)}(t,e.explicitBitstream)}function _o(e,t,n,r){const{basePath:a,refine:o,getRefine:i,lodMetricType:s,getTileType:l,rootLodMetricValue:u,rootBoundingVolume:c}=r,d=e.contentUrl&&e.contentUrl.replace("".concat(a,"/"),""),f=u/2**t,p=function(e,t,n){if(t.region){const{childTileX:r,childTileY:a,childTileZ:o}=n,[i,s,l,u,c,d]=t.region,f=2**e,p=(l-i)/f,h=(u-s)/f,m=(d-c)/f,[g,y]=[i+p*r,i+p*(r+1)],[v,A]=[s+h*a,s+h*(a+1)],[b,_]=[c+m*o,c+m*(o+1)];return{region:[g,v,y,A,b,_]}}return console.warn("Unsupported bounding volume type: ",t),null}(t,c,n);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:i(o),type:l(e),lodMetricType:s,lodMetricValue:f,boundingVolume:p}}function Eo(e,t){return parseInt(e.toString(2)+t.toString(2),2)}function xo(e,t,n,r,a){const o=function(e){const t={};for(const n in e)t["{".concat(n,"}")]=e[n];return t}({level:t,x:n,y:r,z:a});return e.replace(/{level}|{x}|{y}|{z}/gi,e=>o[e])}function Mo(e){if(!e.contentUrl)return Kr;const t=e.contentUrl.split(".").pop();switch(t){case"pnts":return Jr;case"i3dm":case"b3dm":case"glb":case"gltf":return Zr;default:return t}}function wo(e){switch(e){case"REPLACE":case"replace":return Xr;case"ADD":case"add":return qr;default:return e}}function Oo(e,t){if(!e)return null;if(e.content){const n=e.content.uri||e.content.url;e.contentUrl="".concat(t.basePath,"/").concat(n)}return e.id=e.contentUrl,e.lodMetricType=ta,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform,e.type=Mo(e),e.refine=wo(e.refine),e}async function So(e){if(!e.root)return null;const t=e.basePath,n=e.root.extensions["3DTILES_implicit_tiling"],{subdivisionScheme:r,maximumLevel:a,subtreeLevels:o,subtrees:{uri:i}}=n,s=xo(i,0,0,0,0),l="".concat(t,"/").concat(s),u=await Object(en.a)(l,vo),c="".concat(t,"/").concat(e.root.content.uri),d=e.root.refine,f=e.root.geometricError,p=e.root.boundingVolume,h={contentUrlTemplate:c,subtreesUriTemplate:i,subdivisionScheme:r,subtreeLevels:o,maximumLevel:a,refine:d,basePath:t,lodMetricType:ta,rootLodMetricValue:f,rootBoundingVolume:p,getTileType:Mo,getRefine:wo};return await async function(e,t,n){if(!e)return null;e.lodMetricType=ta,e.lodMetricValue=e.geometricError,e.transformMatrix=e.transform;const{children:r,contentUrl:a}=await async function e(t,n,r={mortonIndex:0,x:0,y:0,z:0},a=0,o=0,i={level:0,mortonIndex:0,x:0,y:0,z:0}){const{subdivisionScheme:s,subtreeLevels:l,maximumLevel:u,contentUrlTemplate:c,subtreesUriTemplate:d,basePath:f}=n,p={children:[],lodMetricValue:0,contentUrl:""},h=Ao[s],m=1&a,g=a>>1&1,y=a>>2&1,v=(h**o-1)/(h-1);let A=Eo(r.mortonIndex,a),b=v+A,_=Eo(r.x,m),E=Eo(r.y,g),x=Eo(r.z,y),M=!1;o+1>l&&(M=bo(t.childSubtreeAvailability,A));const w=Eo(i.x,_),O=Eo(i.y,E),S=Eo(i.z,x),T=o+i.level;if(M){const e=xo("".concat(f,"/").concat(d),T,w,O,S);t=await Object(en.a)(e,vo),i.mortonIndex=A,i.x=_,i.y=E,i.z=x,i.level=o,A=0,b=0,_=0,E=0,x=0,o=0}if(!bo(t.tileAvailability,b)||o>u)return p;bo(t.contentAvailability,b)&&(p.contentUrl=xo(c,T,w,O,S));const C=o+1,L={mortonIndex:A,x:_,y:E,z:x};for(let r=0;r<h;r++){const a=await e(t,n,L,r,C,i);if(a.contentUrl||a.children.length){const e=_o(a,T+1,{childTileX:_,childTileY:E,childTileZ:x},n);p.children.push(e)}}return p}(t,n);a&&(e.contentUrl=a,e.content={uri:a.replace("".concat(n.basePath,"/"),"")});return e.refine=wo(e.refine),e.type=Mo(e),e.children=r,e.id=e.contentUrl,e}(e.root,u,h)}const To={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:"3.1.6",extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(e,t,n){const r=t["3d-tiles"]||{};let a;a="auto"===r.isTileset?n.url&&-1!==n.url.indexOf(".json"):r.isTileset;e=a?await async function(e,t,n){var r;const a=JSON.parse((new TextDecoder).decode(e));return a.loader=t.loader||To,a.url=n.url,a.basePath=function(e){return Zn.b.dirname(e.url)}(a),a.root=function(e){var t,n;return(null==e||null===(t=e.extensionsRequired)||void 0===t?void 0:t.includes("3DTILES_implicit_tiling"))&&(null==e||null===(n=e.extensionsUsed)||void 0===n?void 0:n.includes("3DTILES_implicit_tiling"))}(a)?await So(a):function(e){const t=e.basePath,n=Oo(e.root,e),r=[];for(r.push(n);r.length>0;){const e=(r.pop()||{}).children||[];for(const n of e)Oo(n,{basePath:t}),r.push(n)}return n}(a),a.type=ea,a.lodMetricType=ta,a.lodMetricValue=(null===(r=a.root)||void 0===r?void 0:r.lodMetricValue)||0,a}(e,t,n):await async function(e,t,n){const r={content:{featureIds:null}};return await ho(e,0,t,n,r.content),r.content}(e,t,n);return e},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};const Co=[0],Lo={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:To,onTilesetLoad:{type:"function",value:e=>{},compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:(e,t,n)=>{},compare:!1},_getMeshColor:{type:"function",value:e=>[255,255,255],compare:!1}};class Po extends o.a{initializeState(){"onTileLoadFail"in this.props&&E.a.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){const{tileset3d:e}=this.state;return e&&e.isLoaded()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(e.data&&e.data!==t.data&&this._loadTileset(e.data),n.viewportChanged){const{activeViewports:e}=this.state;Object.keys(e).length&&(this._updateTileset(e),this.state.lastUpdatedViewports=e,this.state.activeViewports={})}if(n.propsChanged){const{layerMap:e}=this.state;for(const t in e)e[t].needsUpdate=!0}}activateViewport(e){const{activeViewports:t,lastUpdatedViewports:n}=this.state;this.internalState.viewport=e,t[e.id]=e;const r=null==n?void 0:n[e.id];r&&e.equals(r)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:e,sourceLayer:t}){const{layerMap:n}=this.state,r=t&&t.id;if(r){const t=r.substring(this.id.length+1),a=t.substring(t.indexOf("-")+1);e.object=n[a]&&n[a].tile}return e}filterSubLayer({layer:e,viewport:t}){const{tile:n}=e.props,{id:r}=t;return n.selected&&n.viewportIds.includes(r)}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}async _loadTileset(e){const{loadOptions:t={}}=this.props;let n=this.props.loader||this.props.loaders;Array.isArray(n)&&(n=n[0]);const r={loadOptions:{...t}};if(n.preload){const a=await n.preload(e,t);a.headers&&(r.loadOptions.fetch={...r.loadOptions.fetch,headers:a.headers}),Object.assign(r,a)}const a=await Object(en.a)(e,n,r.loadOptions),o=new xa(a,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError,...r});this.setState({tileset3d:o,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(o)}_onTileLoad(e){const{lastUpdatedViewports:t}=this.state;this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}_onTileUnload(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}_updateTileset(e){const{tileset3d:t}=this.state,{timeline:n}=this.context,r=Object.keys(e).length;if(!n||!r||!t)return;const a=t.update(Object.values(e));this.state.frameNumber!==a&&this.setState({frameNumber:a})}_getSubLayer(e,t){if(!e.content)return null;switch(e.type){case Jr:return this._makePointCloudLayer(e,t);case Zr:return this._make3DModelLayer(e,t);case Qr:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}_makePointCloudLayer(e,t){const{attributes:n,pointCount:r,constantRGBA:a,cartographicOrigin:o,modelMatrix:i}=e.content,{positions:s,normals:l,colors:u}=n;if(!s)return null;const c=t&&t.props.data||{header:{vertexCount:r},attributes:{POSITION:s,NORMAL:l,COLOR_0:u}},{pointSize:d,getPointColor:f}=this.props;return new(this.getSubLayerClass("pointcloud",qt.a))({pointSize:d},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:c,coordinateSystem:Wt.a.METER_OFFSETS,coordinateOrigin:o,modelMatrix:i,getColor:a||f,_offset:0})}_make3DModelLayer(e){const{gltf:t,instances:n,cartographicOrigin:r,modelMatrix:a}=e.content;return new(this.getSubLayerClass("scenegraph",Xt.a))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||Co,scenegraph:t,coordinateSystem:Wt.a.METER_OFFSETS,coordinateOrigin:r,modelMatrix:a,getTransformMatrix:e=>e.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(e,t){const n=e.content,{attributes:r,indices:a,modelMatrix:o,cartographicOrigin:i,coordinateSystem:s=Wt.a.METER_OFFSETS,material:l,featureIds:u}=n,{_getMeshColor:c}=this.props,d=t&&t.props.mesh||new Yt.a({drawMode:4,attributes:Ro(r),indices:a});return new(this.getSubLayerClass("mesh",$t))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:d,data:Co,getColor:c(e),pbrMaterial:l,modelMatrix:o,coordinateOrigin:i,coordinateSystem:s,featureIds:u,_offset:0})}renderLayers(){const{tileset3d:e,layerMap:t}=this.state;return e?e.tiles.map(e=>{const n=t[e.id]=t[e.id]||{tile:e};let{layer:r}=n;return e.selected&&(r?n.needsUpdate&&(r=this._getSubLayer(e,r),n.needsUpdate=!1):r=this._getSubLayer(e)),n.layer=r,r}).filter(Boolean):null}}function Ro(e){const t={};return t.positions={...e.positions,value:new Float32Array(e.positions.value)},e.normals&&(t.normals=e.normals),e.texCoords&&(t.texCoords=e.texCoords),e.colors&&(t.colors=e.colors),e.uvRegions&&(t.uvRegions=e.uvRegions),t}Po.layerName="Tile3DLayer",Po.defaultProps=Lo;const Do={name:"Terrain",id:"terrain",module:"terrain",version:"3.1.6",worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}},ko=[1],Io={...Rt.defaultProps,elevationData:tt,texture:{...tt,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0,loaders:[Do]};function Fo(e){return Array.isArray(e)?e.join(";"):e}class jo extends o.a{updateState({props:e,oldProps:t}){const n=e.elevationData!==t.elevationData;if(n){const{elevationData:t}=e,n=t&&(Array.isArray(t)||t.includes("{x}")&&t.includes("{y}"));this.setState({isTiled:n})}const r=n||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;if(!this.state.isTiled&&r){const t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&E.a.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:n,meshMaxError:r,signal:a}){var o;if(!e)return null;let i=this.getLoadOptions();i={...i,terrain:{skirtHeight:this.state.isTiled?2*r:0,...null===(o=i)||void 0===o?void 0:o.terrain,bounds:t,meshMaxError:r,elevationDecoder:n}};const{fetch:s}=this.props;return s(e,{propName:"elevationData",layer:this,loadOptions:i,signal:a})}getTiledTerrainData(e){const{elevationData:t,fetch:n,texture:r,elevationDecoder:a,meshMaxError:o}=this.props,{viewport:i}=this.context,s=rt(t,e),l=rt(r,e),{bbox:u,signal:c}=e,d=i.isGeospatial?i.projectFlat([u.west,u.south]):[u.left,u.bottom],f=i.isGeospatial?i.projectFlat([u.east,u.north]):[u.right,u.top],p=[d[0],d[1],f[0],f[1]],h=this.loadTerrain({elevationData:s,bounds:p,elevationDecoder:a,meshMaxError:o,signal:c}),m=l?n(l,{propName:"texture",layer:this,loaders:[],signal:c}).catch(e=>null):Promise.resolve(null);return Promise.all([h,m])}renderSubLayers(e){const t=this.getSubLayerClass("mesh",Qt.a),{data:n,color:r}=e;if(!n)return null;const[a,o]=n;return new t(e,{data:ko,mesh:a,texture:o,_instanced:!1,coordinateSystem:Wt.a.CARTESIAN,getPosition:e=>[0,0,0],getColor:r})}onViewportLoad(e){if(!e)return;const{zRange:t}=this.state,n=e.map(e=>e.content).filter(Boolean).map(e=>e[0].header.boundingBox.map(e=>e[2]));if(0===n.length)return;const r=Math.min(...n.map(e=>e[0])),a=Math.max(...n.map(e=>e[1]));(!t||r<t[0]||a>t[1])&&this.setState({zRange:[r,a]})}renderLayers(){const{color:e,material:t,elevationData:n,texture:r,wireframe:a,meshMaxError:o,elevationDecoder:i,tileSize:s,maxZoom:l,minZoom:u,extent:c,maxRequests:d,onTileLoad:f,onTileUnload:p,onTileError:h,maxCacheSize:m,maxCacheByteSize:g,refinementStrategy:y}=this.props;if(this.state.isTiled)return new Rt(this.getSubLayerProps({id:"tiles"}),{wireframe:a,color:e,material:t,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Fo(n),texture:Fo(r),meshMaxError:o,elevationDecoder:i}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:s,maxZoom:l,minZoom:u,extent:c,maxRequests:d,onTileLoad:f,onTileUnload:p,onTileError:h,maxCacheSize:m,maxCacheByteSize:g,refinementStrategy:y});return new(this.getSubLayerClass("mesh",Qt.a))(this.getSubLayerProps({id:"mesh"}),{data:ko,mesh:this.state.terrain,texture:r,_instanced:!1,getPosition:e=>[0,0,0],getColor:e,material:t,wireframe:a})}}function Bo(e){let t=0;for(let t,n,r=0,a=e.length-1;r<e.length;r++)e[r],e[a],(n[0]-t[0])*(t[1]+n[1]);return t}function No(e,t,n){t&&n&&(1===e?t.id=n.readVarint():2===e?function(e,t){const n=e.readVarint()+e.pos;for(;e.pos<n;){const n=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[n]=r}}(n,t):3===e?t.type=n.readVarint():4===e&&(t._geometry=n.pos))}jo.layerName="TerrainLayer",jo.defaultProps=Io;class zo{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(e,t,n,r,a){Object(Ca.a)(this,"properties",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"type",void 0),Object(Ca.a)(this,"id",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_geometry",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=a,e.readFields(No,this,t)}loadGeometry(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let n=1,r=0,a=0,o=0;const i=[];let s;for(;e.pos<t;){if(r<=0){const t=e.readVarint();7&t,t>>3}if(1===n||2===n)e.readSVarint(),e.readSVarint(),1===n&&(s&&i.push(s),[]),s&&s.push([a,o]);else{if(7!==n)throw new Error("unknown command ".concat(n));s&&s.push(s[0].slice())}}return s&&i.push(s),i}bbox(){const e=this._pbf;e.pos=this._geometry;const t=e.readVarint()+e.pos;let n=1,r=0,a=0,o=0,i=1/0,s=-1/0,l=1/0,u=-1/0;for(;e.pos<t;){if(r<=0){const t=e.readVarint();7&t,t>>3}if(1===n||2===n)e.readSVarint(),e.readSVarint(),a<i&&a,a>s&&a,o<l&&o,o>u&&o;else if(7!==n)throw new Error("unknown command ".concat(n))}return[i,l,s,u]}_toGeoJSON(e){let t,n,r=this.loadGeometry(),a=zo.types[this.type];switch(this.type){case 1:const a=[];for(0;t<r.length;t++)a[t]=r[t][0];a,e(r,this);break;case 2:for(0;t<r.length;t++)e(r[t],this);break;case 3:for(function(e){const t=e.length;if(t<=1)return[e];const n=[];let r,a;for(let o=0;o<t;o++){const t=Bo(e[o]);0!==t&&(void 0===a&&t<0,a===t<0?(r&&n.push(r),[e[o]]):r&&r.push(e[o]))}return r&&n.push(r),n}(r),0;t<r.length;t++)for(0;n<r[t].length;n++)e(r[t][n],this)}1===r.length?r[0]:"Multi".concat(a);const o={type:"Feature",geometry:{type:a,coordinates:r},properties:this.properties};return null!==this.id&&(o.id=this.id),o}toGeoJSON(e){if("function"==typeof e)return this._toGeoJSON(e);const{x:t,y:n,z:r}=e,a=this.extent*Math.pow(2,r),o=this.extent*t,i=this.extent*n;return this._toGeoJSON((function(e){for(let t=0;t<e.length;t++){const n=e[t];n[0]=360*(n[0]+o)/a-180;const r=180-360*(n[1]+i)/a;n[1]=360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90}}))}}class Uo{constructor(e,t){Object(Ca.a)(this,"version",void 0),Object(Ca.a)(this,"name",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"length",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),Object(Ca.a)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Ho,this,t),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const t=this._pbf.readVarint()+this._pbf.pos;return new zo(this._pbf,t,this.extent,this._keys,this._values)}}function Ho(e,t,n){t&&n&&(15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){let t=null;const n=e.readVarint()+e.pos;for(;e.pos<n;){const t=e.readVarint()>>3;1===t?e.readString():2===t?e.readFloat():3===t?e.readDouble():4===t?e.readVarint64():5===t?e.readVarint():6===t?e.readSVarint():7===t?e.readBoolean():null}return t}(n)))}class Vo{constructor(e,t){Object(Ca.a)(this,"layers",void 0),this.layers=e.readFields(Go,{},t)}}function Go(e,t,n){if(3===e&&n){const e=new Uo(n,n.readVarint()+n.pos);e.length&&t&&(t[e.name]=e)}}var Yo=n(248);function Wo(e){const t=e.indices.length;if(t<=1)return{type:"Polygon",data:e.data,areas:[[Object(Yo.b)(e.data)]],indices:[e.indices]};const n=[],r=[];let a,o=[],i=[],s=0;for(let l,u,c=0;c<t;c++){e.indices[c]-s,e.indices[c+1]-s||e.data.length;const t=e.data.slice(u,l),d=Object(Yo.b)(t);if(0!==d)void 0===a&&d<0,a===d<0?(i.length&&(n.push(o),r.push(i)),[u],[d]):(o.push(d),i.push(u));else{const t=e.data.slice(0,u),n=e.data.slice(l);e.data=t.concat(n),l-u}}return o&&n.push(o),i.length&&r.push(i),{type:"Polygon",areas:n,indices:r,data:e.data}}function qo(e,t,n){t&&n&&(1===e?t.id=n.readVarint():2===e?function(e,t){const n=e.readVarint()+e.pos;for(;e.pos<n;){const n=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[n]=r}}(n,t):3===e?t.type=n.readVarint():4===e&&(t._geometry=n.pos))}let Xo,Ko,Zo,Jo,Qo,$o,ei;class ti{constructor(e,t,n,r,a,o){Object(Ca.a)(this,"properties",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"type",void 0),Object(Ca.a)(this,"id",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_geometry",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),Object(Ca.a)(this,"_geometryInfo",void 0),this.properties={},this.extent=n,this.type=0,this.id=null,this._pbf=e,this._geometry=-1,this._keys=r,this._values=a,this._geometryInfo=o,e.readFields(qo,this,t)}loadGeometry(){const e=this._pbf;e.pos=this._geometry,e.readVarint()+e.pos,1,0,0,0,0;const t=[],n=[];for(;e.pos<Xo;)if(Jo<=0&&(e.readVarint(),7&Zo,Zo>>3),1===Ko||2===Ko)e.readSVarint(),e.readSVarint(),1===Ko&&t.push(ei),n.push(Qo,$o),2;else{if(7!==Ko)throw new Error("unknown command ".concat(Ko));if(ei>0){const e=t[t.length-1];n.push(n[e],n[e+1]),2}}return{data:n,indices:t}}_toBinaryCoordinates(e){const t=this.loadGeometry();let n;e(t.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=t.indices.length,{type:"Point",...t};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=t.indices.length,this._geometryInfo.linePositionsCount+=t.data.length/2,{type:"LineString",...t};break;case 3:Wo(t),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=n.indices.length;for(const e of n.indices)this._geometryInfo.polygonRingsCount+=e.length;this._geometryInfo.polygonPositionsCount+=n.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}const r={type:"Feature",geometry:n,properties:this.properties};return null!==this.id&&(r.id=this.id),r}toBinaryCoordinates(e){if("function"==typeof e)return this._toBinaryCoordinates(e);const{x:t,y:n,z:r}=e,a=this.extent*Math.pow(2,r),o=this.extent*t,i=this.extent*n;return this._toBinaryCoordinates(e=>function(e,t,n,r){for(let a=0,o=e.length;a<o;a+=2){e[a]=360*(e[a]+t)/r-180;const o=180-360*(e[a+1]+n)/r;e[a+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(e,o,i,a))}}class ni{constructor(e,t){Object(Ca.a)(this,"version",void 0),Object(Ca.a)(this,"name",void 0),Object(Ca.a)(this,"extent",void 0),Object(Ca.a)(this,"length",void 0),Object(Ca.a)(this,"_pbf",void 0),Object(Ca.a)(this,"_keys",void 0),Object(Ca.a)(this,"_values",void 0),Object(Ca.a)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ri,this,t),this.length=this._features.length}feature(e,t){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];const n=this._pbf.readVarint()+this._pbf.pos;return new ti(this._pbf,n,this.extent,this._keys,this._values,t)}}function ri(e,t,n){t&&n&&(15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){let t=null;const n=e.readVarint()+e.pos;for(;e.pos<n;){const t=e.readVarint()>>3;1===t?e.readString():2===t?e.readFloat():3===t?e.readDouble():4===t?e.readVarint64():5===t?e.readVarint():6===t?e.readSVarint():7===t?e.readBoolean():null}return t}(n)))}class ai{constructor(e,t){Object(Ca.a)(this,"layers",void 0),this.layers=e.readFields(oi,{},t)}}function oi(e,t,n){if(3===e&&n){const e=new ni(n,n.readVarint()+n.pos);e.length&&t&&(t[e.name]=e)}}var ii=n(1188),si=n(338),li=n.n(si);function ui(e,t){(function(e){if(e){const t="wgs84"==={...e,mvt:e.mvt||{},gis:e.gis||{}}.coordinates,{tileIndex:n}=e,r=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);if(t&&!r)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property. Check documentation.")}return e})(t);const n=[];if(t){const r="binary"===t.gis.format,a={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(e.byteLength>0){const o=r?new ai(new li.a(e)):new Vo(new li.a(e)),i=t.mvt;(Array.isArray(i.layers)?i.layers:Object.keys(o.layers)).forEach(e=>{const t=o.layers[e],s={...i,layerName:e};if(t)for(let e=0;e<t.length;e++){const o=t.feature(e,a),i=r?di(o,s):ci(o,s);n.push(i)}})}if(r){const t=Object(ii.a)(n,a);return t.byteLength=e.byteLength,t}}return n}function ci(e,t){const n=e.toGeoJSON("wgs84"===t.coordinates?t.tileIndex:fi);return t.layerProperty&&(n.properties[t.layerProperty]=t.layerName),n}function di(e,t){const n=e.toBinaryCoordinates("wgs84"===t.coordinates?t.tileIndex:pi);return t.layerProperty&&n.properties&&(n.properties[t.layerProperty]=t.layerName),n}function fi(e,t){const{extent:n}=t;for(let t=0;t<e.length;t++){const r=e[t];r[0]/=n,r[1]/=n}}function pi(e,t){const{extent:n}=t;for(let t=0,r=e.length;t<r;++t)e[t]/=n}const hi={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.1.6",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{coordinates:"local",layerProperty:"layerName",layers:null,tileIndex:null}}};function mi(e,t){const n=null==t?void 0:t.globalFeatureId;return void 0!==n?function(e,t){const n=vi(e);for(const e of n){let n=0,r=e.featureIds.value[0];for(let a=0;a<e.featureIds.value.length;a++){const o=e.featureIds.value[a];if(o!==r){if(t===e.globalFeatureIds.value[n])return Ai(e,n,a);n=a,r=o}}if(t===e.globalFeatureIds.value[n])return Ai(e,n,e.featureIds.value.length)}throw new Error("featureId:".concat(t," not found"))}(e,n):gi(e,null==t?void 0:t.type)}function gi(e,t){return function(e){const t=[];for(const n of e){if(0===n.featureIds.value.length)continue;let e=0,r=n.featureIds.value[0];for(let a=0;a<n.featureIds.value.length;a++){const o=n.featureIds.value[a];o!==r&&(t.push(Ai(n,e,a)),e=a,r=o)}t.push(Ai(n,e,n.featureIds.value.length))}return t}(vi(e,t))}function yi(e,t,n){switch(e.type){case"Point":return function(e,t,n){const{positions:r}=e,a=bi(r,t,n);if(a.length>1)return{type:"MultiPoint",coordinates:a};return{type:"Point",coordinates:a[0]}}(e,t,n);case"LineString":return function(e,t=-1/0,n=1/0){const{positions:r}=e,a=e.pathIndices.value.filter(e=>e>=t&&e<=n);if(!(a.length>2)){return{type:"LineString",coordinates:bi(r,a[0],a[1])}}const o=[];for(let e=0;e<a.length-1;e++){const t=bi(r,a[e],a[e+1]);o.push(t)}return{type:"MultiLineString",coordinates:o}}(e,t,n);case"Polygon":return function e(t,n=-1/0,r=1/0){const{positions:a}=t,o=t.polygonIndices.value.filter(e=>e>=n&&e<=r),i=t.primitivePolygonIndices.value.filter(e=>e>=n&&e<=r);if(!(o.length>2)){const e=[];for(let t=0;t<i.length-1;t++){const n=i[t],r=i[t+1],o=bi(a,n,r);e.push(o)}return{type:"Polygon",coordinates:e}}const s=[];for(let n=0;n<o.length-1;n++){const r=o[n],a=o[n+1],i=e(t,r,a).coordinates;s.push(i)}return{type:"MultiPolygon",coordinates:s}}(e,t,n);default:const r=e;throw new Error("Unsupported geometry type: ".concat(null==r?void 0:r.type))}}function vi(e,t){if(!Boolean(e.points||e.lines||e.polygons))return e.type=t||function(e){if(e.pathIndices)return"LineString";if(e.polygonIndices)return"Polygon";return"Point"}(e),[e];const n=[];return e.points&&(e.points.type="Point",n.push(e.points)),e.lines&&(e.lines.type="LineString",n.push(e.lines)),e.polygons&&(e.polygons.type="Polygon",n.push(e.polygons)),n}function Ai(e,t,n){return{type:"Feature",geometry:yi(e,t,n),properties:function(e,t=0,n){const r=Object.assign({},e.properties[e.featureIds.value[t]]);for(const n in e.numericProps)r[n]=e.numericProps[n].value[t];return r}(e,t),...function(e,t=0,n){return e.fields&&e.fields[e.featureIds.value[t]]}(e,t)}}function bi(e,t,n){t=t||0,n=n||e.value.length/e.size;const r=[];for(let a=t;a<n;a++){const t=Array();for(let n=a*e.size;n<(a+1)*e.size;n++)t.push(Number(e.value[n]));r.push(t)}return r}var _i=n(823);const Ei={Point:xi,MultiPoint:function(e,t,n){return Mi(e,t,n)},LineString:wi,MultiLineString:function(e,t,n){return e.map(e=>wi(e,t,n))},Polygon:Oi,MultiPolygon:function(e,t,n){return e.map(e=>Oi(e,t,n))}};function xi([e,t],[n,r],a){const o=mt(n[0],r[0],e),i=mt(n[1],r[1],t);return a.unprojectFlat([o,i])}function Mi(e,t,n){return e.map(e=>xi(e,t,n))}function wi(e,t,n){return Mi(e,t,n)}function Oi(e,t,n){return e.map(e=>Mi(e,t,n))}const Si=["points","lines","polygons"];function Ti(e,t,n,r){const a=e.featureIds.value;if(!a.length)return-1;let o=0,i=a[a.length-1]+1;if(r){const t=function(e,t){if(!e.__layers){const t={},{properties:n}=e;for(let e=0;e<n.length;e++){const{layerName:r}=n[e];r&&(t[r]?t[r][1]=e:t[r]=[e,e])}e.__layers=t}return e.__layers[t]}(e,r);if(!t)return-1;o=t[0],i=t[1]+1}let s=-1;if(t in e.numericProps){const r=e.numericProps[t].value.findIndex((e,t)=>e===n&&a[t]>=o&&a[t]<i);return r>=0?e.globalFeatureIds.value[r]:-1}return s=t?Ci(e.properties,e=>e[t]===n,o,i):Ci(e.fields,e=>e.id===n,o,i),s>=0?function(e,t){if(!e.__ids){const t=[],n=e.featureIds.value,r=e.globalFeatureIds.value;for(let e=0;e<n.length;e++)t[n[e]]=r[e];e.__ids=t}return e.__ids[t]}(e,s):-1}function Ci(e,t,n,r){for(let a=n;a<r;a++)if(t(e[a],a))return a;return-1}const Li={uniqueIdProperty:{type:"string",value:""},highlightedFeatureId:null,loaders:[hi],binary:!0};class Pi extends Rt{initializeState(){super.initializeState(),this.setState({data:null,tileJSON:null})}get isLoaded(){return this.state.data&&this.state.tileset&&super.isLoaded}updateState({props:e,oldProps:t,context:n,changeFlags:r}){r.dataChanged&&this._updateTileData(),this.state.data&&(super.updateState({props:e,oldProps:t,context:n,changeFlags:r}),this._setWGS84PropertyForTiles());const{highlightColor:a}=e;a!==t.highlightColor&&Array.isArray(a)&&this.setState({highlightColor:a})}async _updateTileData(){let{data:e}=this.props,t=null;if("string"!=typeof e||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e))e.tilejson&&(t=e);else{const{onDataLoad:n,fetch:r}=this.props;this.setState({data:null,tileJSON:null});try{t=await r(e,{propName:"data",layer:this,loaders:[]})}catch(t){this.raiseError(t,"loading TileJSON"),e=null}n&&n(t)}t&&(e=t.tiles),this.setState({data:e,tileJSON:t})}_getTilesetOptions(e){const t=super._getTilesetOptions(e),{tileJSON:n}=this.state;return n&&(Number.isFinite(n.minzoom)&&n.minzoom>e.minZoom&&(t.minZoom=n.minzoom),Number.isFinite(n.maxzoom)&&(!Number.isFinite(e.maxZoom)||n.maxzoom<e.maxZoom)&&(t.maxZoom=n.maxzoom)),t}renderLayers(){return this.state.data?super.renderLayers():null}getTileData(e){var t;const n=rt(this.state.data,e);if(!n)return Promise.reject("Invalid URL");let r=this.getLoadOptions();const{binary:a,fetch:o}=this.props,{signal:i,x:s,y:l,z:u}=e;return r={...r,mimeType:"application/x-protobuf",mvt:{...null===(t=r)||void 0===t?void 0:t.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:{x:s,y:l,z:u}},gis:a?{format:"binary"}:{}},o(n,{propName:"data",layer:this,loadOptions:r,signal:i})}renderSubLayers(e){const{tile:t}=e,n=Math.pow(2,t.z),r=512/n,a=-r,o=512*t.x/n,i=512*(1-t.y/n),s=(new Ot).scale([r,a,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=s,e.coordinateOrigin=[o,i,0],e.coordinateSystem=Wt.a.CARTESIAN,e.extensions=[...e.extensions||[],new _i.a]);const l=super.renderSubLayers(e);return!this.props.binary||l instanceof _.a||E.a.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),l}_updateAutoHighlight(e){const{uniqueIdProperty:t}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:r}=this.state,a=e.object;let o,i;a&&(o=Ri(a,t),i=Di(a));let{highlightColor:s}=this.props;"function"==typeof s&&(s=s(e)),n===o&&r===i||this.setState({highlightColor:s,hoveredFeatureId:o,hoveredFeatureLayerName:i})}getPickingInfo(e){const t=super.getPickingInfo(e),n=this.context.viewport.resolution;if(this.props.binary&&-1!==t.index){const{data:n}=e.sourceLayer.props;t.object=mi(n,{globalFeatureId:t.index})}return t.object&&!n&&(t.object=Ii(t.object,t.tile.bbox,this.context.viewport)),t}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t,hoveredFeatureLayerName:n}=this.state,{uniqueIdProperty:r,highlightedFeatureId:a,binary:o}=this.props,i=e.content,s=ki(a);if(!(ki(t)||s))return-1;const l=s?a:t;return Array.isArray(i)?i.findIndex(e=>{const t=Ri(e,r)===l,a=s||Di(e)===n;return t&&a}):i&&o?function(e,t,n,r){for(const a of Si){const o=e[a]&&Ti(e[a],t,n,r);if(o>=0)return o}return-1}(i,r,l,s?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context,r=n.width,a=n.height,o=n.x,i=n.y,s=[this.id];return t.pickObjects({x:o,y:i,width:r,height:a,layerIds:s,maxObjects:e})}getRenderedFeatures(e=null){const t=this._pickObjects(e),n=new Set,r=[];for(const e of t){const t=Ri(e.object,this.props.uniqueIdProperty);void 0===t?r.push(e.object):n.has(t)||(n.add(t),r.push(e.object))}return r}_setWGS84PropertyForTiles(){const{tileset:e}=this.state;e.selectedTiles.forEach(e=>{e.hasOwnProperty("dataInWGS84")||Object.defineProperty(e,"dataInWGS84",{get:()=>{if(!e.content)return null;if(this.props.binary&&Array.isArray(e.content)&&!e.content.length)return[];if(void 0===e._contentWGS84){const t=this.props.binary?mi(e.content):e.content;e._contentWGS84=t.map(t=>Ii(t,e.bbox,this.context.viewport))}return e._contentWGS84}})})}}function Ri(e,t){return t?e.properties[t]:"id"in e?e.id:void 0}function Di(e){var t;return(null===(t=e.properties)||void 0===t?void 0:t.layerName)||null}function ki(e){return null!=e&&""!==e}function Ii(e,t,n){const r={...e,geometry:{type:e.geometry.type}};return Object.defineProperty(r.geometry,"coordinates",{get:()=>function(e,t,n){const r=[n.projectFlat([t.west,t.north]),n.projectFlat([t.east,t.south])];return{...e,coordinates:Ei[e.type](e.coordinates,r,n)}}(e.geometry,t,n).coordinates}),r}Pi.layerName="MVTLayer",Pi.defaultProps=Li},function(e,t,n){"use strict";n.r(t),n.d(t,"ScreenGridLayer",(function(){return we})),n.d(t,"CPUGridLayer",(function(){return ke})),n.d(t,"HexagonLayer",(function(){return Ne})),n.d(t,"ContourLayer",(function(){return Bt})),n.d(t,"GridLayer",(function(){return Xt})),n.d(t,"GPUGridLayer",(function(){return Wt})),n.d(t,"AGGREGATION_OPERATION",(function(){return p})),n.d(t,"HeatmapLayer",(function(){return an})),n.d(t,"_GPUGridAggregator",(function(){return k})),n.d(t,"_CPUAggregator",(function(){return Pe})),n.d(t,"_AggregationLayer",(function(){return K})),n.d(t,"_BinSorter",(function(){return pe}));var r=n(50),a=n(465),o=n(1203),i=n(16),s=n(639),l=n(461),u=n(1911),c=n(1913),d=n(422),f=n(826);const p={SUM:1,MEAN:2,MIN:3,MAX:4};function h(e,t){return e+t}function m(e,t){return t>e?t:e}function g(e,t){return t<e?t:e}function y(e,t,n){const r=p[e]||p.SUM;switch(t=function(e,t={}){if(Number.isFinite(e))return e;return n=>(t.index=n.index,e(n.source,t))}(t,n),r){case p.MIN:return e=>function(e,t){if(Number.isFinite(t))return e.length?t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(g,1/0):null}(e,t);case p.SUM:return e=>function(e,t){if(Number.isFinite(t))return e.length?e.length*t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(h,0):null}(e,t);case p.MEAN:return e=>function(e,t){if(Number.isFinite(t))return e.length?t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(h,0)/n.length:null}(e,t);case p.MAX:return e=>function(e,t){if(Number.isFinite(t))return e.length?t:null;const n=e.map(t).filter(Number.isFinite);return n.length?n.reduce(m,-1/0):null}(e,t);default:return null}}function v(e,t={}){return n=>(t.indices=n.map(e=>e.index),e(n.map(e=>e.source),t))}const A={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},b=3402823466e29,_=[32775,32774],E=[32776,32774],x=[32776,32775],M={[p.SUM]:32774,[p.MEAN]:32774,[p.MIN]:_,[p.MAX]:E},w={size:1,operation:p.SUM,needMin:!1,needMax:!1,combineMaxMin:!1};var O=n(250),S=n(167);const T={10240:9728,10241:9728};function C(e,t={}){const{width:n=1,height:r=1,data:a=null,unpackFlipY:o=!0,parameters:s=T}=t;return new O.a(e,{data:a,format:Object(i.j)(e)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:s,dataFormat:6408,width:n,height:r,unpackFlipY:o})}function L(e,t){const{id:n,width:r=1,height:a=1,texture:o}=t;return new S.a(e,{id:n,width:r,height:a,attachments:{36064:o}})}const P=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],R={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},D=[a.a.WEBGL2,a.a.COLOR_ATTACHMENT_RGBA32F,a.a.BLEND_EQUATION_MINMAX,a.a.FLOAT_BLEND,a.a.TEXTURE_FLOAT];class k{static getAggregationData({aggregationData:e,maxData:t,minData:n,maxMinData:r,pixelIndex:a}){const o=4*a,i={};return e&&(i.cellCount=e[o+3],i.cellWeight=e[o]),r?(i.maxCellWieght=r[0],i.minCellWeight=r[3]):(t&&(i.maxCellWieght=t[0],i.totalCount=t[3]),n&&(i.minCellWeight=n[0],i.totalCount=t[3])),i}static getCellData({countsData:e,size:t=1}){const n=e.length/4,r=new Float32Array(n*t),a=new Uint32Array(n);for(let o=0;o<n;o++){for(let n=0;n<t;n++)r[o*t+n]=e[4*o+n];a[o]=e[4*o+3]}return{cellCounts:a,cellWeights:r}}static isSupported(e){return Object(o.c)(e,D)}constructor(e,t={}){this.id=t.id||"gpu-grid-aggregator",this.gl=e,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=Object(i.j)(e)&&Object(o.c)(this.gl,a.a.BLEND_EQUATION_MINMAX,a.a.COLOR_ATTACHMENT_RGBA32F,a.a.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}delete(){const{gridAggregationModel:e,allAggregationModel:t,meanTransform:n}=this,{textures:r,framebuffers:a,maxMinFramebuffers:o,minFramebuffers:i,maxFramebuffers:s,meanTextures:l,resources:u}=this.state;null==e||e.delete(),null==t||t.delete(),null==n||n.delete(),function(e){(e=Array.isArray(e)?e:[e]).forEach(e=>{for(const t in e)e[t].delete()})}([a,r,o,i,s,l,u])}run(e={}){this.setState({results:{}});const t=this._normalizeAggregationParams(e);return this._hasGPUSupport||r.a.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(t)}getData(e){const t={},n=this.state.results;n[e].aggregationData||(n[e].aggregationData=n[e].aggregationBuffer.getData()),t.aggregationData=n[e].aggregationData;for(const r in R){const a=R[r];(n[e][r]||n[e][a])&&(n[e][r]=n[e][r]||n[e][a].getData(),t[r]=n[e][r])}return t}updateShaders(e={}){this.setState({shaderOptions:e,modelDirty:!0})}_normalizeAggregationParams(e){const t={...A,...e},{weights:n}=t;return n&&(t.weights=function(e){const t={};for(const n in e)t[n]={...w,...e[n]};return t}(n)),t}setState(e){Object.assign(this.state,e)}_getAggregateData(e){const t={},{textures:n,framebuffers:r,maxMinFramebuffers:a,minFramebuffers:o,maxFramebuffers:i,resources:l}=this.state,{weights:u}=e;for(const e in u){t[e]={};const{needMin:c,needMax:d,combineMaxMin:f}=u[e];t[e].aggregationTexture=n[e],t[e].aggregationBuffer=Object(s.d)(r[e],{target:u[e].aggregationBuffer,sourceType:5126}),c&&d&&f?(t[e].maxMinBuffer=Object(s.d)(a[e],{target:u[e].maxMinBuffer,sourceType:5126}),t[e].maxMinTexture=l["".concat(e,"-maxMinTexture")]):(c&&(t[e].minBuffer=Object(s.d)(o[e],{target:u[e].minBuffer,sourceType:5126}),t[e].minTexture=l["".concat(e,"-minTexture")]),d&&(t[e].maxBuffer=Object(s.d)(i[e],{target:u[e].maxBuffer,sourceType:5126}),t[e].maxTexture=l["".concat(e,"-maxTexture")]))}return this._trackGPUResultBuffers(t,u),t}_renderAggregateData(e){const{cellSize:t,projectPoints:n,attributes:r,moduleSettings:a,numCol:o,numRow:i,weights:s,translation:l,scaling:u}=e,{maxMinFramebuffers:c,minFramebuffers:d,maxFramebuffers:f}=this.state,p=[o,i],h={blend:!0,depthTest:!1,blendFunc:[1,1]},m={cellSize:t,gridSize:p,projectPoints:n,translation:l,scaling:u};for(const e in s){const{needMin:t,needMax:n}=s[e],o=t&&n&&s[e].combineMaxMin;this._renderToWeightsTexture({id:e,parameters:h,moduleSettings:a,uniforms:m,gridSize:p,attributes:r,weights:s}),o?this._renderToMaxMinTexture({id:e,parameters:{...h,blendEquation:x},gridSize:p,minOrMaxFb:c[e],clearParams:{clearColor:[0,0,0,b]},combineMaxMin:o}):(t&&this._renderToMaxMinTexture({id:e,parameters:{...h,blendEquation:_},gridSize:p,minOrMaxFb:d[e],clearParams:{clearColor:[b,b,b,0]},combineMaxMin:o}),n&&this._renderToMaxMinTexture({id:e,parameters:{...h,blendEquation:E},gridSize:p,minOrMaxFb:f[e],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:o}))}}_renderToMaxMinTexture(e){const{id:t,parameters:n,gridSize:r,minOrMaxFb:a,combineMaxMin:o,clearParams:s={}}=e,{framebuffers:l}=this.state,{gl:u,allAggregationModel:c}=this;Object(i.o)(u,{...s,framebuffer:a,viewport:[0,0,r[0],r[1]]},()=>{u.clear(16384),c.draw({parameters:n,uniforms:{uSampler:l[t].texture,gridSize:r,combineMaxMin:o}})})}_renderToWeightsTexture(e){const{id:t,parameters:n,moduleSettings:r,uniforms:a,gridSize:o,weights:s}=e,{framebuffers:l,equations:c,weightAttributes:d}=this.state,{gl:f,gridAggregationModel:h}=this,{operation:m}=s[t],g=m===p.MIN?[b,b,b,0]:[0,0,0,0];if(Object(i.o)(f,{framebuffer:l[t],viewport:[0,0,o[0],o[1]],clearColor:g},()=>{f.clear(16384);const e={weights:d[t]};h.draw({parameters:{...n,blendEquation:c[t]},moduleSettings:r,uniforms:a,attributes:e})}),m===p.MEAN){const{meanTextures:e,textures:n}=this.state,r={_sourceTextures:{aggregationValues:e[t]},_targetTexture:n[t],elementCount:n[t].width*n[t].height};this.meanTransform?this.meanTransform.update(r):this.meanTransform=function(e,t){return new u.a(e,{vs:"#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n bool isCellValid = bool(aggregationValues.w > 0.);\n meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n meanValues.w = aggregationValues.w;\n gl_PointSize = 1.0;\n}\n",_targetTextureVarying:"meanValues",...t})}(f,r),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),l[t].attach({36064:n[t]})}}_runAggregation(e){this._updateModels(e),this._setupFramebuffers(e),this._renderAggregateData(e);const t=this._getAggregateData(e);return this.setState({results:t}),t}_setupFramebuffers(e){const{textures:t,framebuffers:n,maxMinFramebuffers:r,minFramebuffers:a,maxFramebuffers:o,meanTextures:i,equations:s}=this.state,{weights:l}=e,{numCol:u,numRow:c}=e,d={width:u,height:c};for(const e in l){const{needMin:f,needMax:h,combineMaxMin:m,operation:g}=l[e];t[e]=l[e].aggregationTexture||t[e]||C(this.gl,{id:"".concat(e,"-texture"),width:u,height:c}),t[e].resize(d);let y=t[e];g===p.MEAN&&(i[e]=i[e]||C(this.gl,{id:"".concat(e,"-mean-texture"),width:u,height:c}),i[e].resize(d),y=i[e]),n[e]?n[e].attach({36064:y}):n[e]=L(this.gl,{id:"".concat(e,"-fb"),width:u,height:c,texture:y}),n[e].resize(d),s[e]=M[g]||M.SUM,(f||h)&&(f&&h&&m?r[e]||(y=l[e].maxMinTexture||this._getMinMaxTexture("".concat(e,"-maxMinTexture")),r[e]=L(this.gl,{id:"".concat(e,"-maxMinFb"),texture:y})):(f&&(a[e]||(y=l[e].minTexture||this._getMinMaxTexture("".concat(e,"-minTexture")),a[e]=L(this.gl,{id:"".concat(e,"-minFb"),texture:y}))),h&&(o[e]||(y=l[e].maxTexture||this._getMinMaxTexture("".concat(e,"-maxTexture")),o[e]=L(this.gl,{id:"".concat(e,"-maxFb"),texture:y})))))}}_getMinMaxTexture(e){const{resources:t}=this.state;return t[e]||(t[e]=C(this.gl,{id:"resourceName"})),t[e]}_setupModels({numCol:e=0,numRow:t=0}={}){var n;const{gl:r}=this,{shaderOptions:a}=this.state;if(null===(n=this.gridAggregationModel)||void 0===n||n.delete(),this.gridAggregationModel=function(e,t){const n=Object(d.a)({vs:"#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute vec3 weights;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform bool projectPoints;\nuniform vec2 translation;\nuniform vec3 scaling;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n vec4 result;\n pos.xy = pos.xy/pos.w;\n result = pos + vec4(translation, 0., 0.);\n result.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;\n return result.xy;\n}\n\nvoid main(void) {\n\n vWeights = weights;\n\n vec4 windowPos = vec4(positions, 1.);\n if (projectPoints) {\n windowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));\n }\n\n vec2 pos = project_to_pixel(windowPos);\n\n vec2 pixelXY64[2];\n pixelXY64[0] = vec2(pos.x, 0.);\n pixelXY64[1] = vec2(pos.y, 0.);\n vec2 gridXY64[2];\n gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n float x = floor(gridXY64[0].x);\n float y = floor(gridXY64[1].x);\n pos = vec2(x, y);\n pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n vec2 offset = 1.0 / gridSize;\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n",fs:"#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n gl_FragColor = vec4(vWeights, 1.0);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[c.b,f.a]},t);return new l.a(e,{id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0,...n})}(r,a),!this.allAggregationModel){const n=e*t;this.allAggregationModel=function(e,t){return new l.a(e,{id:"All-Aggregation-Model",vs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n vec2 pos = vec2(-1.0, -1.0);\n vec2 offset = 1.0 / vec2(gridSize);\n pos = pos + offset;\n\n gl_Position = vec4(pos, 0.0, 1.0);\n\n int yIndex = gl_InstanceID / gridSize[0];\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n gl_PointSize = 1.0;\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n if (textureColor.a == 0.) {\n discard;\n }\n fragColor.rgb = textureColor.rgb;\n fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",modules:[c.b],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:t,attributes:{position:[0,0]}})}(r,n)}}_setupWeightAttributes(e){const{weightAttributes:t}=this.state,{weights:n}=e;for(const r in n)t[r]=e.attributes[r]}_trackGPUResultBuffers(e,t){const{resources:n}=this.state;for(const r in e)if(e[r])for(const a of P)if(e[r][a]&&t[r][a]!==e[r][a]){const t="gpu-result-".concat(r,"-").concat(a);n[t]&&n[t].delete(),n[t]=e[r][a]}}_updateModels(e){const{vertexCount:t,attributes:n,numCol:r,numRow:a}=e,{modelDirty:o}=this.state;o&&(this._setupModels(e),this.setState({modelDirty:!1})),this._setupWeightAttributes(e),this.gridAggregationModel.setVertexCount(t),this.gridAggregationModel.setAttributes(n),this.allAggregationModel.setInstanceCount(r*a)}}var I=n(144),F=n(435),j=n(825);const B=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function N(e,t=!1,n=Float32Array){let r;if(Number.isFinite(e[0]))r=new n(e);else{r=new n(4*e.length);let t=0;for(let n=0;n<e.length;n++){const a=e[n];r[t++]=a[0],r[t++]=a[1],r[t++]=a[2],r[t++]=Number.isFinite(a[3])?a[3]:255}}if(t)for(let e=0;e<r.length;e++)r[e]/=255;return r}const z=[0,0,0,0],U=[0,255,0,255],H=["minColor","maxColor","colorRange","colorDomain"],V={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:B};class G extends F.a{static isSupported(e){return Object(o.c)(e,[a.a.TEXTURE_FLOAT])}getShaders(){return{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\nuniform sampler2D maxTexture;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= domain.x && value <= domain.y) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n outColor = outColor / 255.;\n return outColor;\n}\n\nvoid main(void) {\n vSampleCount = instanceCounts.a;\n\n float weight = instanceCounts.r;\n float maxWeight = texture2D(maxTexture, vec2(0.5)).r;\n\n float step = weight / maxWeight;\n vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n vec2 domain = colorDomain;\n float domainMaxValid = float(colorDomain.y != 0.);\n domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n float rangeMinMax = float(shouldUseMinMax);\n vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n vColor = vec4(color.rgb, color.a * opacity);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n if (vSampleCount <= 0.0) {\n discard;\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[j.a]}}initializeState(){const{gl:e}=this.context;this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(e)})}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({oldProps:e,props:t,changeFlags:n});const r=this.getAttributeManager();t.numInstances!==e.numInstances?r.invalidateAll():e.cellSizePixels!==t.cellSizePixels&&r.invalidate("instancePositions"),this._updateUniforms(e,t,n)}draw({uniforms:e}){const{parameters:t,maxTexture:n}=this.props,r=this.props.minColor||z,a=this.props.maxColor||U,o=this.props.colorDomain||[1,0],{model:i}=this.state;i.setUniforms(e).setUniforms({minColor:r,maxColor:a,maxTexture:n,colorDomain:o}).draw({parameters:{depthTest:!1,depthMask:!1,...t}})}calculateInstancePositions(e,{numInstances:t}){const{width:n,height:r}=this.context.viewport,{cellSizePixels:a}=this.props,o=Math.ceil(n/a),{value:i,size:s}=e;for(let e=0;e<t;e++){const t=e%o,l=Math.floor(e/o);i[e*s+0]=t*a/n*2-1,i[e*s+1]=1-l*a/r*2,i[e*s+2]=0}}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new I.a({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0})}_shouldUseMinMax(){const{minColor:e,maxColor:t,colorDomain:n,colorRange:a}=this.props;return e||t?(r.a.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!n&&!a}_updateUniforms(e,t,n){const{model:r}=this.state;if(H.some(n=>e[n]!==t[n])&&r.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),e.colorRange!==t.colorRange&&r.setUniforms({colorRange:N(t.colorRange)}),e.cellMarginPixels!==t.cellMarginPixels||e.cellSizePixels!==t.cellSizePixels||n.viewportChanged){const{width:e,height:t}=this.context.viewport,{cellSizePixels:n,cellMarginPixels:a}=this.props,o=n>a?a:0,i=new Float32Array([(n-o)/e*2,-(n-o)/t*2,1]);r.setUniforms({cellScale:i})}}}G.layerName="ScreenGridCellLayer",G.defaultProps=V;var Y=n(621),W=n(337),q=n(436);function X(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}class K extends Y.a{initializeState(e){super.initializeState(),this.setState({ignoreProps:X(this.constructor._propTypes,e.data.props),dimensions:e})}updateState(e){super.updateState(e);const{changeFlags:t}=e;if(t.extensionsChanged){const e=this.getShaders({});e&&e.defines&&(e.defines.NON_INSTANCED_MODEL=1),this.updateShaders(e)}this._updateAttributes(e.props)}updateAttributes(e){this.setState({changedAttributes:e})}getAttributes(){return this.getAttributeManager().getShaderAttributes()}getModuleSettings(){const{viewport:e,mousePosition:t,gl:n}=this.context;return Object.assign(Object.create(this.props),{viewport:e,mousePosition:t,pickingActive:0,devicePixelRatio:Object(i.e)(n)})}updateShaders(e){}isAggregationDirty(e,t={}){const{props:n,oldProps:r,changeFlags:a}=e,{compareAll:o=!1,dimension:i}=t,{ignoreProps:s}=this.state,{props:l,accessors:u=[]}=i,{updateTriggersChanged:c}=a;if(a.dataChanged)return!0;if(c){if(c.all)return!0;for(const e of u)if(c[e])return!0}if(o)return!!a.extensionsChanged||Object(W.a)({oldProps:r,newProps:n,ignoreProps:s,propTypes:this.constructor._propTypes});for(const e of l)if(n[e]!==r[e])return!0;return!1}isAttributeChanged(e){const{changedAttributes:t}=this.state;return e?t&&void 0!==t[e]:!function(e){let t=!0;for(const n in e){t=!1;break}return t}(t)}_getAttributeManager(){return new q.a(this.context.gl,{id:this.props.id,stats:this.context.stats})}}K.layerName="AggregationLayer";var Z=n(87);function J(e,t,n){const r=n;return r.domain=()=>e,r.range=()=>t,r}function Q(e,t){return J(e,t,n=>function(e,t,n){const a=e[1]-e[0];if(a<=0)return r.a.warn("quantizeScale: invalid domain, returning range[0]")(),t[0];const o=a/t.length,i=Math.floor((n-e[0])/o),s=Math.max(Math.min(i,t.length-1),0);return t[s]}(e,t,n))}function $(e,t){return J(e,t,n=>function(e,t,n){return(n-e[0])/(e[1]-e[0])*(t[1]-t[0])+t[0]}(e,t,n))}function ee(e,t){const n=e.sort(te);let r=0;const a=Math.max(1,t.length),o=new Array(a-1);for(;++r<a;)o[r-1]=ne(n,r/a);const i=e=>function(e,t,n){return t[function(e,t){let n=0,r=e.length;for(;n<r;){const a=n+r>>>1;te(e[a],t)>0?r=a:n=a+1}return n}(e,n)]}(o,t,e);return i.thresholds=()=>o,J(e,t,i)}function te(e,t){return e-t}function ne(e,t){const n=e.length;if(t<=0||n<2)return e[0];if(t>=1)return e[n-1];const r=(n-1)*t,a=Math.floor(r),o=e[a];return o+(e[a+1]-o)*(r-a)}function re(e,t){const n=new Map,r=[];for(const t of e){const e="".concat(t);n.has(e)||n.set(e,r.push(t))}return J(e,t,e=>function(e,t,n,r){const a="".concat(r);let o=t.get(a);return void 0===o&&(o=e.push(r),t.set(a,o)),n[(o-1)%n.length]}(r,n,t,e))}function ae(e){return null!=e}function oe(e,t){return("function"==typeof t?e.map(t):e).filter(ae)}function ie(e,t){return oe(e,t)}function se(e,t){return function(e){const t=[];return e.forEach(e=>{!t.includes(e)&&ae(e)&&t.push(e)}),t}(oe(e,t))}const le=e=>e.length,ue=e=>e.points,ce=e=>e.index,de=(e,t)=>e<t?-1:e>t?1:e>=t?0:NaN,fe={getValue:le,getPoints:ue,getIndex:ce,filterData:null};class pe{constructor(e=[],t=fe){this.aggregatedBins=this.getAggregatedBins(e,t),this._updateMinMaxValues(),this.binMap=this.getBinMap()}getAggregatedBins(e,t){const{getValue:n=le,getPoints:r=ue,getIndex:a=ce,filterData:o}=t,i="function"==typeof o,s=e.length,l=[];let u=0;for(let t=0;t<s;t++){const s=e[t],c=r(s),d=a(s),f=i?c.filter(o):c;s.filteredPoints=i?f:null;const p=f.length?n(f):null;null!=p&&(l[u]={i:Number.isFinite(d)?d:t,value:p,counts:f.length},u++)}return l}_percentileToIndex(e){const t=this.sortedBins.length;if(t<2)return[0,0];const[n,r]=e.map(e=>function(e,t,n){return Math.max(t,Math.min(n,e))}(e,0,100));return[Math.ceil(n/100*(t-1)),Math.floor(r/100*(t-1))]}getBinMap(){const e={};for(const t of this.aggregatedBins)e[t.i]=t;return e}_updateMinMaxValues(){let e=0,t=0,n=3402823466e29,r=0;for(const a of this.aggregatedBins)e=e>a.counts?e:a.counts,t=t>a.value?t:a.value,n=n<a.value?n:a.value,r+=a.counts;this.maxCount=e,this.maxValue=t,this.minValue=n,this.totalCount=r}getValueRange(e){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((e,t)=>de(e.value,t.value))),!this.sortedBins.length)return[];let t=0,n=this.sortedBins.length-1;if(Array.isArray(e)){const r=this._percentileToIndex(e);t=r[0],n=r[1]}return[this.sortedBins[t].value,this.sortedBins[n].value]}getValueDomainByScale(e,[t=0,n=100]=[]){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort((e,t)=>de(e.value,t.value))),!this.sortedBins.length)return[];const r=this._percentileToIndex([t,n]);return this._getScaleDomain(e,r)}_getScaleDomain(e,[t,n]){const r=this.sortedBins;switch(e){case"quantize":case"linear":return[r[t].value,r[n].value];case"quantile":return ie(r.slice(t,n+1),e=>e.value);case"ordinal":return se(r,e=>e.value);default:return[r[t].value,r[n].value]}}}var he=n(122),me=n(34);function ge(e){return Number.isFinite(e)?e:0}function ye(e,t){const n=e.positions.value;let r,a,o=1/0,i=-1/0,s=1/0,l=-1/0;for(let e=0;e<t;e++)a=n[3*e],r=n[3*e+1],o=r<o?r:o,i=r>i?r:i,s=a<s?a:s,l=a>l?a:l;return{xMin:ge(s),xMax:ge(l),yMin:ge(o),yMax:ge(i)}}function ve(e,t){const n=e<0?-1:1;let r=n<0?Math.abs(e)+t:Math.abs(e);return r=Math.floor(r/t)*t,r*n}function Ae(e,t,n=!0){if(!n)return{xOffset:t,yOffset:t};const{yMin:r,yMax:a}=e;return function(e,t){const n=(i=e,i/6378e3*(180/Math.PI)),r=(a=t,o=e,o/6378e3*(180/Math.PI)/Math.cos(a*Math.PI/180));var a,o;var i;return{yOffset:n,xOffset:r}}(t,(r+a)/2)}function be(e,t,n,a){const o=Ae(e,t,a!==me.a.CARTESIAN),i=function(e,t,n,a){const{width:o,height:i}=a,s=n===me.a.CARTESIAN?[-o/2,-i/2]:[-180,-90];r.a.assert(n===me.a.CARTESIAN||n===me.a.LNGLAT||n===me.a.DEFAULT);const{xMin:l,yMin:u}=e;return[-1*(ve(l-s[0],t.xOffset)+s[0]),-1*(ve(u-s[1],t.yOffset)+s[1])]}(e,o,a,n),{xMin:s,yMin:l,xMax:u,yMax:c}=e,d=u-s+o.xOffset,f=c-l+o.yOffset;return{gridOffset:o,translation:i,width:d,height:f,numCol:Math.ceil(d/o.xOffset),numRow:Math.ceil(f/o.yOffset)}}function _e(e,t){const n=function(e,t){const{data:n=[],cellSize:r}=e,{attributes:a,viewport:o,projectPoints:i,numInstances:s}=t,l=a.positions.value,{size:u}=a.positions.getAccessor(),c=t.boundingBox||function(e,t){const n=e.value,{size:r}=e.getAccessor();let a,o,i=1/0,s=-1/0,l=1/0,u=-1/0;for(let e=0;e<t;e++)o=n[e*r],a=n[e*r+1],Number.isFinite(o)&&Number.isFinite(a)&&(i=a<i?a:i,s=a>s?a:s,l=o<l?o:l,u=o>u?o:u);return{xMin:l,xMax:u,yMin:i,yMax:s}}(a.positions,s),d=t.posOffset||[180,90],f=t.gridOffset||Ae(c,r);if(f.xOffset<=0||f.yOffset<=0)return{gridHash:{},gridOffset:f};const{width:p,height:h}=o,m=Math.ceil(p/f.xOffset),g=Math.ceil(h/f.yOffset),y={},{iterable:v,objectInfo:A}=Object(he.a)(n),b=new Array(3);for(const e of v){A.index++,b[0]=l[A.index*u],b[1]=l[A.index*u+1],b[2]=u>=3?l[A.index*u+2]:0;const[t,n]=i?o.project(b):b;if(Number.isFinite(t)&&Number.isFinite(n)){const r=Math.floor((n+d[1])/f.yOffset),a=Math.floor((t+d[0])/f.xOffset);if(!i||a>=0&&a<m&&r>=0&&r<g){const t="".concat(r,"-").concat(a);y[t]=y[t]||{count:0,points:[],lonIdx:a,latIdx:r},y[t].count+=1,y[t].points.push({source:e,index:A.index})}}}return{gridHash:y,gridOffset:f,offsets:[-1*d[0],-1*d[1]]}}(e,t),r=function({gridHash:e,gridOffset:t,offsets:n}){const r=new Array(Object.keys(e).length);let a=0;for(const o in e){const i=o.split("-"),s=parseInt(i[0],10),l=parseInt(i[1],10),u=a++;r[u]={index:u,position:[n[0]+t.xOffset*l,n[1]+t.yOffset*s],...e[o]}}return r}(n);return{gridHash:n.gridHash,gridOffset:n.gridOffset,data:r}}class Ee extends K{initializeState({dimensions:e}){const{gl:t}=this.context;super.initializeState(e),this.setState({layerData:{},gpuGridAggregator:new k(t,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:_e})}updateState(e){super.updateState(e),this.updateAggregationState(e);const{aggregationDataDirty:t,aggregationWeightsDirty:n,gpuAggregation:r}=this.state;if(this.getNumInstances()<=0)return;let a=!1;(t||r&&n)&&(this._updateAggregation(e),a=!0),r||!t&&!n||(this._updateWeightBins(),this._uploadAggregationResults(),a=!0),this.setState({aggregationDirty:a})}finalizeState(){var e;const{count:t}=this.state.weights;t&&t.aggregationBuffer&&t.aggregationBuffer.delete(),null===(e=this.state.gpuGridAggregator)||void 0===e||e.delete(),super.finalizeState()}updateShaders(e){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(e)}updateAggregationState(e){r.a.assert(!1)}allocateResources(e,t){if(this.state.numRow!==e||this.state.numCol!==t){const n=t*e*4*4,r=this.context.gl,{weights:a}=this.state;for(const e in a){const t=a[e];t.aggregationBuffer&&t.aggregationBuffer.delete(),t.aggregationBuffer=new Z.a(r,{byteLength:n,accessor:{size:4,type:5126,divisor:1}})}}}updateResults({aggregationData:e,maxMinData:t,maxData:n,minData:r}){const{count:a}=this.state.weights;a&&(a.aggregationData=e,a.maxMinData=t,a.maxData=n,a.minData=r)}_updateAggregation(e){const{cpuGridAggregator:t,gpuGridAggregator:n,gridOffset:r,posOffset:a,translation:o=[0,0],scaling:i=[0,0,0],boundingBox:s,projectPoints:l,gpuAggregation:u,numCol:c,numRow:d}=this.state,{props:f}=e,{viewport:p}=this.context,h=this.getAttributes(),m=this.getNumInstances();if(u){const{weights:e}=this.state;n.run({weights:e,cellSize:[r.xOffset,r.yOffset],numCol:c,numRow:d,translation:o,scaling:i,vertexCount:m,projectPoints:l,attributes:h,moduleSettings:this.getModuleSettings()})}else{const e=t(f,{gridOffset:r,projectPoints:l,attributes:h,viewport:p,posOffset:a,boundingBox:s});this.setState({layerData:e})}}_updateWeightBins(){const{getValue:e}=this.state,t=new pe(this.state.layerData.data||[],{getValue:e});this.setState({sortedBins:t})}_uploadAggregationResults(){const{numCol:e,numRow:t}=this.state,{data:n}=this.state.layerData,{aggregatedBins:r,minValue:a,maxValue:o,totalCount:i}=this.state.sortedBins,s=new Float32Array(e*t*4).fill(0);for(const t of r){const{lonIdx:r,latIdx:a}=n[t.i],{value:o,counts:i}=t,l=4*(r+a*e);s[l]=o,s[l+4-1]=i}const l=new Float32Array([o,0,0,a]),u=new Float32Array([o,0,0,i]),c=new Float32Array([a,0,0,i]);this.updateResults({aggregationData:s,maxMinData:l,maxData:u,minData:c})}}Ee.layerName="GridAggregationLayer";const xe={...G.defaultProps,getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"},Me={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class we extends Ee{initializeState(){const{gl:e}=this.context;if(!G.isSupported(e))return this.setState({supported:!1}),void r.a.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();super.initializeState({dimensions:Me,getCellSize:e=>e.cellSizePixels});const t={count:{size:1,operation:p.SUM,needMax:!0,maxTexture:C(e,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:t,subLayerData:{attributes:{}},maxTexture:t.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]});this.getAttributeManager().add({positions:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}shouldUpdateState({changeFlags:e}){return this.state.supported&&e.somethingChanged}updateState(e){super.updateState(e)}renderLayers(){if(!this.state.supported)return[];const{maxTexture:e,numRow:t,numCol:n,weights:r}=this.state,{updateTriggers:a}=this.props,{aggregationBuffer:o}=r.count;return new(this.getSubLayerClass("cells",G))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:a}),{data:{attributes:{instanceCounts:o}},maxTexture:e,numInstances:t*n})}finalizeState(){super.finalizeState();const{aggregationBuffer:e,maxBuffer:t,maxTexture:n}=this.state;null==e||e.delete(),null==t||t.delete(),null==n||n.delete()}getPickingInfo({info:e,mode:t}){const{index:n}=e;if(n>=0){const{gpuGridAggregator:t,gpuAggregation:r,weights:a}=this.state,o=r?t.getData("count"):a.count;e.object=k.getAggregationData({pixelIndex:n,...o})}return e}updateResults({aggregationData:e,maxData:t}){const{count:n}=this.state.weights;n.aggregationData=e,n.aggregationBuffer.setData({data:e}),n.maxData=t,n.maxTexture.setImageData({data:t})}updateAggregationState(e){const t=e.props.cellSizePixels,n=e.oldProps.cellSizePixels!==t,{viewportChanged:a}=e.changeFlags;let o=e.props.gpuAggregation;this.state.gpuAggregation!==e.props.gpuAggregation&&o&&!k.isSupported(this.context.gl)&&(r.a.warn("GPU Grid Aggregation not supported, falling back to CPU")(),o=!1);const i=o!==this.state.gpuAggregation;this.setState({gpuAggregation:o});const s=this.isAttributeChanged("positions"),{dimensions:l}=this.state,{data:u,weights:c}=l,d=s||i||a||this.isAggregationDirty(e,{compareAll:o,dimension:u}),f=this.isAggregationDirty(e,{dimension:c});this.setState({aggregationDataDirty:d,aggregationWeightsDirty:f});const{viewport:p}=this.context;if(a||n){const{width:e,height:n}=p,r=Math.ceil(e/t),a=Math.ceil(n/t);this.allocateResources(a,r),this.setState({scaling:[e/2,-n/2,1],gridOffset:{xOffset:t,yOffset:t},width:e,height:n,numCol:r,numRow:a})}f&&this._updateAccessors(e),(d||f)&&this._resetResults()}_updateAccessors(e){const{getWeight:t,aggregation:n,data:r}=e.props,{count:a}=this.state.weights;a&&(a.getWeight=t,a.operation=p[n]),this.setState({getValue:y(n,t,{data:r})})}_resetResults(){const{count:e}=this.state.weights;e&&(e.aggregationData=null)}}we.layerName="ScreenGridLayer",we.defaultProps=xe;var Oe=n(828);function Se(){}const Te=["getBins","getDomain","getScaleFunc"],Ce=[{key:"fillColor",accessor:"getFillColor",pickingInfo:"colorValue",getBins:{triggers:{value:{prop:"getColorValue",updateTrigger:"getColorValue"},weight:{prop:"getColorWeight",updateTrigger:"getColorWeight"},aggregation:{prop:"colorAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"lowerPercentile"},upperPercentile:{prop:"upperPercentile"},scaleType:{prop:"colorScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"colorDomain"},range:{prop:"colorRange"}},onSet:{props:"onSetColorDomain"}},nullValue:[0,0,0,0]},{key:"elevation",accessor:"getElevation",pickingInfo:"elevationValue",getBins:{triggers:{value:{prop:"getElevationValue",updateTrigger:"getElevationValue"},weight:{prop:"getElevationWeight",updateTrigger:"getElevationWeight"},aggregation:{prop:"elevationAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"elevationLowerPercentile"},upperPercentile:{prop:"elevationUpperPercentile"},scaleType:{prop:"elevationScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"elevationDomain"},range:{prop:"elevationRange"}},onSet:{props:"onSetElevationDomain"}},nullValue:-1}],Le=e=>e.cellSize;class Pe{constructor(e){this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=e.getCellSize||Le,this._getAggregator=e.getAggregator,this._addDimension(e.dimensions||Ce)}static defaultDimensions(){return Ce}updateState(e,t){const{oldProps:n,props:r,changeFlags:a}=e;this.updateGetValueFuncs(n,r,a);const o=this.needsReProjectPoints(n,r,a);let i=!1;if(a.dataChanged||o)this.getAggregatedData(r,t),i=!0;else{(this.getDimensionChanges(n,r,a)||[]).forEach(e=>"function"==typeof e&&e()),i=!0}return this.setState({aggregationDirty:i}),this.state}setState(e){this.state={...this.state,...e}}setDimensionState(e,t){this.setState({dimensions:{...this.state.dimensions,[e]:{...this.state.dimensions[e],...t}}})}normalizeResult(e={}){return e.hexagons?{data:e.hexagons,...e}:e.layerData?{data:e.layerData,...e}:e}getAggregatedData(e,t){const n=this._getAggregator(e)(e,t);this.setState({layerData:this.normalizeResult(n)}),this.changeFlags={layerData:!0},this.getSortedBins(e)}updateGetValueFuncs(e,t,n){for(const r in this.dimensionUpdaters){const{value:a,weight:o,aggregation:i}=this.dimensionUpdaters[r].getBins.triggers;let s=t[a.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[r].getBins,e,t,n)&&(s=s?v(s,{data:t.data}):y(t[i.prop],t[o.prop],{data:t.data})),s&&this.setDimensionState(r,{getValue:s})}}needsReProjectPoints(e,t,n){return this._getCellSize(e)!==this._getCellSize(t)||this._getAggregator(e)!==this._getAggregator(t)||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPosition)}addDimension(e){this._addDimension(e)}_addDimension(e=[]){e.forEach(e=>{const{key:t}=e;this.dimensionUpdaters[t]=this.getDimensionUpdaters(e),this.state.dimensions[t]={getValue:null,domain:null,sortedBins:null,scaleFunc:Se}})}getDimensionUpdaters({key:e,accessor:t,pickingInfo:n,getBins:r,getDomain:a,getScaleFunc:o,nullValue:i}){return{key:e,accessor:t,pickingInfo:n,getBins:{updater:this.getDimensionSortedBins,...r},getDomain:{updater:this.getDimensionValueDomain,...a},getScaleFunc:{updater:this.getDimensionScale,...o},attributeAccessor:this.getSubLayerDimensionAttribute(e,i)}}needUpdateDimensionStep(e,t,n,r){return Object.values(e.triggers).some(e=>e.updateTrigger?r.dataChanged||r.updateTriggersChanged&&(r.updateTriggersChanged.all||r.updateTriggersChanged[e.updateTrigger]):t[e.prop]!==n[e.prop])}getDimensionChanges(e,t,n){const r=[];for(const a in this.dimensionUpdaters){const o=Te.find(r=>this.needUpdateDimensionStep(this.dimensionUpdaters[a][r],e,t,n));o&&r.push(this.dimensionUpdaters[a][o].updater.bind(this,t,this.dimensionUpdaters[a]))}return r.length?r:null}getUpdateTriggers(e){const t=e.updateTriggers||{},n={};for(const r in this.dimensionUpdaters){const{accessor:a}=this.dimensionUpdaters[r];n[a]={},Te.forEach(o=>{Object.values(this.dimensionUpdaters[r][o].triggers).forEach(({prop:r,updateTrigger:o})=>{if(o){const e=t[o];"object"!=typeof e||Array.isArray(e)?void 0!==e&&(n[a][r]=e):Object.assign(n[a],e)}else n[a][r]=e[r]})})}return n}getSortedBins(e){for(const t in this.dimensionUpdaters)this.getDimensionSortedBins(e,this.dimensionUpdaters[t])}getDimensionSortedBins(e,t){const{key:n}=t,{getValue:r}=this.state.dimensions[n],a=new pe(this.state.layerData.data||[],{getValue:r,filterData:e._filterData});this.setDimensionState(n,{sortedBins:a}),this.getDimensionValueDomain(e,t)}getDimensionValueDomain(e,t){const{getDomain:n,key:r}=t,{triggers:{lowerPercentile:a,upperPercentile:o,scaleType:i}}=n,s=this.state.dimensions[r].sortedBins.getValueDomainByScale(e[i.prop],[e[a.prop],e[o.prop]]);this.setDimensionState(r,{valueDomain:s}),this.getDimensionScale(e,t)}getDimensionScale(e,t){const{key:n,getScaleFunc:r,getDomain:a}=t,{domain:o,range:i}=r.triggers,{scaleType:s}=a.triggers,{onSet:l}=r,u=e[i.prop],c=e[o.prop]||this.state.dimensions[n].valueDomain,d=function(e){switch(e){case"quantize":return Q;case"linear":return $;case"quantile":return ee;case"ordinal":return re;default:return Q}}(s&&e[s.prop])(c,u);"object"==typeof l&&"function"==typeof e[l.props]&&e[l.props](d.domain()),this.setDimensionState(n,{scaleFunc:d})}getSubLayerDimensionAttribute(e,t){return n=>{const{sortedBins:r,scaleFunc:a}=this.state.dimensions[e],o=r.binMap[n.index];if(o&&0===o.counts)return t;const i=o&&o.value,s=a.domain();return i>=s[0]&&i<=s[s.length-1]?a(i):t}}getSubLayerAccessors(e){const t={};for(const n in this.dimensionUpdaters){const{accessor:r}=this.dimensionUpdaters[n];t[r]=this.getSubLayerDimensionAttribute(e,n)}return t}getPickingInfo({info:e}){let t=null;if(e.picked&&e.index>-1){const n=this.state.layerData.data[e.index],r={};for(const e in this.dimensionUpdaters){const{pickingInfo:t}=this.dimensionUpdaters[e],{sortedBins:a}=this.state.dimensions[e],o=a.binMap[n.index]&&a.binMap[n.index].value;r[t]=o}t=Object.assign(r,n,{points:n.filteredPoints||n.points})}return e.picked=Boolean(t),e.object=t,e}getAccessor(e){return this.dimensionUpdaters.hasOwnProperty(e)?this.dimensionUpdaters[e].attributeAccessor:Se}}function Re(){}const De={colorDomain:null,colorRange:B,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},colorScaleType:"quantize",onSetColorDomain:Re,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Re,gridAggregator:_e,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:e=>e.position},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}};class ke extends K{initializeState(){const e=new Pe({getAggregator:e=>e.gridAggregator,getCellSize:e=>e.cellSize});this.state={cpuAggregator:e,aggregatorState:e.state};this.getAttributeManager().add({positions:{size:3,accessor:"getPosition"}})}updateState(e){super.updateState(e),this.setState({aggregatorState:this.state.cpuAggregator.updateState(e,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances(e.props)})})}getPickingInfo({info:e}){return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(e){return this.state.cpuAggregator.getAccessor("fillColor")(e)}_onGetSublayerElevation(e){return this.state.cpuAggregator.getAccessor("elevation")(e)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:e,extruded:t,cellSize:n,coverage:r,material:a,transitions:o}=this.props,{cpuAggregator:i}=this.state,s=this.getSubLayerClass("grid-cell",Oe.a),l=this._getSublayerUpdateTriggers();return new s({cellSize:n,coverage:r,material:a,elevationScale:e,extruded:t,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:l}),{data:i.state.layerData.data})}}ke.layerName="CPUGridLayer",ke.defaultProps=De;var Ie=n(439),Fe=n(462);function je(){}const Be={colorDomain:null,colorRange:B,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",value:0,min:0,max:100},upperPercentile:{type:"number",value:100,min:0,max:100},colorScaleType:"quantize",onSetColorDomain:je,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",value:0,min:0,max:100},elevationUpperPercentile:{type:"number",value:100,min:0,max:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:je,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:function(e,t){const{data:n,radius:a}=e,{viewport:o,attributes:i}=t,s=n.length?function(e,t){const{attributes:n}=t,r=n.positions.value,{size:a}=n.positions.getAccessor();let o,i=1/0,s=1/0,l=-1/0,u=-1/0;for(o=0;o<a*e.length;o+=a){const e=r[o],t=r[o+1];Number.isFinite(e)&&Number.isFinite(t)&&(i=Math.min(e,i),l=Math.max(e,l),s=Math.min(t,s),u=Math.max(t,u))}return[i,s,l,u].every(Number.isFinite)?[(i+l)/2,(s+u)/2]:null}(n,t):null,l=function(e,t,n){const{unitsPerMeter:r}=t.getDistanceScales(n);return e*r[0]}(a,o,s),u=[],{iterable:c,objectInfo:d}=Object(he.a)(n),f=i.positions.value,{size:p}=i.positions.getAccessor();for(const e of c){d.index++;const t=d.index*p,n=[f[t],f[t+1]];Number.isFinite(n[0])&&Number.isFinite(n[1])?u.push({screenCoord:o.projectFlat(n),source:e,index:d.index}):r.a.warn("HexagonLayer: invalid position")()}return{hexagons:Object(Fe.a)().radius(l).x(e=>e.screenCoord[0]).y(e=>e.screenCoord[1])(u).map((e,t)=>({position:o.unprojectFlat([e.x,e.y]),points:e,index:t})),radiusCommon:l}},getPosition:{type:"accessor",value:e=>e.position},material:!0,_filterData:{type:"function",value:null,optional:!0}};class Ne extends K{initializeState(){const e=new Pe({getAggregator:e=>e.hexagonAggregator,getCellSize:e=>e.radius});this.state={cpuAggregator:e,aggregatorState:e.state,vertices:null};this.getAttributeManager().add({positions:{size:3,accessor:"getPosition"}})}updateState(e){if(super.updateState(e),e.changeFlags.propsOrDataChanged){const t=this.state.cpuAggregator.updateState(e,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==t.layerData){const{hexagonVertices:e}=t.layerData||{};this.setState({vertices:e&&this.convertLatLngToMeterOffset(e)})}this.setState({aggregatorState:t})}}convertLatLngToMeterOffset(e){const{viewport:t}=this.context;if(Array.isArray(e)&&6===e.length){const n=e[0],r=e[3],a=[(n[0]+r[0])/2,(n[1]+r[1])/2],o=t.projectFlat(a),{metersPerUnit:i}=t.getDistanceScales(a);return e.map(e=>{const n=t.projectFlat(e);return[(n[0]-o[0])*i[0],(n[1]-o[1])*i[1]]})}return r.a.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}getPickingInfo({info:e}){return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(e){return this.state.cpuAggregator.getAccessor("fillColor")(e)}_onGetSublayerElevation(e){return this.state.cpuAggregator.getAccessor("elevation")(e)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:e,extruded:t,coverage:n,material:r,transitions:a}=this.props,{aggregatorState:o,vertices:i}=this.state,s=this.getSubLayerClass("hexagon-cell",Ie.a),l=this._getSublayerUpdateTriggers();return new s({...i?{vertices:i,radius:1}:{radius:o.layerData.radiusCommon||1,radiusUnits:"common",angle:90},diskResolution:6,elevationScale:e,extruded:t,coverage:n,material:r,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:a&&{getFillColor:a.getColorValue||a.getColorWeight,getElevation:a.getElevationValue||a.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:l}),{data:o.layerData.data})}}Ne.layerName="HexagonLayer",Ne.defaultProps=Be;var ze=n(1174),Ue=n(289);const He={N:[0,.5],E:[.5,0],S:[0,-.5],W:[-.5,0],NE:[.5,.5],NW:[-.5,.5],SE:[.5,-.5],SW:[-.5,-.5]},Ve=[He.W,He.SW,He.S],Ge=[He.S,He.SE,He.E],Ye=[He.E,He.NE,He.N],We=[He.NW,He.W,He.N],qe=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5]],Xe=[[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6]],Ke=[[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Ze=[[-.5,1/6],[-.5,-1/6],[1/6,.5],[-1/6,.5]],Je=[He.W,He.SW,He.SE,He.E],Qe=[He.S,He.SE,He.NE,He.N],$e=[He.NW,He.W,He.E,He.NE],et=[He.NW,He.SW,He.S,He.N],tt=[[-.5,1/6],[-.5,-1/6],[.5,-1/6],[.5,1/6]],nt=[[-1/6,-.5],[1/6,-.5],[1/6,.5],[-1/6,.5]],rt=[He.NW,He.SW,He.SE,He.NE],at=[He.NW,He.SW,He.SE,He.E,He.N],ot=[He.W,He.SW,He.SE,He.NE,He.N],it=[He.NW,He.W,He.S,He.SE,He.NE],st=[He.NW,He.SW,He.S,He.E,He.NE],lt=[He.NW,He.W,[.5,-1/6],[.5,1/6],He.N],ut=[[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],ct=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E],dt=[He.W,He.SW,He.S,[1/6,.5],[-1/6,.5]],ft=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.N],pt=[[-.5,1/6],[-.5,-1/6],He.E,He.NE,He.N],ht=[He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],mt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6]],gt=[He.W,He.SW,He.SE,He.E,[1/6,.5],[-1/6,.5]],yt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.NE,He.N],vt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],He.E,He.NE],At=[He.NW,He.SW,He.S,[.5,-1/6],[.5,1/6],He.N],bt=[He.W,He.SW,He.S,He.E,He.NE,He.N],_t=[He.NW,He.W,He.S,He.SE,He.E,He.N],Et=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],He.E,He.NE,He.N],xt=[He.W,He.SW,He.S,[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],Mt=[He.NW,He.W,[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],He.N],wt=[[-.5,1/6],[-.5,-1/6],He.S,He.SE,He.E,[1/6,.5],[-1/6,.5]],Ot=[[-.5,1/6],[-.5,-1/6],[-1/6,-.5],[1/6,-.5],[.5,-1/6],[.5,1/6],[1/6,.5],[-1/6,.5]],St={0:[],1:[[He.W,He.S]],2:[[He.S,He.E]],3:[[He.W,He.E]],4:[[He.N,He.E]],5:{0:[[He.W,He.S],[He.N,He.E]],1:[[He.W,He.N],[He.S,He.E]]},6:[[He.N,He.S]],7:[[He.W,He.N]],8:[[He.W,He.N]],9:[[He.N,He.S]],10:{0:[[He.W,He.N],[He.S,He.E]],1:[[He.W,He.S],[He.N,He.E]]},11:[[He.N,He.E]],12:[[He.W,He.E]],13:[[He.S,He.E]],14:[[He.W,He.S]],15:[]};function Tt(e){return parseInt(e,4)}const Ct={[Tt("0000")]:[],[Tt("2222")]:[],[Tt("2221")]:[Ve],[Tt("2212")]:[Ge],[Tt("2122")]:[Ye],[Tt("1222")]:[We],[Tt("0001")]:[Ve],[Tt("0010")]:[Ge],[Tt("0100")]:[Ye],[Tt("1000")]:[We],[Tt("2220")]:[qe],[Tt("2202")]:[Xe],[Tt("2022")]:[Ke],[Tt("0222")]:[Ze],[Tt("0002")]:[qe],[Tt("0020")]:[Xe],[Tt("0200")]:[Ke],[Tt("2000")]:[Ze],[Tt("0011")]:[Je],[Tt("0110")]:[Qe],[Tt("1100")]:[$e],[Tt("1001")]:[et],[Tt("2211")]:[Je],[Tt("2112")]:[Qe],[Tt("1122")]:[$e],[Tt("1221")]:[et],[Tt("2200")]:[tt],[Tt("2002")]:[nt],[Tt("0022")]:[tt],[Tt("0220")]:[nt],[Tt("1111")]:[rt],[Tt("1211")]:[at],[Tt("2111")]:[ot],[Tt("1112")]:[it],[Tt("1121")]:[st],[Tt("1011")]:[at],[Tt("0111")]:[ot],[Tt("1110")]:[it],[Tt("1101")]:[st],[Tt("1200")]:[lt],[Tt("0120")]:[ut],[Tt("0012")]:[ct],[Tt("2001")]:[dt],[Tt("1022")]:[lt],[Tt("2102")]:[ut],[Tt("2210")]:[ct],[Tt("0221")]:[dt],[Tt("1002")]:[ft],[Tt("2100")]:[pt],[Tt("0210")]:[ht],[Tt("0021")]:[mt],[Tt("1220")]:[ft],[Tt("0122")]:[pt],[Tt("2012")]:[ht],[Tt("2201")]:[mt],[Tt("0211")]:[gt],[Tt("2110")]:[yt],[Tt("1102")]:[vt],[Tt("1021")]:[At],[Tt("2011")]:[gt],[Tt("0112")]:[yt],[Tt("1120")]:[vt],[Tt("1201")]:[At],[Tt("2101")]:[bt],[Tt("0121")]:[bt],[Tt("1012")]:[_t],[Tt("1210")]:[_t],[Tt("0101")]:{0:[Ve,Ye],1:[bt],2:[bt]},[Tt("1010")]:{0:[We,Ge],1:[_t],2:[_t]},[Tt("2121")]:{0:[bt],1:[bt],2:[Ve,Ye]},[Tt("1212")]:{0:[_t],1:[_t],2:[We,Ge]},[Tt("2120")]:{0:[Et],1:[Et],2:[qe,Ye]},[Tt("2021")]:{0:[xt],1:[xt],2:[Ve,Ke]},[Tt("1202")]:{0:[Mt],1:[Mt],2:[We,Xe]},[Tt("0212")]:{0:[wt],1:[wt],2:[Ge,Ze]},[Tt("0102")]:{0:[qe,Ye],1:[Et],2:[Et]},[Tt("0201")]:{0:[Ve,Ke],1:[xt],2:[xt]},[Tt("1020")]:{0:[We,Xe],1:[Mt],2:[Mt]},[Tt("2010")]:{0:[Ge,Ze],1:[wt],2:[wt]},[Tt("2020")]:{0:[Ze,Xe],1:[Ot],2:[qe,Ke]},[Tt("0202")]:{0:[Ke,qe],1:[Ot],2:[Ze,Xe]}},Lt={ISO_LINES:1,ISO_BANDS:2},Pt={zIndex:0,zOffset:.005};function Rt(e,t){return Array.isArray(t)?e<t[0]?0:e<t[1]?1:2:e>=t?1:0}function Dt(e){const{cellWeights:t,x:n,y:a,width:o,height:i}=e;let s=e.threshold;e.thresholdValue&&(r.a.deprecated("thresholdValue","threshold")(),s=e.thresholdValue);const l=n<0,u=n>=o-1,c=a<0,d=a>=i-1,f=l||u||c||d,p={},h={};l||d?h.top=0:(p.top=t[(a+1)*o+n],h.top=Rt(p.top,s)),u||d?h.topRight=0:(p.topRight=t[(a+1)*o+n+1],h.topRight=Rt(p.topRight,s)),u||c?h.right=0:(p.right=t[a*o+n+1],h.right=Rt(p.right,s)),l||c?h.current=0:(p.current=t[a*o+n],h.current=Rt(p.current,s));const{top:m,topRight:g,right:y,current:v}=h;let A=-1;Number.isFinite(s)&&(A=m<<3|g<<2|y<<1|v),Array.isArray(s)&&(A=m<<6|g<<4|y<<2|v);let b=0;return f||(b=Rt((p.top+p.topRight+p.right+p.current)/4,s)),{code:A,meanCode:b}}function kt(e){const{gridOrigin:t,cellSize:n,x:r,y:a,code:o,meanCode:i,type:s=Lt.ISO_LINES}=e,l={...Pt,...e.thresholdData};let u=s===Lt.ISO_BANDS?Ct[o]:St[o];Array.isArray(u)||(u=u[i]);const c=l.zIndex*l.zOffset,d=(r+1)*n[0],f=(a+1)*n[1],p=t[0]+d,h=t[1]+f;if(s===Lt.ISO_BANDS){const e=[];return u.forEach(t=>{const r=[];t.forEach(e=>{const t=p+e[0]*n[0],a=h+e[1]*n[1];r.push([t,a,c])}),e.push(r)}),e}const m=[];return u.forEach(e=>{e.forEach(e=>{const t=p+e[0]*n[0],r=h+e[1]*n[1];m.push([t,r,c])})}),m}const It=[255,255,255,255],Ft={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM",contours:[{threshold:1}],zOffset:.005},jt={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class Bt extends Ee{initializeState(){super.initializeState({dimensions:jt}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:p.SUM}}});this.getAttributeManager().add({positions:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}updateState(e){super.updateState(e);let t=!1;const{oldProps:n,props:r}=e,{aggregationDirty:a}=this.state;n.contours===r.contours&&n.zOffset===r.zOffset||(t=!0,this._updateThresholdData(e.props)),this.getNumInstances()>0&&(a||t)&&this._generateContours()}renderLayers(){const{contourSegments:e,contourPolygons:t}=this.state.contourData,n=this.getSubLayerClass("lines",ze.a),r=this.getSubLayerClass("bands",Ue.a);return[e&&e.length>0&&new n(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:e=>e.start,getTargetPosition:e=>e.end,getColor:e=>e.contour.color||It,getWidth:e=>e.contour.strokeWidth||1}),t&&t.length>0&&new r(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:e=>e.vertices,getFillColor:e=>e.contour.color||It})]}updateAggregationState(e){const{props:t,oldProps:n}=e,{cellSize:a,coordinateSystem:o}=t,{viewport:i}=this.context,s=n.cellSize!==a;let l=t.gpuAggregation;this.state.gpuAggregation!==t.gpuAggregation&&l&&!k.isSupported(this.context.gl)&&(r.a.warn("GPU Grid Aggregation not supported, falling back to CPU")(),l=!1);const u=l!==this.state.gpuAggregation;this.setState({gpuAggregation:l});const{dimensions:c}=this.state,d=this.isAttributeChanged("positions"),{data:f,weights:p}=c;let{boundingBox:h}=this.state;if(d&&(h=ye(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:h})),d||s){const{gridOffset:e,translation:t,width:n,height:r,numCol:s,numRow:l}=be(h,a,i,o);this.allocateResources(l,s),this.setState({gridOffset:e,boundingBox:h,translation:t,posOffset:t.slice(),gridOrigin:[-1*t[0],-1*t[1]],width:n,height:r,numCol:s,numRow:l})}const m=d||u||this.isAggregationDirty(e,{dimension:f,compareAll:l}),g=this.isAggregationDirty(e,{dimension:p});g&&this._updateAccessors(e),(m||g)&&this._resetResults(),this.setState({aggregationDataDirty:m,aggregationWeightsDirty:g})}_updateAccessors(e){const{getWeight:t,aggregation:n,data:r}=e.props,{count:a}=this.state.weights;a&&(a.getWeight=t,a.operation=p[n]),this.setState({getValue:y(n,t,{data:r})})}_resetResults(){const{count:e}=this.state.weights;e&&(e.aggregationData=null)}_generateContours(){const{numCol:e,numRow:t,gridOrigin:n,gridOffset:r,thresholdData:a}=this.state,{count:o}=this.state.weights;let{aggregationData:i}=o;i||(i=o.aggregationBuffer.getData(),o.aggregationData=i);const{cellWeights:s}=k.getCellData({countsData:i}),l=function({thresholdData:e,colors:t,cellWeights:n,gridSize:r,gridOrigin:a,cellSize:o}){const i=[],s=[],l=r[0],u=r[1];let c=0,d=0;for(const t of e){const{contour:e}=t,{threshold:r}=e;for(let f=-1;f<l;f++)for(let p=-1;p<u;p++){const{code:h,meanCode:m}=Dt({cellWeights:n,threshold:r,x:f,y:p,width:l,height:u}),g={gridOrigin:a,cellSize:o,x:f,y:p,width:l,height:u,code:h,meanCode:m,thresholdData:t};if(Array.isArray(r)){g.type=Lt.ISO_BANDS;const t=kt(g);for(const n of t)s[d++]={vertices:n,contour:e}}else{g.type=Lt.ISO_LINES;const t=kt(g);for(let n=0;n<t.length;n+=2)i[c++]={start:t[n],end:t[n+1],contour:e}}}}return{contourSegments:i,contourPolygons:s}}({thresholdData:a,cellWeights:s,gridSize:[e,t],gridOrigin:n,cellSize:[r.xOffset,r.yOffset]});this.setState({contourData:l})}_updateThresholdData(e){const{contours:t,zOffset:n}=e,r=t.length,a=new Array(r);for(let e=0;e<r;e++){const r=t[e];a[e]={contour:r,zIndex:r.zIndex||e,zOffset:n}}this.setState({thresholdData:a})}}Bt.layerName="ContourLayer",Bt.defaultProps=Ft;var Nt=n(1179),zt=n(89),Ut=n(1873);const Ht={colorDomain:null,colorRange:B,elevationDomain:null,elevationRange:[0,1e3],elevationScale:{type:"number",min:0,value:1},gridSize:{type:"array",min:0,value:[1,1]},gridOrigin:{type:"array",min:0,value:[0,0]},gridOffset:{type:"array",min:0,value:[0,0]},cellSize:{type:"number",min:0,max:1e3,value:1e3},offset:{type:"array",min:0,value:[1,1]},coverage:{type:"number",min:0,max:1,value:1},extruded:!0,material:!0};class Vt extends F.a{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n vec4 outColor = vec4(0., 0., 0., 0.);\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n float domainRange = domain.y - domain.x;\n if (domainRange <= 0.) {\n outColor = colorRange[0];\n } else {\n float rangeCount = float(RANGE_COUNT);\n float rangeStep = domainRange / rangeCount;\n float idx = floor((value - domain.x) / rangeStep);\n idx = clamp(idx, 0., rangeCount - 1.);\n int intIdx = int(idx);\n outColor = colorRange[intIdx];\n }\n }\n return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n }\n return -1.;\n}\n\nvoid main(void) {\n vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n float elevation = 0.0;\n\n if (extruded) {\n vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n elevation = linearScale(elvDomain, elevationRange, elevations.r);\n elevation = elevation * (positions.z + 1.0) / 2.0 * elevationScale;\n }\n float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n int yIndex = (gl_InstanceID / gridSize[0]);\n int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n geometry.worldPosition = centroidPosition;\n vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n picking_setPickingColor(instancePickingColors);\n\n gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n vec3 normals_commonspace = project_normal(normals);\n\n if (extruded) {\n vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n vColor = vec4(lightColor, color.a * opacity) / 255.;\n } else {\n vColor = vec4(color.rgb, color.a * opacity) / 255.;\n }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n fragColor = vColor;\n fragColor = picking_filterColor(fragColor);\n}\n",modules:[f.a,Nt.a,j.a,c.b]})}initializeState(){const{gl:e}=this.context;this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});const t=this._getModel(e);this._setupUniformBuffer(t),this.setState({model:t})}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new Ut.a,isInstanced:!0})}draw({uniforms:e}){const{cellSize:t,offset:n,extruded:r,elevationScale:a,coverage:o,gridSize:i,gridOrigin:s,gridOffset:l,elevationRange:u,colorMaxMinBuffer:c,elevationMaxMinBuffer:d}=this.props,f=[Object(zt.b)(s[0]),Object(zt.b)(s[1])],p=[Object(zt.b)(l[0]),Object(zt.b)(l[1])],h=this.getDomainUniforms(),m=N(this.props.colorRange);this.bindUniformBuffers(c,d),this.state.model.setUniforms(e).setUniforms(h).setUniforms({cellSize:t,offset:n,extruded:r,elevationScale:a,coverage:o,gridSize:i,gridOrigin:s,gridOriginLow:f,gridOffset:l,gridOffsetLow:p,colorRange:m,elevationRange:u}).draw(),this.unbindUniformBuffers(c,d)}bindUniformBuffers(e,t){e.bind({target:35345,index:0}),t.bind({target:35345,index:1})}unbindUniformBuffers(e,t){e.unbind({target:35345,index:0}),t.unbind({target:35345,index:1})}getDomainUniforms(){const{colorDomain:e,elevationDomain:t}=this.props,n={};return null!==e?(n.colorDomainValid=!0,n.colorDomain=e):n.colorDomainValid=!1,null!==t?(n.elevationDomainValid=!0,n.elevationDomain=t):n.elevationDomainValid=!1,n}_setupUniformBuffer(e){const t=this.context.gl,n=e.program.handle,r=t.getUniformBlockIndex(n,"ColorData"),a=t.getUniformBlockIndex(n,"ElevationData");t.uniformBlockBinding(n,r,0),t.uniformBlockBinding(n,a,1)}}Vt.layerName="GPUGridCellLayer",Vt.defaultProps=Ht;const Gt={colorDomain:null,colorRange:B,getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:1,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:e=>e.position},extruded:!1,material:!0},Yt={data:{props:["cellSize","colorAggregation","elevationAggregation"]}};class Wt extends Ee{initializeState(){const{gl:e}=this.context,t=k.isSupported(e);t||r.a.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),super.initializeState({dimensions:Yt}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:t,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Z.a(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new Z.a(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"});this.getAttributeManager().add({positions:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},color:{size:3,accessor:"getColorWeight"},elevation:{size:3,accessor:"getElevationWeight"}})}updateState(e){if(!1===this.state.isSupported)return;super.updateState(e);const{aggregationDirty:t}=this.state;t&&this.setState({gridHash:null})}getHashKeyForIndex(e){const{numRow:t,numCol:n,boundingBox:r,gridOffset:a}=this.state,o=[n,t],i=[r.xMin,r.yMin],s=[a.xOffset,a.yOffset],l=Math.floor(e/o[0]),u=e-l*o[0],c=Math.floor((l*s[1]+i[1]+90+s[1]/2)/s[1]),d=Math.floor((u*s[0]+i[0]+180+s[0]/2)/s[0]);return"".concat(c,"-").concat(d)}getPositionForIndex(e){const{numRow:t,numCol:n,boundingBox:r,gridOffset:a}=this.state,o=[n,t],i=[r.xMin,r.yMin],s=[a.xOffset,a.yOffset],l=Math.floor(e/o[0]);return[(e-l*o[0])*s[0]+i[0],l*s[1]+i[1]]}getPickingInfo({info:e,mode:t}){const{index:n}=e;let r=null;if(n>=0){const{gpuGridAggregator:e}=this.state,a=this.getPositionForIndex(n),o=k.getAggregationData({pixelIndex:n,...e.getData("color")}),i=k.getAggregationData({pixelIndex:n,...e.getData("elevation")});if(r={colorValue:o.cellWeight,elevationValue:i.cellWeight,count:o.cellCount||i.cellCount,position:a,totalCount:o.totalCount||i.totalCount},"hover"!==t){const{props:e}=this;let{gridHash:t}=this.state;if(!t){const{gridOffset:n,translation:r,boundingBox:a}=this.state,{viewport:o}=this.context;t=_e(e,{gridOffset:n,attributes:this.getAttributes(),viewport:o,translation:r,boundingBox:a}).gridHash,this.setState({gridHash:t})}const a=t[this.getHashKeyForIndex(n)];Object.assign(r,a)}}return e.picked=Boolean(r),e.object=r,e}renderLayers(){if(!this.state.isSupported)return null;const{elevationScale:e,extruded:t,cellSize:n,coverage:r,material:a,elevationRange:o,colorDomain:i,elevationDomain:s}=this.props,{weights:l,numRow:u,numCol:c,gridOrigin:d,gridOffset:f}=this.state,{color:p,elevation:h}=l,m=N(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",Vt))({gridSize:[c,u],gridOrigin:d,gridOffset:[f.xOffset,f.yOffset],colorRange:m,elevationRange:o,colorDomain:i,elevationDomain:s,cellSize:n,coverage:r,material:a,elevationScale:e,extruded:t},this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:p.aggregationBuffer,elevations:h.aggregationBuffer}},colorMaxMinBuffer:p.maxMinBuffer,elevationMaxMinBuffer:h.maxMinBuffer,numInstances:c*u})}finalizeState(){const{color:e,elevation:t}=this.state.weights;[e,t].forEach(e=>{const{aggregationBuffer:t,maxMinBuffer:n}=e;n.delete(),null==t||t.delete()}),super.finalizeState()}updateAggregationState(e){const{props:t,oldProps:n}=e,{cellSize:r,coordinateSystem:a}=t,{viewport:o}=this.context,i=n.cellSize!==r,{dimensions:s}=this.state,l=this.isAttributeChanged("positions"),u=l||this.isAttributeChanged();let{boundingBox:c}=this.state;if(l&&(c=ye(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:c})),l||i){const{gridOffset:e,translation:t,width:n,height:i,numCol:s,numRow:l}=be(c,r,o,a);this.allocateResources(l,s),this.setState({gridOffset:e,translation:t,gridOrigin:[-1*t[0],-1*t[1]],width:n,height:i,numCol:s,numRow:l})}const d=u||this.isAggregationDirty(e,{dimension:s.data,compareAll:!0});d&&this._updateAccessors(e),this.setState({aggregationDataDirty:d})}_updateAccessors(e){const{colorAggregation:t,elevationAggregation:n}=e.props,{color:r,elevation:a}=this.state.weights;r.operation=p[t],a.operation=p[n]}}Wt.layerName="GPUGridLayer",Wt.defaultProps=Gt;const qt={...Wt.defaultProps,...ke.defaultProps,gpuAggregation:!1};class Xt extends Y.a{initializeState(){this.state={useGPUAggregation:!0}}updateState({oldProps:e,props:t,changeFlags:n}){const r={};r.useGPUAggregation=this.canUseGPUAggregation(t),this.setState(r)}renderLayers(){const{data:e,updateTriggers:t}=this.props,n=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",Wt):this.getSubLayerClass("CPU",ke))(this.props,this.getSubLayerProps({id:n,updateTriggers:t}),{data:e})}canUseGPUAggregation(e){const{gpuAggregation:t,lowerPercentile:n,upperPercentile:r,getColorValue:a,getElevationValue:o,colorScaleType:i}=e;return!!t&&(!!k.isSupported(this.context.gl)&&(0===n&&100===r&&(null===a&&null===o&&("quantile"!==i&&"ordinal"!==i))))}}Xt.layerName="GridLayer",Xt.defaultProps=qt;const Kt=new Float32Array(12);function Zt(e,t=2){let n=0;for(const r of e)for(let e=0;e<t;e++)Kt[n++]=r[e]||0;return Kt}class Jt extends F.a{getShaders(){return{vs:"#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\n\nattribute vec3 positions;\nattribute vec2 texCoords;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvoid main(void) {\n gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n vTexCoords = texCoords;\n vec4 maxTexture = texture2D(maxTexture, vec2(0.5));\n float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n float minValue = maxValue * threshold;\n if (colorDomain[1] > 0.) {\n maxValue = colorDomain[1];\n minValue = colorDomain[0];\n }\n vIntensityMax = intensity / maxValue;\n vIntensityMin = intensity / minValue;\n}\n",fs:"#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D texture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvec4 getLinearColor(float value) {\n float factor = clamp(value * vIntensityMax, 0., 1.);\n vec4 color = texture2D(colorTexture, vec2(factor, 0.5));\n color.a *= min(value * vIntensityMin, 1.0);\n return color;\n}\n\nvoid main(void) {\n vec4 weights = texture2D(texture, vTexCoords);\n float weight = weights.r;\n\n if (aggregationMode > 0.5) {\n weight /= max(1.0, weights.a);\n }\n if (weight <= 0.) {\n discard;\n }\n\n vec4 linearColor = getLinearColor(weight);\n linearColor.a *= opacity;\n gl_FragColor =linearColor;\n}\n",modules:[f.a]}}initializeState(){const{gl:e}=this.context;this.getAttributeManager().add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(e)})}_getModel(e){const{vertexCount:t}=this.props;return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new I.a({drawMode:6,vertexCount:t})})}draw({uniforms:e}){const{model:t}=this.state,{texture:n,maxTexture:r,colorTexture:a,intensity:o,threshold:i,aggregationMode:s,colorDomain:l}=this.props;t.setUniforms({...e,texture:n,maxTexture:r,colorTexture:a,intensity:o,threshold:i,aggregationMode:s,colorDomain:l}).draw()}}Jt.layerName="TriangleLayer";const Qt={mipmaps:!1,parameters:{10240:9729,10241:9729,10242:33071,10243:33071},dataFormat:6408},$t=[0,0],en={SUM:0,MEAN:1},tn={getPosition:{type:"accessor",value:e=>e.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:B,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},nn=[a.a.BLEND_EQUATION_MINMAX,a.a.TEXTURE_FLOAT],rn={data:{props:["radiusPixels"]}};class an extends K{initializeState(){const{gl:e}=this.context;if(!Object(o.c)(e,nn))return this.setState({supported:!1}),void r.a.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();super.initializeState(rn),this.setState({supported:!0,colorDomain:$t}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState(e){this.state.supported&&(super.updateState(e),this._updateHeatmapState(e))}_updateHeatmapState(e){const{props:t,oldProps:n}=e,r=this._getChangeFlags(e);(r.dataChanged||r.viewportChanged)&&(r.boundsChanged=this._updateBounds(r.dataChanged),this._updateTextureRenderingBounds()),r.dataChanged||r.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):r.viewportZoomChanged&&this._debouncedUpdateWeightmap(),t.colorRange!==n.colorRange&&this._updateColorTexture(e),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:e.context.viewport.zoom})}renderLayers(){if(!this.state.supported)return[];const{weightsTexture:e,triPositionBuffer:t,triTexCoordBuffer:n,maxWeightsTexture:r,colorTexture:a,colorDomain:o}=this.state,{updateTriggers:i,intensity:s,threshold:l,aggregation:u}=this.props;return new(this.getSubLayerClass("triangle",Jt))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:i}),{coordinateSystem:me.a.DEFAULT,data:{attributes:{positions:t,texCoords:n}},vertexCount:4,maxTexture:r,colorTexture:a,aggregationMode:en[u]||0,texture:e,intensity:s,threshold:l,colorDomain:o})}finalizeState(){super.finalizeState();const{weightsTransform:e,weightsTexture:t,maxWeightTransform:n,maxWeightsTexture:r,triPositionBuffer:a,triTexCoordBuffer:o,colorTexture:i,updateTimer:s}=this.state;null==e||e.delete(),null==t||t.delete(),null==n||n.delete(),null==r||r.delete(),null==a||a.delete(),null==o||o.delete(),null==i||i.delete(),s&&clearTimeout(s)}_getAttributeManager(){return new q.a(this.context.gl,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(e){const t={},{dimensions:n}=this.state;t.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(e,{compareAll:!0,dimension:n.data}),t.viewportChanged=e.changeFlags.viewportChanged;const{zoom:r}=this.state;return e.context.viewport&&e.context.viewport.zoom===r||(t.viewportZoomChanged=!0),t}_createTextures(){const{gl:e}=this.context,{textureSize:t,format:n,type:r}=this.state;this.setState({weightsTexture:new O.a(e,{width:t,height:t,format:n,type:r,...Qt}),maxWeightsTexture:new O.a(e,{format:n,type:r,...Qt})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{gl:e}=this.context,{weightsTextureSize:t}=this.props,n=Math.min(t,Object(i.f)(e,3379)),s=Object(o.c)(e,a.a.COLOR_ATTACHMENT_RGBA32F),{format:l,type:u}=function({gl:e,floatTargetSupport:t}){return{format:Object(i.j)(e)?34836:6408,type:t?5126:5121}}({gl:e,floatTargetSupport:s}),c=s?1:1/255;this.setState({textureSize:n,format:l,type:u,weightsScale:c}),s||r.a.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}getShaders(e){return super.getShaders("max-weights-transform"===e?{vs:"attribute vec4 inTexture;\nvarying vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\ngl_PointSize = 1.0;\n}\n",_fs:"varying vec4 outTexture;\nvoid main() {\n gl_FragColor = outTexture;\n gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n"}:{vs:"attribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float weights;\nvarying vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\n weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n float radiusTexels = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n gl_PointSize = radiusTexels * 2.;\n\n vec3 commonPosition = project_position(positions, positions64Low);\n gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n}\n",_fs:"varying vec4 weightsTexture;\nfloat gaussianKDE(float u){\n return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\n float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n if (dist > 0.5) {\n discard;\n }\n gl_FragColor = weightsTexture * gaussianKDE(2. * dist);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}_createWeightsTransform(e={}){var t;const{gl:n}=this.context;let{weightsTransform:r}=this.state;const{weightsTexture:a}=this.state;null===(t=r)||void 0===t||t.delete(),r=new u.a(n,{id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:a,_targetTextureVarying:"weightsTexture",...e}),this.setState({weightsTransform:r})}_setupResources(){const{gl:e}=this.context;this._createTextures();const{textureSize:t,weightsTexture:n,maxWeightsTexture:r}=this.state,a=this.getShaders("weights-transform");this._createWeightsTransform(a);const o=this.getShaders("max-weights-transform"),i=new u.a(e,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:n},_targetTexture:r,_targetTextureVarying:"outTexture",...o,elementCount:t*t});this.setState({weightsTexture:n,maxWeightsTexture:r,maxWeightTransform:i,zoom:null,triPositionBuffer:new Z.a(e,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new Z.a(e,{byteLength:48,accessor:{size:2}})})}updateShaders(e){this._createWeightsTransform(e)}_updateMaxWeightValue(){const{maxWeightTransform:e}=this.state;e.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}_updateBounds(e=!1){const{viewport:t}=this.context,n=[t.unproject([0,0]),t.unproject([t.width,0]),t.unproject([t.width,t.height]),t.unproject([0,t.height])].map(e=>e.map(Math.fround)),r=function(e){const t=e.map(e=>e[0]),n=e.map(e=>e[1]),r=Math.min.apply(null,t),a=Math.max.apply(null,t);return[r,Math.min.apply(null,n),a,Math.max.apply(null,n)]}(n),a={visibleWorldBounds:r,viewportCorners:n};let o=!1;if(e||!this.state.worldBounds||(i=this.state.worldBounds,!((s=r)[0]>=i[0]&&s[2]<=i[2]&&s[1]>=i[1]&&s[3]<=i[3]))){const e=this._worldToCommonBounds(r),t=this._commonToWorldBounds(e);this.props.coordinateSystem===me.a.LNGLAT&&(t[1]=Math.max(t[1],-85.051129),t[3]=Math.min(t[3],85.051129),t[0]=Math.max(t[0],-360),t[2]=Math.min(t[2],360));const n=this._worldToCommonBounds(t);a.worldBounds=t,a.normalizedCommonBounds=n,o=!0}var i,s;return this.setState(a),o}_updateTextureRenderingBounds(){const{triPositionBuffer:e,triTexCoordBuffer:t,normalizedCommonBounds:n,viewportCorners:r}=this.state,{viewport:a}=this.context;e.subData(Zt(r,3));const o=r.map(e=>function(e,t){const[n,r,a,o]=t;return[(e[0]-n)/(a-n),(e[1]-r)/(o-r)]}(a.projectPosition(e),n));t.subData(Zt(o,2))}_updateColorTexture(e){const{colorRange:t}=e.props;let{colorTexture:n}=this.state;const r=N(t,!1,Uint8Array);n?n.setImageData({data:r,width:t.length}):n=new O.a(this.context.gl,{data:r,width:t.length,height:1,...Qt}),this.setState({colorTexture:n})}_updateWeightmap(){const{radiusPixels:e,colorDomain:t,aggregation:n}=this.props,{weightsTransform:r,worldBounds:a,textureSize:o,weightsTexture:i,weightsScale:s}=this.state;this.state.isWeightMapDirty=!1;const l=this._worldToCommonBounds(a,{useLayerCoordinateSystem:!0});if(t&&"SUM"===n){const{viewport:e}=this.context,n=e.distanceScales.metersPerUnit[2]*(l[2]-l[0])/o;this.state.colorDomain=t.map(e=>e*n*s)}else this.state.colorDomain=t||$t;const u={radiusPixels:e,commonBounds:l,textureWidth:o,weightsScale:s};r.update({elementCount:this.getNumInstances()}),r.run({uniforms:u,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:this.getAttributes(),moduleSettings:this.getModuleSettings()}),this._updateMaxWeightValue(),i.setParameters({10240:9729,10241:9729})}_debouncedUpdateWeightmap(e=!1){let{updateTimer:t}=this.state;const{debounceTimeout:n}=this.props;e?(t=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirty:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(t),t=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),n)),this.setState({updateTimer:t})}_worldToCommonBounds(e,t={}){const{useLayerCoordinateSystem:n=!1}=t,[r,a,o,i]=e,{viewport:s}=this.context,{textureSize:l}=this.state,{coordinateSystem:u}=this.props,c=n&&(u===me.a.LNGLAT_OFFSETS||u===me.a.METER_OFFSETS),d=c?s.projectPosition(this.props.coordinateOrigin):[0,0],f=2*l/s.scale;let p,h;return n&&!c?(p=this.projectPosition([r,a,0]),h=this.projectPosition([o,i,0])):(p=s.projectPosition([r,a,0]),h=s.projectPosition([o,i,0])),function(e,t,n){const[r,a,o,i]=e,s=o-r,l=i-a;let u=s,c=l;s/l<t/n?u=t/n*l:c=n/t*s,u<t&&(u=t,c=n);const d=(o+r)/2,f=(i+a)/2;return[d-u/2,f-c/2,d+u/2,f+c/2]}([p[0]-d[0],p[1]-d[1],h[0]-d[0],h[1]-d[1]],f,f)}_commonToWorldBounds(e){const[t,n,r,a]=e,{viewport:o}=this.context,i=o.unprojectPosition([t,n]),s=o.unprojectPosition([r,a]);return i.slice(0,2).concat(s.slice(0,2))}}an.layerName="HeatmapLayer",an.defaultProps=tn},function(e,t,n){"use strict";n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return d}));var r=n(154),a=n(163),o=n(90),i=n(79),s=n(342);function l(e,t){if(Object(o.a)(Object(i.d)(e),"setParameters requires a WebGL context"),Object(s.b)(t))return;const n={};for(const a in t){const o=Number(a),i=r.e[a];i&&("string"==typeof i?n[i]=!0:i(e,t[a],o))}const a=e.state&&e.state.cache;if(a)for(const o in n){(0,r.a[o])(e,t,a)}}function u(e,t){if("number"==typeof(t=t||r.c)){const n=t,a=r.d[n];return a?a(e,n):e.getParameter(n)}const n=Array.isArray(t)?t:Object.keys(t),a={};for(const t of n){const n=r.d[t];a[t]=n?n(e,Number(t)):e.getParameter(Number(t))}return a}function c(e){l(e,r.c)}function d(e,t,n){if(Object(s.b)(t))return n(e);const{nocatch:r=!0}=t;let o;if(Object(a.b)(e),l(e,t),r)o=n(e),Object(a.a)(e);else try{o=n(e)}finally{Object(a.a)(e)}return o}},function(e,t,n){"use strict";function r(e){this._context=e}r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},t.a=function(e){return new r(e)}},function(e,t,n){"use strict";function r(e){return function(t){return t.matches(e)}}n.d(t,"a",(function(){return r})),t.b=function(e){return function(){return this.matches(e)}}},function(e,t,n){"use strict";var r=n(287),a=n(211);function o(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===a.b&&t.documentElement.namespaceURI===a.b?t.createElement(e):t.createElementNS(n,e)}}function i(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}t.a=function(e){var t=Object(r.a)(e);return(t.local?i:o)(t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="3.1.6"},function(e,t,n){"use strict";n.d(t,"b",(function(){return r}));var r="http://www.w3.org/1999/xhtml";t.a={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(4),a=n(333);class o{constructor(e,t){Object(r.a)(this,"name",void 0),Object(r.a)(this,"type",void 0),Object(r.a)(this,"sampleSize",1),Object(r.a)(this,"time",void 0),Object(r.a)(this,"count",void 0),Object(r.a)(this,"samples",void 0),Object(r.a)(this,"lastTiming",void 0),Object(r.a)(this,"lastSampleTime",void 0),Object(r.a)(this,"lastSampleCount",void 0),Object(r.a)(this,"_count",0),Object(r.a)(this,"_time",0),Object(r.a)(this,"_samples",0),Object(r.a)(this,"_startTime",0),Object(r.a)(this,"_timerPending",!1),this.name=e,this.type=t,this.reset()}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=Object(a.a)(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(Object(a.a)()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class i{constructor(e){Object(r.a)(this,"id",void 0),Object(r.a)(this,"stats",{}),this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e in this.stats)this.stats[e].reset();return this}forEach(e){for(const t in this.stats)e(this.stats[t])}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;const{name:t,type:n}=e;return this.stats[t]||(this.stats[t]=e instanceof o?e:new o(t,n)),this.stats[t]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var r=n(103);function a(e,t,n=null){if(n)return n;const a={fetch:Object(r.a)(t,e),...e};return Array.isArray(a.loaders)||(a.loaders=null),a}function o(e,t){if(!t&&e&&!Array.isArray(e))return e;let n;if(e&&(n=Array.isArray(e)?e:[e]),t&&t.loaders){const e=Array.isArray(t.loaders)?t.loaders:[t.loaders];n=n?[...n,...e]:e}return n&&n.length?n:null}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e.default:e}t.__esModule=!0;var a=n(1404);t.Motion=r(a);var o=n(1406);t.StaggeredMotion=r(o);var i=n(1407);t.TransitionMotion=r(i);var s=n(1409);t.spring=r(s);var l=n(869);t.presets=r(l);var u=n(376);t.stripStyle=r(u);var c=n(1410);t.reorderKeys=r(c)},function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(85),a=n(453),o=n(47),i=n(146);class s extends a.a{get ELEMENTS(){return Object(i.a)(!1),0}get RANK(){return Object(i.a)(!1),0}toString(){let e="[";if(o.b.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+t])}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=" ".concat(this[t])}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=Object(r.a)(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)t[e]=this[n+e];return t}setColumn(e,t){const n=e*this.RANK;for(let e=0;e<this.RANK;++e)this[n+e]=t[e];return this}}var l=n(301),u=n(14),c=n(35),d=n(19),f=n(48);const p=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),h=Object.freeze([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),m=Object.freeze({COL0ROW0:0,COL0ROW1:1,COL0ROW2:2,COL0ROW3:3,COL1ROW0:4,COL1ROW1:5,COL1ROW2:6,COL1ROW3:7,COL2ROW0:8,COL2ROW1:9,COL2ROW2:10,COL2ROW3:11,COL3ROW0:12,COL3ROW1:13,COL3ROW2:14,COL3ROW3:15}),g={};class y extends s{static get IDENTITY(){return g.IDENTITY=g.IDENTITY||Object.freeze(new y(p)),g.IDENTITY}static get ZERO(){return g.ZERO=g.ZERO||Object.freeze(new y(h)),g.ZERO}get INDICES(){return m}get ELEMENTS(){return 16}get RANK(){return 4}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=t,this[2]=n,this[3]=r,this[4]=a,this[5]=o,this[6]=i,this[7]=s,this[8]=l,this[9]=u,this[10]=c,this[11]=d,this[12]=f,this[13]=p,this[14]=h,this[15]=m,this.check()}setRowMajor(e,t,n,r,a,o,i,s,l,u,c,d,f,p,h,m){return this[0]=e,this[1]=a,this[2]=l,this[3]=f,this[4]=t,this[5]=o,this[6]=u,this[7]=p,this[8]=n,this[9]=i,this[10]=c,this[11]=h,this[12]=r,this[13]=s,this[14]=d,this[15]=m,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(p)}fromQuaternion(e){return u.c(this,e),this.check()}frustum({left:e,right:t,bottom:n,top:r,near:a,far:o}){return o===1/0?y._computeInfinitePerspectiveOffCenter(this,e,t,n,r,a):u.d(this,e,t,n,r,a,o),this.check()}static _computeInfinitePerspectiveOffCenter(e,t,n,r,a,o){const i=2*o/(n-t),s=2*o/(a-r),l=(n+t)/(n-t),u=(a+r)/(a-r),c=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=l,e[9]=u,e[10]=-1,e[11]=-1,e[12]=0,e[13]=0,e[14]=c,e[15]=0,e}lookAt(e,t,n){return 1===arguments.length&&({eye:e,center:t,up:n}=e),t=t||[0,0,0],n=n||[0,1,0],u.g(this,e,t,n),this.check()}ortho({left:e,right:t,bottom:n,top:r,near:a=.1,far:o=500}){return u.i(this,e,t,n,r,a,o),this.check()}orthographic({fovy:e=45*Math.PI/180,aspect:t=1,focalDistance:n=1,near:r=.1,far:a=500}){if(e>2*Math.PI)throw Error("radians");const o=e/2,i=n*Math.tan(o),s=i*t;return(new y).ortho({left:-s,right:s,bottom:-i,top:i,near:r,far:a})}perspective({fovy:e,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:a=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return u.j(this,e,n,r,a),this.check()}determinant(){return u.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*r,e[5]=this[5]*a,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*r,e[9]=this[9]*a,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){const n=this.getScale(t||[-0,-0,-0]),r=1/n[0],a=1/n[1],o=1/n[2];return e[0]=this[0]*r,e[1]=this[1]*a,e[2]=this[2]*o,e[3]=this[4]*r,e[4]=this[5]*a,e[5]=this[6]*o,e[6]=this[8]*r,e[7]=this[9]*a,e[8]=this[10]*o,e}transpose(){return u.q(this,this),this.check()}invert(){return u.f(this,this),this.check()}multiplyLeft(e){return u.h(this,e,this),this.check()}multiplyRight(e){return u.h(this,this,e),this.check()}rotateX(e){return u.l(this,this,e),this.check()}rotateY(e){return u.m(this,this,e),this.check()}rotateZ(e){return u.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return u.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?u.o(this,this,e):u.o(this,this,[e,e,e]),this.check()}translate(e){return u.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(t=f.n(t||[-0,-0,-0,-0],e,this),Object(r.b)(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){const{length:n}=e;switch(n){case 2:t=c.j(t||[-0,-0],e,this);break;case 3:t=d.t(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=Object(l.a)(t||[-0,-0],e,this);break;case 3:t=Object(l.c)(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return Object(r.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return Object(r.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return Object(r.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}},,function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CURRENT_VERSION=t.VERSIONS=void 0;var a=(0,r(n(137)).default)({v0:null,v1:null});t.VERSIONS=a;var o=a.v1;t.CURRENT_VERSION=o},function(e,t,n){"use strict";(function(e,r){n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));const a={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"==typeof r&&r},o=(globalThis,a.window||a.self||a.global),i=a.process||{};console}).call(this,n(55),n(82))},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var a,o,i,s=r(n(12)),l=n(11),u={palm:588,desk:768},c={palm:function(){return(0,l.css)(a||(a=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).palm}),l.css.apply(void 0,arguments))},portable:function(){return(0,l.css)(o||(o=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk}),l.css.apply(void 0,arguments))},desk:function(){return(0,l.css)(i||(i=(0,s.default)(["\n @media (min-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk+1}),l.css.apply(void 0,arguments))}};t.media=c},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=R;var o,i,s,l=r(n(5)),u=r(n(7)),c=r(n(13)),d=r(n(9)),f=r(n(10)),p=r(n(8)),h=r(n(3)),m=r(n(12)),g=a(n(0)),y=n(94),v=n(54),A=r(n(1)),b=r(n(11)),_=r(n(865)),E=r(n(513)),x=n(28),M=n(61),w=n(514);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,h.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var a=(0,p.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,f.default)(this,n)}}var C=(0,b.default)(x.Input)(o||(o=(0,m.default)(["\n width: ","px;\n margin-left: ","px;\n font-size: ","; // 10px // 12px;\n padding: ","; // 4px 6px; // 6px 12px;\n"])),(function(e){return e.theme.sliderInputWidth}),(function(e){return e.flush?0:"tiny"===e.size?12:18}),(function(e){return e.theme.sliderInputFontSize}),(function(e){return e.theme.sliderInputPadding})),L=b.default.div(i||(i=(0,m.default)(["\n display: flex;\n position: relative;\n align-items: ",";\n"])),(function(e){return!e.isRanged&&e.showInput?"center":"flex-start"})),P=b.default.div(s||(s=(0,m.default)(["\n margin-top: 12px;\n display: flex;\n justify-content: space-between;\n"])));function R(e){var t=function(t){(0,d.default)(r,t);var n=T(r);function r(){var e;(0,l.default)(this,r);for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return e=n.call.apply(n,[this].concat(a)),(0,h.default)((0,c.default)(e),"state",{value0:0,value1:1,prevValue0:0,prevValue1:1,width:288}),(0,h.default)((0,c.default)(e),"sliderContainer",null),(0,h.default)((0,c.default)(e),"setSliderContainer",(function(t){e.sliderContainer=t,e._resize()})),(0,h.default)((0,c.default)(e),"inputValue0",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"inputValue1",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"value0Selector",(function(e){return e.value0})),(0,h.default)((0,c.default)(e),"value1Selector",(function(e){return e.value1})),(0,h.default)((0,c.default)(e),"filterValueSelector",(0,v.createSelector)(e.value0Selector,e.value1Selector,(function(e,t){return[e,t]}))),(0,h.default)((0,c.default)(e),"_roundValToStep",(function(t){var n=e.props,r=n.range,a=n.step;return(0,M.roundValToStep)(r[0],a,t)})),(0,h.default)((0,c.default)(e),"_setRangeVal1",(function(t){var n=e.props,r=n.value0,a=n.range,o=n.onChange,i=Number(t);return o([r,(0,M.clamp)([r,a[1]],e._roundValToStep(i))]),!0})),(0,h.default)((0,c.default)(e),"_setRangeVal0",(function(t){var n=e.props,r=n.value1,a=n.range,o=n.onChange,i=Number(t);return o([(0,M.clamp)([a[0],r],e._roundValToStep(i)),r]),!0})),(0,h.default)((0,c.default)(e),"_resize",(function(){if(e.sliderContainer){var t=e.sliderContainer.offsetWidth;t!==e.state.width&&e.setState({width:t})}})),(0,h.default)((0,c.default)(e),"_onChangeInput",(function(t,n){e.setState((0,h.default)({},t,n.target.value))})),e}return(0,u.default)(r,[{key:"componentDidMount",value:function(){this.sliderContainer instanceof Element&&(0,w.observeDimensions)(this.sliderContainer,this._resize)}},{key:"componentDidUpdate",value:function(){this._resize()}},{key:"componentWillUnmount",value:function(){this.sliderContainer instanceof Element&&(0,w.unobserveDimensions)(this.sliderContainer)}},{key:"_renderInput",value:function(e){var t=this,n="value0"===e?this._setRangeVal0:this._setRangeVal1,r="value0"===e?this.inputValue0:this.inputValue1,a=function(r){n(r.target.value)||t.setState((0,h.default)({},e,t.state[e]))},o=this._onChangeInput.bind(this,e);return g.default.createElement(C,{className:"kg-range-slider__input",type:"number",ref:r,id:"slider-input-".concat(e),key:e,value:this.state[e],onChange:o,onKeyPress:function(e){"Enter"===e.key&&(a(e),r.current.blur())},onBlur:a,flush:"value0"===e,size:this.props.inputSize,secondary:"secondary"===this.props.inputTheme})}},{key:"render",value:function(){var t=this.props,n=t.isRanged,r=t.showInput,a=t.histogram,o=t.lineChart,i=t.range,s=t.onChange,l=t.sliderHandleWidth,u=t.step,c=t.timezone,d=t.timeFormat,f=t.playbackControlWidth,p=this.state.width,h=Math.max(p-l,0),m=a&&a.length||o;return g.default.createElement("div",{className:"kg-range-slider",style:{width:"100%",padding:"0 ".concat(l/2,"px")},ref:this.setSliderContainer},Array.isArray(i)&&i.every(Number.isFinite)&&g.default.createElement(g.default.Fragment,null,m?g.default.createElement(e,{histogram:a,lineChart:this.props.lineChart,plotType:this.props.plotType,isEnlarged:this.props.isEnlarged,onBrush:function(e,t){return s([e,t])},marks:this.props.marks,range:i,value:this.props.plotValue||this.filterValueSelector(this.props),width:h,isRanged:n,step:u,timezone:c,timeFormat:d,playbackControlWidth:f}):null,g.default.createElement(L,{className:"kg-range-slider__slider",isRanged:n,showInput:r},this.props.xAxis?g.default.createElement("div",{style:{height:"30px"}},g.default.createElement(this.props.xAxis,{width:h,timezone:c,domain:i,isEnlarged:this.props.isEnlarged})):null,g.default.createElement(E.default,{marks:this.props.marks,showValues:!1,isRanged:n,minValue:i[0],maxValue:i[1],value0:this.props.value0,value1:this.props.value1,step:u,handleWidth:l,onSlider0Change:this._setRangeVal0,onSlider1Change:this._setRangeVal1,onSliderBarChange:function(e,t){s([e,t])},enableBarDrag:!0}),!n&&r?this._renderInput("value1"):null),n&&r?g.default.createElement(P,{className:"range-slider__input-group"},this._renderInput("value0"),this._renderInput("value1")):null))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=null,r=e.value0,a=e.value1;return e.value0===t.prevValue0||isNaN(r)||(n=S(S({},n||{}),{},{value0:r,prevValue0:r})),e.value1===t.prevValue1||isNaN(a)||(n=S(S({},n||{}),{},{value1:a,prevValue1:a})),n}}]),r}(g.Component);return(0,h.default)(t,"propTypes",{range:A.default.arrayOf(A.default.number),value0:A.default.number.isRequired,value1:A.default.number.isRequired,onChange:A.default.func.isRequired,histogram:A.default.arrayOf(A.default.any),isRanged:A.default.bool,isEnlarged:A.default.bool,showInput:A.default.bool,inputTheme:A.default.string,inputSize:A.default.string,step:A.default.number,sliderHandleWidth:A.default.number,xAxis:A.default.elementType}),(0,h.default)(t,"defaultProps",{isEnlarged:!1,isRanged:!0,showInput:!0,sliderHandleWidth:12,inputTheme:"",inputSize:"small",onChange:function(){}}),(0,y.polyfill)(t),t}R.deps=[_.default]},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=t.classList=void 0;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11));function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var v={list:"list-selector",listHeader:"list__header",listSection:"list__section",listItem:"list__item",listItemAnchor:"list__item__anchor"};t.classList=v;var A=function(e){return e},b=function(e){var t=e.value,n=e.displayOption,r=void 0===n?A:n;return p.default.createElement("span",{className:v.listItemAnchor},r(t))};t.ListItem=b;var _=g.default.div(o||(o=(0,f.default)(["\n background-color: ",";\n border-top: 1px solid\n ",";\n ",";\n"])),(function(e){return e.light?e.theme.dropdownListBgdLT:e.theme.dropdownListBgd}),(function(e){return e.light?e.theme.dropdownListBorderTopLT:e.theme.dropdownListBorderTop}),(function(e){return e.light?e.theme.dropdownListLT:e.theme.dropdownList})),E=function(e){(0,l.default)(n,e);var t=y(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"_onClick",value:function(e,t){t.preventDefault(),this.props.onOptionSelected(e,t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.fixedOptions,r=t.light,a=this.props.displayOption;if(!this.props.options.length&&this.props.allowCustomValues<=0)return!1;var o=Array.isArray(n)?n.length:0;return p.default.createElement(_,{className:v.list,light:r},this.props.customListHeaderComponent?p.default.createElement("div",{className:v.listHeader},p.default.createElement(this.props.customListHeaderComponent,null)):null,o>0?p.default.createElement("div",{className:v.listSection},n.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n,fixed:!0}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))}))):null,this.props.options.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n+o}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))})))}}]),n}(p.Component);t.default=E,(0,d.default)(E,"propTypes",{options:h.default.arrayOf(h.default.any),allowCustomValues:h.default.number,customClasses:h.default.object,customValues:h.default.arrayOf(h.default.any),customListItemComponent:h.default.oneOfType([h.default.element,h.default.func]),customListHeaderComponent:h.default.oneOfType([h.default.element,h.default.func]),selectionIndex:h.default.number,onOptionSelected:h.default.func,displayOption:h.default.func.isRequired,defaultClassNames:h.default.bool,areResultsTruncated:h.default.bool,resultsTruncatedMessage:h.default.string,listItemComponent:h.default.func}),(0,d.default)(E,"defaultProps",{customClasses:{},customListItemComponent:b,customListHeaderComponent:null,allowCustomValues:0,customValues:[],displayOption:A,onOptionSelected:function(){},defaultClassNames:!0,selectionIndex:null})},function(e,t,n){var r=n(320),a=n(1444),o=n(1445),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?a(e):o(e)}},function(e,t,n){var r=n(1470),a=n(1473);e.exports=function(e,t){var n=a(e,t);return r(n)?n:void 0}},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11)),y=n(39),v=n(28);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var b=g.default.div(o||(o=(0,f.default)(["\n margin-left: ","px;\n display: flex;\n align-items: center;\n color: ",";\n\n :hover {\n cursor: pointer;\n color: ",";\n }\n\n &.disabled {\n pointer-events: none;\n opacity: 0.3;\n }\n"])),(function(e){return e.flush?0:8}),(function(e){return e.active?e.theme.panelHeaderIconActive:e.theme.panelHeaderIcon}),(function(e){return e.hoverColor?e.theme[e.hoverColor]:e.theme.panelHeaderIconHover}));function _(){var e=function(e){(0,l.default)(n,e);var t=A(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.tooltip,r=e.id,a=e.active,o=e.flush,i=e.hoverColor,s=e.tooltipType,l=e.disabled,u=e.className;return p.default.createElement(b,{className:(0,m.default)("panel--header__action",(0,d.default)({disabled:l},u,u)),active:a,hoverColor:i,flush:o},p.default.createElement(this.props.IconComponent,{"data-tip":!0,"data-for":"".concat(n,"_").concat(r),height:"16px",onClick:t}),n?p.default.createElement(v.Tooltip,{id:"".concat(n,"_").concat(r),effect:"solid",delayShow:500,type:s},p.default.createElement("span",null,p.default.createElement(y.FormattedMessage,{id:n}))):null)}}]),n}(p.Component);return(0,d.default)(e,"propTypes",{id:h.default.string,flush:h.default.bool,tooltip:h.default.string,onClick:h.default.func,active:h.default.bool,disabled:h.default.bool,hoverColor:h.default.string,className:h.default.string,tooltipType:h.default.string}),(0,d.default)(e,"defaultProps",{onClick:function(){},hoverColor:null,active:!1}),e}_.deps=[]},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(0)),o=n(1560),i=n(39);var s=function(){var e=a.default.memo((function(e){var t=e.id,n=e.message;return a.default.createElement(o.Tooltip,{id:t,place:"left",effect:"solid"},a.default.createElement("span",null,a.default.createElement(i.FormattedMessage,{id:n})))}));return e.displayName="MapControlTooltip",e};t.default=s},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.CURRENT_VERSION=t.VERSIONS=void 0;var a=(0,r(n(137)).default)({v0:null,v1:null});t.VERSIONS=a;var o=a.v1;t.CURRENT_VERSION=o},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.media=void 0;var a,o,i,s=r(n(12)),l=n(11),u={palm:588,desk:768},c={palm:function(){return(0,l.css)(a||(a=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).palm}),l.css.apply(void 0,arguments))},portable:function(){return(0,l.css)(o||(o=(0,s.default)(["\n @media (max-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk}),l.css.apply(void 0,arguments))},desk:function(){return(0,l.css)(i||(i=(0,s.default)(["\n @media (min-width: ","px) {\n ",";\n }\n "])),(function(e){return(e.theme.breakPoints||u).desk+1}),l.css.apply(void 0,arguments))}};t.media=c},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=R;var o,i,s,l=r(n(5)),u=r(n(7)),c=r(n(13)),d=r(n(9)),f=r(n(10)),p=r(n(8)),h=r(n(3)),m=r(n(12)),g=a(n(0)),y=n(94),v=n(54),A=r(n(1)),b=r(n(11)),_=r(n(988)),E=r(n(570)),x=n(29),M=n(62),w=n(571);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){(0,h.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var a=(0,p.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,f.default)(this,n)}}var C=(0,b.default)(x.Input)(o||(o=(0,m.default)(["\n width: ","px;\n margin-left: ","px;\n font-size: ","; // 10px // 12px;\n padding: ","; // 4px 6px; // 6px 12px;\n"])),(function(e){return e.theme.sliderInputWidth}),(function(e){return e.flush?0:"tiny"===e.size?12:18}),(function(e){return e.theme.sliderInputFontSize}),(function(e){return e.theme.sliderInputPadding})),L=b.default.div(i||(i=(0,m.default)(["\n display: flex;\n position: relative;\n align-items: ",";\n"])),(function(e){return!e.isRanged&&e.showInput?"center":"flex-start"})),P=b.default.div(s||(s=(0,m.default)(["\n margin-top: 12px;\n display: flex;\n justify-content: space-between;\n"])));function R(e){var t=function(t){(0,d.default)(r,t);var n=T(r);function r(){var e;(0,l.default)(this,r);for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return e=n.call.apply(n,[this].concat(a)),(0,h.default)((0,c.default)(e),"state",{value0:0,value1:1,prevValue0:0,prevValue1:1,width:288}),(0,h.default)((0,c.default)(e),"sliderContainer",null),(0,h.default)((0,c.default)(e),"setSliderContainer",(function(t){e.sliderContainer=t,e._resize()})),(0,h.default)((0,c.default)(e),"inputValue0",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"inputValue1",(0,g.createRef)()),(0,h.default)((0,c.default)(e),"value0Selector",(function(e){return e.value0})),(0,h.default)((0,c.default)(e),"value1Selector",(function(e){return e.value1})),(0,h.default)((0,c.default)(e),"filterValueSelector",(0,v.createSelector)(e.value0Selector,e.value1Selector,(function(e,t){return[e,t]}))),(0,h.default)((0,c.default)(e),"_roundValToStep",(function(t){var n=e.props,r=n.range,a=n.step;return(0,M.roundValToStep)(r[0],a,t)})),(0,h.default)((0,c.default)(e),"_setRangeVal1",(function(t){var n=e.props,r=n.value0,a=n.range,o=n.onChange,i=Number(t);return o([r,(0,M.clamp)([r,a[1]],e._roundValToStep(i))]),!0})),(0,h.default)((0,c.default)(e),"_setRangeVal0",(function(t){var n=e.props,r=n.value1,a=n.range,o=n.onChange,i=Number(t);return o([(0,M.clamp)([a[0],r],e._roundValToStep(i)),r]),!0})),(0,h.default)((0,c.default)(e),"_resize",(function(){if(e.sliderContainer){var t=e.sliderContainer.offsetWidth;t!==e.state.width&&e.setState({width:t})}})),(0,h.default)((0,c.default)(e),"_onChangeInput",(function(t,n){e.setState((0,h.default)({},t,n.target.value))})),e}return(0,u.default)(r,[{key:"componentDidMount",value:function(){this.sliderContainer instanceof Element&&(0,w.observeDimensions)(this.sliderContainer,this._resize)}},{key:"componentDidUpdate",value:function(){this._resize()}},{key:"componentWillUnmount",value:function(){this.sliderContainer instanceof Element&&(0,w.unobserveDimensions)(this.sliderContainer)}},{key:"_renderInput",value:function(e){var t=this,n="value0"===e?this._setRangeVal0:this._setRangeVal1,r="value0"===e?this.inputValue0:this.inputValue1,a=function(r){n(r.target.value)||t.setState((0,h.default)({},e,t.state[e]))},o=this._onChangeInput.bind(this,e);return g.default.createElement(C,{className:"kg-range-slider__input",type:"number",ref:r,id:"slider-input-".concat(e),key:e,value:this.state[e],onChange:o,onKeyPress:function(e){"Enter"===e.key&&(a(e),r.current.blur())},onBlur:a,flush:"value0"===e,size:this.props.inputSize,secondary:"secondary"===this.props.inputTheme})}},{key:"render",value:function(){var t=this.props,n=t.isRanged,r=t.showInput,a=t.histogram,o=t.lineChart,i=t.range,s=t.onChange,l=t.sliderHandleWidth,u=t.step,c=t.timezone,d=t.timeFormat,f=t.playbackControlWidth,p=this.state.width,h=Math.max(p-l,0),m=a&&a.length||o;return g.default.createElement("div",{className:"kg-range-slider",style:{width:"100%",padding:"0 ".concat(l/2,"px")},ref:this.setSliderContainer},Array.isArray(i)&&i.every(Number.isFinite)&&g.default.createElement(g.default.Fragment,null,m?g.default.createElement(e,{histogram:a,lineChart:this.props.lineChart,plotType:this.props.plotType,isEnlarged:this.props.isEnlarged,onBrush:function(e,t){return s([e,t])},marks:this.props.marks,range:i,value:this.props.plotValue||this.filterValueSelector(this.props),width:h,isRanged:n,step:u,timezone:c,timeFormat:d,playbackControlWidth:f}):null,g.default.createElement(L,{className:"kg-range-slider__slider",isRanged:n,showInput:r},this.props.xAxis?g.default.createElement("div",{style:{height:"30px"}},g.default.createElement(this.props.xAxis,{width:h,timezone:c,domain:i,isEnlarged:this.props.isEnlarged})):null,g.default.createElement(E.default,{marks:this.props.marks,showValues:!1,isRanged:n,minValue:i[0],maxValue:i[1],value0:this.props.value0,value1:this.props.value1,step:u,handleWidth:l,onSlider0Change:this._setRangeVal0,onSlider1Change:this._setRangeVal1,onSliderBarChange:function(e,t){s([e,t])},enableBarDrag:!0}),!n&&r?this._renderInput("value1"):null),n&&r?g.default.createElement(P,{className:"range-slider__input-group"},this._renderInput("value0"),this._renderInput("value1")):null))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=null,r=e.value0,a=e.value1;return e.value0===t.prevValue0||isNaN(r)||(n=S(S({},n||{}),{},{value0:r,prevValue0:r})),e.value1===t.prevValue1||isNaN(a)||(n=S(S({},n||{}),{},{value1:a,prevValue1:a})),n}}]),r}(g.Component);return(0,h.default)(t,"propTypes",{range:A.default.arrayOf(A.default.number),value0:A.default.number.isRequired,value1:A.default.number.isRequired,onChange:A.default.func.isRequired,histogram:A.default.arrayOf(A.default.any),isRanged:A.default.bool,isEnlarged:A.default.bool,showInput:A.default.bool,inputTheme:A.default.string,inputSize:A.default.string,step:A.default.number,sliderHandleWidth:A.default.number,xAxis:A.default.elementType}),(0,h.default)(t,"defaultProps",{isEnlarged:!1,isRanged:!0,showInput:!0,sliderHandleWidth:12,inputTheme:"",inputSize:"small",onChange:function(){}}),(0,y.polyfill)(t),t}R.deps=[_.default]},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ListItem=t.classList=void 0;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11));function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var v={list:"list-selector",listHeader:"list__header",listSection:"list__section",listItem:"list__item",listItemAnchor:"list__item__anchor"};t.classList=v;var A=function(e){return e},b=function(e){var t=e.value,n=e.displayOption,r=void 0===n?A:n;return p.default.createElement("span",{className:v.listItemAnchor},r(t))};t.ListItem=b;var _=g.default.div(o||(o=(0,f.default)(["\n background-color: ",";\n border-top: 1px solid\n ",";\n ",";\n"])),(function(e){return e.light?e.theme.dropdownListBgdLT:e.theme.dropdownListBgd}),(function(e){return e.light?e.theme.dropdownListBorderTopLT:e.theme.dropdownListBorderTop}),(function(e){return e.light?e.theme.dropdownListLT:e.theme.dropdownList})),E=function(e){(0,l.default)(n,e);var t=y(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"_onClick",value:function(e,t){t.preventDefault(),this.props.onOptionSelected(e,t)}},{key:"render",value:function(){var e=this,t=this.props,n=t.fixedOptions,r=t.light,a=this.props.displayOption;if(!this.props.options.length&&this.props.allowCustomValues<=0)return!1;var o=Array.isArray(n)?n.length:0;return p.default.createElement(_,{className:v.list,light:r},this.props.customListHeaderComponent?p.default.createElement("div",{className:v.listHeader},p.default.createElement(this.props.customListHeaderComponent,null)):null,o>0?p.default.createElement("div",{className:v.listSection},n.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n,fixed:!0}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))}))):null,this.props.options.map((function(t,n){return p.default.createElement("div",{className:(0,m.default)(v.listItem,{hover:e.props.selectionIndex===n+o}),key:"".concat(a(t),"_").concat(n),onMouseDown:function(n){return e._onClick(t,n)},onClick:function(n){return e._onClick(t,n)}},p.default.createElement(e.props.customListItemComponent,{value:t,displayOption:a}))})))}}]),n}(p.Component);t.default=E,(0,d.default)(E,"propTypes",{options:h.default.arrayOf(h.default.any),allowCustomValues:h.default.number,customClasses:h.default.object,customValues:h.default.arrayOf(h.default.any),customListItemComponent:h.default.oneOfType([h.default.element,h.default.func]),customListHeaderComponent:h.default.oneOfType([h.default.element,h.default.func]),selectionIndex:h.default.number,onOptionSelected:h.default.func,displayOption:h.default.func.isRequired,defaultClassNames:h.default.bool,areResultsTruncated:h.default.bool,resultsTruncatedMessage:h.default.string,listItemComponent:h.default.func}),(0,d.default)(E,"defaultProps",{customClasses:{},customListItemComponent:b,customListHeaderComponent:null,allowCustomValues:0,customValues:[],displayOption:A,onOptionSelected:function(){},defaultClassNames:!0,selectionIndex:null})},function(e,t,n){"use strict";var r=n(2),a=n(6);Object.defineProperty(t,"__esModule",{value:!0}),t.default=_;var o,i=r(n(5)),s=r(n(7)),l=r(n(9)),u=r(n(10)),c=r(n(8)),d=r(n(3)),f=r(n(12)),p=a(n(0)),h=r(n(1)),m=r(n(36)),g=r(n(11)),y=n(40),v=n(29);function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,c.default)(e);if(t){var a=(0,c.default)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var b=g.default.div(o||(o=(0,f.default)(["\n margin-left: ","px;\n display: flex;\n align-items: center;\n color: ",";\n\n :hover {\n cursor: pointer;\n color: ",";\n }\n\n &.disabled {\n pointer-events: none;\n opacity: 0.3;\n }\n"])),(function(e){return e.flush?0:8}),(function(e){return e.active?e.theme.panelHeaderIconActive:e.theme.panelHeaderIcon}),(function(e){return e.hoverColor?e.theme[e.hoverColor]:e.theme.panelHeaderIconHover}));function _(){var e=function(e){(0,l.default)(n,e);var t=A(n);function n(){return(0,i.default)(this,n),t.apply(this,arguments)}return(0,s.default)(n,[{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.tooltip,r=e.id,a=e.active,o=e.flush,i=e.hoverColor,s=e.tooltipType,l=e.disabled,u=e.className;return p.default.createElement(b,{className:(0,m.default)("panel--header__action",(0,d.default)({disabled:l},u,u)),active:a,hoverColor:i,flush:o},p.default.createElement(this.props.IconComponent,{"data-tip":!0,"data-for":"".concat(n,"_").concat(r),height:"16px",onClick:t}),n?p.default.createElement(v.Tooltip,{id:"".concat(n,"_").concat(r),effect:"solid",delayShow:500,type:s},p.default.createElement("span",null,p.default.createElement(y.FormattedMessage,{id:n}))):null)}}]),n}(p.Component);return(0,d.default)(e,"propTypes",{id:h.default.string,flush:h.default.bool,tooltip:h.default.string,onClick:h.default.func,active:h.default.bool,disabled:h.default.bool,hoverColor:h.default.string,className:h.default.string,tooltipType:h.default.string}),(0,d.default)(e,"defaultProps",{onClick:function(){},hoverColor:null,active:!1}),e}_.deps=[]},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=r(n(0)),o=n(568),i=n(40);var s=function(){var e=a.default.memo((function(e){var t=e.id,n=e.message;return a.default.createElement(o.Tooltip,{id:t,place:"left",effect:"solid"},a.default.createElement("span",null,a.default.createElement(i.FormattedMessage,{id:n})))}));return e.displayName="MapControlTooltip",e};t.default=s},function(e,t){e.exports=function(e,t,n,r){var a,o,i=e.length,s=0;t=t<0?-t>i?0:i+t:t>i?i:t;if(n=n>0?n:0,r.length<1e4)return(o=Array.from(r)).unshift(t,n),[].splice.apply(e,o);a=[].splice.apply(e,[t,n]);for(;s<r.length;)(o=r.slice(s,s+1e4)).unshift(t,0),[].splice.apply(e,o),s+=1e4,t+=1e4;return a}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return lt})),n.d(t,"InteractiveMap",(function(){return lt})),n.d(t,"StaticMap",(function(){return Ue})),n.d(t,"Source",(function(){return ht})),n.d(t,"Layer",(function(){return At})),n.d(t,"BaseControl",(function(){return Et})),n.d(t,"Marker",(function(){return kt})),n.d(t,"Popup",(function(){return zt})),n.d(t,"FullscreenControl",(function(){return Wt})),n.d(t,"GeolocateControl",(function(){return Qt})),n.d(t,"NavigationControl",(function(){return an})),n.d(t,"ScaleControl",(function(){return un})),n.d(t,"CanvasOverlay",(function(){return fn})),n.d(t,"HTMLOverlay",(function(){return mn})),n.d(t,"SVGOverlay",(function(){return vn})),n.d(t,"TRANSITION_EVENTS",(function(){return Ve})),n.d(t,"TransitionInterpolator",(function(){return ce})),n.d(t,"LinearInterpolator",(function(){return Oe})),n.d(t,"FlyToInterpolator",(function(){return _e})),n.d(t,"MapController",(function(){return et})),n.d(t,"WebMercatorViewport",(function(){return q})),n.d(t,"setRTLTextPlugin",(function(){return An})),n.d(t,"_MapContext",(function(){return De}));var r=n(299),a=n(33),o=n(15),i=n(32),s=n(58),l=n(57),u=n(37),c=n(4),d=n(0),f=n(1),p=n.n(f);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var v=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function A(e){if(!e)return null;if("string"==typeof e)return e;e.toJS&&(e=e.toJS());var t,n={},r=g(e.layers);try{for(r.s();!(t=r.n()).done;){var a=t.value;n[a.id]=a}}catch(e){r.e(e)}finally{r.f()}var o=e.layers.map((function(e){var t=n[e.ref],r=null;if("interactive"in e&&delete(r=m({},e)).interactive,t){delete(r=r||m({},e)).ref;var a,o=g(v);try{for(o.s();!(a=o.n()).done;){var i=a.value;i in t&&(r[i]=t[i])}}catch(e){o.e(e)}finally{o.f()}}return r||e}));return m(m({},e),{},{layers:o})}var b=n(252),_=n(42),E=n(48);function x(e,t){var n=E.n([],t,e);return E.k(n,n,1/n[3]),n}function M(e,t){var n=e%t;return n<0?t+n:n}function w(e,t,n){return n*t+(1-n)*e}var O=n(14),S=n(35),T=n(19);function C(e,t){if(!e)throw new Error(t||"@math.gl/web-mercator: assertion failed.")}var L=Math.PI,P=L/4,R=L/180,D=180/L;function k(e){return Math.pow(2,e)}function I(e){return Math.log2(e)}function F(e){var t=Object(_.a)(e,2),n=t[0],r=t[1];C(Number.isFinite(n)),C(Number.isFinite(r)&&r>=-90&&r<=90,"invalid latitude");var a=r*R;return[512*(n*R+L)/(2*L),512*(L+Math.log(Math.tan(P+.5*a)))/(2*L)]}function j(e){var t=Object(_.a)(e,2),n=t[0],r=t[1],a=n/512*(2*L)-L,o=2*(Math.atan(Math.exp(r/512*(2*L)-L))-P);return[a*D,o*D]}function B(e){var t=e.latitude,n=e.longitude,r=e.highPrecision,a=void 0!==r&&r;C(Number.isFinite(t)&&Number.isFinite(n));var o={},i=Math.cos(t*R),s=512/360/i,l=512/4003e4/i;if(o.unitsPerMeter=[l,l,l],o.metersPerUnit=[1/l,1/l,1/l],o.unitsPerDegree=[512/360,s,l],o.degreesPerUnit=[.703125,1/s,1/l],a){var u=R*Math.tan(t*R)/i,c=512/360*u/2,d=512/4003e4*u,f=d/s*l;o.unitsPerDegree2=[0,c,d],o.unitsPerMeter2=[f,0,f]}return o}function N(e){var t=e.height,n=e.pitch,r=e.bearing,a=e.altitude,o=e.scale,i=e.center,s=void 0===i?null:i,l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return O.p(l,l,[0,0,-a]),O.l(l,l,-n*R),O.n(l,l,r*R),o/=t,O.o(l,l,[o,o,o]),s&&O.p(l,l,T.l([],s)),l}function z(e){var t=e.width,n=e.height,r=e.pitch,a=function(e){var t=e.width,n=e.height,r=e.altitude,a=void 0===r?1.5:r,o=e.pitch,i=void 0===o?0:o,s=e.nearZMultiplier,l=void 0===s?1:s,u=e.farZMultiplier,c=void 0===u?1:u,d=i*R,f=Math.atan(.5/a),p=Math.sin(f)*a/Math.sin(Math.min(Math.max(Math.PI/2-d-f,.01),Math.PI-.01));return{fov:2*f,aspect:t/n,focalDistance:a,near:l,far:(Math.sin(d)*p+a)*c}}({width:t,height:n,altitude:e.altitude,pitch:r,nearZMultiplier:e.nearZMultiplier,farZMultiplier:e.farZMultiplier}),o=a.fov,i=a.aspect,s=a.near,l=a.far;return O.j([],o,i,s,l)}function U(e,t){var n=Object(_.a)(e,3),r=n[0],a=n[1],o=n[2],i=void 0===o?0:o;return C(Number.isFinite(r)&&Number.isFinite(a)&&Number.isFinite(i)),x(t,[r,a,i,1])}function H(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=Object(_.a)(e,3),a=r[0],o=r[1],i=r[2];if(C(Number.isFinite(a)&&Number.isFinite(o),"invalid pixel coordinate"),Number.isFinite(i)){var s=x(t,[a,o,i,1]);return s}var l=x(t,[a,o,0,1]),u=x(t,[a,o,1,1]),c=l[2],d=u[2],f=c===d?0:((n||0)-c)/(d-c);return S.c([],l,u,f)}function V(e){var t=e.width,n=e.height,r=e.bounds,a=e.minExtent,o=void 0===a?0:a,i=e.maxZoom,s=void 0===i?24:i,l=e.padding,u=void 0===l?0:l,c=e.offset,d=void 0===c?[0,0]:c,f=Object(_.a)(r,2),p=Object(_.a)(f[0],2),h=p[0],m=p[1],g=Object(_.a)(f[1],2),y=g[0],v=g[1];if(Number.isFinite(u)){u={top:u,bottom:u,left:u,right:u}}else C(Number.isFinite(u.top)&&Number.isFinite(u.bottom)&&Number.isFinite(u.left)&&Number.isFinite(u.right));var A=new q({width:t,height:n,longitude:0,latitude:0,zoom:0}),b=A.project([h,v]),E=A.project([y,m]),x=[Math.max(Math.abs(E[0]-b[0]),o),Math.max(Math.abs(E[1]-b[1]),o)],M=[t-u.left-u.right-2*Math.abs(d[0]),n-u.top-u.bottom-2*Math.abs(d[1])];C(M[0]>0&&M[1]>0);var w=M[0]/x[0],O=M[1]/x[1],S=(u.right-u.left)/2/w,T=(u.bottom-u.top)/2/O,L=[(E[0]+b[0])/2+S,(E[1]+b[1])/2+T],P=A.unproject(L),R=Math.min(s,A.zoom+Math.log2(Math.abs(Math.min(w,O))));return C(Number.isFinite(R)),{longitude:P[0],latitude:P[1],zoom:R}}var G=Math.PI/180;function Y(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=e.width,o=e.height,i=e.unproject,s={targetZ:r},l=i([0,o],s),u=i([a,o],s),c=Math.atan(.5/e.altitude),d=(90-e.pitch)*G;return c>d-.01?(t=W(e,0,r),n=W(e,a,r)):(t=i([0,0],s),n=i([a,0],s)),[l,u,n,t]}function W(e,t,n){var r=e.pixelUnprojectionMatrix,a=x(r,[t,0,1,1]),o=x(r,[t,e.height,1,1]),i=(n*e.distanceScales.unitsPerMeter[2]-a[2])/(o[2]-a[2]),s=j(S.c([],a,o,i));return s[2]=n,s}var q=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1},n=t.width,r=t.height,o=t.latitude,i=void 0===o?0:o,s=t.longitude,l=void 0===s?0:s,u=t.zoom,c=void 0===u?0:u,d=t.pitch,f=void 0===d?0:d,p=t.bearing,h=void 0===p?0:p,m=t.altitude,g=void 0===m?1.5:m,y=t.nearZMultiplier,v=void 0===y?.02:y,A=t.farZMultiplier,b=void 0===A?1.01:A;Object(a.a)(this,e),n=n||1,r=r||1;var _=k(c);g=Math.max(.75,g);var E=F([l,i]);E[2]=0,this.projectionMatrix=z({width:n,height:r,pitch:f,altitude:g,nearZMultiplier:v,farZMultiplier:b}),this.viewMatrix=N({height:r,scale:_,center:E,pitch:f,bearing:h,altitude:g}),this.width=n,this.height=r,this.scale=_,this.latitude=i,this.longitude=l,this.zoom=c,this.pitch=f,this.bearing=h,this.altitude=g,this.center=E,this.distanceScales=B(this),this._initMatrices(),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),Object.freeze(this)}return Object(i.a)(e,[{key:"_initMatrices",value:function(){var e=this.width,t=this.height,n=this.projectionMatrix,r=this.viewMatrix,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];O.h(a,a,n),O.h(a,a,r),this.viewProjectionMatrix=a;var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];O.o(o,o,[e/2,-t/2,1]),O.p(o,o,[1,-1,0]),O.h(o,o,a);var i=O.f([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!i)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=i}},{key:"equals",value:function(t){return t instanceof e&&(t.width===this.width&&t.height===this.height&&O.b(t.projectionMatrix,this.projectionMatrix)&&O.b(t.viewMatrix,this.viewMatrix))}},{key:"project",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,r=void 0===n||n,a=this.projectPosition(e),o=U(a,this.pixelProjectionMatrix),i=Object(_.a)(o,2),s=i[0],l=i[1],u=r?l:this.height-l;return 2===e.length?[s,u]:[s,u,o[2]]}},{key:"unproject",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.topLeft,r=void 0===n||n,a=t.targetZ,o=void 0===a?void 0:a,i=Object(_.a)(e,3),s=i[0],l=i[1],u=i[2],c=r?l:this.height-l,d=o&&o*this.distanceScales.unitsPerMeter[2],f=H([s,c,u],this.pixelUnprojectionMatrix,d),p=this.unprojectPosition(f),h=Object(_.a)(p,3),m=h[0],g=h[1],y=h[2];return Number.isFinite(u)?[m,g,y]:Number.isFinite(o)?[m,g,o]:[m,g]}},{key:"projectPosition",value:function(e){var t=F(e),n=Object(_.a)(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.unitsPerMeter[2]]}},{key:"unprojectPosition",value:function(e){var t=j(e),n=Object(_.a)(t,2);return[n[0],n[1],(e[2]||0)*this.distanceScales.metersPerUnit[2]]}},{key:"projectFlat",value:function(e){return F(e)}},{key:"unprojectFlat",value:function(e){return j(e)}},{key:"getMapCenterByLngLatPosition",value:function(e){var t=e.lngLat,n=H(e.pos,this.pixelUnprojectionMatrix),r=F(t),a=S.a([],r,S.d([],n));return j(S.a([],this.center,a))}},{key:"getLocationAtPoint",value:function(e){var t=e.lngLat,n=e.pos;return this.getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"fitBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.width,a=this.height,o=V(Object.assign({width:r,height:a,bounds:t},n)),i=o.longitude,s=o.latitude,l=o.zoom;return new e({width:r,height:a,longitude:i,latitude:s,zoom:l})}},{key:"getBounds",value:function(e){var t=this.getBoundingRegion(e),n=Math.min.apply(Math,Object(b.a)(t.map((function(e){return e[0]})))),r=Math.max.apply(Math,Object(b.a)(t.map((function(e){return e[0]}))));return[[n,Math.min.apply(Math,Object(b.a)(t.map((function(e){return e[1]}))))],[r,Math.max.apply(Math,Object(b.a)(t.map((function(e){return e[1]}))))]]}},{key:"getBoundingRegion",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Y(this,e.z||0)}}]),e}();function X(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return K(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return K(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Z=["longitude","latitude","zoom"],J={curve:1.414,speed:1.2};function Q(e,t,n){var r=(n=Object.assign({},J,n)).curve,a=e.zoom,o=[e.longitude,e.latitude],i=k(a),s=t.zoom,l=[t.longitude,t.latitude],u=k(s-a),c=F(o),d=F(l),f=S.f([],d,c),p=Math.max(e.width,e.height),h=p/u,m=S.b(f)*i,g=Math.max(m,.01),y=r*r,v=(h*h-p*p+y*y*g*g)/(2*p*y*g),A=(h*h-p*p-y*y*g*g)/(2*h*y*g),b=Math.log(Math.sqrt(v*v+1)-v),_=Math.log(Math.sqrt(A*A+1)-A);return{startZoom:a,startCenterXY:c,uDelta:f,w0:p,u1:m,S:(_-b)/r,rho:r,rho2:y,r0:b,r1:_}}var $=n(1181),ee=n(463),te=n(656),ne=n.n(te);function re(e){return Array.isArray(e)||ArrayBuffer.isView(e)}function ae(e,t){if(e===t)return!0;if(re(e)&&re(t)){if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!ae(e[n],t[n]))return!1;return!0}return Math.abs(e-t)<=1e-7}function oe(e,t,n){return Math.max(t,Math.min(n,e))}function ie(e,t,n){return re(e)?e.map((function(e,r){return ie(e,t[r],n)})):n*t+(1-n)*e}function se(e,t){if(!e)throw new Error(t||"react-map-gl: assertion failed.")}function le(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return ue(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ue(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function ue(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ce=function(){function e(){Object(a.a)(this,e),Object(c.a)(this,"propNames",[])}return Object(i.a)(e,[{key:"arePropsEqual",value:function(e,t){var n,r=le(this.propNames||[]);try{for(r.s();!(n=r.n()).done;){var a=n.value;if(!ae(e[a],t[a]))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}},{key:"initializeProps",value:function(e,t){return{start:e,end:t}}},{key:"interpolateProps",value:function(e,t,n){se(!1,"interpolateProps is not implemented")}},{key:"getDuration",value:function(e,t){return t.transitionDuration}}]),e}(),de={longitude:1,bearing:1};function fe(e){return Number.isFinite(e)||Array.isArray(e)}function pe(e,t,n){return function(e){return e in de}(e)&&Math.abs(n-t)>180&&(n=n<0?n+360:n-360),n}function he(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return me(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function me(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var ye=["longitude","latitude","zoom","bearing","pitch"],ve=["latitude","longitude","zoom","width","height"],Ae=["bearing","pitch"],be={speed:1.2,curve:1.414},_e=function(e){Object(s.a)(n,e);var t=ge(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,n),e=t.call(this),Object(c.a)(Object(o.a)(e),"speed",void 0),Object(c.a)(Object(o.a)(e),"propNames",ye),Object(c.a)(Object(o.a)(e),"props",void 0),e.props=Object.assign({},be,r),e}return Object(i.a)(n,[{key:"initializeProps",value:function(e,t){var n,r={},a={},o=he(ve);try{for(o.s();!(n=o.n()).done;){var i=n.value,s=e[i],l=t[i];se(fe(s)&&fe(l),"".concat(i," must be supplied for transition")),r[i]=s,a[i]=pe(i,s,l)}}catch(e){o.e(e)}finally{o.f()}var u,c=he(Ae);try{for(c.s();!(u=c.n()).done;){var d=u.value,f=e[d]||0,p=t[d]||0;r[d]=f,a[d]=pe(d,f,p)}}catch(e){c.e(e)}finally{c.f()}return{start:r,end:a}}},{key:"interpolateProps",value:function(e,t,n){var r,a=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a={},o=Q(e,t,r),i=o.startZoom,s=o.startCenterXY,l=o.uDelta,u=o.w0,c=o.u1,d=o.S,f=o.rho,p=o.rho2,h=o.r0;if(c<.01){var m,g=X(Z);try{for(g.s();!(m=g.n()).done;){var y=m.value,v=e[y],A=t[y];a[y]=w(v,A,n)}}catch(e){g.e(e)}finally{g.f()}return a}var b=n*d,_=Math.cosh(h)/Math.cosh(h+f*b),E=u*((Math.cosh(h)*Math.tanh(h+f*b)-Math.sinh(h))/p)/c,x=1/_,M=i+I(x),O=S.e([],l,E);S.a(O,O,s);var T=j(O);return a.longitude=T[0],a.latitude=T[1],a.zoom=M,a}(e,t,n,this.props),o=he(Ae);try{for(o.s();!(r=o.n()).done;){var i=r.value;a[i]=ie(e[i],t[i],n)}}catch(e){o.e(e)}finally{o.f()}return a}},{key:"getDuration",value:function(e,t){var n=t.transitionDuration;return"auto"===n&&(n=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=r=Object.assign({},J,r),o=a.screenSpeed,i=a.speed,s=a.maxDuration,l=Q(e,t,r),u=l.S,c=l.rho,d=1e3*u;return n=Number.isFinite(o)?d/(o/c):d/i,Number.isFinite(s)&&n>s?0:n}(e,t,this.props)),n}}]),n}(ce);function Ee(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xe(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,a,o=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){i=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(i)throw a}}}}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Me(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var we=["longitude","latitude","zoom","bearing","pitch"],Oe=function(e){Object(s.a)(n,e);var t=Me(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)(this,n),e=t.call(this),Object(c.a)(Object(o.a)(e),"around",void 0),Array.isArray(r)&&(r={transitionProps:r}),e.propNames=r.transitionProps||we,r.around&&(e.around=r.around),e}return Object(i.a)(n,[{key:"initializeProps",value:function(e,t){var n={},r={};if(this.around){n.around=this.around;var a=new q(e).unproject(this.around);Object.assign(r,t,{around:new q(t).project(a),aroundLngLat:a})}var o,i=Ee(this.propNames);try{for(i.s();!(o=i.n()).done;){var s=o.value,l=e[s],u=t[s];se(fe(l)&&fe(u),"".concat(s," must be supplied for transition")),n[s]=l,r[s]=pe(s,l,u)}}catch(e){i.e(e)}finally{i.f()}return{start:n,end:r}}},{key:"interpolateProps",value:function(e,t,n){var r,a={},o=Ee(this.propNames);try{for(o.s();!(r=o.n()).done;){var i=r.value;a[i]=ie(e[i],t[i],n)}}catch(e){o.e(e)}finally{o.f()}if(t.around){var s=new q(Object.assign({},t,a)).getMapCenterByLngLatPosition({lngLat:t.aroundLngLat,pos:ie(e.around,t.around,n)}),l=Object(_.a)(s,2),u=l[0],c=l[1];a.longitude=u,a.latitude=c}return a}}]),n}(ce),Se={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},Te=0,Ce=0,Le=1.5,Pe=function(){function e(t){var n=t.width,r=t.height,o=t.latitude,i=t.longitude,s=t.zoom,l=t.bearing,u=void 0===l?Ce:l,d=t.pitch,f=void 0===d?Te:d,p=t.altitude,h=void 0===p?Le:p,m=t.maxZoom,g=void 0===m?Se.maxZoom:m,y=t.minZoom,v=void 0===y?Se.minZoom:y,A=t.maxPitch,b=void 0===A?Se.maxPitch:A,_=t.minPitch,E=void 0===_?Se.minPitch:_,x=t.transitionDuration,M=t.transitionEasing,w=t.transitionInterpolator,O=t.transitionInterruption,S=t.startPanLngLat,T=t.startZoomLngLat,C=t.startBearing,L=t.startPitch,P=t.startZoom;Object(a.a)(this,e),Object(c.a)(this,"_viewportProps",void 0),Object(c.a)(this,"_interactiveState",void 0),se(Number.isFinite(n),"`width` must be supplied"),se(Number.isFinite(r),"`height` must be supplied"),se(Number.isFinite(i),"`longitude` must be supplied"),se(Number.isFinite(o),"`latitude` must be supplied"),se(Number.isFinite(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:n,height:r,latitude:o,longitude:i,zoom:s,bearing:u,pitch:f,altitude:h,maxZoom:g,minZoom:v,maxPitch:b,minPitch:E,transitionDuration:x,transitionEasing:M,transitionInterpolator:w,transitionInterruption:O}),this._interactiveState={startPanLngLat:S,startZoomLngLat:T,startBearing:C,startPitch:L,startZoom:P}}return Object(i.a)(e,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getInteractiveState",value:function(){return this._interactiveState}},{key:"panStart",value:function(e){var t=e.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(t)})}},{key:"pan",value:function(e){var t=e.pos,n=e.startPos,r=this._interactiveState.startPanLngLat||this._unproject(n);if(!r)return this;var a=this._calculateNewLngLat({startPanLngLat:r,pos:t}),o=Object(_.a)(a,2),i=o[0],s=o[1];return this._getUpdatedMapState({longitude:i,latitude:s})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(e){e.pos;return this._getUpdatedMapState({startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(e){var t=e.deltaScaleX,n=void 0===t?0:t,r=e.deltaScaleY,a=void 0===r?0:r,o=this._interactiveState,i=o.startBearing,s=o.startPitch;if(!Number.isFinite(i)||!Number.isFinite(s))return this;var l=this._calculateNewPitchAndBearing({deltaScaleX:n,deltaScaleY:a,startBearing:i||0,startPitch:s||0}),u=l.pitch,c=l.bearing;return this._getUpdatedMapState({bearing:c,pitch:u})}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(e){var t=e.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(t),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(e){var t=e.pos,n=e.startPos,r=e.scale;se(r>0,"`scale` must be a positive number");var a=this._interactiveState,o=a.startZoom,i=a.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,i=this._unproject(n)||this._unproject(t)),se(i,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var s=this._calculateNewZoom({scale:r,startZoom:o||0}),l=new q(Object.assign({},this._viewportProps,{zoom:s})).getMapCenterByLngLatPosition({lngLat:i,pos:t}),u=Object(_.a)(l,2),c=u[0],d=u[1];return this._getUpdatedMapState({zoom:s,longitude:c,latitude:d})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(t){return new e(Object.assign({},this._viewportProps,this._interactiveState,t))}},{key:"_applyConstraints",value:function(e){var t=e.maxZoom,n=e.minZoom,r=e.zoom;e.zoom=oe(r,n,t);var a=e.maxPitch,o=e.minPitch,i=e.pitch;return e.pitch=oe(i,o,a),Object.assign(e,function(e){var t=e.width,n=e.height,r=e.longitude,a=e.latitude,o=e.zoom,i=e.pitch,s=void 0===i?0:i,l=e.bearing,u=void 0===l?0:l;(r<-180||r>180)&&(r=M(r+180,360)-180),(u<-180||u>180)&&(u=M(u+180,360)-180);var c=new q({width:t,height:n,longitude:r,latitude:a,zoom:o}),d=c.project([r,85.05113])[1],f=c.project([r,-85.05113])[1],p=0;return f-d<n&&(o+=Math.log2(n/(f-d)),d=(c=new q({width:t,height:n,longitude:r,latitude:a,zoom:o})).project([r,85.05113])[1],f=c.project([r,-85.05113])[1]),d>0?p=d:f<n&&(p=f-n),p&&(a=c.unproject([t/2,n/2+p])[1]),{width:t,height:n,longitude:r,latitude:a,zoom:o,pitch:s,bearing:u}}(e)),e}},{key:"_unproject",value:function(e){var t=new q(this._viewportProps);return e&&t.unproject(e)}},{key:"_calculateNewLngLat",value:function(e){var t=e.startPanLngLat,n=e.pos;return new q(this._viewportProps).getMapCenterByLngLatPosition({lngLat:t,pos:n})}},{key:"_calculateNewZoom",value:function(e){var t=e.scale,n=e.startZoom,r=this._viewportProps,a=r.maxZoom,o=r.minZoom;return oe(n+Math.log2(t),o,a)}},{key:"_calculateNewPitchAndBearing",value:function(e){var t=e.deltaScaleX,n=e.deltaScaleY,r=e.startBearing,a=e.startPitch;n=oe(n,-1,1);var o=this._viewportProps,i=o.minPitch,s=o.maxPitch,l=a;return n>0?l=a+n*(s-a):n<0&&(l=a-n*(i-a)),{pitch:l,bearing:r+180*t}}}]),e}();function Re(e){return e[0].toLowerCase()+e.slice(1)}var De=Object(d.createContext)({viewport:null,map:null,mapContainer:null,onViewportChange:null,onViewStateChange:null,eventManager:null,isDragging:!1});function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var je="A valid API access token is required to use Mapbox data";var Be={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},Ne=Object.assign({},ee.a.propTypes,{width:p.a.oneOfType([p.a.number,p.a.string]),height:p.a.oneOfType([p.a.number,p.a.string]),onResize:p.a.func,preventStyleDiffing:p.a.bool,disableTokenWarning:p.a.bool,visible:p.a.bool,className:p.a.string,style:p.a.object,visibilityConstraints:p.a.object}),ze=Object.assign({},ee.a.defaultProps,{preventStyleDiffing:!1,disableTokenWarning:!1,visible:!0,onResize:function(){},className:"",style:null,visibilityConstraints:Se}),Ue=function(e){Object(s.a)(n,e);var t=Fe(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{accessTokenInvalid:!1}),Object(c.a)(Object(o.a)(e),"_mapbox",null),Object(c.a)(Object(o.a)(e),"_map",null),Object(c.a)(Object(o.a)(e),"_mapboxMapRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_mapContainerRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_queryParams",{}),Object(c.a)(Object(o.a)(e),"_width",0),Object(c.a)(Object(o.a)(e),"_height",0),Object(c.a)(Object(o.a)(e),"getMap",(function(){return e._map})),Object(c.a)(Object(o.a)(e),"queryRenderedFeatures",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e._map.queryRenderedFeatures(t,n)})),Object(c.a)(Object(o.a)(e),"_mapboxMapError",(function(t){401!==(t.error&&t.error.status||t.status)||e.state.accessTokenInvalid||(console.error(je),e.setState({accessTokenInvalid:!0})),e.props.onError(t)})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){if(n.supported()){var e=this.props.mapStyle;this._mapbox=new ee.a(Object.assign({},this.props,{mapboxgl:ne.a,width:this._width,height:this._height,container:this._mapboxMapRef.current,onError:this._mapboxMapError,mapStyle:A(e)})),this._map=this._mapbox.getMap()}}},{key:"componentDidUpdate",value:function(e){this._mapbox&&(this._updateMapStyle(e,this.props),this._updateMapProps(this.props))}},{key:"componentWillUnmount",value:function(){this._mapbox&&(this._mapbox.finalize(),this._mapbox=null,this._map=null)}},{key:"_updateMapSize",value:function(e,t){this._width===e&&this._height===t||(this._width=e,this._height=t,this._updateMapProps(this.props))}},{key:"_updateMapStyle",value:function(e,t){var n=t.mapStyle;n!==e.mapStyle&&n&&this._map.setStyle(A(n),{diff:!this.props.preventStyleDiffing})}},{key:"_updateMapProps",value:function(e){this._mapbox&&this._mapbox.setProps(Object.assign({},e,{width:this._width,height:this._height}))}},{key:"_renderNoTokenWarning",value:function(){if(this.state.accessTokenInvalid&&!this.props.disableTokenWarning){return d.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},d.createElement("h3",{key:"header"},"NO_TOKEN_WARNING"),d.createElement("div",{key:"text"},"For information on setting up your basemap, read"),d.createElement("a",{key:"link",href:"https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens"},"Note on Map Tokens"))}return null}},{key:"_renderOverlays",value:function(e){var t=this,n=e.width,r=e.height;return this._updateMapSize(n,r),d.createElement(De.Consumer,null,(function(e){var a=Ie(Ie({},e),{},{viewport:new q(Ie(Ie(Ie({},t.props),t.props.viewState),{},{width:n,height:r})),map:t._map,mapContainer:e.mapContainer||t._mapContainerRef.current});return d.createElement(De.Provider,{value:a},d.createElement("div",{key:"map-overlays",className:"overlays",style:Be},t.props.children))}))}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.width,r=e.height,a=e.style,o=e.visibilityConstraints,i=Object.assign({position:"relative"},a,{width:n,height:r}),s=this.props.visible&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Se;for(var n in t){var r=n.slice(0,3),a=Re(n.slice(3));if("min"===r&&e[a]<t[n])return!1;if("max"===r&&e[a]>t[n])return!1}return!0}(this.props.viewState||this.props,o),l=Object.assign({},Be,{visibility:s?"inherit":"hidden"});return d.createElement("div",{key:"map-container",style:i,ref:this._mapContainerRef},d.createElement("div",{key:"map-mapbox",ref:this._mapboxMapRef,style:l,className:t}),d.createElement($.a,{key:"autosizer",onResize:this.props.onResize},this._renderOverlays.bind(this)),this._renderNoTokenWarning())}}],[{key:"supported",value:function(){return ne.a&&ne.a.supported()}}]),n}(d.PureComponent);Object(c.a)(Ue,"propTypes",Ne),Object(c.a)(Ue,"defaultProps",ze);var He=function(){};var Ve={BREAK:1,SNAP_TO_END:2,IGNORE:3,UPDATE:4},Ge={transitionDuration:0,transitionEasing:function(e){return e},transitionInterpolator:new Oe,transitionInterruption:Ve.BREAK,onTransitionStart:He,onTransitionInterrupt:He,onTransitionEnd:He,onViewportChange:He,onStateChange:He},Ye=function(){function e(t,n){var r=this;Object(a.a)(this,e),Object(c.a)(this,"props",void 0),Object(c.a)(this,"state",void 0),Object(c.a)(this,"time",void 0),Object(c.a)(this,"_animationFrame",null),Object(c.a)(this,"_onTransitionFrame",(function(){r._animationFrame=requestAnimationFrame(r._onTransitionFrame),r._updateViewport()})),t&&(this.props=t),this.time=n||Date.now}return Object(i.a)(e,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(e){var t=this.props;if(this.props=e,this._shouldIgnoreViewportChange(t,e))return!1;if(this._isTransitionEnabled(e)){var n=Object.assign({},t),r=Object.assign({},e);if(this._isTransitionInProgress()&&(t.onTransitionInterrupt(),this.state.interruption===Ve.SNAP_TO_END?Object.assign(n,this.state.endProps):Object.assign(n,this.state.propsInTransition),this.state.interruption===Ve.UPDATE)){var a=this.time(),o=(a-this.state.startTime)/this.state.duration;r.transitionDuration=this.state.duration-(a-this.state.startTime),r.transitionEasing=function(e,t){var n=e(t);return function(r){return 1/(1-n)*(e(r*(1-t)+t)-n)}}(this.state.easing,o),r.transitionInterpolator=n.transitionInterpolator}return r.onTransitionStart(),this._triggerTransition(n,r),!0}return this._isTransitionInProgress()&&(t.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return Boolean(this._animationFrame)}},{key:"_isTransitionEnabled",value:function(e){var t=e.transitionDuration,n=e.transitionInterpolator;return(t>0||"auto"===t)&&Boolean(n)}},{key:"_isUpdateDueToCurrentTransition",value:function(e){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(e,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(e,t){return!e||(this._isTransitionInProgress()?this.state.interruption===Ve.IGNORE||this._isUpdateDueToCurrentTransition(t):!this._isTransitionEnabled(t)||t.transitionInterpolator.arePropsEqual(e,t))}},{key:"_triggerTransition",value:function(e,t){se(this._isTransitionEnabled(t)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var n=t.transitionInterpolator,r=n.getDuration?n.getDuration(e,t):t.transitionDuration;if(0!==r){var a=t.transitionInterpolator.initializeProps(e,t),o={inTransition:!0,isZooming:e.zoom!==t.zoom,isPanning:e.longitude!==t.longitude||e.latitude!==t.latitude,isRotating:e.bearing!==t.bearing||e.pitch!==t.pitch};this.state={duration:r,easing:t.transitionEasing,interpolator:t.transitionInterpolator,interruption:t.transitionInterruption,startTime:this.time(),startProps:a.start,endProps:a.end,animation:null,propsInTransition:{},interactionState:o},this._onTransitionFrame(),this.props.onStateChange(o)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.props.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var e=this.time(),t=this.state,n=t.startTime,r=t.duration,a=t.easing,o=t.interpolator,i=t.startProps,s=t.endProps,l=!1,u=(e-n)/r;u>=1&&(u=1,l=!0),u=a(u);var c=o.interpolateProps(i,s,u),d=new Pe(Object.assign({},this.props,c));this.state.propsInTransition=d.getViewportProps(),this.props.onViewportChange(this.state.propsInTransition,this.state.interactionState,this.props),l&&(this._endTransition(),this.props.onTransitionEnd())}}]),e}();Object(c.a)(Ye,"defaultProps",Ge);var We=n(622);var qe={transitionDuration:0},Xe={transitionDuration:300,transitionEasing:function(e){return e},transitionInterpolator:new Oe,transitionInterruption:Ve.BREAK},Ke=["wheel"],Ze=["panstart","panmove","panend"],Je=["pinchstart","pinchmove","pinchend","pinchcancel"],Qe=["doubletap"],$e=["keydown"],et=function(){function e(){var t=this;Object(a.a)(this,e),Object(c.a)(this,"events",[]),Object(c.a)(this,"mapState",void 0),Object(c.a)(this,"onViewportChange",void 0),Object(c.a)(this,"onStateChange",void 0),Object(c.a)(this,"mapStateProps",void 0),Object(c.a)(this,"eventManager",void 0),Object(c.a)(this,"scrollZoom",!0),Object(c.a)(this,"dragPan",!0),Object(c.a)(this,"dragRotate",!0),Object(c.a)(this,"doubleClickZoom",!0),Object(c.a)(this,"touchZoom",!0),Object(c.a)(this,"touchRotate",!1),Object(c.a)(this,"keyboard",!0),Object(c.a)(this,"_state",{isDragging:!1}),Object(c.a)(this,"_events",{}),Object(c.a)(this,"_transitionManager",new Ye),Object(c.a)(this,"setState",(function(e){Object.assign(t._state,e),t.onStateChange&&t.onStateChange(t._state)})),this.handleEvent=this.handleEvent.bind(this),this._onWheelEnd=function(e,t){var n,r,a,o=function(){return a=null,e.apply(n,r)};return function(){n=this,r=arguments,a&&clearTimeout(a),a=setTimeout(o,t)}}(this._onWheelEnd,100)}return Object(i.a)(e,[{key:"handleEvent",value:function(e){switch(this.mapState=this.getMapState(),e.type){case"panstart":return this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchcancel":case"pinchend":return this._onPinchEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}},{key:"getCenter",value:function(e){var t=e.offsetCenter;return[t.x,t.y]}},{key:"isFunctionKeyPressed",value:function(e){var t=e.srcEvent;return Boolean(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}},{key:"updateViewport",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.mapState?this.mapState.getViewportProps():{},a=Object.assign({},e.getViewportProps(),t),o=Object.keys(a).some((function(e){return r[e]!==a[e]}));o&&this.onViewportChange(a,n,r),this.setState(Object.assign({},e.getInteractiveState(),n))}},{key:"getMapState",value:function(e){return new Pe(Object.assign({},this.mapStateProps,this._state,e))}},{key:"setOptions",value:function(e){var t=e.onViewportChange,n=e.onStateChange,r=e.eventManager,a=void 0===r?this.eventManager:r,o=e.isInteractive,i=void 0===o||o,s=e.scrollZoom,l=void 0===s?this.scrollZoom:s,u=e.dragPan,c=void 0===u?this.dragPan:u,d=e.dragRotate,f=void 0===d?this.dragRotate:d,p=e.doubleClickZoom,h=void 0===p?this.doubleClickZoom:p,m=e.touchZoom,g=void 0===m?this.touchZoom:m,y=e.touchRotate,v=void 0===y?this.touchRotate:y,A=e.keyboard,b=void 0===A?this.keyboard:A;this.onViewportChange=t,this.onStateChange=n;var _=!this.mapStateProps||this.mapStateProps.height!==e.height;this.mapStateProps=e,_&&this.updateViewport(new Pe(e)),this._transitionManager.processViewportChange(Object.assign({},e,{onStateChange:this.setState})),this.eventManager!==a&&(this.eventManager=a,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(Ke,i&&l),this.toggleEvents(Ze,i&&(c||f)),this.toggleEvents(Je,i&&(g||v)),this.toggleEvents(Qe,i&&h),this.toggleEvents($e,i&&b),this.scrollZoom=l,this.dragPan=c,this.dragRotate=f,this.doubleClickZoom=h,this.touchZoom=g,this.touchRotate=v,this.keyboard=b}},{key:"toggleEvents",value:function(e,t){var n=this;this.eventManager&&e.forEach((function(e){n._events[e]!==t&&(n._events[e]=t,t?n.eventManager.on(e,n.handleEvent):n.eventManager.off(e,n.handleEvent))}))}},{key:"_onPanStart",value:function(e){var t=this.getCenter(e),n=this.mapState.panStart({pos:t}).rotateStart({pos:t});return this.updateViewport(n,qe,{isDragging:!0}),!0}},{key:"_onPan",value:function(e){return this.isFunctionKeyPressed(e)||e.rightButton?this._onPanRotate(e):this._onPanMove(e)}},{key:"_onPanEnd",value:function(e){var t=this.mapState.panEnd().rotateEnd();return this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isRotating:!1}),!0}},{key:"_onPanMove",value:function(e){if(!this.dragPan)return!1;var t=this.getCenter(e),n=this.mapState.pan({pos:t});return this.updateViewport(n,qe,{isPanning:!0}),!0}},{key:"_onPanRotate",value:function(e){if(!this.dragRotate)return!1;var t=e.deltaX,n=e.deltaY,r=this.getCenter(e),a=Object(_.a)(r,2)[1],o=a-n,i=this.mapState.getViewportProps(),s=i.width,l=i.height,u=t/s,c=0;n>0?Math.abs(l-o)>5&&(c=n/(o-l)*1.2):n<0&&o>5&&(c=1-a/o),c=Math.min(1,Math.max(-1,c));var d=this.mapState.rotate({deltaScaleX:u,deltaScaleY:c});return this.updateViewport(d,qe,{isRotating:!0}),!0}},{key:"_onWheel",value:function(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e),n=e.delta,r=2/(1+Math.exp(-Math.abs(.01*n)));n<0&&0!==r&&(r=1/r);var a=this.mapState.zoom({pos:t,scale:r});return this.updateViewport(a,qe,{isZooming:!0}),this._onWheelEnd(),!0}},{key:"_onWheelEnd",value:function(){this.setState({isZooming:!1})}},{key:"_onPinchStart",value:function(e){var t=this.getCenter(e),n=this.mapState.zoomStart({pos:t}).rotateStart({pos:t});return this._state.startPinchRotation=e.rotation,this.updateViewport(n,qe,{isDragging:!0}),!0}},{key:"_onPinch",value:function(e){if(!this.touchZoom&&!this.touchRotate)return!1;var t=this.mapState;if(this.touchZoom){var n=e.scale,r=this.getCenter(e);t=t.zoom({pos:r,scale:n})}if(this.touchRotate){var a=e.rotation,o=this._state.startPinchRotation;t=t.rotate({deltaScaleX:-(a-o)/180})}return this.updateViewport(t,qe,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),!0}},{key:"_onPinchEnd",value:function(e){var t=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e),n=this.isFunctionKeyPressed(e),r=this.mapState.zoom({pos:t,scale:n?.5:2});return this.updateViewport(r,Object.assign({},Xe,{transitionInterpolator:new Oe({around:t})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(e){if(!this.keyboard)return!1;var t,n=this.isFunctionKeyPressed(e),r=this.mapStateProps;switch(e.srcEvent.keyCode){case 189:t=n?this.getMapState({zoom:r.zoom-2}):this.getMapState({zoom:r.zoom-1});break;case 187:t=n?this.getMapState({zoom:r.zoom+2}):this.getMapState({zoom:r.zoom+1});break;case 37:t=n?this.getMapState({bearing:r.bearing-15}):this.mapState.pan({pos:[100,0],startPos:[0,0]});break;case 39:t=n?this.getMapState({bearing:r.bearing+15}):this.mapState.pan({pos:[-100,0],startPos:[0,0]});break;case 38:t=n?this.getMapState({pitch:r.pitch+10}):this.mapState.pan({pos:[0,100],startPos:[0,0]});break;case 40:t=n?this.getMapState({pitch:r.pitch-10}):this.mapState.pan({pos:[0,-100],startPos:[0,0]});break;default:return!1}return this.updateViewport(t,Xe)}}]),e}(),tt=[{old:"onChangeViewport",new:"onViewportChange"},{old:"perspectiveEnabled",new:"dragRotate"},{old:"onHoverFeatures",new:"onHover"},{old:"onClickFeatures",new:"onClick"},{old:"touchZoomRotate",new:"touchZoom, touchRotate"},{old:"mapControls",new:"controller"}];function nt(e){return"react-map-gl: `".concat(e,"` is removed.")}function rt(e){return"Use `".concat(e,"` instead.")}function at(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tt.forEach((function(t){if(e.hasOwnProperty(t.old)){var n=nt(t.old);t.new&&(n="".concat(n," ").concat(rt(t.new))),console.warn(n)}}))}function ot(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var it=Object.assign({},Ue.propTypes,{maxZoom:p.a.number,minZoom:p.a.number,maxPitch:p.a.number,minPitch:p.a.number,onViewStateChange:p.a.func,onViewportChange:p.a.func,onInteractionStateChange:p.a.func,transitionDuration:p.a.oneOfType([p.a.number,p.a.string]),transitionInterpolator:p.a.object,transitionInterruption:p.a.number,transitionEasing:p.a.func,onTransitionStart:p.a.func,onTransitionInterrupt:p.a.func,onTransitionEnd:p.a.func,scrollZoom:p.a.bool,dragPan:p.a.bool,dragRotate:p.a.bool,doubleClickZoom:p.a.bool,touchZoom:p.a.bool,touchRotate:p.a.bool,keyboard:p.a.bool,onHover:p.a.func,onClick:p.a.func,onDblClick:p.a.func,onContextMenu:p.a.func,onMouseDown:p.a.func,onMouseMove:p.a.func,onMouseUp:p.a.func,onTouchStart:p.a.func,onTouchMove:p.a.func,onTouchEnd:p.a.func,onMouseEnter:p.a.func,onMouseLeave:p.a.func,onMouseOut:p.a.func,onWheel:p.a.func,touchAction:p.a.string,clickRadius:p.a.number,interactiveLayerIds:p.a.array,getCursor:p.a.func,controller:p.a.instanceOf(et)}),st=Object.assign({},Ue.defaultProps,Se,Ye.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(e){return e.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",clickRadius:0,getCursor:function(e){var t=e.isDragging,n=e.isHovering;return t?"grabbing":n?"pointer":"grab"}}),lt=function(e){Object(s.a)(n,e);var t=ot(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"state",{isLoaded:!1,isDragging:!1,isHovering:!1}),Object(c.a)(Object(o.a)(r),"_controller",void 0),Object(c.a)(Object(o.a)(r),"_eventManager",void 0),Object(c.a)(Object(o.a)(r),"_interactiveContext",void 0),Object(c.a)(Object(o.a)(r),"_width",0),Object(c.a)(Object(o.a)(r),"_height",0),Object(c.a)(Object(o.a)(r),"_eventCanvasRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(r),"_staticMapRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(r),"getMap",(function(){return r._staticMapRef.current?r._staticMapRef.current.getMap():null})),Object(c.a)(Object(o.a)(r),"queryRenderedFeatures",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.getMap();return n&&n.queryRenderedFeatures(e,t)})),Object(c.a)(Object(o.a)(r),"_onInteractionStateChange",(function(e){var t=e.isDragging,n=void 0!==t&&t;n!==r.state.isDragging&&(r._updateInteractiveContext({isDragging:n}),r.setState({isDragging:n}));var a=r.props.onInteractionStateChange;a&&a(e)})),Object(c.a)(Object(o.a)(r),"_onResize",(function(e){var t=e.width,n=e.height;r._width=t,r._height=n,r._setControllerProps(r.props),r.props.onResize({width:t,height:n})})),Object(c.a)(Object(o.a)(r),"_onViewportChange",(function(e,t,n){var a=r.props,o=a.onViewStateChange,i=a.onViewportChange;o&&o({viewState:e,interactionState:t,oldViewState:n}),i&&i(e,t,n)})),Object(c.a)(Object(o.a)(r),"_onLoad",(function(e){r.setState({isLoaded:!0}),r.props.onLoad(e)})),Object(c.a)(Object(o.a)(r),"_onEvent",(function(e,t){var n=r.props[e];n&&n(r._normalizeEvent(t))})),Object(c.a)(Object(o.a)(r),"_onPointerDown",(function(e){switch(e.pointerType){case"touch":r._onEvent("onTouchStart",e);break;default:r._onEvent("onMouseDown",e)}})),Object(c.a)(Object(o.a)(r),"_onPointerUp",(function(e){switch(e.pointerType){case"touch":r._onEvent("onTouchEnd",e);break;default:r._onEvent("onMouseUp",e)}})),Object(c.a)(Object(o.a)(r),"_onPointerMove",(function(e){switch(e.pointerType){case"touch":r._onEvent("onTouchMove",e);break;default:r._onEvent("onMouseMove",e)}if(!r.state.isDragging){var t,n=r.props,a=n.onHover,o=n.interactiveLayerIds;e=r._normalizeEvent(e),r.state.isLoaded&&(o||a)&&(t=r._getFeatures({pos:e.point,radius:r.props.clickRadius})),a&&(e.features=t,a(e));var i=Boolean(o&&t&&t.length>0),s=i&&!r.state.isHovering,l=!i&&r.state.isHovering;s&&r._onEvent("onMouseEnter",e),l&&r._onEvent("onMouseLeave",e),(s||l)&&r.setState({isHovering:i})}})),Object(c.a)(Object(o.a)(r),"_onClick",(function(e){var t=r.props,n=t.onClick,a=t.onNativeClick,o=t.onDblClick,i=t.doubleClickZoom,s=[],l=o||i;switch(e.type){case"anyclick":s.push(a),l||s.push(n);break;case"click":l&&s.push(n)}(s=s.filter(Boolean)).length&&((e=r._normalizeEvent(e)).features=r._getFeatures({pos:e.point,radius:r.props.clickRadius}),s.forEach((function(t){return t(e)})))})),at(e),r._controller=e.controller||new et,r._eventManager=new We.EventManager(null,{touchAction:e.touchAction}),r._updateInteractiveContext({isDragging:!1,eventManager:r._eventManager}),r}return Object(i.a)(n,null,[{key:"supported",value:function(){return Ue.supported()}}]),Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this._eventManager,t=this._eventCanvasRef.current;e.setElement(t),e.on({pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerup:this._onPointerUp,pointerleave:this._onEvent.bind(this,"onMouseOut"),click:this._onClick,anyclick:this._onClick,dblclick:this._onEvent.bind(this,"onDblClick"),wheel:this._onEvent.bind(this,"onWheel"),contextmenu:this._onEvent.bind(this,"onContextMenu")}),this._setControllerProps(this.props),this._updateInteractiveContext({mapContainer:t})}},{key:"componentDidUpdate",value:function(){this._setControllerProps(this.props)}},{key:"componentWillUnmount",value:function(){this._eventManager.destroy()}},{key:"_setControllerProps",value:function(e){e=Object.assign({},e,e.viewState,{isInteractive:Boolean(e.onViewStateChange||e.onViewportChange),onViewportChange:this._onViewportChange,onStateChange:this._onInteractionStateChange,eventManager:this._eventManager,width:this._width,height:this._height}),this._controller.setOptions(e);var t=this._interactiveContext;t.onViewportChange=e.onViewportChange,t.onViewStateChange=e.onViewStateChange}},{key:"_getFeatures",value:function(e){var t,n=e.pos,r=e.radius,a={},o=this.getMap();if(this.props.interactiveLayerIds&&(a.layers=this.props.interactiveLayerIds),r){var i=r,s=[[n[0]-i,n[1]+i],[n[0]+i,n[1]-i]];t=o&&o.queryRenderedFeatures(s,a)}else t=o&&o.queryRenderedFeatures(n,a);return t}},{key:"_updateInteractiveContext",value:function(e){this._interactiveContext=Object.assign({},this._interactiveContext,e)}},{key:"_normalizeEvent",value:function(e){if(e.lngLat)return e;var t=e.offsetCenter,n=[t.x,t.y],r=new q(Object.assign({},this.props,{width:this._width,height:this._height}));return e.point=n,e.lngLat=r.unproject(n),e}},{key:"render",value:function(){var e=this.props,t=e.width,n=e.height,a=e.style,o=e.getCursor,i=Object.assign({position:"relative"},a,{width:t,height:n,cursor:o(this.state)});return d.createElement(De.Provider,{value:this._interactiveContext},d.createElement("div",{key:"event-canvas",ref:this._eventCanvasRef,style:i},d.createElement(Ue,Object(r.a)({},this.props,{width:"100%",height:"100%",style:null,onResize:this._onResize,onLoad:this._onLoad,ref:this._staticMapRef}),this.props.children)))}}]),n}(d.PureComponent);Object(c.a)(lt,"propTypes",it),Object(c.a)(lt,"defaultProps",st);var ut=n(244);function ct(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ct(e[n],t[n]))return!1;return!0}if(Array.isArray(t))return!1;if("object"===Object(ut.a)(e)&&"object"===Object(ut.a)(t)){var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var o=0,i=r;o<i.length;o++){var s=i[o];if(!t.hasOwnProperty(s))return!1;if(!ct(e[s],t[s]))return!1}return!0}return!1}function dt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var ft={type:p.a.string.isRequired,id:p.a.string},pt=0,ht=function(e){Object(s.a)(n,e);var t=dt(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"id",void 0),Object(c.a)(Object(o.a)(r),"type",void 0),Object(c.a)(Object(o.a)(r),"_map",null),Object(c.a)(Object(o.a)(r),"_sourceOptions",{}),Object(c.a)(Object(o.a)(r),"_updateSource",(function(){var e=Object(o.a)(r),t=e.type;if(e._map){var n=Object(o.a)(r),a=n._sourceOptions,i=n.props;se(!i.id||i.id===r.id,"source id changed"),se(i.type===t,"source type changed");var s="",l=0;for(var u in i)"children"===u||"id"===u||ct(a[u],i[u])||(a[u]=i[u],s=u,l++);var c=r.getSource();if(c){if(l)if("geojson"===t)c.setData(a.data);else if("image"===t)c.updateImage({url:a.url,coordinates:a.coordinates});else if("canvas"!==t&&"video"!==t||1!==l||"coordinates"!==s)if("vector"===t&&c.setUrl)switch(s){case"url":c.setUrl(a.url);break;case"tiles":c.setTiles(a.tiles)}else console.warn("Unable to update <Source> prop: ".concat(s));else c.setCoordinates(a.coordinates)}else r._createSource(a)}})),r.id=e.id||"jsx-source-".concat(pt++),r.type=e.type,r}return Object(i.a)(n,[{key:"componentWillUnmount",value:function(){var e=this,t=this._map;t&&(t.off("styledata",this._updateSource),requestAnimationFrame((function(){t.style&&t.style._loaded&&t.removeSource(e.id)})))}},{key:"getSource",value:function(){var e=this._map;return e&&e.style&&e.getSource(this.id)}},{key:"_createSource",value:function(e){var t=this._map;t.style&&t.style._loaded&&t.addSource(this.id,e)}},{key:"_render",value:function(e){var t=this;return!this._map&&e.map&&(this._map=e.map,this._map.on("styledata",this._updateSource)),this._updateSource(),d.Children.map(this.props.children,(function(e){return e&&Object(d.cloneElement)(e,{source:t.id})}))}},{key:"render",value:function(){return d.createElement(De.Consumer,null,this._render.bind(this))}}]),n}(d.PureComponent);function mt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function gt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(ht,"propTypes",ft);var yt={type:p.a.oneOf(Object.keys({fill:"fill",line:"line",symbol:"symbol",circle:"circle","fill-extrusion":"fill-extrusion",raster:"raster",background:"background",heatmap:"heatmap",hillshade:"hillshade"})).isRequired,id:p.a.string,source:p.a.string,beforeId:p.a.string};var vt=0,At=function(e){Object(s.a)(n,e);var t=gt(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"id",void 0),Object(c.a)(Object(o.a)(r),"type",void 0),Object(c.a)(Object(o.a)(r),"_map",null),Object(c.a)(Object(o.a)(r),"_layerOptions",{}),Object(c.a)(Object(o.a)(r),"_updateLayer",(function(){var e=r._map;if(e){var t=Object(o.a)(r),n=t.props,a=t._layerOptions;if(se(!n.id||n.id===r.id,"layer id changed"),se(n.type===r.type,"layer type changed"),r.getLayer())try{!function(e,t,n,r){var a=n.layout,o=void 0===a?{}:a,i=n.paint,s=void 0===i?{}:i,l=n.filter,u=n.minzoom,c=n.maxzoom,d=n.beforeId,f=mt(n,["layout","paint","filter","minzoom","maxzoom","beforeId"]);if(d!==r.beforeId&&e.moveLayer(t,d),o!==r.layout){for(var p in o)ct(o[p],r.layout[p])||e.setLayoutProperty(t,p,o[p]);for(var h in r.layout)o.hasOwnProperty(h)||e.setLayoutProperty(t,h,void 0)}if(s!==r.paint){for(var m in s)ct(s[m],r.paint[m])||e.setPaintProperty(t,m,s[m]);for(var g in r.paint)s.hasOwnProperty(g)||e.setPaintProperty(t,g,void 0)}for(var y in ct(l,r.filter)||e.setFilter(t,l),u===r.minzoom&&c===r.maxzoom||e.setLayerZoomRange(t,u,c),f)ct(f[y],r[y])||e.setLayerProperty(t,y,f[y])}(e,r.id,n,a),Object.assign(a,n)}catch(e){console.warn(e)}else r._createLayer()}})),r.id=e.id||"jsx-layer-".concat(vt++),r.type=e.type,r}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this._updateLayer()}},{key:"componentDidUpdate",value:function(){this._updateLayer()}},{key:"componentWillUnmount",value:function(){var e=this._map;e&&(e.off("styledata",this._updateLayer),e.style&&e.style._loaded&&e.removeLayer(this.id))}},{key:"getLayer",value:function(){var e=this._map;return e&&e.style&&e.getLayer(this.id)}},{key:"_createLayer",value:function(){var e=this._map;if(e.style&&e.style._loaded){var t=Object.assign({},this.props);t.id=this.id,delete t.beforeId,e.addLayer(t,this.props.beforeId),this._layerOptions=t}}},{key:"_render",value:function(e){return!this._map&&e.map&&(this._map=e.map,this._map.on("styledata",this._updateLayer)),null}},{key:"render",value:function(){return d.createElement(De.Consumer,null,this._render.bind(this))}}]),n}(d.PureComponent);function bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(At,"propTypes",yt);var _t={captureScroll:p.a.bool,captureDrag:p.a.bool,captureClick:p.a.bool,captureDoubleClick:p.a.bool,capturePointerMove:p.a.bool},Et=function(e){Object(s.a)(n,e);var t=bt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_context",{}),Object(c.a)(Object(o.a)(e),"_events",null),Object(c.a)(Object(o.a)(e),"_containerRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_onScroll",(function(t){e.props.captureScroll&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onDragStart",(function(t){e.props.captureDrag&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onDblClick",(function(t){e.props.captureDoubleClick&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onClick",(function(t){e.props.captureClick&&t.stopPropagation()})),Object(c.a)(Object(o.a)(e),"_onPointerMove",(function(t){e.props.capturePointerMove&&t.stopPropagation()})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this._containerRef.current;if(e){var t=this._context.eventManager;t&&(this._events={wheel:this._onScroll,panstart:this._onDragStart,anyclick:this._onClick,click:this._onClick,dblclick:this._onDblClick,pointermove:this._onPointerMove},t.watch(this._events,e))}}},{key:"componentWillUnmount",value:function(){var e=this._context.eventManager;e&&this._events&&e.off(this._events)}},{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){var e=this;return d.createElement(De.Consumer,null,(function(t){return e._context=t,e._render()}))}}]),n}(d.PureComponent);function xt(e,t,n){return(xt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(u.a)(e)););return e}(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(n):a.value}})(e,t,n||e)}function Mt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(Et,"propTypes",_t),Object(c.a)(Et,"defaultProps",{captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1});var wt=Object.assign({},Et.propTypes,{draggable:p.a.bool,onDrag:p.a.func,onDragEnd:p.a.func,onDragStart:p.a.func,offsetLeft:p.a.number,offsetTop:p.a.number}),Ot=Object.assign({},Et.defaultProps,{draggable:!1,offsetLeft:0,offsetTop:0}),St=function(e){Object(s.a)(n,e);var t=Mt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{dragPos:null,dragOffset:null}),Object(c.a)(Object(o.a)(e),"_dragEvents",null),Object(c.a)(Object(o.a)(e),"_onDragStart",(function(t){var n=e.props,r=n.draggable,a=n.captureDrag;if((r||a)&&t.stopPropagation(),r){var o=e._getDragEventPosition(t),i=e._getDragEventOffset(t);e.setState({dragPos:o,dragOffset:i}),e._setupDragEvents();var s=e.props.onDragStart;if(s&&i){var l=Object.assign({},t);l.lngLat=e._getDragLngLat(o,i),s(l)}}})),Object(c.a)(Object(o.a)(e),"_onDrag",(function(t){t.stopPropagation();var n=e._getDragEventPosition(t);e.setState({dragPos:n});var r=e.props.onDrag,a=e.state.dragOffset;if(r&&a){var o=Object.assign({},t);o.lngLat=e._getDragLngLat(n,a),r(o)}})),Object(c.a)(Object(o.a)(e),"_onDragEnd",(function(t){var n=e.state,r=n.dragPos,a=n.dragOffset;t.stopPropagation(),e.setState({dragPos:null,dragOffset:null}),e._removeDragEvents();var o=e.props.onDragEnd;if(o&&r&&a){var i=Object.assign({},t);i.lngLat=e._getDragLngLat(r,a),o(i)}})),Object(c.a)(Object(o.a)(e),"_onDragCancel",(function(t){t.stopPropagation(),e.setState({dragPos:null,dragOffset:null}),e._removeDragEvents()})),e}return Object(i.a)(n,[{key:"componentWillUnmount",value:function(){xt(Object(u.a)(n.prototype),"componentWillUnmount",this).call(this),this._removeDragEvents()}},{key:"_setupDragEvents",value:function(){var e=this._context.eventManager;e&&(this._dragEvents={panmove:this._onDrag,panend:this._onDragEnd,pancancel:this._onDragCancel},e.on(this._dragEvents))}},{key:"_removeDragEvents",value:function(){var e=this._context.eventManager;e&&this._dragEvents&&(e.off(this._dragEvents),this._dragEvents=null)}},{key:"_getDragEventPosition",value:function(e){var t=e.offsetCenter;return[t.x,t.y]}},{key:"_getDragEventOffset",value:function(e){var t=e.center,n=t.x,r=t.y,a=this._containerRef.current;if(a){var o=a.getBoundingClientRect();return[o.left-n,o.top-r]}return null}},{key:"_getDraggedPosition",value:function(e,t){return[e[0]+t[0],e[1]+t[1]]}},{key:"_getDragLngLat",value:function(e,t){var n=this.props,r=n.offsetLeft,a=n.offsetTop,o=this._getDraggedPosition(e,t),i=Object(_.a)(o,2),s=i[0],l=i[1];return this._context.viewport.unproject([s-r,l-a])}}]),n}(Et);Object(c.a)(St,"propTypes",wt),Object(c.a)(St,"defaultProps",Ot);var Tt="undefined"!=typeof window&&window.devicePixelRatio||1,Ct=function(e){return Math.round(e*Tt)/Tt},Lt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x";if(null===e)return t;var r="x"===n?e.offsetWidth:e.offsetHeight;return Ct(t/100*r)/r*100};function Pt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var Rt=Object.assign({},St.propTypes,{className:p.a.string,longitude:p.a.number.isRequired,latitude:p.a.number.isRequired}),Dt=Object.assign({},St.defaultProps,{className:""}),kt=function(e){Object(s.a)(n,e);var t=Pt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_control",null),e}return Object(i.a)(n,[{key:"_getPosition",value:function(){var e=this.props,t=e.longitude,n=e.latitude,r=e.offsetLeft,a=e.offsetTop,o=this.state,i=o.dragPos,s=o.dragOffset;if(i&&s)return this._getDraggedPosition(i,s);var l=this._context.viewport.project([t,n]),u=Object(_.a)(l,2),c=u[0],d=u[1];return[c+=r,d+=a]}},{key:"_render",value:function(){var e=this._getPosition(),t=Object(_.a)(e,2),n=t[0],r=t[1],a="translate(".concat(Ct(n),"px, ").concat(Ct(r),"px)"),o=this._containerRef.current;if(this._control&&o)o.style.transform=a;else{var i=this.props,s=i.className,l=i.draggable,u=this.state.dragPos,c={position:"absolute",left:0,top:0,transform:a,cursor:l?u?"grabbing":"grab":"auto"};this._control=d.createElement("div",{className:"mapboxgl-marker ".concat(s),ref:this._containerRef,style:c},this.props.children)}return this._control}},{key:"render",value:function(){return this._control=null,xt(Object(u.a)(n.prototype),"render",this).call(this)}}]),n}(St);Object(c.a)(kt,"propTypes",Rt),Object(c.a)(kt,"defaultProps",Dt);var It={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}},Ft=Object.keys(It);function jt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var Bt=Object.assign({},Et.propTypes,{className:p.a.string,longitude:p.a.number.isRequired,latitude:p.a.number.isRequired,altitude:p.a.number,offsetLeft:p.a.number,offsetTop:p.a.number,tipSize:p.a.number,closeButton:p.a.bool,closeOnClick:p.a.bool,anchor:p.a.oneOf(Object.keys(It)),dynamicPosition:p.a.bool,sortByDepth:p.a.bool,onClose:p.a.func}),Nt=Object.assign({},Et.defaultProps,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}}),zt=function(e){Object(s.a)(n,e);var t=jt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_closeOnClick",!1),Object(c.a)(Object(o.a)(e),"_contentRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_onClick",(function(t){if(e.props.captureClick&&t.stopPropagation(),e.props.closeOnClick||"mapboxgl-popup-close-button"===t.target.className){e.props.onClose();var n=e._context.eventManager;n&&n.once("click",(function(e){return e.stopPropagation()}),t.target)}})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){xt(Object(u.a)(n.prototype),"componentDidMount",this).call(this),this.forceUpdate()}},{key:"_getPosition",value:function(e,t){var n=this._context.viewport,r=this.props,a=r.anchor,o=r.dynamicPosition,i=r.tipSize,s=this._contentRef.current;return s&&o?function(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=e.selfWidth,i=e.selfHeight,s=e.anchor,l=e.padding,u=void 0===l?0:l,c=It[s],d=c.x,f=c.y,p=n-f*i,h=p+i;if(p<u)for(;p<u&&f>=.5;)f-=.5,p+=.5*i;else if(h>a-u)for(;h>a-u&&f<=.5;)f+=.5,h-=.5*i;var m=t-d*o,g=m+o,y=.5;if(.5===f&&(d=Math.floor(d),y=1),m<u)for(;m<u&&d>=y;)d-=y,m+=y*o;else if(g>r-u)for(;g>r-u&&d<=1-y;)d+=y,g-=y*o;return Ft.find((function(e){var t=It[e];return t.x===d&&t.y===f}))||s}({x:e,y:t,anchor:a,padding:i,width:n.width,height:n.height,selfWidth:s.clientWidth,selfHeight:s.clientHeight}):a}},{key:"_getContainerStyle",value:function(e,t,n,r){var a=this._context.viewport,o=this.props,i=o.offsetLeft,s=o.offsetTop,l=o.sortByDepth,u=It[r],c=e+i,d=t+s,f=this._containerRef.current,p=Lt(f,100*-u.x),h=Lt(f,100*-u.y,"y"),m={position:"absolute",transform:"\n translate(".concat(p,"%, ").concat(h,"%)\n translate(").concat(Ct(c),"px, ").concat(Ct(d),"px)\n "),display:void 0,zIndex:void 0};return l?(n>1||n<-1||e<0||e>a.width||t<0||t>a.height?m.display="none":m.zIndex=Math.floor((1-n)/2*1e5),m):m}},{key:"_renderTip",value:function(e){var t=this.props.tipSize;return d.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:t}})}},{key:"_renderContent",value:function(){var e=this.props,t=e.closeButton,n=e.children,r=this._context.eventManager?null:this._onClick;return d.createElement("div",{key:"content",ref:this._contentRef,className:"mapboxgl-popup-content",onClick:r},t&&d.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button"},"×"),n)}},{key:"_render",value:function(){var e=this.props,t=e.className,n=e.longitude,r=e.latitude,a=e.altitude,o=this._context.viewport.project([n,r,a]),i=Object(_.a)(o,3),s=i[0],l=i[1],u=i[2],c=this._getPosition(s,l),f=this._getContainerStyle(s,l,u,c);return d.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(c," ").concat(t),style:f,ref:this._containerRef},this._renderTip(c),this._renderContent())}}]),n}(Et);Object(c.a)(zt,"propTypes",Bt),Object(c.a)(zt,"defaultProps",Nt);var Ut=n(136);function Ht(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}var Vt,Gt=Object.assign({},Et.propTypes,{className:p.a.string,container:p.a.object,label:p.a.string}),Yt=Object.assign({},Et.defaultProps,{className:"",container:null,label:"Toggle fullscreen"}),Wt=function(e){Object(s.a)(n,e);var t=Ht(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{isFullscreen:!1,showButton:!1}),Object(c.a)(Object(o.a)(e),"_mapboxFullscreenControl",null),Object(c.a)(Object(o.a)(e),"_onFullscreenChange",(function(){var t=!e._mapboxFullscreenControl._fullscreen;e._mapboxFullscreenControl._fullscreen=t,e.setState({isFullscreen:t})})),Object(c.a)(Object(o.a)(e),"_onClickFullscreen",(function(){e._mapboxFullscreenControl._onClickFullscreen()})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this.props.container||this._context.mapContainer;this._mapboxFullscreenControl=new ne.a.FullscreenControl({container:e}),this.setState({showButton:this._mapboxFullscreenControl._checkFullscreenSupport()}),Ut.a.addEventListener(this._mapboxFullscreenControl._fullscreenchange,this._onFullscreenChange)}},{key:"componentWillUnmount",value:function(){Ut.a.removeEventListener(this._mapboxFullscreenControl._fullscreenchange,this._onFullscreenChange)}},{key:"_renderButton",value:function(e,t,n){return d.createElement("button",{key:e,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(e),type:"button",title:t,onClick:n},d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}},{key:"_render",value:function(){if(!this.state.showButton)return null;var e=this.props,t=e.className,n=e.label,r=this.state.isFullscreen?"shrink":"fullscreen";return d.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group ".concat(t),ref:this._containerRef},this._renderButton(r,n,this._onClickFullscreen))}}]),n}(Et);function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(Wt,"propTypes",Gt),Object(c.a)(Wt,"defaultProps",Yt);var Xt=Object.assign({},Ye.defaultProps,{transitionDuration:500}),Kt=function(){},Zt=Object.assign({},Et.propTypes,{className:p.a.string,style:p.a.object,label:p.a.string,auto:p.a.bool,positionOptions:p.a.object,fitBoundsOptions:p.a.object,trackUserLocation:p.a.bool,showUserLocation:p.a.bool,onViewStateChange:p.a.func,onViewportChange:p.a.func,onGeolocate:p.a.func}),Jt=Object.assign({},Et.defaultProps,{className:"",style:{},label:"Geolocate",auto:!1,positionOptions:null,fitBoundsOptions:null,trackUserLocation:!1,showUserLocation:!0,onGeolocate:function(){}}),Qt=function(e){Object(s.a)(n,e);var t=qt(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"state",{supportsGeolocation:!1,markerPosition:null}),Object(c.a)(Object(o.a)(e),"_mapboxGeolocateControl",null),Object(c.a)(Object(o.a)(e),"_geolocateButtonRef",Object(d.createRef)()),Object(c.a)(Object(o.a)(e),"_setupMapboxGeolocateControl",(function(t){if(t){var n={showUserLocation:!1};["positionOptions","fitBoundsOptions","trackUserLocation"].forEach((function(t){t in e.props&&null!==e.props[t]&&(n[t]=e.props[t])}));var r=new ne.a.GeolocateControl(n);e._mapboxGeolocateControl=r,r._watchState="OFF",r._geolocateButton=e._geolocateButtonRef.current,r.options.trackUserLocation&&r._geolocateButton&&r._geolocateButton.setAttribute("aria-pressed","false"),r._updateMarker=e._updateMarker,r._updateCamera=e._updateCamera,r._setup=!0;var a=e._context.eventManager;r.options.trackUserLocation&&a&&a.on("panstart",(function(){"ACTIVE_LOCK"===r._watchState&&(r._watchState="BACKGROUND",r._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),r._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"))})),r.on("geolocate",e.props.onGeolocate)}else console.warn("Geolocation support is not available, the GeolocateControl will not be visible.")})),Object(c.a)(Object(o.a)(e),"_triggerGeolocate",(function(){var t=e._mapboxGeolocateControl;return t._map=e._context.map,e.props.showUserLocation&&(t.on("geolocate",e._updateMarker),t.on("trackuserlocationend",e._updateMarker)),e._mapboxGeolocateControl.trigger()})),Object(c.a)(Object(o.a)(e),"_updateMarker",(function(t){t&&e.setState({markerPosition:t.coords})})),Object(c.a)(Object(o.a)(e),"_getBounds",(function(e){var t=new ne.a.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,r=t.toBounds(n);return[[r._ne.lng,r._ne.lat],[r._sw.lng,r._sw.lat]]})),Object(c.a)(Object(o.a)(e),"_updateCamera",(function(t){var n=e._context.viewport,r=e._getBounds(t),a=new q(n).fitBounds(r),o=a.longitude,i=a.latitude,s=a.zoom,l=Object.assign({},n,{longitude:o,latitude:i,zoom:s}),u=new Pe(l),c=Object.assign({},u.getViewportProps(),Xt),d=e.props.onViewportChange||e._context.onViewportChange||Kt;(e.props.onViewStateChange||e._context.onViewStateChange||Kt)({viewState:c}),d(c)})),Object(c.a)(Object(o.a)(e),"_renderButton",(function(t,n,r){return d.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),ref:e._geolocateButtonRef,type:"button",title:n,onClick:r},d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))})),Object(c.a)(Object(o.a)(e),"_renderMarker",(function(){var t=e.state.markerPosition,n=e.props.showUserLocation;return t&&n?d.createElement(kt,{key:"location-maker",longitude:t.longitude,latitude:t.latitude,captureDrag:!1,captureDoubleClick:!1},d.createElement("div",{className:"mapboxgl-user-location-dot",style:{transform:"translate(-50%, -50%)"}})):null})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this;(void 0!==Vt?Promise.resolve(Vt):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((function(e){return Vt="denied"!==e.state})):(Vt=Boolean(window.navigator.geolocation),Promise.resolve(Vt))).then((function(t){e.setState({supportsGeolocation:t}),e._setupMapboxGeolocateControl(t),t&&e.props.auto&&e._triggerGeolocate()}))}},{key:"componentDidUpdate",value:function(e){this.state.supportsGeolocation&&!e.auto&&this.props.auto&&this._triggerGeolocate()}},{key:"componentWillUnmount",value:function(){if(this._mapboxGeolocateControl){var e=this._mapboxGeolocateControl._geolocationWatchID;void 0!==e&&(window.navigator.geolocation.clearWatch(e),this._mapboxGeolocateControl._geolocationWatchID=void 0)}}},{key:"_render",value:function(){if(!this.state.supportsGeolocation)return null;var e=this.props,t=e.className,n=e.style,r=e.label;return d.createElement("div",null,this._renderMarker(),d.createElement("div",{key:"geolocate-control",className:"mapboxgl-ctrl mapboxgl-ctrl-group ".concat(t),ref:this._containerRef,style:n},this._renderButton("geolocate",r,this._triggerGeolocate)))}}]),n}(Et);function $t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(Qt,"propTypes",Zt),Object(c.a)(Qt,"defaultProps",Jt);var en=function(){},tn=Object.assign({},Et.propTypes,{className:p.a.string,onViewStateChange:p.a.func,onViewportChange:p.a.func,showCompass:p.a.bool,showZoom:p.a.bool,zoomInLabel:p.a.string,zoomOutLabel:p.a.string,compassLabel:p.a.string}),nn=Object.assign({},Et.defaultProps,{className:"",showCompass:!0,showZoom:!0,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",compassLabel:"Reset North"});function rn(e){return function(e,t){for(var n=(e||"").split(".").map(Number),r=(t||"").split(".").map(Number),a=0;a<3;a++){var o=n[a]||0,i=r[a]||0;if(o<i)return-1;if(o>i)return 1}return 0}(e,"1.6.0")>=0?2:1}var an=function(e){Object(s.a)(n,e);var t=$t(n);function n(e){var r;return Object(a.a)(this,n),r=t.call(this,e),Object(c.a)(Object(o.a)(r),"_uiVersion",void 0),Object(c.a)(Object(o.a)(r),"_onZoomIn",(function(){r._updateViewport({zoom:r._context.viewport.zoom+1})})),Object(c.a)(Object(o.a)(r),"_onZoomOut",(function(){r._updateViewport({zoom:r._context.viewport.zoom-1})})),Object(c.a)(Object(o.a)(r),"_onResetNorth",(function(){r._updateViewport({bearing:0,pitch:0})})),at(e),r}return Object(i.a)(n,[{key:"_updateViewport",value:function(e){var t=this._context.viewport,n=new Pe(Object.assign({},t,e)),r=Object.assign({},n.getViewportProps(),Xe),a=this.props.onViewportChange||this._context.onViewportChange||en;(this.props.onViewStateChange||this._context.onViewStateChange||en)({viewState:r}),a(r)}},{key:"_renderCompass",value:function(){var e=this._context.viewport.bearing,t={transform:"rotate(".concat(-e,"deg)")};return 2===this._uiVersion?d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true",style:t}):d.createElement("span",{className:"mapboxgl-ctrl-compass-arrow",style:t})}},{key:"_renderButton",value:function(e,t,n,r){return d.createElement("button",{key:e,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(e),type:"button",title:t,onClick:n},r||d.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}},{key:"_render",value:function(){var e=this.props,t=e.className,n=e.showCompass,r=e.showZoom,a=e.zoomInLabel,o=e.zoomOutLabel,i=e.compassLabel;if(!this._uiVersion){var s=this._context.map;this._uiVersion=s?rn(s.version):2}return d.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group ".concat(t),ref:this._containerRef},r&&this._renderButton("zoom-in",a,this._onZoomIn),r&&this._renderButton("zoom-out",o,this._onZoomOut),n&&this._renderButton("compass",i,this._onResetNorth,this._renderCompass()))}}]),n}(Et);function on(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(an,"propTypes",tn),Object(c.a)(an,"defaultProps",nn);var sn=Object.assign({},Et.propTypes,{maxWidth:p.a.number,unit:p.a.oneOf(["imperial","metric","nautical"])}),ln=Object.assign({},Et.defaultProps,{maxWidth:100,unit:"metric"}),un=function(e){Object(s.a)(n,e);var t=on(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_control",null),Object(c.a)(Object(o.a)(e),"_mapboxScaleControl",null),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=new ne.a.ScaleControl;e._map=this._context.map,e._container=this._containerRef.current,this._mapboxScaleControl=e,this._update()}},{key:"_update",value:function(){var e=this._mapboxScaleControl;e&&(e.options=this.props,e._onMove())}},{key:"_render",value:function(){return this._control=this._control||d.createElement("div",{ref:this._containerRef,className:"mapboxgl-ctrl mapboxgl-ctrl-scale"}),this._update(),this._control}}]),n}(Et);function cn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(un,"propTypes",sn),Object(c.a)(un,"defaultProps",ln);var dn=Object.assign({},Et.propTypes,{redraw:p.a.func.isRequired}),fn=function(e){Object(s.a)(n,e);var t=cn(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),Object(c.a)(Object(o.a)(e),"_canvas",void 0),Object(c.a)(Object(o.a)(e),"_ctx",void 0),Object(c.a)(Object(o.a)(e),"_redraw",(function(){var t=e._ctx;if(t){var n=Ut.b.devicePixelRatio||1;t.save(),t.scale(n,n);var r=e._context,a=r.viewport,o=r.isDragging;e.props.redraw({width:a.width,height:a.height,ctx:t,isDragging:o,project:a.project.bind(a),unproject:a.unproject.bind(a)}),t.restore()}})),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this._containerRef.current;e&&(this._canvas=e,this._ctx=e.getContext("2d")),this._redraw()}},{key:"_render",value:function(){var e=Ut.b.devicePixelRatio||1,t=this._context.viewport,n=t.width,r=t.height;return this._redraw(),d.createElement("canvas",{ref:this._containerRef,width:n*e,height:r*e,style:{width:"".concat(n,"px"),height:"".concat(r,"px"),position:"absolute",left:0,top:0}})}}]),n}(Et);function pn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(fn,"propTypes",dn),Object(c.a)(fn,"defaultProps",{captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1});var hn=Object.assign({},Et.propTypes,{redraw:p.a.func.isRequired,style:p.a.object}),mn=function(e){Object(s.a)(n,e);var t=pn(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"_render",value:function(){var e=this._context,t=e.viewport,n=e.isDragging,r=Object.assign({position:"absolute",left:0,top:0,width:t.width,height:t.height},this.props.style);return d.createElement("div",{ref:this._containerRef,style:r},this.props.redraw({width:t.width,height:t.height,isDragging:n,project:t.project.bind(t),unproject:t.unproject.bind(t)}))}}]),n}(Et);function gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(l.a)(this,n)}}Object(c.a)(mn,"propTypes",hn),Object(c.a)(mn,"defaultProps",{captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1});var yn=Object.assign({},Et.propTypes,{redraw:p.a.func.isRequired,style:p.a.object}),vn=function(e){Object(s.a)(n,e);var t=gn(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"_render",value:function(){var e=this._context,t=e.viewport,n=e.isDragging,r=Object.assign({position:"absolute",left:0,top:0},this.props.style);return d.createElement("svg",{width:t.width,height:t.height,ref:this._containerRef,style:r},this.props.redraw({width:t.width,height:t.height,isDragging:n,project:t.project.bind(t),unproject:t.unproject.bind(t)}))}}]),n}(Et);Object(c.a)(vn,"propTypes",yn),Object(c.a)(vn,"defaultProps",{captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1});var An=ne.a?ne.a.setRTLTextPlugin:function(){}},function(e,t,n){"use strict";n.r(t),n.d(t,"color",(function(){return r.e})),n.d(t,"rgb",(function(){return r.g})),n.d(t,"hsl",(function(){return r.f})),n.d(t,"lab",(function(){return d})),n.d(t,"hcl",(function(){return A})),n.d(t,"lch",(function(){return v})),n.d(t,"gray",(function(){return c})),n.d(t,"cubehelix",(function(){return P}));var r=n(95),a=n(125);const o=Math.PI/180,i=180/Math.PI,s=6/29,l=3*s*s;function u(e){if(e instanceof f)return new f(e.l,e.a,e.b,e.opacity);if(e instanceof b)return _(e);e instanceof r.b||(e=Object(r.h)(e));var t,n,a=g(e.r),o=g(e.g),i=g(e.b),s=p((.2225045*a+.7168786*o+.0606169*i)/1);return a===o&&o===i?t=n=s:(t=p((.4360747*a+.3850649*o+.1430804*i)/.96422),n=p((.0139322*a+.0971045*o+.7141733*i)/.82521)),new f(116*s-16,500*(t-s),200*(s-n),e.opacity)}function c(e,t){return new f(e,0,0,null==t?1:t)}function d(e,t,n,r){return 1===arguments.length?u(e):new f(e,t,n,null==r?1:r)}function f(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function p(e){return e>.008856451679035631?Math.pow(e,1/3):e/l+4/29}function h(e){return e>s?e*e*e:l*(e-4/29)}function m(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function g(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function y(e){if(e instanceof b)return new b(e.h,e.c,e.l,e.opacity);if(e instanceof f||(e=u(e)),0===e.a&&0===e.b)return new b(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*i;return new b(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}function v(e,t,n,r){return 1===arguments.length?y(e):new b(n,t,e,null==r?1:r)}function A(e,t,n,r){return 1===arguments.length?y(e):new b(e,t,n,null==r?1:r)}function b(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function _(e){if(isNaN(e.h))return new f(e.l,0,0,e.opacity);var t=e.h*o;return new f(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Object(a.a)(f,d,Object(a.b)(r.a,{brighter:function(e){return new f(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker:function(e){return new f(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb:function(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=.96422*h(t),e=1*h(e),n=.82521*h(n),new r.b(m(3.1338561*t-1.6168667*e-.4906146*n),m(-.9787684*t+1.9161415*e+.033454*n),m(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Object(a.a)(b,A,Object(a.b)(r.a,{brighter:function(e){return new b(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker:function(e){return new b(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb:function(){return _(this).rgb()}}));var E=-.14861,x=1.78277,M=-.29227,w=-.90649,O=1.97294,S=O*w,T=O*x,C=x*M-w*E;function L(e){if(e instanceof R)return new R(e.h,e.s,e.l,e.opacity);e instanceof r.b||(e=Object(r.h)(e));var t=e.r/255,n=e.g/255,a=e.b/255,o=(C*a+S*t-T*n)/(C+S-T),s=a-o,l=(O*(n-o)-M*s)/w,u=Math.sqrt(l*l+s*s)/(O*o*(1-o)),c=u?Math.atan2(l,s)*i-120:NaN;return new R(c<0?c+360:c,u,o,e.opacity)}function P(e,t,n,r){return 1===arguments.length?L(e):new R(e,t,n,null==r?1:r)}function R(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Object(a.a)(R,P,Object(a.b)(r.a,{brighter:function(e){return e=null==e?r.c:Math.pow(r.c,e),new R(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?r.d:Math.pow(r.d,e),new R(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=isNaN(this.h)?0:(this.h+120)*o,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),a=Math.cos(e),i=Math.sin(e);return new r.b(255*(t+n*(E*a+x*i)),255*(t+n*(M*a+w*i)),255*(t+n*(O*a)),this.opacity)}}))},function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return s}));let r="";const a={};function o(e){r=e}function i(){return r}function s(e){for(const t in a)if(e.startsWith(t)){const n=a[t];e=e.replace(t,n)}return e.startsWith("http://")||e.startsWith("https://")||(e="".concat(r).concat(e)),e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return d}));var r=n(104),a=n(71),o=n(64);function i(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function s(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function l(e){return e<0?-e*e:e*e}function u(e){var t=e(a.c,a.c),n=1;function o(){return 1===n?e(a.c,a.c):.5===n?e(s,l):e(i(n),i(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,o()):n},Object(r.b)(t)}function c(){var e=u(Object(a.d)());return e.copy=function(){return Object(a.a)(e,c()).exponent(e.exponent())},o.b.apply(e,arguments),e}function d(){return c.apply(null,arguments).exponent(.5)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i}));var r=n(633);function a(e){return e&&"object"==typeof e&&e.isBuffer}function o(e){return r.toBuffer?r.toBuffer(e):e}function i(e){if(a(e)){return new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer}return e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(e){if(!(t=r.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return s}));var r,a,o,i=n(437);function s(e){return r=Object(i.a)(e),a=r.format,o=r.formatPrefix,r}s({thousands:",",grouping:[3],currency:["$",""]})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(235),a=n(251);async function o(e,t){if("string"==typeof e){e=Object(r.b)(e);let n=t;return null!=t&&t.fetch&&"function"!=typeof(null==t?void 0:t.fetch)&&(n=t.fetch),await fetch(e,n)}return await Object(a.b)(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(176);const a=[255,255,255],o=1,i=[0,0,-1];let s=0;class l{constructor(e={}){const{color:t=a}=e,{intensity:n=o}=e,{direction:l=i}=e,{_shadow:u=!1}=e;this.id=e.id||"directional-".concat(s++),this.color=t,this.intensity=n,this.type="directional",this.direction=new r.a(l).normalize().toArray(),this.shadow=u}getProjectedLight(){return this}}},function(e,t,n){"use strict";var r=n(1903);var a={name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry = VertexGeometry(\n vec4(0.0, 0.0, 1.0, 0.0),\n vec3(0.0),\n vec3(0.0),\n vec3(0.0),\n vec2(0.0),\n vec3(0.0)\n);\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},o=n(34);const i=Object.keys(o.a).map(e=>"const int COORDINATE_SYSTEM_".concat(e," = ").concat(o.a[e],";")).join(""),s=Object.keys(o.d).map(e=>"const int PROJECTION_MODE_".concat(e," = ").concat(o.d[e],";")).join(""),l=Object.keys(o.e).map(e=>"const int UNIT_".concat(e.toUpperCase()," = ").concat(o.e[e],";")).join("");var u="".concat(i,"\n").concat(s,"\n").concat(l,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.0;\nfloat project_size() {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n project_uPseudoMeters == false) {\n \n if (geometry.position.w == 0.0) {\n float y = clamp(geometry.worldPosition.y, -89.9, 89.9);\n return 1.0 / cos(radians(y));\n }\n \n float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n float y2 = y * y;\n float y4 = y2 * y2;\n float y6 = y4 * y2;\n return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n }\n return 1.0;\n}\nfloat project_size(float meters) {\n return meters * project_uCommonUnitsPerMeter.z * project_size();\n}\n\nvec2 project_size(vec2 meters) {\n return meters * project_uCommonUnitsPerMeter.xy * project_size();\n}\n\nvec3 project_size(vec3 meters) {\n return meters * project_uCommonUnitsPerMeter * project_size();\n}\n\nvec4 project_size(vec4 meters) {\n return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\nvec3 project_normal(vec3 vector) {\n vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n mat3 rotation;\n if (project_needs_rotation(geometry.position.xyz, rotation)) {\n n = rotation * n;\n }\n return n;\n}\n\nvec4 project_offset_(vec4 offset) {\n float dy = offset.y;\n vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\nvec2 project_mercator_(vec2 lnglat) {\n float x = lnglat.x;\n if (project_uWrapLongitude) {\n x = mod(x + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\nvec4 project_common_position_to_clipspace(vec4 position) {\n return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n return project_size(meters) * project_uScale;\n}\nfloat project_size_to_pixel(float size, int unit) {\n if (unit == UNIT_METERS) return project_size_to_pixel(size);\n if (unit == UNIT_COMMON) return size * project_uScale;\n return size;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\n"),c=n(294);const d={};t.a={name:"project",dependencies:[r.a,a],vs:u,getUniforms:function(e=d){return e.viewport?Object(c.b)(e):{}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(121),a=n(420);var o=n(615),i=n(109),s=n(103),l=n(293),u=n(213),c=n(145),d=n(183);async function f(e,t,n,p){Object(r.a)(!p||"object"==typeof p),!t||Array.isArray(t)||Object(i.a)(t)||(p=void 0,n=t,t=void 0),e=await e,n=n||{};const{url:h}=Object(c.b)(e),m=t,g=Object(u.b)(m,p),y=await Object(d.a)(e,g,n);return y?(n=Object(s.c)(n,y,g,h),p=Object(u.a)({url:h,parse:f,loaders:g},n,p),await async function(e,t,n,i){if(function(e,t=a.a){Object(r.a)(e,"no worker provided");const n=e.version}(e),t=await Object(l.a)(t,e,n),e.parseTextSync&&"string"==typeof t)return n.dataType="text",e.parseTextSync(t,n,i,e);if(Object(o.a)(e,n))return await Object(o.b)(e,t,n,i,f);if(e.parseText&&"string"==typeof t)return await e.parseText(t,n,i,e);if(e.parse)return await e.parse(t,n,i,e);throw Object(r.a)(!e.parseSync),new Error("".concat(e.id," loader - no parser found and worker is disabled"))}(y,e,n,p)):null}},function(e,t,n){"use strict";function r(e){return(r="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})(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e){return+e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=function(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}},function(e,t,n){"use strict";(function(e){var r=n(86),a=n(1198),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof e&&e&&!e.nodeType&&e,s=i&&i.exports===o?r.a.Buffer:void 0,l=(s?s.isBuffer:void 0)||a.a;t.a=l}).call(this,n(540)(e))},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}));n(99);function r(e,t={}){const{start:n=0,end:r=e.length}=t,a=t.size||2;let o=0;for(let t=n,i=r-a;t<r;t+=a)o+=(e[t]-e[i])*(e[t+1]+e[i+1]),i=t;return o/2}function a(e,t,n,r){n=n||2;const a=t&&t.length,l=a?t[0]*n:e.length;let u=o(e,0,l,n,!0,r&&r[0]);const c=[];if(!u||u.next===u.prev)return c;let d,h,m,y,v,A,b;if(a&&(u=function(e,t,n,r,a){const s=[];let l,u,c,d,h;for(l=0,u=t.length;l<u;l++)c=t[l]*r,d=l<u-1?t[l+1]*r:e.length,h=o(e,c,d,r,!1,a&&a[l+1]),h===h.next&&(h.steiner=!0),s.push(g(h));for(s.sort(f),l=0;l<s.length;l++)p(s[l],n),n=i(n,n.next);return n}(e,t,u,n,r)),e.length>80*n){y=h=e[0],v=m=e[1];for(let t=n;t<l;t+=n)A=e[t],b=e[t+1],A<y&&(y=A),b<v&&(v=b),A>h&&(h=A),b>m&&(m=b);d=Math.max(h-y,m-v),d=0!==d?1/d:0}return s(u,c,n,y,v,d),c}function o(e,t,n,a,o,i){let s,l;if(void 0===i&&(i=r(e,{start:t,end:n,size:a})),o===i<0)for(s=t;s<n;s+=a)l=O(s,e[s],e[s+1],l);else for(s=n-a;s>=t;s-=a)l=O(s,e[s],e[s+1],l);return l&&b(l,l.next)&&(S(l),l=l.next),l}function i(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!b(r,r.next)&&0!==A(r.prev,r,r.next))r=r.next;else{if(S(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function s(e,t,n,r,a,o,f){if(!e)return;!f&&o&&function(e,t,n,r){let a=e;do{null===a.z&&(a.z=m(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next}while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,function(e){let t,n,r,a,o,i,s,l,u=1;do{for(a=e,e=null,l=null,r=0;a;){for(r++,i=a,o=0,n=0;n<u&&(o++,i=i.nextZ,i);n++);for(s=u;o>0||s>0&&i;)0!==o&&(0===s||!i||a.z<=i.z)?(t=a,a=a.nextZ,o--):(t=i,i=i.nextZ,s--),l?l.nextZ=t:e=t,t.prevZ=l,l=t;a=i}l.nextZ=null,u*=2}while(r>1)}(a)}(e,r,a,o);let p,h,g=e;for(;e.prev!==e.next;)if(p=e.prev,h=e.next,o?u(e,r,a,o):l(e))t.push(p.i/n),t.push(e.i/n),t.push(h.i/n),S(e),e=h.next,g=h.next;else if((e=h)===g){f?1===f?s(e=c(i(e),t,n),t,n,r,a,o,2):2===f&&d(e,t,n,r,a,o):s(i(e),t,n,r,a,o,1);break}}function l(e){const t=e.prev,n=e,r=e.next;if(A(t,n,r)>=0)return!1;let a=e.next.next;for(;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&A(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function u(e,t,n,r){const a=e.prev,o=e,i=e.next;if(A(a,o,i)>=0)return!1;const s=a.x<o.x?a.x<i.x?a.x:i.x:o.x<i.x?o.x:i.x,l=a.y<o.y?a.y<i.y?a.y:i.y:o.y<i.y?o.y:i.y,u=a.x>o.x?a.x>i.x?a.x:i.x:o.x>i.x?o.x:i.x,c=a.y>o.y?a.y>i.y?a.y:i.y:o.y>i.y?o.y:i.y,d=m(s,l,t,n,r),f=m(u,c,t,n,r);let p=e.prevZ,h=e.nextZ;for(;p&&p.z>=d&&h&&h.z<=f;){if(p!==e.prev&&p!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,p.x,p.y)&&A(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,h!==e.prev&&h!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,p.x,p.y)&&A(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;h&&h.z<=f;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,o.x,o.y,i.x,i.y,h.x,h.y)&&A(h.prev,h,h.next)>=0)return!1;h=h.nextZ}return!0}function c(e,t,n){let r=e;do{const a=r.prev,o=r.next.next;!b(a,o)&&_(a,r,r.next,o)&&M(a,o)&&M(o,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(o.i/n),S(r),S(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function d(e,t,n,r,a,o){let l=e;do{let e=l.next.next;for(;e!==l.prev;){if(l.i!==e.i&&v(l,e)){let u=w(l,e);return l=i(l,l.next),u=i(u,u.next),s(l,t,n,r,a,o),void s(u,t,n,r,a,o)}e=e.next}l=l.next}while(l!==e)}function f(e,t){return e.x-t.x}function p(e,t){if(t=function(e,t){let n=t;const r=e.x,a=e.y;let o,i=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){const e=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>i){if(i=e,e===r){if(a===n.y)return n;if(a===n.next.y)return n.next}o=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!o)return null;if(r===i)return o;const s=o,l=o.x,u=o.y;let c,d=1/0;n=o;do{r>=n.x&&n.x>=l&&r!==n.x&&y(a<u?r:i,a,l,u,a<u?i:r,a,n.x,n.y)&&(c=Math.abs(a-n.y)/(r-n.x),M(n,e)&&(c<d||c===d&&(n.x>o.x||n.x===o.x&&h(o,n)))&&(o=n,d=c)),n=n.next}while(n!==s);return o}(e,t)){const n=w(t,e);i(t,t.next),i(n,n.next)}}function h(e,t){return A(e.prev,e,t.prev)<0&&A(t.next,e,e.next)<0}function m(e,t,n,r,a){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*a)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*a)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function g(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function y(e,t,n,r,a,o,i,s){return(a-i)*(t-s)-(e-i)*(o-s)>=0&&(e-i)*(r-s)-(n-i)*(t-s)>=0&&(n-i)*(o-s)-(a-i)*(r-s)>=0}function v(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&_(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(M(e,t)&&M(t,e)&&function(e,t){let n=e,r=!1;const a=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&a<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(A(e.prev,e,t.prev)||A(e,t.prev,t))||b(e,t)&&A(e.prev,e,e.next)>0&&A(t.prev,t,t.next)>0)}function A(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function b(e,t){return e.x===t.x&&e.y===t.y}function _(e,t,n,r){const a=x(A(e,t,n)),o=x(A(e,t,r)),i=x(A(n,r,e)),s=x(A(n,r,t));return a!==o&&i!==s||(!(0!==a||!E(e,n,t))||(!(0!==o||!E(e,r,t))||(!(0!==i||!E(n,e,r))||!(0!==s||!E(n,t,r)))))}function E(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function x(e){return e>0?1:e<0?-1:0}function M(e,t){return A(e.prev,e,e.next)<0?A(e,t,e.next)>=0&&A(e,e.prev,t)>=0:A(e,t,e.prev)<0||A(e,e.next,t)<0}function w(e,t){const n=new T(e.i,e.x,e.y),r=new T(t.i,t.x,t.y),a=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function O(e,t,n,r){const a=new T(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function S(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function T(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return h})),n.d(t,"a",(function(){return o}));function r(){}function a(e,t){var n=new r;if(e instanceof r)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var a,o=-1,i=e.length;if(null==t)for(;++o<i;)n.set(o,e[o]);else for(;++o<i;)n.set(t(a=e[o],o,e),a)}else if(e)for(var s in e)n.set(s,e[s]);return n}r.prototype=a.prototype={constructor:r,has:function(e){return"$"+e in this},get:function(e){return this["$"+e]},set:function(e,t){return this["$"+e]=t,this},remove:function(e){var t="$"+e;return t in this&&delete this[t]},clear:function(){for(var e in this)"$"===e[0]&&delete this[e]},keys:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)"$"===t[0]&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)"$"===t[0]&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)"$"===t[0]&&++e;return e},empty:function(){for(var e in this)if("$"===e[0])return!1;return!0},each:function(e){for(var t in this)"$"===t[0]&&e(this[t],t.slice(1),this)}};var o=a,i=function(){var e,t,n,r=[],a=[];function i(n,a,s,l){if(a>=r.length)return null!=e&&n.sort(e),null!=t?t(n):n;for(var u,c,d,f=-1,p=n.length,h=r[a++],m=o(),g=s();++f<p;)(d=m.get(u=h(c=n[f])+""))?d.push(c):m.set(u,[c]);return m.each((function(e,t){l(g,t,i(e,a,s,l))})),g}return n={object:function(e){return i(e,0,s,l)},map:function(e){return i(e,0,u,c)},entries:function(e){return function e(n,o){if(++o>r.length)return n;var i,s=a[o-1];return null!=t&&o>=r.length?i=n.entries():(i=[],n.each((function(t,n){i.push({key:n,values:e(t,o)})}))),null!=s?i.sort((function(e,t){return s(e.key,t.key)})):i}(i(e,0,u,c),0)},key:function(e){return r.push(e),n},sortKeys:function(e){return a[r.length-1]=e,n},sortValues:function(t){return e=t,n},rollup:function(e){return t=e,n}}};function s(){return{}}function l(e,t,n){e[t]=n}function u(){return o()}function c(e,t,n){e.set(t,n)}function d(){}var f=o.prototype;function p(e,t){var n=new d;if(e instanceof d)e.each((function(e){n.add(e)}));else if(e){var r=-1,a=e.length;if(null==t)for(;++r<a;)n.add(e[r]);else for(;++r<a;)n.add(t(e[r],r,e))}return n}d.prototype=p.prototype={constructor:d,has:f.has,add:function(e){return this["$"+(e+="")]=e,this},remove:f.remove,clear:f.clear,values:f.keys,size:f.size,empty:f.empty,each:f.each};var h=p},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(16),a=n(135),o=n(21);let i="";class s extends a.a{static isSupported(e,t){return a.a.isSupported(e,t)}constructor(e,t={}){var n,a;Object(r.b)(e),(t instanceof Promise||"string"==typeof t)&&(t={data:t}),"string"==typeof t.data&&(t=Object.assign({},t,{data:(n=t.data,Object(o.a)("string"==typeof n),n=i+n,new Promise((e,t)=>{try{const r=new Image;r.onload=()=>e(r),r.onerror=()=>t(new Error(`Could not load image ${n}.`)),r.crossOrigin=a&&a.crossOrigin||"anonymous",r.src=n}catch(e){t(e)}}))})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var r=n(51),a=n(145);async function o(e){if(Object(r.j)(e))return e;const t={},n=Object(a.a)(e);n>=0&&(t["content-length"]=String(n));const{url:o,type:i}=Object(a.b)(e);i&&(t["content-type"]=i);const s=await async function(e){if("string"==typeof e)return"data:,".concat(e.slice(0,5));if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(e=>{const n=new FileReader;n.onload=t=>{var n;return e(null==t||null===(n=t.target)||void 0===n?void 0:n.result)},n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=function(e){let t="";const n=new Uint8Array(e);for(let e=0;e<n.byteLength;e++)t+=String.fromCharCode(n[e]);return btoa(t)}(e.slice(0,5));return"data:base64,".concat(t)}return null}(e);s&&(t["x-first-bytes"]=s),"string"==typeof e&&(e=(new TextEncoder).encode(e));const l=new Response(e,{headers:t});return Object.defineProperty(l,"url",{value:o}),l}async function i(e){if(!e.ok){const t=await async function(e){let t="Failed to fetch resource ".concat(e.url," (").concat(e.status,"): ");try{const n=e.headers.get("Content-Type");let r=e.statusText;n.includes("application/json")&&(r+=" ".concat(await e.text())),t+=r,t=t.length>60?"".concat(t.slice(60),"..."):t}catch(e){}return t}(e);throw new Error(t)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(340);var a=n(446);function o(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(a.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(98);const a="EXT_color_buffer_float";var o={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:a,bpp:2},33327:{gl2:a,bpp:4},34842:{gl2:a,bpp:8},33326:{gl2:a,bpp:4},33328:{gl2:a,bpp:8},34836:{gl2:a,bpp:16},35898:{gl2:a,bpp:4}},i=n(16),s=n(21);class l extends r.a{static isSupported(e,{format:t}={format:null}){return!t||function(e,t,n){const r=n[t];if(!r)return!1;const a=Object(i.j)(e)&&r.gl2||r.gl1;return"string"==typeof a?e.getExtension(a):a}(e,t,o)}static getSamplesForFormat(e,{format:t}){return e.getInternalformatParameter(36161,t,32937)}constructor(e,t={}){super(e,t),this.initialize(t),Object.seal(this)}initialize({format:e,width:t=1,height:n=1,samples:r=0}){return Object(s.a)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&Object(i.j)(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,t,n):this.gl.renderbufferStorage(36161,e,t,n),this.format=e,this.width=t,this.height=n,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*o[this.format].bpp),this}resize({width:e,height:t}){return e!==this.width||t!==this.height?this.initialize({width:e,height:t,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(e){this.gl.bindRenderbuffer(36161,e)}_syncHandle(e){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(e){this.gl.bindRenderbuffer(36161,this.handle);return this.gl.getRenderbufferParameter(36161,e)}}},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var r="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",a="undefined"!=typeof window?window:e,o=(void 0!==e||window,"undefined"!=typeof document&&document,!1);try{var i={get passive(){return o=!0,!0}};a.addEventListener("test",i,i),a.removeEventListener("test",i,i)}catch(e){}}).call(this,n(55))},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));const r="undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",a="undefined"!=typeof window?window:e;void 0!==e||window,"undefined"!=typeof document&&document;let o=!1;try{const e={get passive(){return o=!0,!0}};a.addEventListener("test",e,e),a.removeEventListener("test",e,e)}catch(e){}}).call(this,n(55))},,,function(e,t){e.exports=r},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.LAYER_TYPES=void 0;var a=(0,r(n(137)).default)({point:null,arc:null,line:null,grid:null,hexagon:null,geojson:null,cluster:null,icon:null,heatmap:null,hexagonId:null,"3D":null,trip:null,s2:null});t.LAYER_TYPES=a},function(e,t){function n(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(a,o){var i=e.apply(t,r);function s(e){n(i,a,o,s,l,"next",e)}function l(e){n(i,a,o,s,l,"throw",e)}s(void 0)}))}}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.processCsvData=S,t.parseRowsByFields=T,t.getSampleForTypeAnalyze=C,t.parseCsvRowsByFieldType=P,t.getFieldsFromData=R,t.renameDuplicateFields=D,t.analyzerTypeToFieldType=k,t.processRowObject=I,t.processGeojson=F,t.formatCsv=j,t.validateInputData=function(e){if(!(0,v.isPlainObject)(e))return(0,d.default)("addDataToMap Error: dataset.data cannot be null"),null;if(!Array.isArray(e.fields))return(0,d.default)("addDataToMap Error: expect dataset.data.fields to be an array"),null;if(!Array.isArray(e.rows))return(0,d.default)("addDataToMap Error: expect dataset.data.rows to be an array"),null;var t=e.fields,n=e.rows;if(t.every((function(e,r){if((0,v.isPlainObject)(e)||((0,d.default)("fields needs to be an array of object, but find ".concat((0,i.default)(e))),t[r]={}),e.name||((0,d.default)("field.name is required but missing in ".concat(JSON.stringify(e))),t[r].name="column_".concat(r)),!h.ALL_FIELD_TYPES[e.type])return(0,d.default)("unknown field type ".concat(e.type)),!1;if(!t.every((function(e){return e.analyzerType})))return(0,d.default)("field missing analyzerType"),!1;if(e.type===h.ALL_FIELD_TYPES.timestamp){var a=function(e,t,n){var r=[],a=0;for(;r.length<n&&a<e.length;)(0,m.notNullorUndefined)(e[a][t])&&r.push(e[a]),a++;return r}(n,r,10).map((function(e){return{ts:e[r]}})),o=f.Analyzer.computeColMeta(a)[0];return o&&"TIME"===o.category&&o.format===e.format}return!0})))return{rows:n,fields:t};var r=C({fields:t.map((function(e){return e.name})),rows:n}),a=t.map((function(e){return e.name})),o=R(r,a);return{fields:t.map((function(e,t){return E(E({},e),{},{type:o[t].type,format:o[t].format,analyzerType:o[t].analyzerType})})),rows:n}},t.processKeplerglJSON=B,t.processKeplerglDataset=N,t.Processors=t.DATASET_HANDLERS=t.PARSE_FIELD_VALUE_FROM_STRING=t.CSV_NULLS=t.ACCEPTED_ANALYZER_TYPES=void 0;var a,o,i=r(n(63)),s=r(n(3)),l=n(1166),u=n(91),c=n(49),d=r(n(359)),f=n(262),p=r(n(365)),h=n(30),m=n(61),g=r(n(312)),y=n(264),v=n(69);function A(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=[f.DATA_TYPES.DATE,f.DATA_TYPES.TIME,f.DATA_TYPES.DATETIME,f.DATA_TYPES.NUMBER,f.DATA_TYPES.INT,f.DATA_TYPES.FLOAT,f.DATA_TYPES.BOOLEAN,f.DATA_TYPES.STRING,f.DATA_TYPES.GEOMETRY,f.DATA_TYPES.GEOMETRY_FROM_STRING,f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,f.DATA_TYPES.ZIPCODE,f.DATA_TYPES.ARRAY,f.DATA_TYPES.OBJECT];t.ACCEPTED_ANALYZER_TYPES=x;var M=/^(null|NULL|Null|NaN|\/N||)$/;t.CSV_NULLS=M;var w=Object.keys(f.DATA_TYPES).filter((function(e){return!x.includes(e)})),O=(a={},(0,s.default)(a,h.ALL_FIELD_TYPES.boolean,{valid:function(e){return"boolean"==typeof e},parse:function(e){return"true"===e||"True"===e||"TRUE"===e||"1"===e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.integer,{valid:function(e){return parseInt(e,10)===e},parse:function(e){return parseInt(e,10)}}),(0,s.default)(a,h.ALL_FIELD_TYPES.timestamp,{valid:function(e,t){return["x","X"].includes(t.format)?"number"==typeof e:"string"==typeof e},parse:function(e,t){return["x","X"].includes(t.format)?Number(e):e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.real,{valid:function(e){return parseFloat(e)===e},parse:parseFloat}),a);function S(e,t){var n,r;if("string"==typeof e){var a=(0,l.csvParseRows)(e);if(!Array.isArray(a)||a.length<2)throw new Error("process Csv Data Failed: CSV is empty");r=a[0],n=a.slice(1)}else Array.isArray(e)&&e.length&&(n=e,r=t,Array.isArray(r)||(r=e[0],n=e.slice(1)));if(!n||!r)throw new Error("invalid input passed to processCsvData");L(n);var o=R(C({fields:r,rows:n}),r);return{fields:o,rows:T(n,o)}}function T(e,t){var n=t.findIndex((function(e){return"_geojson"===e.name}));return t.forEach(P.bind(null,e,n)),e}function C(e){var t=e.fields,n=e.rows,r=e.sampleCount,a=void 0===r?50:r,o=Math.min(a,n.length),i=(0,u.range)(0,o,1).map((function(e){return{}}));return t.forEach((function(e,t){for(var r=0,a=0;a<o;)if(r>=n.length)i[a][e]=null,a++;else if((0,m.notNullorUndefined)(n[r][t])){var s=n[r][t];i[a][e]="string"==typeof s?s.trim():s,a++,r++}else r++})),i}function L(e){for(var t=new RegExp(M,"g"),n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)"string"==typeof e[n][r]&&e[n][r].match(t)&&(e[n][r]=null)}function P(e,t,n,r){var a=O[n.type];if(a){var o=e.find((function(e){return(0,m.notNullorUndefined)(e[r])}));if(!o||a.valid(o[r],n))return;e.forEach((function(e){null!==e[r]&&(e[r]=a.parse(e[r],n),t>-1&&e[t]&&e[t].properties&&(e[t].properties[n.name]=e[r]))}))}}function R(e,t){var n=f.Analyzer.computeColMeta(e,[{regex:/.*geojson|all_points/g,dataType:"GEOMETRY"},{regex:/.*census/g,dataType:"STRING"}],{ignoredDataTypes:w}),r=D(t).fieldByIndex;return t.map((function(e,t){var a=r[t],o=n.find((function(t){return t.key===e}))||{},i=o.type;return{name:a,id:a,displayName:a,format:o.format,fieldIdx:t,type:k(i),analyzerType:i,valueAccessor:function(e){return function(n){return e.valueAt(n.index,t)}}}}))}function D(e){return e.reduce((function(e,t,n){var r=e.allNames,a=t;if(r.includes(t)){for(var o=0;r.includes("".concat(t,"-").concat(o));)o++;a="".concat(t,"-").concat(o)}return e.fieldByIndex[n]=a,e.allNames.push(a),e}),{allNames:[],fieldByIndex:{}})}function k(e){var t=f.DATA_TYPES.DATE,n=f.DATA_TYPES.TIME,r=f.DATA_TYPES.DATETIME,a=f.DATA_TYPES.NUMBER,o=f.DATA_TYPES.INT,i=f.DATA_TYPES.FLOAT,s=f.DATA_TYPES.BOOLEAN,l=f.DATA_TYPES.STRING,u=f.DATA_TYPES.GEOMETRY,d=f.DATA_TYPES.GEOMETRY_FROM_STRING,p=f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,m=f.DATA_TYPES.ZIPCODE,g=f.DATA_TYPES.ARRAY,y=f.DATA_TYPES.OBJECT;switch(e){case t:return h.ALL_FIELD_TYPES.date;case n:case r:return h.ALL_FIELD_TYPES.timestamp;case i:return h.ALL_FIELD_TYPES.real;case o:return h.ALL_FIELD_TYPES.integer;case s:return h.ALL_FIELD_TYPES.boolean;case u:case d:case p:case g:case y:return h.ALL_FIELD_TYPES.geojson;case a:case l:case m:return h.ALL_FIELD_TYPES.string;default:return c.console.warn("Unsupported analyzer type: ".concat(e)),h.ALL_FIELD_TYPES.string}}function I(e){if(!Array.isArray(e)||!e.length)return null;var t=Object.keys(e[0]),n=e.map((function(e){return t.map((function(t){return e[t]}))}));return L(n),S(n,t)}function F(e){var t=(0,p.default)(e);if(!t||!Array.isArray(t.features))throw new Error("Read File Failed: File is not a valid GeoJSON. Read more about [supported file format](".concat(y.GUIDES_FILE_FORMAT_DOC,")"));for(var n=[],r=0;r<t.features.length;r++){var a=t.features[r];a.geometry&&n.push(E({_geojson:a},a.properties||{}))}var o=n.reduce((function(e,t){return Object.keys(t).forEach((function(t){e.includes(t)||e.push(t)})),e}),[]);return n.forEach((function(e){o.forEach((function(t){t in e||(e[t]=null,e._geojson.properties[t]=null)}))})),I(n)}function j(e,t){var n,r=[t.map((function(e){return e.displayName||e.name}))],a=A(e.rows(!0));try{for(a.s();!(n=a.n()).done;){var o=n.value;r.push(o.map((function(e,n){return(0,m.parseFieldValue)(e,t[n].type)})))}}catch(e){a.e(e)}finally{a.f()}return(0,l.csvFormatRows)(r)}function B(e){return e?g.default.load(e.datasets,e.config):null}function N(e){if(!e)return null;var t=g.default.parseSavedData((0,v.toArray)(e));return t?Array.isArray(e)?t:t[0]:null}t.PARSE_FIELD_VALUE_FROM_STRING=O;var z=(o={},(0,s.default)(o,h.DATASET_FORMATS.row,I),(0,s.default)(o,h.DATASET_FORMATS.geojson,F),(0,s.default)(o,h.DATASET_FORMATS.csv,S),(0,s.default)(o,h.DATASET_FORMATS.keplergl,N),o);t.DATASET_HANDLERS=z;var U={processGeojson:F,processCsvData:S,processRowObject:I,processKeplerglJSON:B,processKeplerglDataset:N,analyzerTypeToFieldType:k,getFieldsFromData:R,parseCsvRowsByFieldType:P,formatCsv:j};t.Processors=U},function(e,t,n){"use strict";e.exports={Analyzer:n(1332),DATA_TYPES:n(364).DATA_TYPES,RegexList:n(809)}},function(e,t,n){(function(e,n){var r="[object Arguments]",a="[object Map]",o="[object Object]",i="[object Set]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[r]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u[a]=u["[object Number]"]=u[o]=u["[object RegExp]"]=u[i]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,f=c||d||Function("return this")(),p=t&&!t.nodeType&&t,h=p&&"object"==typeof n&&n&&!n.nodeType&&n,m=h&&h.exports===p,g=m&&c.process,y=function(){try{return g&&g.binding&&g.binding("util")}catch(e){}}(),v=y&&y.isTypedArray;function A(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function b(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function _(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var E,x,M,w=Array.prototype,O=Function.prototype,S=Object.prototype,T=f["__core-js_shared__"],C=O.toString,L=S.hasOwnProperty,P=(E=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"",R=S.toString,D=RegExp("^"+C.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=m?f.Buffer:void 0,I=f.Symbol,F=f.Uint8Array,j=S.propertyIsEnumerable,B=w.splice,N=I?I.toStringTag:void 0,z=Object.getOwnPropertySymbols,U=k?k.isBuffer:void 0,H=(x=Object.keys,M=Object,function(e){return x(M(e))}),V=ye(f,"DataView"),G=ye(f,"Map"),Y=ye(f,"Promise"),W=ye(f,"Set"),q=ye(f,"WeakMap"),X=ye(Object,"create"),K=_e(V),Z=_e(G),J=_e(Y),Q=_e(W),$=_e(q),ee=I?I.prototype:void 0,te=ee?ee.valueOf:void 0;function ne(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function re(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ae(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function oe(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new ae;++t<n;)this.add(e[t])}function ie(e){var t=this.__data__=new re(e);this.size=t.size}function se(e,t){var n=Me(e),r=!n&&xe(e),a=!n&&!r&&we(e),o=!n&&!r&&!a&&Le(e),i=n||r||a||o,s=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var u in e)!t&&!L.call(e,u)||i&&("length"==u||a&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||be(u,l))||s.push(u);return s}function le(e,t){for(var n=e.length;n--;)if(Ee(e[n][0],t))return n;return-1}function ue(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":N&&N in Object(e)?function(e){var t=L.call(e,N),n=e[N];try{e[N]=void 0;var r=!0}catch(e){}var a=R.call(e);r&&(t?e[N]=n:delete e[N]);return a}(e):function(e){return R.call(e)}(e)}function ce(e){return Ce(e)&&ue(e)==r}function de(e,t,n,s,l){return e===t||(null==e||null==t||!Ce(e)&&!Ce(t)?e!=e&&t!=t:function(e,t,n,s,l,u){var c=Me(e),d=Me(t),f=c?"[object Array]":Ae(e),p=d?"[object Array]":Ae(t),h=(f=f==r?o:f)==o,m=(p=p==r?o:p)==o,g=f==p;if(g&&we(e)){if(!we(t))return!1;c=!0,h=!1}if(g&&!h)return u||(u=new ie),c||Le(e)?he(e,t,n,s,l,u):function(e,t,n,r,o,s,l){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new F(e),new F(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ee(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case a:var u=b;case i:var c=1&r;if(u||(u=_),e.size!=t.size&&!c)return!1;var d=l.get(e);if(d)return d==t;r|=2,l.set(e,t);var f=he(u(e),u(t),r,o,s,l);return l.delete(e),f;case"[object Symbol]":if(te)return te.call(e)==te.call(t)}return!1}(e,t,f,n,s,l,u);if(!(1&n)){var y=h&&L.call(e,"__wrapped__"),v=m&&L.call(t,"__wrapped__");if(y||v){var A=y?e.value():e,E=v?t.value():t;return u||(u=new ie),l(A,E,n,s,u)}}if(!g)return!1;return u||(u=new ie),function(e,t,n,r,a,o){var i=1&n,s=me(e),l=s.length,u=me(t).length;if(l!=u&&!i)return!1;var c=l;for(;c--;){var d=s[c];if(!(i?d in t:L.call(t,d)))return!1}var f=o.get(e);if(f&&o.get(t))return f==t;var p=!0;o.set(e,t),o.set(t,e);var h=i;for(;++c<l;){d=s[c];var m=e[d],g=t[d];if(r)var y=i?r(g,m,d,t,e,o):r(m,g,d,e,t,o);if(!(void 0===y?m===g||a(m,g,n,r,o):y)){p=!1;break}h||(h="constructor"==d)}if(p&&!h){var v=e.constructor,A=t.constructor;v==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof A&&A instanceof A||(p=!1)}return o.delete(e),o.delete(t),p}(e,t,n,s,l,u)}(e,t,n,s,de,l))}function fe(e){return!(!Te(e)||function(e){return!!P&&P in e}(e))&&(Oe(e)?D:s).test(_e(e))}function pe(e){if(!function(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||S;return e===n}(e))return H(e);var t=[];for(var n in Object(e))L.call(e,n)&&"constructor"!=n&&t.push(n);return t}function he(e,t,n,r,a,o){var i=1&n,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var u=o.get(e);if(u&&o.get(t))return u==t;var c=-1,d=!0,f=2&n?new oe:void 0;for(o.set(e,t),o.set(t,e);++c<s;){var p=e[c],h=t[c];if(r)var m=i?r(h,p,c,t,e,o):r(p,h,c,e,t,o);if(void 0!==m){if(m)continue;d=!1;break}if(f){if(!A(t,(function(e,t){if(i=t,!f.has(i)&&(p===e||a(p,e,n,r,o)))return f.push(t);var i}))){d=!1;break}}else if(p!==h&&!a(p,h,n,r,o)){d=!1;break}}return o.delete(e),o.delete(t),d}function me(e){return function(e,t,n){var r=t(e);return Me(e)?r:function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}(r,n(e))}(e,Pe,ve)}function ge(e,t){var n=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?n["string"==typeof t?"string":"hash"]:n.map}function ye(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return fe(n)?n:void 0}ne.prototype.clear=function(){this.__data__=X?X(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(X){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return L.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return X?void 0!==t[e]:L.call(t,e)},ne.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=X&&void 0===t?"__lodash_hash_undefined__":t,this},re.prototype.clear=function(){this.__data__=[],this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=le(t,e);return!(n<0)&&(n==t.length-1?t.pop():B.call(t,n,1),--this.size,!0)},re.prototype.get=function(e){var t=this.__data__,n=le(t,e);return n<0?void 0:t[n][1]},re.prototype.has=function(e){return le(this.__data__,e)>-1},re.prototype.set=function(e,t){var n=this.__data__,r=le(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(G||re),string:new ne}},ae.prototype.delete=function(e){var t=ge(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return ge(this,e).get(e)},ae.prototype.has=function(e){return ge(this,e).has(e)},ae.prototype.set=function(e,t){var n=ge(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},oe.prototype.add=oe.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},oe.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.clear=function(){this.__data__=new re,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(r)}return n.set(e,t),this.size=n.size,this};var ve=z?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[a++]=i)}return o}(z(e),(function(t){return j.call(e,t)})))}:function(){return[]},Ae=ue;function be(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||l.test(e))&&e>-1&&e%1==0&&e<t}function _e(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ee(e,t){return e===t||e!=e&&t!=t}(V&&"[object DataView]"!=Ae(new V(new ArrayBuffer(1)))||G&&Ae(new G)!=a||Y&&"[object Promise]"!=Ae(Y.resolve())||W&&Ae(new W)!=i||q&&"[object WeakMap]"!=Ae(new q))&&(Ae=function(e){var t=ue(e),n=t==o?e.constructor:void 0,r=n?_e(n):"";if(r)switch(r){case K:return"[object DataView]";case Z:return a;case J:return"[object Promise]";case Q:return i;case $:return"[object WeakMap]"}return t});var xe=ce(function(){return arguments}())?ce:function(e){return Ce(e)&&L.call(e,"callee")&&!j.call(e,"callee")},Me=Array.isArray;var we=U||function(){return!1};function Oe(e){if(!Te(e))return!1;var t=ue(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==typeof e}var Le=v?function(e){return function(t){return e(t)}}(v):function(e){return Ce(e)&&Se(e.length)&&!!u[ue(e)]};function Pe(e){return function(e){return null!=e&&Se(e.length)&&!Oe(e)}(e)?se(e):pe(e)}n.exports=function(e,t){return de(e,t)}}).call(this,n(55),n(156)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BUG_REPORT_LINK=t.GUIDES_FILE_FORMAT_DOC=t.EXPORT_HTML_MAP_MODES_DOC=t.MAPBOX_ACCESS_TOKEN=t.ADD_DATA_TO_MAP_DOC=t.EXPORT_HTML_MAP_DOC=t.API_REFERENCE_DOC=t.ACTIONS_DOC=t.USER_GUIDE_DOC=void 0;var r="https://docs.kepler.gl/docs/user-guides";t.USER_GUIDE_DOC=r;var a="https://docs.kepler.gl/docs/api-reference/actions/actions";t.ACTIONS_DOC=a;t.API_REFERENCE_DOC="https://docs.kepler.gl/docs/api-reference";var o="".concat(r,"/k-save-and-export");t.EXPORT_HTML_MAP_DOC=o;var i="".concat(a,"#adddatatomap");t.ADD_DATA_TO_MAP_DOC=i;t.MAPBOX_ACCESS_TOKEN="https://docs.mapbox.com/help/how-mapbox-works/access-tokens/";var s="".concat(r,"/k-save-and-export#export-html-map");t.EXPORT_HTML_MAP_MODES_DOC=s;var l="".concat(r,"/b-kepler-gl-workflow/a-add-data-to-the-map#supported-file-formats");t.GUIDES_FILE_FORMAT_DOC=l;t.BUG_REPORT_LINK="https://github.com/keplergl/kepler.gl/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBug%5D"},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.createDataContainer=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;if((t=l(l({},c),t)).inputDataFormat===u.ROWS_ARRAY)return new o.RowDataContainer({rows:e,fields:t.fields});throw Error("Failed to create a data container: not implemented format")},t.createIndexedDataContainer=d,t.getSampleData=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=e.numRows(),r=Math.max(Math.floor(n/t),1),a=[],o=0;o<n;o+=r)a.push(o);return d(e,a)},t.DataForm=void 0;var a=r(n(3)),o=n(1338),i=n(1339);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u={ROWS_ARRAY:"ROWS_ARRAY"};t.DataForm=u;var c={inputDataFormat:u.ROWS_ARRAY};function d(e,t){return new i.IndexedDataContainer(e,t)}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.findDefaultLayer=function(e,t){if(!e)return[];return Object.keys(t).reduce((function(n,r){var a="function"==typeof t[r].findDefaultLayerProps?t[r].findDefaultLayerProps(e,n):{props:[]},o=Array.isArray(a)?a:a.props||[];return(a.foundLayers||n).concat(o.map((function(t){return l(l({},t),{},{type:r,dataId:e.id})})))}),[]).map((function(n){var r=new t[n.type](n);return"function"==typeof r.setInitialLayerConfig&&e.dataContainer?r.setInitialLayerConfig(e):r}))},t.calculateLayerData=function(e,t,n){if(!e.type||!e.hasAllColumns()||!e.config.dataId)return{layer:e,layerData:{}};return{layerData:e.formatLayerData(t.datasets,n),layer:e}},t.getLayerHoverProp=function(e){var t=e.interactionConfig,n=e.hoverInfo,r=e.layers,a=e.layersToRender,o=e.datasets;if(t.tooltip.enabled&&n&&n.picked){var i=n.object,s=n.layer,l=r[s.props.idx];if(i&&l&&l.getHoverData&&a[l.id]){var u=l.config.dataId;if(!u)return null;var c=o[u],d=c.dataContainer,f=c.fields,p=l.getHoverData(i,d,f),h=t.tooltip.config.fieldsToShow[u];return{data:p,fields:f,fieldsToShow:h,layer:l}}}return null},t.renderDeckGlLayer=function(e,t,n){var r=e.datasets,a=e.layers,o=e.layerData,i=e.hoverInfo,s=e.clicked,l=e.mapState,u=e.interactionConfig,c=e.animationConfig,d=e.mapLayers,f=e.maskPolygon,p=a[n],h=o[n],m=(r[p.config.dataId]||{}).gpuFilter,g=s||i,y=!d||d&&d[p.id];return p.renderLayer({data:h,gpuFilter:m,idx:n,interactionConfig:u,layerCallbacks:t,mapState:l,animationConfig:c,objectHovered:g,visible:y,maskPolygon:f})},t.isLayerRenderable=u,t.isLayerVisible=c,t.prepareLayersForDeck=function(e,t){return e.reduce((function(e,n,r){return l(l({},e),{},(0,a.default)({},n.id,u(n,t[r])&&n.overlayType===o.OVERLAY_TYPE.deckgl))}),{})},t.prepareLayersToRender=function(e,t,n){return e.reduce((function(e,r,o){return l(l({},e),{},(0,a.default)({},r.id,u(r,t[o])&&c(r,n)))}),{})},t.getMaskExtensionProps=function(e){return{maskId:Boolean(e&&e.length)&&i.MASK_LAYER_ID,extensions:[d]}};var a=r(n(3)),o=n(126),i=n(30);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t){return e.id!==i.GEOCODER_LAYER_ID&&e.shouldRenderLayer(t)}function c(e,t){return e.config.isVisible&&(!t||t&&t[e.id])}var d=new(n(134).MaskExtension)},function(e,t,n){"use strict";n.r(t),t.default={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795}},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,i=parseInt,s="object"==typeof t&&t&&t.Object===Object&&t,l="object"==typeof self&&self&&self.Object===Object&&self,u=s||l||Function("return this")(),c=Object.prototype.toString,d=Math.max,f=Math.min,p=function(){return u.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==c.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var s=a.test(e);return s||o.test(e)?i(e.slice(2),s?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,a,o,i,s,l,u=0,c=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var n=r,o=a;return r=a=void 0,u=t,i=e.apply(o,n)}function A(e){return u=e,s=setTimeout(_,t),c?v(e):i}function b(e){var n=e-l;return void 0===l||n>=t||n<0||g&&e-u>=o}function _(){var e=p();if(b(e))return E(e);s=setTimeout(_,function(e){var n=t-(e-l);return g?f(n,o-(e-u)):n}(e))}function E(e){return s=void 0,y&&r?v(e):(r=a=void 0,i)}function x(){var e=p(),n=b(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return A(l);if(g)return s=setTimeout(_,t),v(l)}return void 0===s&&(s=setTimeout(_,t)),i}return t=m(t)||0,h(n)&&(c=!!n.leading,o=(g="maxWait"in n)?d(m(n.maxWait)||0,t):o,y="trailing"in n?!!n.trailing:y),x.cancel=function(){void 0!==s&&clearTimeout(s),u=0,r=l=a=s=void 0},x.flush=function(){return void 0===s?i:E(p())},x}}).call(this,n(55))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){e.exports=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.LAYER_TYPES=void 0;var a=(0,r(n(137)).default)({point:null,arc:null,line:null,grid:null,hexagon:null,geojson:null,cluster:null,icon:null,heatmap:null,hexagonId:null,"3D":null,trip:null,s2:null});t.LAYER_TYPES=a},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.processCsvData=S,t.parseRowsByFields=T,t.getSampleForTypeAnalyze=C,t.parseCsvRowsByFieldType=P,t.getFieldsFromData=R,t.renameDuplicateFields=D,t.analyzerTypeToFieldType=k,t.processRowObject=I,t.processGeojson=F,t.formatCsv=j,t.validateInputData=function(e){if(!(0,v.isPlainObject)(e))return(0,d.default)("addDataToMap Error: dataset.data cannot be null"),null;if(!Array.isArray(e.fields))return(0,d.default)("addDataToMap Error: expect dataset.data.fields to be an array"),null;if(!Array.isArray(e.rows))return(0,d.default)("addDataToMap Error: expect dataset.data.rows to be an array"),null;var t=e.fields,n=e.rows;if(t.every((function(e,r){if((0,v.isPlainObject)(e)||((0,d.default)("fields needs to be an array of object, but find ".concat((0,i.default)(e))),t[r]={}),e.name||((0,d.default)("field.name is required but missing in ".concat(JSON.stringify(e))),t[r].name="column_".concat(r)),!h.ALL_FIELD_TYPES[e.type])return(0,d.default)("unknown field type ".concat(e.type)),!1;if(!t.every((function(e){return e.analyzerType})))return(0,d.default)("field missing analyzerType"),!1;if(e.type===h.ALL_FIELD_TYPES.timestamp){var a=function(e,t,n){var r=[],a=0;for(;r.length<n&&a<e.length;)(0,m.notNullorUndefined)(e[a][t])&&r.push(e[a]),a++;return r}(n,r,10).map((function(e){return{ts:e[r]}})),o=f.Analyzer.computeColMeta(a)[0];return o&&"TIME"===o.category&&o.format===e.format}return!0})))return{rows:n,fields:t};var r=C({fields:t.map((function(e){return e.name})),rows:n}),a=t.map((function(e){return e.name})),o=R(r,a);return{fields:t.map((function(e,t){return E(E({},e),{},{type:o[t].type,format:o[t].format,analyzerType:o[t].analyzerType})})),rows:n}},t.processKeplerglJSON=B,t.processKeplerglDataset=N,t.Processors=t.DATASET_HANDLERS=t.PARSE_FIELD_VALUE_FROM_STRING=t.CSV_NULLS=t.ACCEPTED_ANALYZER_TYPES=void 0;var a,o,i=r(n(63)),s=r(n(3)),l=n(1166),u=n(91),c=n(49),d=r(n(359)),f=n(262),p=r(n(365)),h=n(31),m=n(62),g=r(n(324)),y=n(273),v=n(70);function A(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach((function(t){(0,s.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var x=[f.DATA_TYPES.DATE,f.DATA_TYPES.TIME,f.DATA_TYPES.DATETIME,f.DATA_TYPES.NUMBER,f.DATA_TYPES.INT,f.DATA_TYPES.FLOAT,f.DATA_TYPES.BOOLEAN,f.DATA_TYPES.STRING,f.DATA_TYPES.GEOMETRY,f.DATA_TYPES.GEOMETRY_FROM_STRING,f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,f.DATA_TYPES.ZIPCODE,f.DATA_TYPES.ARRAY,f.DATA_TYPES.OBJECT];t.ACCEPTED_ANALYZER_TYPES=x;var M=/^(null|NULL|Null|NaN|\/N||)$/;t.CSV_NULLS=M;var w=Object.keys(f.DATA_TYPES).filter((function(e){return!x.includes(e)})),O=(a={},(0,s.default)(a,h.ALL_FIELD_TYPES.boolean,{valid:function(e){return"boolean"==typeof e},parse:function(e){return"true"===e||"True"===e||"TRUE"===e||"1"===e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.integer,{valid:function(e){return parseInt(e,10)===e},parse:function(e){return parseInt(e,10)}}),(0,s.default)(a,h.ALL_FIELD_TYPES.timestamp,{valid:function(e,t){return["x","X"].includes(t.format)?"number"==typeof e:"string"==typeof e},parse:function(e,t){return["x","X"].includes(t.format)?Number(e):e}}),(0,s.default)(a,h.ALL_FIELD_TYPES.real,{valid:function(e){return parseFloat(e)===e},parse:parseFloat}),a);function S(e,t){var n,r;if("string"==typeof e){var a=(0,l.csvParseRows)(e);if(!Array.isArray(a)||a.length<2)throw new Error("process Csv Data Failed: CSV is empty");r=a[0],n=a.slice(1)}else Array.isArray(e)&&e.length&&(n=e,r=t,Array.isArray(r)||(r=e[0],n=e.slice(1)));if(!n||!r)throw new Error("invalid input passed to processCsvData");L(n);var o=R(C({fields:r,rows:n}),r);return{fields:o,rows:T(n,o)}}function T(e,t){var n=t.findIndex((function(e){return"_geojson"===e.name}));return t.forEach(P.bind(null,e,n)),e}function C(e){var t=e.fields,n=e.rows,r=e.sampleCount,a=void 0===r?50:r,o=Math.min(a,n.length),i=(0,u.range)(0,o,1).map((function(e){return{}}));return t.forEach((function(e,t){for(var r=0,a=0;a<o;)if(r>=n.length)i[a][e]=null,a++;else if((0,m.notNullorUndefined)(n[r][t])){var s=n[r][t];i[a][e]="string"==typeof s?s.trim():s,a++,r++}else r++})),i}function L(e){for(var t=new RegExp(M,"g"),n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)"string"==typeof e[n][r]&&e[n][r].match(t)&&(e[n][r]=null)}function P(e,t,n,r){var a=O[n.type];if(a){var o=e.find((function(e){return(0,m.notNullorUndefined)(e[r])}));if(!o||a.valid(o[r],n))return;e.forEach((function(e){null!==e[r]&&(e[r]=a.parse(e[r],n),t>-1&&e[t]&&e[t].properties&&(e[t].properties[n.name]=e[r]))}))}}function R(e,t){var n=f.Analyzer.computeColMeta(e,[{regex:/.*geojson|all_points/g,dataType:"GEOMETRY"},{regex:/.*census/g,dataType:"STRING"}],{ignoredDataTypes:w}),r=D(t).fieldByIndex;return t.map((function(e,t){var a=r[t],o=n.find((function(t){return t.key===e}))||{},i=o.type;return{name:a,id:a,displayName:a,format:o.format,fieldIdx:t,type:k(i),analyzerType:i,valueAccessor:function(e){return function(n){return e.valueAt(n.index,t)}}}}))}function D(e){return e.reduce((function(e,t,n){var r=e.allNames,a=t;if(r.includes(t)){for(var o=0;r.includes("".concat(t,"-").concat(o));)o++;a="".concat(t,"-").concat(o)}return e.fieldByIndex[n]=a,e.allNames.push(a),e}),{allNames:[],fieldByIndex:{}})}function k(e){var t=f.DATA_TYPES.DATE,n=f.DATA_TYPES.TIME,r=f.DATA_TYPES.DATETIME,a=f.DATA_TYPES.NUMBER,o=f.DATA_TYPES.INT,i=f.DATA_TYPES.FLOAT,s=f.DATA_TYPES.BOOLEAN,l=f.DATA_TYPES.STRING,u=f.DATA_TYPES.GEOMETRY,d=f.DATA_TYPES.GEOMETRY_FROM_STRING,p=f.DATA_TYPES.PAIR_GEOMETRY_FROM_STRING,m=f.DATA_TYPES.ZIPCODE,g=f.DATA_TYPES.ARRAY,y=f.DATA_TYPES.OBJECT;switch(e){case t:return h.ALL_FIELD_TYPES.date;case n:case r:return h.ALL_FIELD_TYPES.timestamp;case i:return h.ALL_FIELD_TYPES.real;case o:return h.ALL_FIELD_TYPES.integer;case s:return h.ALL_FIELD_TYPES.boolean;case u:case d:case p:case g:case y:return h.ALL_FIELD_TYPES.geojson;case a:case l:case m:return h.ALL_FIELD_TYPES.string;default:return c.console.warn("Unsupported analyzer type: ".concat(e)),h.ALL_FIELD_TYPES.string}}function I(e){if(!Array.isArray(e)||!e.length)return null;var t=Object.keys(e[0]),n=e.map((function(e){return t.map((function(t){return e[t]}))}));return L(n),S(n,t)}function F(e){var t=(0,p.default)(e);if(!t||!Array.isArray(t.features))throw new Error("Read File Failed: File is not a valid GeoJSON. Read more about [supported file format](".concat(y.GUIDES_FILE_FORMAT_DOC,")"));for(var n=[],r=0;r<t.features.length;r++){var a=t.features[r];a.geometry&&n.push(E({_geojson:a},a.properties||{}))}var o=n.reduce((function(e,t){return Object.keys(t).forEach((function(t){e.includes(t)||e.push(t)})),e}),[]);return n.forEach((function(e){o.forEach((function(t){t in e||(e[t]=null,e._geojson.properties[t]=null)}))})),I(n)}function j(e,t){var n,r=[t.map((function(e){return e.displayName||e.name}))],a=A(e.rows(!0));try{for(a.s();!(n=a.n()).done;){var o=n.value;r.push(o.map((function(e,n){return(0,m.parseFieldValue)(e,t[n].type)})))}}catch(e){a.e(e)}finally{a.f()}return(0,l.csvFormatRows)(r)}function B(e){return e?g.default.load(e.datasets,e.config):null}function N(e){if(!e)return null;var t=g.default.parseSavedData((0,v.toArray)(e));return t?Array.isArray(e)?t:t[0]:null}t.PARSE_FIELD_VALUE_FROM_STRING=O;var z=(o={},(0,s.default)(o,h.DATASET_FORMATS.row,I),(0,s.default)(o,h.DATASET_FORMATS.geojson,F),(0,s.default)(o,h.DATASET_FORMATS.csv,S),(0,s.default)(o,h.DATASET_FORMATS.keplergl,N),o);t.DATASET_HANDLERS=z;var U={processGeojson:F,processCsvData:S,processRowObject:I,processKeplerglJSON:B,processKeplerglDataset:N,analyzerTypeToFieldType:k,getFieldsFromData:R,parseCsvRowsByFieldType:P,formatCsv:j};t.Processors=U},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BUG_REPORT_LINK=t.GUIDES_FILE_FORMAT_DOC=t.EXPORT_HTML_MAP_MODES_DOC=t.MAPBOX_ACCESS_TOKEN=t.ADD_DATA_TO_MAP_DOC=t.EXPORT_HTML_MAP_DOC=t.API_REFERENCE_DOC=t.ACTIONS_DOC=t.USER_GUIDE_DOC=void 0;var r="https://docs.kepler.gl/docs/user-guides";t.USER_GUIDE_DOC=r;var a="https://docs.kepler.gl/docs/api-reference/actions/actions";t.ACTIONS_DOC=a;t.API_REFERENCE_DOC="https://docs.kepler.gl/docs/api-reference";var o="".concat(r,"/k-save-and-export");t.EXPORT_HTML_MAP_DOC=o;var i="".concat(a,"#adddatatomap");t.ADD_DATA_TO_MAP_DOC=i;t.MAPBOX_ACCESS_TOKEN="https://docs.mapbox.com/help/how-mapbox-works/access-tokens/";var s="".concat(r,"/k-save-and-export#export-html-map");t.EXPORT_HTML_MAP_MODES_DOC=s;var l="".concat(r,"/b-kepler-gl-workflow/a-add-data-to-the-map#supported-file-formats");t.GUIDES_FILE_FORMAT_DOC=l;t.BUG_REPORT_LINK="https://github.com/keplergl/kepler.gl/issues/new?assignees=&labels=bug&template=bug_report.md&title=%5BBug%5D"},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.createDataContainer=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:c;if((t=l(l({},c),t)).inputDataFormat===u.ROWS_ARRAY)return new o.RowDataContainer({rows:e,fields:t.fields});throw Error("Failed to create a data container: not implemented format")},t.createIndexedDataContainer=d,t.getSampleData=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=e.numRows(),r=Math.max(Math.floor(n/t),1),a=[],o=0;o<n;o+=r)a.push(o);return d(e,a)},t.DataForm=void 0;var a=r(n(3)),o=n(1635),i=n(1636);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u={ROWS_ARRAY:"ROWS_ARRAY"};t.DataForm=u;var c={inputDataFormat:u.ROWS_ARRAY};function d(e,t){return new i.IndexedDataContainer(e,t)}},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.findDefaultLayer=function(e,t){if(!e)return[];return Object.keys(t).reduce((function(n,r){var a="function"==typeof t[r].findDefaultLayerProps?t[r].findDefaultLayerProps(e,n):{props:[]},o=Array.isArray(a)?a:a.props||[];return(a.foundLayers||n).concat(o.map((function(t){return l(l({},t),{},{type:r,dataId:e.id})})))}),[]).map((function(n){var r=new t[n.type](n);return"function"==typeof r.setInitialLayerConfig&&e.dataContainer?r.setInitialLayerConfig(e):r}))},t.calculateLayerData=function(e,t,n){if(!e.type||!e.hasAllColumns()||!e.config.dataId)return{layer:e,layerData:{}};return{layerData:e.formatLayerData(t.datasets,n),layer:e}},t.getLayerHoverProp=function(e){var t=e.interactionConfig,n=e.hoverInfo,r=e.layers,a=e.layersToRender,o=e.datasets;if(t.tooltip.enabled&&n&&n.picked){var i=n.object,s=n.layer,l=r[s.props.idx];if(i&&l&&l.getHoverData&&a[l.id]){var u=l.config.dataId;if(!u)return null;var c=o[u],d=c.dataContainer,f=c.fields,p=l.getHoverData(i,d,f),h=t.tooltip.config.fieldsToShow[u];return{data:p,fields:f,fieldsToShow:h,layer:l}}}return null},t.renderDeckGlLayer=function(e,t,n){var r=e.datasets,a=e.layers,o=e.layerData,i=e.hoverInfo,s=e.clicked,l=e.mapState,u=e.interactionConfig,c=e.animationConfig,d=e.mapLayers,f=e.maskPolygon,p=a[n],h=o[n],m=(r[p.config.dataId]||{}).gpuFilter,g=s||i,y=!d||d&&d[p.id];return p.renderLayer({data:h,gpuFilter:m,idx:n,interactionConfig:u,layerCallbacks:t,mapState:l,animationConfig:c,objectHovered:g,visible:y,maskPolygon:f})},t.isLayerRenderable=u,t.isLayerVisible=c,t.prepareLayersForDeck=function(e,t){return e.reduce((function(e,n,r){return l(l({},e),{},(0,a.default)({},n.id,u(n,t[r])&&n.overlayType===o.OVERLAY_TYPE.deckgl))}),{})},t.prepareLayersToRender=function(e,t,n){return e.reduce((function(e,r,o){return l(l({},e),{},(0,a.default)({},r.id,u(r,t[o])&&c(r,n)))}),{})},t.getMaskExtensionProps=function(e){return{maskId:Boolean(e&&e.length)&&i.MASK_LAYER_ID,extensions:[d]}};var a=r(n(3)),o=n(129),i=n(31);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e,t){return e.id!==i.GEOCODER_LAYER_ID&&e.shouldRenderLayer(t)}function c(e,t){return e.config.isVisible&&(!t||t&&t[e.id])}var d=new(n(134).MaskExtension)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,o,i,s=r(n(12)),l=r(n(0)),u=r(n(11)),c=n(40),d=n(29),f=n(45),p=u.default.div(a||(a=(0,s.default)(["\n background-color: ",";\n flex-grow: 1;\n z-index: 1;\n p {\n margin-bottom: 0;\n }\n"])),(function(e){return e.theme.mapPanelBackgroundColor})),h=u.default.div.attrs({className:"map-control__panel-content"})(o||(o=(0,s.default)(["\n ",";\n max-height: 500px;\n min-height: 100px;\n min-width: ","px;\n overflow: auto;\n"])),(function(e){return e.theme.dropdownScrollBar}),(function(e){return e.theme.mapControl.width})),m=u.default.div.attrs({className:"map-control__panel-header"})(i||(i=(0,s.default)(["\n display: flex;\n justify-content: space-between;\n background-color: ",";\n height: 32px;\n padding: 6px 12px;\n font-size: 11px;\n color: ",";\n position: relative;\n\n button {\n width: 18px;\n height: 18px;\n }\n"])),(function(e){return e.theme.mapPanelHeaderBackgroundColor}),(function(e){return e.theme.titleTextColor}));var g=function(){var e=l.default.memo((function(e){var t=e.children,n=e.header,r=e.onClick,a=e.scale,o=void 0===a?1:a,i=e.isExport,s=e.logoComponent;return l.default.createElement(p,{style:{transform:"scale(".concat(o,")"),marginBottom:"8px"}},l.default.createElement(m,null,i&&s?s:n?l.default.createElement("span",{style:{verticalAlign:"middle"}},l.default.createElement(c.FormattedMessage,{id:n})):null,i?null:l.default.createElement(d.IconRoundSmall,{className:"close-map-control-item",onClick:r},l.default.createElement(f.Close,{height:"16px"}))),l.default.createElement(h,null,t))}));return e.displayName="MapControlPanel",e};t.default=g},function(e,t,n){e.exports=function(e){return r({},e)};var r=n(408)},function(e,t,n){"use strict";var r=n(2);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a,o,i,s=r(n(12)),l=r(n(0)),u=r(n(11)),c=n(39),d=n(28),f=n(44),p=u.default.div(a||(a=(0,s.default)(["\n background-color: ",";\n flex-grow: 1;\n z-index: 1;\n p {\n margin-bottom: 0;\n }\n"])),(function(e){return e.theme.mapPanelBackgroundColor})),h=u.default.div.attrs({className:"map-control__panel-content"})(o||(o=(0,s.default)(["\n ",";\n max-height: 500px;\n min-height: 100px;\n min-width: ","px;\n overflow: auto;\n"])),(function(e){return e.theme.dropdownScrollBar}),(function(e){return e.theme.mapControl.width})),m=u.default.div.attrs({className:"map-control__panel-header"})(i||(i=(0,s.default)(["\n display: flex;\n justify-content: space-between;\n background-color: ",";\n height: 32px;\n padding: 6px 12px;\n font-size: 11px;\n color: ",";\n position: relative;\n\n button {\n width: 18px;\n height: 18px;\n }\n"])),(function(e){return e.theme.mapPanelHeaderBackgroundColor}),(function(e){return e.theme.titleTextColor}));var g=function(){var e=l.default.memo((function(e){var t=e.children,n=e.header,r=e.onClick,a=e.scale,o=void 0===a?1:a,i=e.isExport,s=e.logoComponent;return l.default.createElement(p,{style:{transform:"scale(".concat(o,")"),marginBottom:"8px"}},l.default.createElement(m,null,i&&s?s:n?l.default.createElement("span",{style:{verticalAlign:"middle"}},l.default.createElement(c.FormattedMessage,{id:n})):null,i?null:l.default.createElement(d.IconRoundSmall,{className:"close-map-control-item",onClick:r},l.default.createElement(f.Close,{height:"16px"}))),l.default.createElement(h,null,t))}));return e.displayName="MapControlPanel",e};t.default=g},function(e,t,n){"use strict";n.r(t),n.d(t,"SortableContainer",(function(){return fe})),n.d(t,"sortableContainer",(function(){return fe})),n.d(t,"SortableElement",(function(){return me})),n.d(t,"sortableElement",(function(){return me})),n.d(t,"SortableHandle",(function(){return re})),n.d(t,"sortableHandle",(function(){return re})),n.d(t,"arrayMove",(function(){return E}));var r=n(299),a=n(42),o=n(4);function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Object(o.a)(e,t,n[t])}))}return e}var s=n(33),l=n(32),u=n(57),c=n(37),d=n(58),f=n(15),p=n(0),h=n(1),m=n.n(h),g=n(102),y=n(93),v=n.n(y),A=n(252),b=function(){function e(){Object(s.a)(this,e),Object(o.a)(this,"refs",{})}return Object(l.a)(e,[{key:"add",value:function(e,t){this.refs[e]||(this.refs[e]=[]),this.refs[e].push(t)}},{key:"remove",value:function(e,t){var n=this.getIndex(e,t);-1!==n&&this.refs[e].splice(n,1)}},{key:"isActive",value:function(){return this.active}},{key:"getActive",value:function(){var e=this;return this.refs[this.active.collection].find((function(t){return t.node.sortableInfo.index==e.active.index}))}},{key:"getIndex",value:function(e,t){return this.refs[e].indexOf(t)}},{key:"getOrderedRefs",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.active.collection;return this.refs[e].sort(_)}}]),e}();function _(e,t){return e.node.sortableInfo.index-t.node.sortableInfo.index}function E(e,t,n){return(e=e.slice()).splice(n<0?e.length+n:n,0,e.splice(t,1)[0]),e}function x(e,t){return Object.keys(e).reduce((function(n,r){return-1===t.indexOf(r)&&(n[r]=e[r]),n}),{})}var M={end:["touchend","touchcancel","mouseup"],move:["touchmove","mousemove"],start:["touchstart","mousedown"]},w=function(){if("undefined"==typeof window||"undefined"==typeof document)return"";var e=window.getComputedStyle(document.documentElement,"")||["-moz-hidden-iframe"],t=(Array.prototype.slice.call(e).join("").match(/-(moz|webkit|ms)-/)||""===e.OLink&&["","o"])[1];switch(t){case"ms":return"ms";default:return t&&t.length?t[0].toUpperCase()+t.substr(1):""}}();function O(e,t){Object.keys(t).forEach((function(n){e.style[n]=t[n]}))}function S(e,t){e.style["".concat(w,"Transform")]=null==t?"":"translate3d(".concat(t.x,"px,").concat(t.y,"px,0)")}function T(e,t){e.style["".concat(w,"TransitionDuration")]=null==t?"":"".concat(t,"ms")}function C(e,t){for(;e;){if(t(e))return e;e=e.parentNode}return null}function L(e,t,n){return Math.max(e,Math.min(n,t))}function P(e){return"px"===e.substr(-2)?parseFloat(e):0}function R(e){var t=window.getComputedStyle(e);return{bottom:P(t.marginBottom),left:P(t.marginLeft),right:P(t.marginRight),top:P(t.marginTop)}}function D(e,t){var n=t.displayName||t.name;return n?"".concat(e,"(").concat(n,")"):e}function k(e,t){var n=e.getBoundingClientRect();return{top:n.top+t.top,left:n.left+t.left}}function I(e){return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:e.changedTouches&&e.changedTouches.length?{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}:{x:e.pageX,y:e.pageY}}function F(e){return e.touches&&e.touches.length||e.changedTouches&&e.changedTouches.length}function j(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{left:0,top:0};if(e){var r={left:n.left+e.offsetLeft,top:n.top+e.offsetTop};return e.parentNode===t?r:j(e.parentNode,t,r)}}function B(e,t,n){return e<n&&e>t?e-1:e>n&&e<t?e+1:e}function N(e){var t=e.lockOffset,n=e.width,r=e.height,a=t,o=t,i="px";if("string"==typeof t){var s=/^[+-]?\d*(?:\.\d*)?(px|%)$/.exec(t);v()(null!==s,'lockOffset value should be a number or a string of a number followed by "px" or "%". Given %s',t),a=parseFloat(t),o=parseFloat(t),i=s[1]}return v()(isFinite(a)&&isFinite(o),"lockOffset value should be a finite. Given %s",t),"%"===i&&(a=a*n/100,o=o*r/100),{x:a,y:o}}function z(e){var t=e.height,n=e.width,r=e.lockOffset,o=Array.isArray(r)?r:[r,r];v()(2===o.length,"lockOffset prop of SortableContainer should be a single value or an array of exactly two values. Given %s",r);var i=Object(a.a)(o,2),s=i[0],l=i[1];return[N({height:t,lockOffset:s,width:n}),N({height:t,lockOffset:l,width:n})]}function U(e){return e instanceof HTMLElement?function(e){var t=window.getComputedStyle(e),n=/(auto|scroll)/;return["overflow","overflowX","overflowY"].find((function(e){return n.test(t[e])}))}(e)?e:U(e.parentNode):null}function H(e){var t=window.getComputedStyle(e);return"grid"===t.display?{x:P(t.gridColumnGap),y:P(t.gridRowGap)}:{x:0,y:0}}var V=27,G=32,Y=37,W=38,q=39,X=40,K="A",Z="BUTTON",J="CANVAS",Q="INPUT",$="OPTION",ee="TEXTAREA",te="SELECT";function ne(e){var t="input, textarea, select, canvas, [contenteditable]",n=e.querySelectorAll(t),r=e.cloneNode(!0);return Object(A.a)(r.querySelectorAll(t)).forEach((function(e,t){("file"!==e.type&&(e.value=n[t].value),"radio"===e.type&&e.name&&(e.name="__sortableClone__".concat(e.name)),e.tagName===J&&n[t].width>0&&n[t].height>0)&&e.getContext("2d").drawImage(n[t],0,0)})),r}function re(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return Object(s.a)(this,n),Object(u.a)(this,Object(c.a)(n).apply(this,arguments))}return Object(d.a)(n,t),Object(l.a)(n,[{key:"componentDidMount",value:function(){Object(g.findDOMNode)(this).sortableHandle=!0}},{key:"getWrappedInstance",value:function(){return v()(a.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableHandle() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=a.withRef?"wrappedInstance":null;return Object(p.createElement)(e,Object(r.a)({ref:t},this.props))}}]),n}(p.Component),Object(o.a)(t,"displayName",D("sortableHandle",e)),n}function ae(e){return null!=e.sortableHandle}var oe=function(){function e(t,n){Object(s.a)(this,e),this.container=t,this.onScrollCallback=n}return Object(l.a)(e,[{key:"clear",value:function(){null!=this.interval&&(clearInterval(this.interval),this.interval=null)}},{key:"update",value:function(e){var t=this,n=e.translate,r=e.minTranslate,a=e.maxTranslate,o=e.width,i=e.height,s={x:0,y:0},l={x:1,y:1},u=10,c=10,d=this.container,f=d.scrollTop,p=d.scrollLeft,h=d.scrollHeight,m=d.scrollWidth,g=0===f,y=h-f-d.clientHeight==0,v=0===p,A=m-p-d.clientWidth==0;n.y>=a.y-i/2&&!y?(s.y=1,l.y=c*Math.abs((a.y-i/2-n.y)/i)):n.x>=a.x-o/2&&!A?(s.x=1,l.x=u*Math.abs((a.x-o/2-n.x)/o)):n.y<=r.y+i/2&&!g?(s.y=-1,l.y=c*Math.abs((n.y-i/2-r.y)/i)):n.x<=r.x+o/2&&!v&&(s.x=-1,l.x=u*Math.abs((n.x-o/2-r.x)/o)),this.interval&&(this.clear(),this.isAutoScrolling=!1),0===s.x&&0===s.y||(this.interval=setInterval((function(){t.isAutoScrolling=!0;var e={left:l.x*s.x,top:l.y*s.y};t.container.scrollTop+=e.top,t.container.scrollLeft+=e.left,t.onScrollCallback(e)}),5))}}]),e}();var ie={axis:m.a.oneOf(["x","y","xy"]),contentWindow:m.a.any,disableAutoscroll:m.a.bool,distance:m.a.number,getContainer:m.a.func,getHelperDimensions:m.a.func,helperClass:m.a.string,helperContainer:m.a.oneOfType([m.a.func,"undefined"==typeof HTMLElement?m.a.any:m.a.instanceOf(HTMLElement)]),hideSortableGhost:m.a.bool,keyboardSortingTransitionDuration:m.a.number,lockAxis:m.a.string,lockOffset:m.a.oneOfType([m.a.number,m.a.string,m.a.arrayOf(m.a.oneOfType([m.a.number,m.a.string]))]),lockToContainerEdges:m.a.bool,onSortEnd:m.a.func,onSortMove:m.a.func,onSortOver:m.a.func,onSortStart:m.a.func,pressDelay:m.a.number,pressThreshold:m.a.number,keyCodes:m.a.shape({lift:m.a.arrayOf(m.a.number),drop:m.a.arrayOf(m.a.number),cancel:m.a.arrayOf(m.a.number),up:m.a.arrayOf(m.a.number),down:m.a.arrayOf(m.a.number)}),shouldCancelStart:m.a.func,transitionDuration:m.a.number,updateBeforeSortStart:m.a.func,useDragHandle:m.a.bool,useWindowAsScrollContainer:m.a.bool},se={lift:[G],drop:[G],cancel:[V],up:[W,Y],down:[X,q]},le={axis:"y",disableAutoscroll:!1,distance:0,getHelperDimensions:function(e){var t=e.node;return{height:t.offsetHeight,width:t.offsetWidth}},hideSortableGhost:!0,lockOffset:"50%",lockToContainerEdges:!1,pressDelay:0,pressThreshold:5,keyCodes:se,shouldCancelStart:function(e){return-1!==[Q,ee,te,$,Z].indexOf(e.target.tagName)||!!C(e.target,(function(e){return"true"===e.contentEditable}))},transitionDuration:300,useWindowAsScrollContainer:!1},ue=Object.keys(ie);function ce(e){v()(!(e.distance&&e.pressDelay),"Attempted to set both `pressDelay` and `distance` on SortableContainer, you may only use one or the other, not both at the same time.")}function de(e,t){try{var n=e()}catch(e){return t(!0,e)}return n&&n.then?n.then(t.bind(null,!1),t.bind(null,!0)):t(!1,value)}function fe(e){var t,n,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(e){var t;return Object(s.a)(this,n),t=Object(u.a)(this,Object(c.a)(n).call(this,e)),Object(o.a)(Object(f.a)(Object(f.a)(t)),"state",{}),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleStart",(function(e){var n=t.props,r=n.distance,a=n.shouldCancelStart;if(2!==e.button&&!a(e)){t.touched=!0,t.position=I(e);var o=C(e.target,(function(e){return null!=e.sortableInfo}));if(o&&o.sortableInfo&&t.nodeIsChild(o)&&!t.state.sorting){var i=t.props.useDragHandle,s=o.sortableInfo,l=s.index,u=s.collection;if(s.disabled)return;if(i&&!C(e.target,ae))return;t.manager.active={collection:u,index:l},F(e)||e.target.tagName!==K||e.preventDefault(),r||(0===t.props.pressDelay?t.handlePress(e):t.pressTimer=setTimeout((function(){return t.handlePress(e)}),t.props.pressDelay))}}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"nodeIsChild",(function(e){return e.sortableInfo.manager===t.manager})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleMove",(function(e){var n=t.props,r=n.distance,a=n.pressThreshold;if(!t.state.sorting&&t.touched&&!t._awaitingUpdateBeforeSortStart){var o=I(e),i={x:t.position.x-o.x,y:t.position.y-o.y},s=Math.abs(i.x)+Math.abs(i.y);t.delta=i,r||a&&!(s>=a)?r&&s>=r&&t.manager.isActive()&&t.handlePress(e):(clearTimeout(t.cancelTimer),t.cancelTimer=setTimeout(t.cancel,0))}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleEnd",(function(){t.touched=!1,t.cancel()})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"cancel",(function(){var e=t.props.distance;t.state.sorting||(e||clearTimeout(t.pressTimer),t.manager.active=null)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handlePress",(function(e){try{var n=t.manager.getActive(),r=function(){if(n){var r=function(){var n=p.sortableInfo.index,r=R(p),a=H(t.container),c=t.scrollContainer.getBoundingClientRect(),g=s({index:n,node:p,collection:h});if(t.node=p,t.margin=r,t.gridGap=a,t.width=g.width,t.height=g.height,t.marginOffset={x:t.margin.left+t.margin.right+t.gridGap.x,y:Math.max(t.margin.top,t.margin.bottom,t.gridGap.y)},t.boundingClientRect=p.getBoundingClientRect(),t.containerBoundingRect=c,t.index=n,t.newIndex=n,t.axis={x:o.indexOf("x")>=0,y:o.indexOf("y")>=0},t.offsetEdge=j(p,t.container),t.initialOffset=I(m?i({},e,{pageX:t.boundingClientRect.left,pageY:t.boundingClientRect.top}):e),t.initialScroll={left:t.scrollContainer.scrollLeft,top:t.scrollContainer.scrollTop},t.initialWindowScroll={left:window.pageXOffset,top:window.pageYOffset},t.helper=t.helperContainer.appendChild(ne(p)),O(t.helper,{boxSizing:"border-box",height:"".concat(t.height,"px"),left:"".concat(t.boundingClientRect.left-r.left,"px"),pointerEvents:"none",position:"fixed",top:"".concat(t.boundingClientRect.top-r.top,"px"),width:"".concat(t.width,"px")}),m&&t.helper.focus(),u&&(t.sortableGhost=p,O(p,{opacity:0,visibility:"hidden"})),t.minTranslate={},t.maxTranslate={},m){var y=f?{top:0,left:0,width:t.contentWindow.innerWidth,height:t.contentWindow.innerHeight}:t.containerBoundingRect,v=y.top,A=y.left,b=y.width,_=v+y.height,E=A+b;t.axis.x&&(t.minTranslate.x=A-t.boundingClientRect.left,t.maxTranslate.x=E-(t.boundingClientRect.left+t.width)),t.axis.y&&(t.minTranslate.y=v-t.boundingClientRect.top,t.maxTranslate.y=_-(t.boundingClientRect.top+t.height))}else t.axis.x&&(t.minTranslate.x=(f?0:c.left)-t.boundingClientRect.left-t.width/2,t.maxTranslate.x=(f?t.contentWindow.innerWidth:c.left+c.width)-t.boundingClientRect.left-t.width/2),t.axis.y&&(t.minTranslate.y=(f?0:c.top)-t.boundingClientRect.top-t.height/2,t.maxTranslate.y=(f?t.contentWindow.innerHeight:c.top+c.height)-t.boundingClientRect.top-t.height/2);l&&l.split(" ").forEach((function(e){return t.helper.classList.add(e)})),t.listenerNode=e.touches?p:t.contentWindow,m?(t.listenerNode.addEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.addEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.addEventListener("keydown",t.handleKeyDown)):(M.move.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortMove,!1)})),M.end.forEach((function(e){return t.listenerNode.addEventListener(e,t.handleSortEnd,!1)}))),t.setState({sorting:!0,sortingIndex:n}),d&&d({node:p,index:n,collection:h,isKeySorting:m,nodes:t.manager.getOrderedRefs(),helper:t.helper},e),m&&t.keyMove(0)},a=t.props,o=a.axis,s=a.getHelperDimensions,l=a.helperClass,u=a.hideSortableGhost,c=a.updateBeforeSortStart,d=a.onSortStart,f=a.useWindowAsScrollContainer,p=n.node,h=n.collection,m=t.manager.isKeySorting,g=function(){if("function"==typeof c){t._awaitingUpdateBeforeSortStart=!0;var n=de((function(){var t=p.sortableInfo.index;return Promise.resolve(c({collection:h,index:t,node:p,isKeySorting:m},e)).then((function(){}))}),(function(e,n){if(t._awaitingUpdateBeforeSortStart=!1,e)throw n;return n}));if(n&&n.then)return n.then((function(){}))}}();return g&&g.then?g.then(r):r()}}();return Promise.resolve(r&&r.then?r.then((function(){})):void 0)}catch(e){return Promise.reject(e)}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleSortMove",(function(e){var n=t.props.onSortMove;"function"==typeof e.preventDefault&&e.preventDefault(),t.updateHelperPosition(e),t.animateNodes(),t.autoscroll(),n&&n(e)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleSortEnd",(function(e){var n=t.props,r=n.hideSortableGhost,a=n.onSortEnd,o=t.manager,i=o.active.collection,s=o.isKeySorting,l=t.manager.getOrderedRefs();t.listenerNode&&(s?(t.listenerNode.removeEventListener("wheel",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("mousedown",t.handleKeyEnd,!0),t.listenerNode.removeEventListener("keydown",t.handleKeyDown)):(M.move.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortMove)})),M.end.forEach((function(e){return t.listenerNode.removeEventListener(e,t.handleSortEnd)})))),t.helper.parentNode.removeChild(t.helper),r&&t.sortableGhost&&O(t.sortableGhost,{opacity:"",visibility:""});for(var u=0,c=l.length;u<c;u++){var d=l[u],f=d.node;d.edgeOffset=null,d.boundingClientRect=null,S(f,null),T(f,null),d.translate=null}t.autoScroller.clear(),t.manager.active=null,t.manager.isKeySorting=!1,t.setState({sorting:!1,sortingIndex:null}),"function"==typeof a&&a({collection:i,newIndex:t.newIndex,oldIndex:t.index,isKeySorting:s,nodes:l},e),t.touched=!1})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"autoscroll",(function(){var e=t.props.disableAutoscroll,n=t.manager.isKeySorting;if(e)t.autoScroller.clear();else{if(n){var r=i({},t.translate),a=0,o=0;return t.axis.x&&(r.x=Math.min(t.maxTranslate.x,Math.max(t.minTranslate.x,t.translate.x)),a=t.translate.x-r.x),t.axis.y&&(r.y=Math.min(t.maxTranslate.y,Math.max(t.minTranslate.y,t.translate.y)),o=t.translate.y-r.y),t.translate=r,S(t.helper,t.translate),t.scrollContainer.scrollLeft+=a,void(t.scrollContainer.scrollTop+=o)}t.autoScroller.update({height:t.height,maxTranslate:t.maxTranslate,minTranslate:t.minTranslate,translate:t.translate,width:t.width})}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"onAutoScroll",(function(e){t.translate.x+=e.left,t.translate.y+=e.top,t.animateNodes()})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleKeyDown",(function(e){var n=e.keyCode,r=t.props,a=r.shouldCancelStart,o=r.keyCodes,s=i({},se,void 0===o?{}:o);t.manager.active&&!t.manager.isKeySorting||!(t.manager.active||s.lift.includes(n)&&!a(e)&&t.isValidSortingTarget(e))||(e.stopPropagation(),e.preventDefault(),s.lift.includes(n)&&!t.manager.active?t.keyLift(e):s.drop.includes(n)&&t.manager.active?t.keyDrop(e):s.cancel.includes(n)?(t.newIndex=t.manager.active.index,t.keyDrop(e)):s.up.includes(n)?t.keyMove(-1):s.down.includes(n)&&t.keyMove(1))})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"keyLift",(function(e){var n=e.target,r=C(n,(function(e){return null!=e.sortableInfo})).sortableInfo,a=r.index,o=r.collection;t.initialFocusedNode=n,t.manager.isKeySorting=!0,t.manager.active={index:a,collection:o},t.handlePress(e)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"keyMove",(function(e){var n=t.manager.getOrderedRefs(),r=n[n.length-1].node.sortableInfo.index,a=t.newIndex+e,o=t.newIndex;if(!(a<0||a>r)){t.prevIndex=o,t.newIndex=a;var i=B(t.newIndex,t.prevIndex,t.index),s=n.find((function(e){return e.node.sortableInfo.index===i})),l=s.node,u=t.containerScrollDelta,c=s.boundingClientRect||k(l,u),d=s.translate||{x:0,y:0},f=c.top+d.y-u.top,p=c.left+d.x-u.left,h=o<a,m=h&&t.axis.x?l.offsetWidth-t.width:0,g=h&&t.axis.y?l.offsetHeight-t.height:0;t.handleSortMove({pageX:p+m,pageY:f+g,ignoreTransition:0===e})}})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"keyDrop",(function(e){t.handleSortEnd(e),t.initialFocusedNode&&t.initialFocusedNode.focus()})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"handleKeyEnd",(function(e){t.manager.active&&t.keyDrop(e)})),Object(o.a)(Object(f.a)(Object(f.a)(t)),"isValidSortingTarget",(function(e){var n=t.props.useDragHandle,r=e.target,a=C(r,(function(e){return null!=e.sortableInfo}));return a&&a.sortableInfo&&!a.sortableInfo.disabled&&(n?ae(r):r.sortableInfo)})),ce(e),t.manager=new b,t.events={end:t.handleEnd,move:t.handleMove,start:t.handleStart},t}return Object(d.a)(n,t),Object(l.a)(n,[{key:"getChildContext",value:function(){return{manager:this.manager}}},{key:"componentDidMount",value:function(){var e=this,t=this.props.useWindowAsScrollContainer,n=this.getContainer();Promise.resolve(n).then((function(n){e.container=n,e.document=e.container.ownerDocument||document;var r=e.props.contentWindow||e.document.defaultView||window;e.contentWindow="function"==typeof r?r():r,e.scrollContainer=t?e.document.scrollingElement||e.document.documentElement:U(e.container)||e.container,e.autoScroller=new oe(e.scrollContainer,e.onAutoScroll),Object.keys(e.events).forEach((function(t){return M[t].forEach((function(n){return e.container.addEventListener(n,e.events[t],!1)}))})),e.container.addEventListener("keydown",e.handleKeyDown)}))}},{key:"componentWillUnmount",value:function(){var e=this;this.helper&&this.helper.parentNode&&this.helper.parentNode.removeChild(this.helper),this.container&&(Object.keys(this.events).forEach((function(t){return M[t].forEach((function(n){return e.container.removeEventListener(n,e.events[t])}))})),this.container.removeEventListener("keydown",this.handleKeyDown))}},{key:"updateHelperPosition",value:function(e){var t=this.props,n=t.lockAxis,r=t.lockOffset,o=t.lockToContainerEdges,i=t.transitionDuration,s=t.keyboardSortingTransitionDuration,l=void 0===s?i:s,u=this.manager.isKeySorting,c=e.ignoreTransition,d=I(e),f={x:d.x-this.initialOffset.x,y:d.y-this.initialOffset.y};if(f.y-=window.pageYOffset-this.initialWindowScroll.top,f.x-=window.pageXOffset-this.initialWindowScroll.left,this.translate=f,o){var p=z({height:this.height,lockOffset:r,width:this.width}),h=Object(a.a)(p,2),m=h[0],g=h[1],y={x:this.width/2-m.x,y:this.height/2-m.y},v={x:this.width/2-g.x,y:this.height/2-g.y};f.x=L(this.minTranslate.x+y.x,this.maxTranslate.x-v.x,f.x),f.y=L(this.minTranslate.y+y.y,this.maxTranslate.y-v.y,f.y)}"x"===n?f.y=0:"y"===n&&(f.x=0),u&&l&&!c&&T(this.helper,l),S(this.helper,f)}},{key:"animateNodes",value:function(){var e=this.props,t=e.transitionDuration,n=e.hideSortableGhost,r=e.onSortOver,a=this.containerScrollDelta,o=this.windowScrollDelta,i=this.manager.getOrderedRefs(),s=this.offsetEdge.left+this.translate.x+a.left,l=this.offsetEdge.top+this.translate.y+a.top,u=this.manager.isKeySorting,c=this.newIndex;this.newIndex=null;for(var d=0,f=i.length;d<f;d++){var p=i[d].node,h=p.sortableInfo.index,m=p.offsetWidth,g=p.offsetHeight,y={height:this.height>g?g/2:this.height/2,width:this.width>m?m/2:this.width/2},v=u&&h>this.index&&h<=c,A=u&&h<this.index&&h>=c,b={x:0,y:0},_=i[d].edgeOffset;_||(_=j(p,this.container),i[d].edgeOffset=_,u&&(i[d].boundingClientRect=k(p,a)));var E=d<i.length-1&&i[d+1],x=d>0&&i[d-1];E&&!E.edgeOffset&&(E.edgeOffset=j(E.node,this.container),u&&(E.boundingClientRect=k(E.node,a))),h!==this.index?(t&&T(p,t),this.axis.x?this.axis.y?A||h<this.index&&(s+o.left-y.width<=_.left&&l+o.top<=_.top+y.height||l+o.top+y.height<=_.top)?(b.x=this.width+this.marginOffset.x,_.left+b.x>this.containerBoundingRect.width-y.width&&E&&(b.x=E.edgeOffset.left-_.left,b.y=E.edgeOffset.top-_.top),null===this.newIndex&&(this.newIndex=h)):(v||h>this.index&&(s+o.left+y.width>=_.left&&l+o.top+y.height>=_.top||l+o.top+y.height>=_.top+g))&&(b.x=-(this.width+this.marginOffset.x),_.left+b.x<this.containerBoundingRect.left+y.width&&x&&(b.x=x.edgeOffset.left-_.left,b.y=x.edgeOffset.top-_.top),this.newIndex=h):v||h>this.index&&s+o.left+y.width>=_.left?(b.x=-(this.width+this.marginOffset.x),this.newIndex=h):(A||h<this.index&&s+o.left<=_.left+y.width)&&(b.x=this.width+this.marginOffset.x,null==this.newIndex&&(this.newIndex=h)):this.axis.y&&(v||h>this.index&&l+o.top+y.height>=_.top?(b.y=-(this.height+this.marginOffset.y),this.newIndex=h):(A||h<this.index&&l+o.top<=_.top+y.height)&&(b.y=this.height+this.marginOffset.y,null==this.newIndex&&(this.newIndex=h))),S(p,b),i[d].translate=b):n&&(this.sortableGhost=p,O(p,{opacity:0,visibility:"hidden"}))}null==this.newIndex&&(this.newIndex=this.index),u&&(this.newIndex=c);var M=u?this.prevIndex:c;r&&this.newIndex!==M&&r({collection:this.manager.active.collection,index:this.index,newIndex:this.newIndex,oldIndex:M,isKeySorting:u,nodes:i,helper:this.helper})}},{key:"getWrappedInstance",value:function(){return v()(h.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableContainer() call"),this.refs.wrappedInstance}},{key:"getContainer",value:function(){var e=this.props.getContainer;return"function"!=typeof e?Object(g.findDOMNode)(this):e(h.withRef?this.getWrappedInstance():void 0)}},{key:"render",value:function(){var t=h.withRef?"wrappedInstance":null;return Object(p.createElement)(e,Object(r.a)({ref:t},x(this.props,ue)))}},{key:"helperContainer",get:function(){var e=this.props.helperContainer;return"function"==typeof e?e():this.props.helperContainer||this.document.body}},{key:"containerScrollDelta",get:function(){return this.props.useWindowAsScrollContainer?{left:0,top:0}:{left:this.scrollContainer.scrollLeft-this.initialScroll.left,top:this.scrollContainer.scrollTop-this.initialScroll.top}}},{key:"windowScrollDelta",get:function(){return{left:this.contentWindow.pageXOffset-this.initialWindowScroll.left,top:this.contentWindow.pageYOffset-this.initialWindowScroll.top}}}]),n}(p.Component),Object(o.a)(t,"displayName",D("sortableList",e)),Object(o.a)(t,"defaultProps",le),Object(o.a)(t,"propTypes",ie),Object(o.a)(t,"childContextTypes",{manager:m.a.object.isRequired}),n}var pe={index:m.a.number.isRequired,collection:m.a.oneOfType([m.a.number,m.a.string]),disabled:m.a.bool},he=Object.keys(pe);function me(e){var t,n,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withRef:!1};return n=t=function(t){function n(){return Object(s.a)(this,n),Object(u.a)(this,Object(c.a)(n).apply(this,arguments))}return Object(d.a)(n,t),Object(l.a)(n,[{key:"componentDidMount",value:function(){this.register()}},{key:"componentDidUpdate",value:function(e){this.node&&(e.index!==this.props.index&&(this.node.sortableInfo.index=this.props.index),e.disabled!==this.props.disabled&&(this.node.sortableInfo.disabled=this.props.disabled)),e.collection!==this.props.collection&&(this.unregister(e.collection),this.register())}},{key:"componentWillUnmount",value:function(){this.unregister()}},{key:"register",value:function(){var e=this.props,t=e.collection,n=e.disabled,r=e.index,a=Object(g.findDOMNode)(this);a.sortableInfo={collection:t,disabled:n,index:r,manager:this.context.manager},this.node=a,this.ref={node:a},this.context.manager.add(t,this.ref)}},{key:"unregister",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.collection;this.context.manager.remove(e,this.ref)}},{key:"getWrappedInstance",value:function(){return v()(a.withRef,"To access the wrapped instance, you need to pass in {withRef: true} as the second argument of the SortableElement() call"),this.refs.wrappedInstance}},{key:"render",value:function(){var t=a.withRef?"wrappedInstance":null;return Object(p.createElement)(e,Object(r.a)({ref:t},x(this.props,he)))}}]),n}(p.Component),Object(o.a)(t,"displayName",D("sortableElement",e)),Object(o.a)(t,"contextTypes",{manager:m.a.object.isRequired}),Object(o.a)(t,"propTypes",pe),Object(o.a)(t,"defaultProps",{collection:0}),n}},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return s})),n.d(t,"a",(function(){return l}));var r=n(109),a=n(103);const o=()=>{const e=Object(a.b)();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function i(e){const t=o();e=Array.isArray(e)?e:[e];for(const n of e){const e=Object(r.b)(n);t.find(t=>e===t)||t.unshift(e)}}function s(){return o()}function l(){Object(a.b)().loaderRegistry=[]}},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"a",(function(){return m}));var r=n(352),a=n(239),o=n(447),i=n(71),s=n(64);function l(e){return Math.log(e)}function u(e){return Math.exp(e)}function c(e){return-Math.log(-e)}function d(e){return-Math.exp(-e)}function f(e){return isFinite(e)?+("1e"+e):e<0?0:e}function p(e){return function(t){return-e(-t)}}function h(e){var t,n,i=e(l,u),s=i.domain,h=10;function m(){return t=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),function(t){return Math.log(t)/e})}(h),n=function(e){return 10===e?f:e===Math.E?Math.exp:function(t){return Math.pow(e,t)}}(h),s()[0]<0?(t=p(t),n=p(n),e(c,d)):e(l,u),i}return i.base=function(e){return arguments.length?(h=+e,m()):h},i.domain=function(e){return arguments.length?(s(e),m()):s()},i.ticks=function(e){var a,o=s(),i=o[0],l=o[o.length-1];(a=l<i)&&(f=i,i=l,l=f);var u,c,d,f=t(i),p=t(l),m=null==e?10:+e,g=[];if(!(h%1)&&p-f<m){if(f=Math.floor(f),p=Math.ceil(p),i>0){for(;f<=p;++f)for(c=1,u=n(f);c<h;++c)if(!((d=u*c)<i)){if(d>l)break;g.push(d)}}else for(;f<=p;++f)for(c=h-1,u=n(f);c>=1;--c)if(!((d=u*c)<i)){if(d>l)break;g.push(d)}2*g.length<m&&(g=Object(r.a)(i,l,m))}else g=Object(r.a)(f,p,Math.min(p-f,m)).map(n);return a?g.reverse():g},i.tickFormat=function(e,r){if(null==r&&(r=10===h?".0e":","),"function"!=typeof r&&(r=Object(a.b)(r)),e===1/0)return r;null==e&&(e=10);var o=Math.max(1,h*e/i.ticks().length);return function(e){var a=e/n(Math.round(t(e)));return a*h<h-.5&&(a*=h),a<=o?r(e):""}},i.nice=function(){return s(Object(o.a)(s(),{floor:function(e){return n(Math.floor(t(e)))},ceil:function(e){return n(Math.ceil(t(e)))}}))},i}function m(){var e=h(Object(i.d)()).domain([1,10]);return e.copy=function(){return Object(i.a)(e,m()).base(e.base())},s.b.apply(e,arguments),e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n(47),a=n(142),o=n(296),i=n(53),s=n(92);const l={pitch:0,bearing:0,altitude:1.5,minZoom:0,maxZoom:20,minPitch:0,maxPitch:60,position:[0,0,0]};class u extends o.a{constructor(e){e={...l,...e};const{makeViewport:t,width:n,height:r,latitude:a,longitude:o,zoom:i,bearing:u,pitch:c,altitude:d,position:f,maxZoom:p,minZoom:h,maxPitch:m,minPitch:g,startPanLngLat:y,startZoomLngLat:v,startRotatePos:A,startBearing:b,startPitch:_,startZoom:E,normalize:x}=e||{};Object(s.a)(Number.isFinite(o)),Object(s.a)(Number.isFinite(a)),Object(s.a)(Number.isFinite(i)),super({width:n,height:r,latitude:a,longitude:o,zoom:i,bearing:u,pitch:c,altitude:d,maxZoom:p,minZoom:h,maxPitch:m,minPitch:g,normalize:x,position:f}),this._state={startPanLngLat:y,startZoomLngLat:v,startRotatePos:A,startBearing:b,startPitch:_,startZoom:E},this.makeViewport=t}panStart({pos:e}){return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan({pos:e,startPos:t}){const n=this._state.startPanLngLat||this._unproject(t);if(!n)return this;const r=this.makeViewport(this._viewportProps).panByPosition(n,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){const{startRotatePos:r,startBearing:a,startPitch:o}=this._state;if(!r||!Number.isFinite(a)||!Number.isFinite(o))return this;let i;return i=e?this._calculateNewPitchAndBearing({...this._getRotationParams(e,r),startBearing:a,startPitch:o}):{bearing:a+t,pitch:o+n},this._getUpdatedState(i)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart({pos:e}){return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:n}){let{startZoom:r,startZoomLngLat:a}=this._state;Number.isFinite(r)||(r=this._viewportProps.zoom,a=this._unproject(t)||this._unproject(e));const o=this._calculateNewZoom({scale:n,startZoom:r}),i=this.makeViewport({...this._viewportProps,zoom:o});return this._getUpdatedState({zoom:o,...i.panByPosition(a,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(e=2){return this._zoomFromCenter(e)}zoomOut(e=2){return this._zoomFromCenter(1/e)}moveLeft(e=100){return this._panFromCenter([e,0])}moveRight(e=100){return this._panFromCenter([-e,0])}moveUp(e=100){return this._panFromCenter([0,e])}moveDown(e=100){return this._panFromCenter([0,-e])}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}shortestPathFrom(e){const t=e.getViewportProps(),n={...this._viewportProps},{bearing:r,longitude:a}=n;return Math.abs(r-t.bearing)>180&&(n.bearing=r<0?r+360:r-360),Math.abs(a-t.longitude)>180&&(n.longitude=a<0?a+360:a-360),n}_zoomFromCenter(e){const{width:t,height:n}=this._viewportProps;return this.zoom({pos:[t/2,n/2],scale:e})}_panFromCenter(e){const{width:t,height:n}=this._viewportProps;return this.pan({startPos:[t/2,n/2],pos:[t/2+e[0],n/2+e[1]]})}_getUpdatedState(e){return new this.constructor({makeViewport:this.makeViewport,...this._viewportProps,...this._state,...e})}_applyConstraints(e){const{maxZoom:t,minZoom:n,zoom:a}=e;e.zoom=Object(r.a)(a,n,t);const{maxPitch:o,minPitch:s,pitch:l}=e;e.pitch=Object(r.a)(l,s,o);const{normalize:u=!0}=e;return u&&Object.assign(e,Object(i.m)(e)),e}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:n,minZoom:a}=this._viewportProps,o=t+Math.log2(e);return Object(r.a)(o,a,n)}_calculateNewPitchAndBearing({deltaScaleX:e,deltaScaleY:t,startBearing:n,startPitch:a}){t=Object(r.a)(t,-1,1);const{minPitch:o,maxPitch:i}=this._viewportProps;let s=a;return t>0?s=a+t*(i-a):t<0&&(s=a-t*(o-a)),{pitch:s,bearing:n+180*e}}_getRotationParams(e,t){const n=e[0]-t[0],r=e[1]-t[1],a=e[1],o=t[1],{width:i,height:s}=this._viewportProps,l=n/i;let u=0;return r>0?Math.abs(s-o)>5&&(u=r/(o-s)*1.2):r<0&&o>5&&(u=1-a/o),u=Math.min(1,Math.max(-1,u)),{deltaScaleX:l,deltaScaleY:u}}}class c extends a.a{constructor(e){e.dragMode=e.dragMode||"pan",super(u,e)}setProps(e){e.position=e.position||[0,0,0];const t=this.controllerStateProps;super.setProps(e);(!t||t.height!==e.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...this.controllerStateProps,...this._state}))}get linearTransitionProps(){return["longitude","latitude","zoom","bearing","pitch","position"]}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(47),a=n(92);class o{constructor(e={}){Array.isArray(e)&&(e={compare:e,extract:e,required:e});const{compare:t,extract:n,required:r}=e;this._propsToCompare=t,this._propsToExtract=n,this._requiredProps=r}arePropsEqual(e,t){for(const n of this._propsToCompare||Object.keys(t))if(!(n in e)||!(n in t)||!Object(r.d)(e[n],t[n]))return!1;return!0}initializeProps(e,t){let n;if(this._propsToExtract){const r={},a={};for(const n of this._propsToExtract)r[n]=e[n],a[n]=t[n];n={start:r,end:a}}else n={start:e,end:t};return this._checkRequiredProps(n.start),this._checkRequiredProps(n.end),n}interpolateProps(e,t,n){return t}getDuration(e,t){return t.transitionDuration}_checkRequiredProps(e){this._requiredProps&&this._requiredProps.forEach(t=>{const n=e[t];Object(a.a)(Number.isFinite(n)||Array.isArray(n),"".concat(t," is required for transition"))})}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return g}));var r=n(47),a=n(142),o=n(296),i=n(89);const s=0,l=0,u=0,c=[0,0,0],d=-90,f=90,p=-1/0,h=1/0;class m extends o.a{constructor({makeViewport:e,width:t,height:n,rotationX:r=s,rotationOrbit:a=l,target:o=c,zoom:i=u,minRotationX:m=d,maxRotationX:g=f,minZoom:y=p,maxZoom:v=h,startPanPosition:A,startRotatePos:b,startRotationX:_,startRotationOrbit:E,startZoomPosition:x,startZoom:M}){super({width:t,height:n,rotationX:r,rotationOrbit:a,target:o,zoom:i,minRotationX:m,maxRotationX:g,minZoom:y,maxZoom:v}),this._state={startPanPosition:A,startRotatePos:b,startRotationX:_,startRotationOrbit:E,startZoomPosition:x,startZoom:M},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){const n=this._state.startPanPosition||t;if(!n)return this;const r=this.makeViewport(this._viewportProps).panByPosition(n,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){const{startRotatePos:r,startRotationX:a,startRotationOrbit:o}=this._state,{width:i,height:s}=this._viewportProps;if(!r||!Number.isFinite(a)||!Number.isFinite(o))return this;let l;if(e){let t=(e[0]-r[0])/i;const n=(e[1]-r[1])/s;(a<-90||a>90)&&(t*=-1),l={rotationX:a+180*n,rotationOrbit:o+180*t}}else l={rotationX:a+n,rotationOrbit:o+t};return this._getUpdatedState(l)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(e){const t=e.getViewportProps(),n={...this._viewportProps},{rotationOrbit:r}=n;return Math.abs(r-t.rotationOrbit)>180&&(n.rotationOrbit=r<0?r+360:r-360),n}zoomStart({pos:e}){return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this._viewportProps.zoom})}zoom({pos:e,startPos:t,scale:n}){const{zoom:r}=this._viewportProps;let{startZoom:a,startZoomPosition:o}=this._state;Number.isFinite(a)||(a=r,o=this._unproject(t)||this._unproject(e));const i=this._calculateNewZoom({scale:n,startZoom:a}),s=this.makeViewport({...this._viewportProps,zoom:i});return this._getUpdatedState({zoom:i,...s.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:e})})}zoomOut(e=2){return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/e})})}moveLeft(e=50){return this._panFromCenter([-e,0])}moveRight(e=50){return this._panFromCenter([e,0])}moveUp(e=50){return this._panFromCenter([0,-e])}moveDown(e=50){return this._panFromCenter([0,e])}rotateLeft(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit-e})}rotateRight(e=15){return this._getUpdatedState({rotationOrbit:this._viewportProps.rotationOrbit+e})}rotateUp(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX-e})}rotateDown(e=10){return this._getUpdatedState({rotationX:this._viewportProps.rotationX+e})}_unproject(e){const t=this.makeViewport(this._viewportProps);return e&&t.unproject(e)}_calculateNewZoom({scale:e,startZoom:t}){const{maxZoom:n,minZoom:a}=this._viewportProps;Number.isFinite(t)||(t=this._viewportProps.zoom);const o=t+Math.log2(e);return Object(r.a)(o,a,n)}_panFromCenter(e){const{width:t,height:n,target:r}=this._viewportProps;return this.pan({startPosition:r,pos:[t/2+e[0],n/2+e[1]]})}_getUpdatedState(e){return new this.constructor({...this._viewportProps,...this._state,...e})}_applyConstraints(e){const{maxZoom:t,minZoom:n,zoom:a,maxRotationX:o,minRotationX:s,rotationOrbit:l}=e;return e.zoom=Object(r.a)(a,n,t),e.rotationX=Object(r.a)(e.rotationX,s,o),(l<-180||l>180)&&(e.rotationOrbit=Object(i.e)(l+180,360)-180),e}}class g extends a.a{constructor(e){super(m,e)}get linearTransitionProps(){return["target","zoom","rotationX","rotationOrbit"]}}},function(e,t,n){"use strict";var r=n(468),a=n(52),o=n(207),i=n(188);t.a=function(){var e=i.a,t=i.b,n=Object(a.a)(!0),s=null,l=o.a,u=null;function c(a){var o,i,c,d=a.length,f=!1;for(null==s&&(u=l(c=Object(r.a)())),o=0;o<=d;++o)!(o<d&&n(i=a[o],o,a))===f&&((f=!f)?u.lineStart():u.lineEnd()),f&&u.point(+e(i,o,a),+t(i,o,a));if(c)return u=null,c+""||null}return c.x=function(t){return arguments.length?(e="function"==typeof t?t:Object(a.a)(+t),c):e},c.y=function(e){return arguments.length?(t="function"==typeof e?e:Object(a.a)(+e),c):t},c.defined=function(e){return arguments.length?(n="function"==typeof e?e:Object(a.a)(!!e),c):n},c.curve=function(e){return arguments.length?(l=e,null!=s&&(u=l(s)),c):l},c.context=function(e){return arguments.length?(null==e?s=u=null:u=l(s=e),c):s},c}},function(e,t,n){"use strict";function r(){}t.a=function(e){return null==e?r:function(){return this.querySelector(e)}}},function(e,t,n){"use strict";var r=n(211);t.a=function(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),r.a.hasOwnProperty(t)?{space:r.a[t],local:e}:e}},function(e,t,n){"use strict";t.a=function(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}},function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var r=n(435),a=n(826),o=n(1179),i=n(825),s=n(34),l=n(1203),u=n(465),c=n(461),d=n(144),f=n(346),p=n(827),h=n(124);class m extends p.a{constructor(e){const{fp64:t,IndexType:n=Uint32Array}=e;super({...e,attributes:{positions:{size:3,type:t?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:n,size:1}}})}get(e){const{attributes:t}=this;return"indices"===e?t.indices&&t.indices.subarray(0,this.vertexCount):t[e]}updateGeometry(e){super.updateGeometry(e);const t=this.buffers.indices;t&&(this.vertexCount=(t.value||t).length)}normalizeGeometry(e){if(this.normalize){if(e=f.b(e,this.positionSize),this.opts.resolution)return Object(h.b)(e.positions||e,e.holeIndices,{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0});if(this.opts.wrapLongitude)return Object(h.c)(e.positions||e,e.holeIndices,{size:this.positionSize,maxLatitude:86,edgeTypes:!0})}return e}getGeometrySize(e){if(Array.isArray(e)&&!Number.isFinite(e[0])){let t=0;for(const n of e)t+=this.getGeometrySize(n);return t}return(e.positions||e).length/this.positionSize}getGeometryFromBuffer(e){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(e):()=>null}updateGeometryAttributes(e,t){if(Array.isArray(e)&&!Number.isFinite(e[0]))for(const n of e){const e=this.getGeometrySize(n);t.geometrySize=e,this.updateGeometryAttributes(n,t),t.vertexStart+=e,t.indexStart=this.indexStarts[t.geometryIndex+1]}else this._updateIndices(e,t),this._updatePositions(e,t),this._updateVertexValid(e,t)}_updateIndices(e,{geometryIndex:t,vertexStart:n,indexStart:r}){const{attributes:a,indexStarts:o,typedArrayManager:i}=this;let s=a.indices;if(!s)return;let l=r;const u=f.a(e,this.positionSize,this.opts.preproject);s=i.allocate(s,r+u.length,{copy:!0});for(let e=0;e<u.length;e++)s[l++]=u[e]+n;o[t+1]=r+u.length,a.indices=s}_updatePositions(e,{vertexStart:t,geometrySize:n}){const{attributes:{positions:r},positionSize:a}=this;if(!r)return;const o=e.positions||e;for(let e=t,i=0;i<n;e++,i++){const t=o[i*a],n=o[i*a+1],s=a>2?o[i*a+2]:0;r[3*e]=t,r[3*e+1]=n,r[3*e+2]=s}}_updateVertexValid(e,{vertexStart:t,geometrySize:n}){const{attributes:{vertexValid:r},positionSize:a}=this,o=e&&e.holeIndices;if(e&&e.edgeTypes?r.set(e.edgeTypes,t):r.fill(1,t,t+n),o)for(let e=0;e<o.length;e++)r[t+o[e]/a-1]=0;r[t+n-1]=0}}var g="\nattribute vec2 vertexPositions;\nattribute float vertexValid;\n\nuniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nstruct PolygonProps {\n vec4 fillColors;\n vec4 lineColors;\n vec3 positions;\n vec3 nextPositions;\n vec3 pickingColors;\n vec3 positions64Low;\n vec3 nextPositions64Low;\n float elevations;\n};\n\nvec3 project_offset_normal(vec3 vector) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n return normalize(vector * project_uCommonUnitsPerWorldUnit);\n }\n return project_normal(vector);\n}\n\nvoid calculatePosition(PolygonProps props) {\n#ifdef IS_SIDE_VERTEX\n if(vertexValid < 0.5){\n gl_Position = vec4(0.);\n return;\n }\n#endif\n\n vec3 pos;\n vec3 pos64Low;\n vec3 normal;\n vec4 colors = isWireframe ? props.lineColors : props.fillColors;\n\n geometry.worldPosition = props.positions;\n geometry.worldPositionAlt = props.nextPositions;\n geometry.pickingColor = props.pickingColors;\n\n#ifdef IS_SIDE_VERTEX\n pos = mix(props.positions, props.nextPositions, vertexPositions.x);\n pos64Low = mix(props.positions64Low, props.nextPositions64Low, vertexPositions.x);\n#else\n pos = props.positions;\n pos64Low = props.positions64Low;\n#endif\n\n if (extruded) {\n pos.z += props.elevations * vertexPositions.y * elevationScale;\n }\n gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n if (extruded) {\n #ifdef IS_SIDE_VERTEX\n normal = vec3(\n props.positions.y - props.nextPositions.y + (props.positions64Low.y - props.nextPositions64Low.y),\n props.nextPositions.x - props.positions.x + (props.nextPositions64Low.x - props.positions64Low.x),\n 0.0);\n normal = project_offset_normal(normal);\n #else\n normal = project_normal(vec3(0.0, 0.0, 1.0));\n #endif\n geometry.normal = normal;\n vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal);\n vColor = vec4(lightColor, colors.a * opacity);\n } else {\n vColor = vec4(colors.rgb, colors.a * opacity);\n }\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",y="#define SHADER_NAME solid-polygon-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float elevations;\nattribute vec4 fillColors;\nattribute vec4 lineColors;\nattribute vec3 pickingColors;\n\n".concat(g,"\n\nvoid main(void) {\n PolygonProps props;\n\n props.positions = positions;\n props.positions64Low = positions64Low;\n props.elevations = elevations;\n props.fillColors = fillColors;\n props.lineColors = lineColors;\n props.pickingColors = pickingColors;\n\n calculatePosition(props);\n}\n"),v="#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\n\n\nattribute vec3 instancePositions;\nattribute vec3 nextPositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 nextPositions64Low;\nattribute float instanceElevations;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\n".concat(g,"\n\nvoid main(void) {\n PolygonProps props;\n\n #if RING_WINDING_ORDER_CW == 1\n props.positions = instancePositions;\n props.positions64Low = instancePositions64Low;\n props.nextPositions = nextPositions;\n props.nextPositions64Low = nextPositions64Low;\n #else\n props.positions = nextPositions;\n props.positions64Low = nextPositions64Low;\n props.nextPositions = instancePositions;\n props.nextPositions64Low = instancePositions64Low;\n #endif\n props.elevations = instanceElevations;\n props.fillColors = instanceFillColors;\n props.lineColors = instanceLineColors;\n props.pickingColors = instancePickingColors;\n\n calculatePosition(props);\n}\n");const A=[0,0,0,255],b={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:e=>e.polygon},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:A},getLineColor:{type:"accessor",value:A},material:!0},_={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class E extends r.a{getShaders(e){return super.getShaders({vs:"top"===e?y:v,fs:"#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",defines:{RING_WINDING_ORDER_CW:this.props._normalize||"CCW"!==this.props._windingOrder?1:0},modules:[a.a,o.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const{gl:e,viewport:t}=this.context;let{coordinateSystem:n}=this.props;t.isGeospatial&&n===s.a.DEFAULT&&(n=s.a.LNGLAT),this.setState({numInstances:0,polygonTesselator:new m({preproject:n===s.a.LNGLAT&&t.projectFlat,fp64:this.use64bitPositions(),IndexType:!e||Object(l.c)(e,u.a.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});const r=this.getAttributeManager();r.remove(["instancePickingColors"]),r.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:_,accessor:"getPolygon",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:!0},elevations:{size:1,transition:_,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:_,accessor:"getFillColor",defaultValue:A,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:_,accessor:"getLineColor",defaultValue:A,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n),shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}getPickingInfo(e){const t=super.getPickingInfo(e),{index:n}=t,{data:r}=this.props;return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(e){const{data:t}=this.props;if(t[0]&&t[0].__source)for(let n=0;n<t.length;n++)t[n].__source.index===e&&this._disablePickingIndex(n);else this._disablePickingIndex(e)}draw({uniforms:e}){const{extruded:t,filled:n,wireframe:r,elevationScale:a}=this.props,{topModel:o,sideModel:i,polygonTesselator:s}=this.state,l={...e,extruded:Boolean(t),elevationScale:a};i&&(i.setInstanceCount(s.instanceCount-1),i.setUniforms(l),r&&(i.setDrawMode(3),i.setUniforms({isWireframe:!0}).draw()),n&&(i.setDrawMode(6),i.setUniforms({isWireframe:!1}).draw())),o&&(o.setVertexCount(s.vertexCount),o.setUniforms(l).draw())}updateState(e){super.updateState(e),this.updateGeometry(e);const{props:t,oldProps:n,changeFlags:r}=e,a=this.getAttributeManager();var o;(r.extensionsChanged||t.filled!==n.filled||t.extruded!==n.extruded)&&(null===(o=this.state.models)||void 0===o||o.forEach(e=>e.delete()),this.setState(this._getModels(this.context.gl)),a.invalidateAll())}updateGeometry({props:e,oldProps:t,changeFlags:n}){if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon)){const{polygonTesselator:t}=this.state,r=e.data.attributes||{};t.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:r.getPolygon,buffers:r,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:n.dataChanged}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),n.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(e){const{id:t,filled:n,extruded:r}=this.props;let a,o;if(n){const n=this.getShaders("top");n.defines.NON_INSTANCED_MODEL=1,a=new c.a(e,{...n,id:"".concat(t,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0})}return r&&(o=new c.a(e,{...this.getShaders("side"),id:"".concat(t,"-side"),geometry:new d.a({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1}),o.userData.excludeAttributes={indices:!0}),{models:[o,a].filter(Boolean),topModel:a,sideModel:o}}calculateIndices(e){const{polygonTesselator:t}=this.state;e.startIndices=t.indexStarts,e.value=t.get("indices")}calculatePositions(e){const{polygonTesselator:t}=this.state;e.startIndices=t.vertexStarts,e.value=t.get("positions")}calculateVertexValid(e){e.value=this.state.polygonTesselator.get("vertexValid")}}E.layerName="SolidPolygonLayer",E.defaultProps=b},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(435),a=n(826),o=n(825),i=n(50),s=n(34),l=n(461),u=n(144),c=n(827),d=n(124);class f extends c.a{constructor(e){super({...e,attributes:{positions:{size:3,padding:18,initialize:!0,type:e.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}getGeometryFromBuffer(e){return this.normalize?super.getGeometryFromBuffer(e):()=>null}normalizeGeometry(e){return this.normalize?function(e,t,n,r){let a=e;if(Array.isArray(e[0])){const n=e.length*t;a=new Array(n);for(let n=0;n<e.length;n++)for(let r=0;r<t;r++)a[n*t+r]=e[n][r]||0}return n?Object(d.d)(a,{size:t,gridResolution:n}):r?Object(d.e)(a,{size:t}):a}(e,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):e}get(e){return this.attributes[e]}getGeometrySize(e){if(Array.isArray(e[0])){let t=0;for(const n of e)t+=this.getGeometrySize(n);return t}const t=this.getPathLength(e);return t<2?0:this.isClosed(e)?t<3?0:t+2:t}updateGeometryAttributes(e,t){if(0!==t.geometrySize)if(e&&Array.isArray(e[0]))for(const n of e){const e=this.getGeometrySize(n);t.geometrySize=e,this.updateGeometryAttributes(n,t),t.vertexStart+=e}else this._updateSegmentTypes(e,t),this._updatePositions(e,t)}_updateSegmentTypes(e,t){const{segmentTypes:n}=this.attributes,r=this.isClosed(e),{vertexStart:a,geometrySize:o}=t;n.fill(0,a,a+o),r?(n[a]=4,n[a+o-2]=4):(n[a]+=1,n[a+o-2]+=2),n[a+o-1]=4}_updatePositions(e,t){const{positions:n}=this.attributes;if(!n)return;const{vertexStart:r,geometrySize:a}=t,o=new Array(3);for(let t=r,i=0;i<a;t++,i++)this.getPointOnPath(e,i,o),n[3*t]=o[0],n[3*t+1]=o[1],n[3*t+2]=o[2]}getPathLength(e){return e.length/this.positionSize}getPointOnPath(e,t,n=[]){const{positionSize:r}=this;t*r>=e.length&&(t+=1-e.length/r);const a=t*r;return n[0]=e[a],n[1]=e[a+1],n[2]=3===r&&e[a+2]||0,n}isClosed(e){if(!this.normalize)return this.opts.loop;const{positionSize:t}=this,n=e.length-t;return e[0]===e[n]&&e[1]===e[n+1]&&(2===t||e[2]===e[n+2])}}const p=[0,0,0,255],h={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:e=>e.path},getColor:{type:"accessor",value:p},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},m={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class g extends r.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\nuniform int widthUnits;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n vec2 width\n) {\n bool isEnd = positions.x > 0.0;\n float sideOfPath = positions.y;\n float isJoint = float(sideOfPath == 0.0);\n\n vec3 deltaA3 = (currPoint - prevPoint);\n vec3 deltaB3 = (nextPoint - currPoint);\n\n mat3 rotationMatrix;\n bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n if (needsRotation) {\n deltaA3 = deltaA3 * rotationMatrix;\n deltaB3 = deltaB3 * rotationMatrix;\n }\n vec2 deltaA = deltaA3.xy / width;\n vec2 deltaB = deltaB3.xy / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = dirA + dirB;\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 dir = isEnd ? dirA : dirB;\n vec2 perp = isEnd ? perpA : perpB;\n float L = isEnd ? lenA : lenB;\n float sinHalfA = abs(dot(miterVec, perp));\n float cosHalfA = abs(dot(dirA, miterVec));\n float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n float cornerPosition = sideOfPath * turnDirection;\n\n float miterSize = 1.0 / max(sinHalfA, EPSILON);\n miterSize = mix(\n min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n miterSize,\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n * (sideOfPath + isJoint * turnDirection);\n bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n bool isCap = isStartCap || isEndCap;\n if (isCap) {\n offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\n vJointType = capType;\n } else {\n vJointType = jointType;\n }\n vPathLength = L;\n vCornerOffset = offsetVec;\n vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n vMiterLength = isCap ? isJoint : vMiterLength;\n\n vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n vPathPosition = vec2(\n dot(offsetFromStartOfPath, perp),\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n if (needsRotation) {\n offset = rotationMatrix * offset;\n }\n return currPoint + offset;\n}\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n if (position.w < EPSILON) {\n float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n position = refPosition + (position - refPosition) * r;\n }\n}\n\nvoid main() {\n geometry.pickingColor = instancePickingColors;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n geometry.worldPosition = currPosition;\n vec2 widthPixels = vec2(clamp(\n project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n widthMinPixels, widthMaxPixels) / 2.0);\n vec3 width;\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n width = vec3(widthPixels, 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w,\n project_pixel_size_to_clipspace(width.xy)\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64Low);\n currPosition = project_position(currPosition, currPosition64Low);\n nextPosition = project_position(nextPosition, nextPosition64Low);\n\n width = vec3(project_pixel_size(widthPixels), 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n\n if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\n discard;\n }\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[a.a,o.a]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:m,accessor:"getPath",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:m,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:m,defaultValue:p},instancePickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n)}}),this.setState({pathTesselator:new f({fp64:this.use64bitPositions()})}),this.props.getDashArray&&!this.props.extensions.length&&i.a.removed("getDashArray","PathStyleExtension")()}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager();if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPath)){const{pathTesselator:e}=this.state,a=t.data.attributes||{};e.updateGeometry({data:t.data,geometryBuffer:a.getPath,buffers:a,normalize:!t._pathType,loop:"loop"===t._pathType,getGeometry:t.getPath,positionFormat:t.positionFormat,wrapLongitude:t.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:n.dataChanged}),this.setState({numInstances:e.instanceCount,startIndices:e.vertexStarts}),n.dataChanged||r.invalidateAll()}if(n.extensionsChanged){var a;const{gl:e}=this.context;null===(a=this.state.model)||void 0===a||a.delete(),this.state.model=this._getModel(e),r.invalidateAll()}}getPickingInfo(e){const t=super.getPickingInfo(e),{index:n}=t,{data:r}=this.props;return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(e){const{data:t}=this.props;if(t[0]&&t[0].__source)for(let n=0;n<t.length;n++)t[n].__source.index===e&&this._disablePickingIndex(n);else this._disablePickingIndex(e)}draw({uniforms:e}){const{jointRounded:t,capRounded:n,billboard:r,miterLimit:a,widthUnits:o,widthScale:i,widthMinPixels:l,widthMaxPixels:u}=this.props;this.state.model.setUniforms(e).setUniforms({jointType:Number(t),capType:Number(n),billboard:r,widthUnits:s.e[o],widthScale:i,miterLimit:a,widthMinPixels:l,widthMaxPixels:u}).draw()}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new u.a({drawMode:4,attributes:{indices:new Uint16Array([0,1,2,1,4,2,1,3,4,3,5,4]),positions:{value:new Float32Array([0,0,0,-1,0,1,1,-1,1,1,1,0]),size:2}}}),isInstanced:!0})}calculatePositions(e){const{pathTesselator:t}=this.state;e.startIndices=t.vertexStarts,e.value=t.get("positions")}calculateSegmentTypes(e){const{pathTesselator:t}=this.state;e.startIndices=t.vertexStarts,e.value=t.get("segmentTypes")}}g.layerName="PathLayer",g.defaultProps=h},function(e,t,n){"use strict";n.d(t,"a",(function(){return M}));var r=n(435),a=n(826),o=n(825),i=n(34),s=n(50),l=n(461),u=n(144),c=n(1190),d=n(639),f=n(250),p=n(1908),h=n(805),m=n(122);const g=()=>{},y={10241:9987,10240:9729,10242:33071,10243:33071};function v(e,t,n,r){return n===t.width&&r===t.height?t:(e.canvas.height=r,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.canvas)}function A(e){return e&&(e.id||e.url)}function b(e,t,n){for(let r=0;r<t.length;r++){const{icon:a,xOffset:o}=t[r];e[A(a)]={...a,x:o,y:n}}}class _{constructor(e,{onUpdate:t=g,onError:n=g}){this.gl=e,this.onUpdate=t,this.onError=n,this._loadOptions=null,this._getIcon=null,this._texture=null,this._externalTexture=null,this._mapping={},this._pendingCount=0,this._autoPacking=!1,this._xOffset=0,this._yOffset=0,this._rowHeight=0,this._buffer=4,this._canvasWidth=1024,this._canvasHeight=0,this._canvas=null}finalize(){var e;null===(e=this._texture)||void 0===e||e.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(e){const t=this._autoPacking?A(e):e;return this._mapping[t]||{}}setProps({loadOptions:e,autoPacking:t,iconAtlas:n,iconMapping:r,data:a,getIcon:o}){e&&(this._loadOptions=e),void 0!==t&&(this._autoPacking=t),o&&(this._getIcon=o),r&&(this._mapping=r),n&&this._updateIconAtlas(n),this._autoPacking&&(a||o)&&"undefined"!=typeof document&&(this._canvas=this._canvas||document.createElement("canvas"),this._updateAutoPacking(a))}get isLoaded(){return 0===this._pendingCount}_updateIconAtlas(e){var t;null===(t=this._texture)||void 0===t||t.delete(),this._texture=null,this._externalTexture=e,this.onUpdate()}_updateAutoPacking(e){const t=Object.values(function(e,t,n){if(!e||!t)return null;n=n||{};const r={},{iterable:a,objectInfo:o}=Object(m.a)(e);for(const e of a){o.index++;const a=t(e,o),i=A(a);if(!a)throw new Error("Icon is missing.");if(!a.url)throw new Error("Icon url is missing.");r[i]||n[i]&&a.url===n[i].url||(r[i]={...a,source:e,sourceIndex:o.index})}return r}(e,this._getIcon,this._mapping)||{});if(t.length>0){const{mapping:e,xOffset:n,yOffset:r,rowHeight:a,canvasHeight:o}=function({icons:e,buffer:t,mapping:n={},xOffset:r=0,yOffset:a=0,rowHeight:o=0,canvasWidth:i}){let s=[];for(let l=0;l<e.length;l++){const u=e[l];if(!n[A(u)]){const{height:e,width:l}=u;r+l+t>i&&(b(n,s,a),r=0,a=o+a+t,o=0,s=[]),s.push({icon:u,xOffset:r}),r=r+l+t,o=Math.max(o,e)}}return s.length>0&&b(n,s,a),{mapping:n,rowHeight:o,xOffset:r,yOffset:a,canvasWidth:i,canvasHeight:(l=o+a+t,Math.pow(2,Math.ceil(Math.log2(l))))};var l}({icons:t,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=a,this._mapping=e,this._xOffset=n,this._yOffset=r,this._canvasHeight=o,this._texture||(this._texture=new f.a(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:y})),this._texture.height!==this._canvasHeight&&(this._texture=function(e,t,n,r){const a=t.width,o=t.height,i=Object(c.a)(t,{width:n,height:r});return Object(d.b)(t,i,{targetY:0,width:a,height:o}),t.delete(),i}(this.gl,this._texture,this._canvasWidth,this._canvasHeight)),this.onUpdate(),this._loadIcons(t)}}_loadIcons(e){const t=this._canvas.getContext("2d");for(const n of e)this._pendingCount++,Object(h.a)(n.url,p.a,this._loadOptions).then(e=>{const r=A(n),{x:a,y:o,width:i,height:s}=this._mapping[r],l=v(t,e,i,s);this._texture.setSubImageData({data:l,x:a,y:o,width:i,height:s}),this._texture.generateMipmap(),this.onUpdate()}).catch(e=>{this.onError({url:n.url,source:n.source,sourceIndex:n.sourceIndex,loadOptions:this._loadOptions,error:e})}).finally(()=>{this._pendingCount--})}}const E=[0,0,0,255],x={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:e=>e.position},getIcon:{type:"accessor",value:e=>e.icon},getColor:{type:"accessor",value:E},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};class M extends r.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\nuniform int sizeUnits;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\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 geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale, sizeUnits), \n sizeMinPixels, sizeMaxPixels\n );\n float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[a.a,o.a]})}initializeState(){this.state={iconManager:new _(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:E},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager(),{iconAtlas:a,iconMapping:o,data:i,getIcon:s}=t,{iconManager:l}=this.state;l.setProps({loadOptions:t.loadOptions});let u=!1;if(a||this.internalState.isAsyncPropLoading("iconAtlas")?(e.iconAtlas!==t.iconAtlas&&l.setProps({iconAtlas:a,autoPacking:!1}),e.iconMapping!==t.iconMapping&&(l.setProps({iconMapping:o}),u=!0)):l.setProps({autoPacking:!0}),(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&l.setProps({data:i,getIcon:s}),u&&(r.invalidate("instanceOffsets"),r.invalidate("instanceIconFrames"),r.invalidate("instanceColorModes")),n.extensionsChanged){var c;const{gl:e}=this.context;null===(c=this.state.model)||void 0===c||c.delete(),this.state.model=this._getModel(e),r.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:e}){const{sizeScale:t,sizeMinPixels:n,sizeMaxPixels:r,sizeUnits:a,billboard:o,alphaCutoff:s}=this.props,{iconManager:l}=this.state,u=l.getTexture();u&&this.state.model.setUniforms(e).setUniforms({iconsTexture:u,iconsTextureDim:[u.width,u.height],sizeUnits:i.e[a],sizeScale:t,sizeMinPixels:n,sizeMaxPixels:r,billboard:o,alphaCutoff:s}).draw()}_getModel(e){return new l.a(e,{...this.getShaders(),id:this.props.id,geometry:new u.a({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(e){const{onIconError:t}=this.getCurrentLayer().props;t?t(e):s.a.error(e.error)()}getInstanceOffset(e){const t=this.state.iconManager.getIconMapping(e);return[t.width/2-t.anchorX||0,t.height/2-t.anchorY||0]}getInstanceColorMode(e){return this.state.iconManager.getIconMapping(e).mask?1:0}getInstanceIconFrame(e){const t=this.state.iconManager.getIconMapping(e);return[t.x||0,t.y||0,t.width||0,t.height||0]}}M.layerName="IconLayer",M.defaultProps=x},function(e,t,n){"use strict";t.a=function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}},function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return c}));var r=n(421),a=n(51),o=n(298),i=n(251);const s="Cannot convert supplied data type";function l(e,t,n){if(t.text&&"string"==typeof e)return e;if(Object(a.c)(e)&&(e=e.buffer),e instanceof ArrayBuffer){const n=e;if(t.text&&!t.binary){return new TextDecoder("utf8").decode(n)}return n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary){return new TextDecoder("utf8").decode(e)}let n=e.buffer;const r=e.byteLength||e.length;return 0===e.byteOffset&&r===n.byteLength||(n=n.slice(e.byteOffset,e.byteOffset+r)),n}throw new Error(s)}async function u(e,t,n){const u=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if("string"==typeof e||u)return l(e,t);if(Object(a.b)(e)&&(e=await Object(i.b)(e)),Object(a.j)(e)){const n=e;return await Object(i.a)(n),t.binary?await n.arrayBuffer():await n.text()}if(Object(a.i)(e)&&(e=Object(o.a)(e,n)),Object(a.d)(e)||Object(a.a)(e))return Object(r.a)(e);throw new Error(s)}async function c(e,t){if(Object(a.e)(e))return e;if(Object(a.j)(e)){const n=e;await Object(i.a)(n);const r=await n.body;return Object(o.a)(r,t)}return Object(a.b)(e)||Object(a.i)(e)?Object(o.a)(e,t):Object(a.a)(e)?e[Symbol.asyncIterator]():function(e){if(ArrayBuffer.isView(e))return function*(){yield e.buffer}();if(e instanceof ArrayBuffer)return function*(){yield e}();if(Object(a.e)(e))return e;if(Object(a.d)(e))return e[Symbol.iterator]();throw new Error(s)}(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return h}));var r=n(14),a=n(48),o=n(34),i=n(184);const s=[0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],u=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c=[0,0,0],d=[0,0,0],f=Object(i.a)((function({viewport:e,devicePixelRatio:t,coordinateSystem:n,coordinateOrigin:i}){const{projectionCenter:u,viewProjectionMatrix:d,originCommon:f,cameraPosCommon:h,shaderCoordinateOrigin:m,geospatialOrigin:g}=function(e,t,n){const{viewMatrixUncentered:o,projectionMatrix:i}=e;let{viewMatrix:u,viewProjectionMatrix:c}=e,d=s,f=s,h=e.cameraPosition;const{geospatialOrigin:m,shaderCoordinateOrigin:g,offsetMode:y}=p(e,t,n);y&&(f=e.projectPosition(m||g),h=[h[0]-f[0],h[1]-f[1],h[2]-f[2]],f[3]=1,d=a.n([],f,c),u=o||u,c=r.h([],i,u),c=r.h([],c,l));return{viewMatrix:u,viewProjectionMatrix:c,projectionCenter:d,originCommon:f,cameraPosCommon:h,shaderCoordinateOrigin:g,geospatialOrigin:m}}(e,n,i),y=e.getDistanceScales(),v=[e.width*t,e.height*t],A=a.n([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,b={project_uCoordinateSystem:n,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:m,project_uCommonOrigin:f.slice(0,3),project_uCenter:u,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:v,project_uDevicePixelRatio:t,project_uFocalDistance:A,project_uCommonUnitsPerMeter:y.unitsPerMeter,project_uCommonUnitsPerWorldUnit:y.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:c,project_uScale:e.scale,project_uViewProjectionMatrix:d,project_uCameraPosition:h};if(g){const t=e.getDistanceScales(g);switch(n){case o.a.METER_OFFSETS:b.project_uCommonUnitsPerWorldUnit=t.unitsPerMeter,b.project_uCommonUnitsPerWorldUnit2=t.unitsPerMeter2;break;case o.a.LNGLAT:case o.a.LNGLAT_OFFSETS:e._pseudoMeters||(b.project_uCommonUnitsPerMeter=t.unitsPerMeter),b.project_uCommonUnitsPerWorldUnit=t.unitsPerDegree,b.project_uCommonUnitsPerWorldUnit2=t.unitsPerDegree2;break;case o.a.CARTESIAN:b.project_uCommonUnitsPerWorldUnit=[1,1,t.unitsPerMeter[2]],b.project_uCommonUnitsPerWorldUnit2=[0,0,t.unitsPerMeter2[2]]}}return b}));function p(e,t,n=d){n.length<3&&(n=[n[0],n[1],0]);let r,a=n,i=!0;switch(r=t===o.a.LNGLAT_OFFSETS||t===o.a.METER_OFFSETS?n:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case o.d.WEB_MERCATOR:t!==o.a.LNGLAT&&t!==o.a.CARTESIAN||(r=[0,0,0],i=!1);break;case o.d.WEB_MERCATOR_AUTO_OFFSET:t===o.a.LNGLAT?a=r:t===o.a.CARTESIAN&&(a=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],r=e.unprojectPosition(a),a[0]-=n[0],a[1]-=n[1],a[2]-=n[2]);break;case o.d.IDENTITY:a=e.position.map(Math.fround),a[2]=a[2]||0;break;case o.d.GLOBE:i=!1,r=null;break;default:i=!1}return{geospatialOrigin:r,shaderCoordinateOrigin:a,offsetMode:i}}function h({viewport:e,devicePixelRatio:t=1,modelMatrix:n=null,coordinateSystem:r=o.a.DEFAULT,coordinateOrigin:a,autoWrapLongitude:i=!1}={}){r===o.a.DEFAULT&&(r=e.isGeospatial?o.a.LNGLAT:o.a.CARTESIAN);const s=f({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:a});return s.project_uWrapLongitude=i,s.project_uModelMatrix=n||u,s}},function(e,t,n){"use strict";var r=n(34),a=n(242),o=n(215),i=n(176),s=n(184),l=n(53);const u=Object(s.a)((function({viewport:e,center:t}){return new o.a(e.viewProjectionMatrix).invert().transform(t)})),c=Object(s.a)((function({viewport:e,shadowMatrices:t}){const n=[],r=e.pixelUnprojectionMatrix,a=e.isGeospatial?void 0:1,s=[[0,0,a],[e.width,0,a],[0,e.height,a],[e.width,e.height,a],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map(e=>function(e,t){const[n,r,a]=e,o=Object(l.n)([n,r,a],t);if(Number.isFinite(a))return o;return[o[0],o[1],0]}(e,r));for(const r of t){const t=r.clone().translate(new i.a(e.center).negate()),a=s.map(e=>t.transform(e)),l=(new o.a).ortho({left:Math.min(...a.map(e=>e[0])),right:Math.max(...a.map(e=>e[0])),bottom:Math.min(...a.map(e=>e[1])),top:Math.max(...a.map(e=>e[1])),near:Math.min(...a.map(e=>-e[2])),far:Math.max(...a.map(e=>-e[2]))});n.push(l.multiplyRight(r))}return n})),d=[0,0,0,1],f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];t.a={name:"shadow",dependencies:[a.a],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(e={},t={})=>{if(e.drawToShadowMap||e.shadowMaps&&e.shadowMaps.length>0){const{shadowEnabled:n=!0}=e;return n&&e.shadowMatrices&&e.shadowMatrices.length>0?function(e={},t={}){const n={shadow_uDrawShadowMap:Boolean(e.drawToShadowMap),shadow_uUseShadowMap:!!e.shadowMaps&&e.shadowMaps.length>0,shadow_uColor:e.shadowColor||d,shadow_uLightId:e.shadowLightId||0,shadow_uLightCount:e.shadowMatrices.length},a=u({viewport:e.viewport,center:t.project_uCenter}),o=[],s=c({shadowMatrices:e.shadowMatrices,viewport:e.viewport}).slice();for(let n=0;n<e.shadowMatrices.length;n++){const l=s[n],u=l.clone().translate(new i.a(e.viewport.center).negate());t.project_uCoordinateSystem===r.a.LNGLAT&&t.project_uProjectionMode===r.d.WEB_MERCATOR?(s[n]=u,o[n]=a):(s[n]=l.clone().multiplyRight(f),o[n]=u.transform(a))}for(let t=0;t<s.length;t++)n["shadow_uViewProjectionMatrices[".concat(t,"]")]=s[t],n["shadow_uProjectCenters[".concat(t,"]")]=o[t],e.shadowMaps&&e.shadowMaps.length>0?n["shadow_uShadowMap".concat(t)]=e.shadowMaps[t]:n["shadow_uShadowMap".concat(t)]=e.dummyShadowMap;return n}(e,t):{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1}}return{}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(4);class a{constructor(e){Object(r.a)(this,"_viewportProps",void 0),Object(r.a)(this,"_state",void 0),this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}},function(e,t,n){"use strict";t.a=function(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));const r=262144;var a=n(193),o=n(182);function i(e,t){return a.c?async function*(e,t){const n=e.getReader();let r;try{for(;;){const e=r||n.read();null!=t&&t._streamReadAhead&&(r=n.read());const{done:a,value:i}=await e;if(a)return;yield Object(o.d)(i)}}catch(e){n.releaseLock()}}(e,t):async function*(e,t){for await(const t of e)yield Object(o.d)(t)}(e)}var s=n(51);function l(e,t){if("string"==typeof e)return function*(e,t){const n=(null==t?void 0:t.chunkSize)||262144;let r=0;const a=new TextEncoder;for(;r<e.length;){const t=Math.min(e.length-r,n),o=e.slice(r,r+t);r+=t,yield a.encode(o)}}(e,t);if(e instanceof ArrayBuffer)return function*(e,t={}){const{chunkSize:n=r}=t;let a=0;for(;a<e.byteLength;){const t=Math.min(e.byteLength-a,n),r=new ArrayBuffer(t),o=new Uint8Array(e,a,t);new Uint8Array(r).set(o),a+=t,yield r}}(e,t);if(Object(s.b)(e))return async function*(e,t){const n=(null==t?void 0:t.chunkSize)||1048576;let r=0;for(;r<e.size;){const t=r+n,a=await e.slice(r,t).arrayBuffer();r=t,yield a}}(e,t);if(Object(s.i)(e))return i(e,t);if(Object(s.j)(e)){return i(e.body,t)}throw new Error("makeIterator")}},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";t.a=e=>()=>e},function(e,t,n){"use strict";function r(e,t,n){const r=t[0],a=t[1],o=n[3]*r+n[7]*a||1;return e[0]=(n[0]*r+n[4]*a)/o,e[1]=(n[1]*r+n[5]*a)/o,e}function a(e,t,n){const r=t[0],a=t[1],o=t[2],i=n[3]*r+n[7]*a+n[11]*o||1;return e[0]=(n[0]*r+n[4]*a+n[8]*o)/i,e[1]=(n[1]*r+n[5]*a+n[9]*o)/i,e[2]=(n[2]*r+n[6]*a+n[10]*o)/i,e}function o(e,t,n){const r=t[0],a=t[1];return e[0]=n[0]*r+n[2]*a,e[1]=n[1]*r+n[3]*a,e[2]=t[2],e}n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"b",(function(){return o}))},function(e,t,n){"use strict";e.exports=function(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),a=n.length;if(r.length!==a)return!1;for(var o=0;o<a;o++){var i=n[o];if(e[i]!==t[i]||!Object.prototype.hasOwnProperty.call(t,i))return!1}return!0}},function(e,t,n){var r,a,o;
|
|
20
20
|
/**
|
|
21
21
|
* @license long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
22
22
|
* Released under the Apache License, Version 2.0
|